diff --git a/packages/frontend/src/App.vue b/packages/frontend/src/App.vue index d709025..b97a7e8 100644 --- a/packages/frontend/src/App.vue +++ b/packages/frontend/src/App.vue @@ -26,12 +26,12 @@ const handleLogout = () => { diff --git a/packages/frontend/src/components/AddConnectionForm.vue b/packages/frontend/src/components/AddConnectionForm.vue index b305132..1377bb9 100644 --- a/packages/frontend/src/components/AddConnectionForm.vue +++ b/packages/frontend/src/components/AddConnectionForm.vue @@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'; import { useConnectionsStore, ConnectionInfo } from '../stores/connections.store'; import { useProxiesStore } from '../stores/proxies.store'; // 引入代理 Store import { useTagsStore } from '../stores/tags.store'; // 引入标签 Store +import TagInput from './TagInput.vue'; // 导入新的 TagInput 组件 // 定义组件发出的事件 const emit = defineEmits(['close', 'connection-added', 'connection-updated']); @@ -253,25 +254,18 @@ const handleSubmit = async () => {
{{ t('proxies.loading') }}
-
{{ t('proxies.error', { error: proxyStoreError }) }}
- +
{{ t('proxies.error', { error: proxyStoreError }) }}
+ - -
- -
-
{{ t('tags.loading') }}
-
{{ t('tags.error', { error: tagStoreError }) }}
-
{{ t('tags.noTags') }}
- -
-
+ +
+ + + +
- -
+ +
{{ formError || storeError }}
@@ -334,32 +328,14 @@ textarea { padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; - box-sizing: border-box; /* Include padding and border in element's total width and height */ -} + box-sizing: border-box; /* Include padding and border in element's total width and height */ + } -/* 标签选择样式 */ -.tag-checkbox-group { - max-height: 150px; /* 限制高度,出现滚动条 */ - overflow-y: auto; - border: 1px solid #ccc; - padding: 0.5rem; - border-radius: 4px; - margin-top: 0.5rem; -} + /* 移除旧的标签选择样式 */ + /* .tag-checkbox-group ... */ + /* .tag-checkbox-label ... */ -.tag-checkbox-label { - display: block; /* 每个标签占一行 */ - margin-bottom: 0.3rem; - font-weight: normal; /* 普通字体 */ - cursor: pointer; -} - -.tag-checkbox-label input[type="checkbox"] { - margin-right: 0.5rem; - width: auto; /* 恢复复选框默认宽度 */ -} - -.loading-small, .error-small, .info-small { + .loading-small, .error-small, .info-small { font-size: 0.9em; color: #666; margin-top: 0.2rem; diff --git a/packages/frontend/src/components/AddProxyForm.vue b/packages/frontend/src/components/AddProxyForm.vue index 4c76d61..d038b7f 100644 --- a/packages/frontend/src/components/AddProxyForm.vue +++ b/packages/frontend/src/components/AddProxyForm.vue @@ -1,8 +1,10 @@ - - - - diff --git a/packages/frontend/src/components/TagInput.vue b/packages/frontend/src/components/TagInput.vue new file mode 100644 index 0000000..afe37b1 --- /dev/null +++ b/packages/frontend/src/components/TagInput.vue @@ -0,0 +1,336 @@ + + + + + diff --git a/packages/frontend/src/components/TagList.vue b/packages/frontend/src/components/TagList.vue deleted file mode 100644 index 1596c82..0000000 --- a/packages/frontend/src/components/TagList.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/packages/frontend/src/locales/en.json b/packages/frontend/src/locales/en.json index 8589503..3a9a216 100644 --- a/packages/frontend/src/locales/en.json +++ b/packages/frontend/src/locales/en.json @@ -295,10 +295,13 @@ }, "status": { "never": "Never" - } - }, - "settings": { - "title": "Settings", + }, + "inputPlaceholder": "Type to search or create tags...", + "removeSelection": "Remove this tag selection", + "deleteTagGlobally": "Delete this tag globally" + }, + "settings": { + "title": "Settings", "changePassword": { "title": "Change Password", "currentPassword": "Current Password:", diff --git a/packages/frontend/src/locales/zh.json b/packages/frontend/src/locales/zh.json index 280b73c..0dcedfc 100644 --- a/packages/frontend/src/locales/zh.json +++ b/packages/frontend/src/locales/zh.json @@ -298,10 +298,13 @@ }, "status": { "never": "从未" - } - }, - "settings": { - "title": "设置", + }, + "inputPlaceholder": "输入搜索或创建标签...", + "removeSelection": "移除此标签选择", + "deleteTagGlobally": "全局删除此标签" + }, + "settings": { + "title": "设置", "changePassword": { "title": "修改密码", "currentPassword": "当前密码:", diff --git a/packages/frontend/src/router/index.ts b/packages/frontend/src/router/index.ts index 8c4fca8..bd62e71 100644 --- a/packages/frontend/src/router/index.ts +++ b/packages/frontend/src/router/index.ts @@ -26,16 +26,16 @@ const routes: Array = [ { path: '/proxies', name: 'Proxies', - component: () => import('../views/ProxiesView.vue') - }, - // 新增:标签管理页面 - { - path: '/tags', - name: 'Tags', - component: () => import('../views/TagsView.vue') - }, - // 工作区页面 (不再需要 connectionId 参数) - { + component: () => import('../views/ProxiesView.vue') + }, + // 移除:标签管理页面路由 + // { + // path: '/tags', + // name: 'Tags', + // component: () => import('../views/TagsView.vue') + // }, + // 工作区页面 (不再需要 connectionId 参数) + { path: '/workspace', // 移除动态路由段 name: 'Workspace', component: () => import('../views/WorkspaceView.vue'), diff --git a/packages/frontend/src/views/TagsView.vue b/packages/frontend/src/views/TagsView.vue deleted file mode 100644 index 685e69d..0000000 --- a/packages/frontend/src/views/TagsView.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - -