+ {filters.map(filter => (
+
+
+ {filter.type === 'select' ? (
+
+ ) : (
+ handleFilterChange(filter.key, e.target.value)}
+ />
+ )}
+
+ ))}
+
+
+
+ {showFilter && (
+
+ )}
+
+ );
+}
+
+export default SearchBar;
diff --git a/src/components/common/StatusBadge.jsx b/src/components/common/StatusBadge.jsx
new file mode 100644
index 0000000..2856a99
--- /dev/null
+++ b/src/components/common/StatusBadge.jsx
@@ -0,0 +1,34 @@
+/**
+ * StatusBadge - 状态标签组件
+ * 显示不同状态的标签(运行中、停止、警告、错误等)
+ *
+ * @param {Object} props - 组件属性
+ * @param {string} props.status - 状态类型(running, stopped, starting, warning, error)
+ * @param {string} [props.text] - 自定义文本(可选,默认使用状态对应的文本)
+ * @param {boolean} [props.small] - 是否使用小尺寸
+ */
+function StatusBadge({ status, text, small = false }) {
+ const statusConfig = {
+ running: { className: 'status-running', defaultText: '运行中' },
+ stopped: { className: 'status-stopped', defaultText: '已停止' },
+ starting: { className: 'status-starting', defaultText: '启动中' },
+ warning: { className: 'status-warning', defaultText: '警告' },
+ error: { className: 'status-error', defaultText: '失败' },
+ // 附加状态
+ success: { className: 'status-running', defaultText: '成功' },
+ };
+
+ const config = statusConfig[status] || statusConfig.stopped;
+ const displayText = text || config.defaultText;
+
+ return (
+