diff --git a/src/components/index.ts b/src/components/index.ts index f4c61579b54be..f26d2e90315c6 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -8,10 +8,10 @@ import Chart from './chart/Chart.vue'; import Metric from './chart/Metric.vue'; import ContextMenu from './context-menu/ContextMenu.vue'; import ContextMenuList from './context-menu/ContextMenuList.vue'; +import * as date from './date/date'; import DateRangePicker from './date/DateRangePicker.vue'; import DateTimeRangePicker from './date/DateTimeRangePicker.vue'; import RangePicker from './date/RangePicker.vue'; -import * as date from './date/date'; import ConfirmDialog from './dialog/ConfirmDialog.vue'; import CreateEditDialog from './dialog/CreateEditDialog.vue'; import Dialog from './dialog/Dialog.vue'; @@ -34,6 +34,7 @@ import FileActions from './file/FileActions.vue'; import FileDiff from './file/FileDiff.vue'; import FileEditor from './file/FileEditor.vue'; import FileEditorCreateWithAiDialog from './file/FileEditorCreateWithAiDialog.vue'; +import * as fileEditorDropZone from './file/fileEditorDropZone'; import FileEditorNavMenu from './file/FileEditorNavMenu.vue'; import FileEditorNavMenuContextMenu from './file/FileEditorNavMenuContextMenu.vue'; import FileEditorNavTabs from './file/FileEditorNavTabs.vue'; @@ -43,16 +44,15 @@ import FileEditorSettingsDialog from './file/FileEditorSettingsDialog.vue'; import FileTab from './file/FileTab.vue'; import FileUpload from './file/FileUpload.vue'; import UploadFilesDialog from './file/UploadFilesDialog.vue'; -import * as fileEditorDropZone from './file/fileEditorDropZone'; +import * as filter from './filter/filter'; import FilterCondition from './filter/FilterCondition.vue'; import FilterConditionList from './filter/FilterConditionList.vue'; import FilterInput from './filter/FilterInput.vue'; import FilterSelect from './filter/FilterSelect.vue'; -import * as filter from './filter/filter'; import Form from './form/Form.vue'; import FormItem from './form/FormItem.vue'; -import FormTableField from './form/FormTableField.vue'; import * as formTable from './form/formTable'; +import FormTableField from './form/FormTableField.vue'; import useForm from './form/useForm'; import CreateEditGitDialog from './git/CreateEditGitDialog.vue'; import CreateGitBranchDialog from './git/CreateGitBranchDialog.vue'; @@ -69,11 +69,10 @@ import GitStatus from './git/GitStatus.vue'; import UploadGitFilesDialog from './git/UploadGitFilesDialog.vue'; import useGit from './git/useGit'; import AtomMaterialIcon from './icon/AtomMaterialIcon.vue'; +import * as icon from './icon/icon'; import Icon from './icon/Icon.vue'; import MenuItemIcon from './icon/MenuItemIcon.vue'; -import * as icon from './icon/icon'; import InputList from './input/InputList.vue'; -import LexicalEditor from './lexical/LexicalEditor.vue'; import BlockOptionsDropdownList from './lexical/components/BlockOptionsDropdownList.vue'; import DropdownButton from './lexical/components/DropdownButton.vue'; import FloatLinkEditor from './lexical/components/FloatLinkEditor.vue'; @@ -89,6 +88,7 @@ import useLexicalList from './lexical/composables/useLexicalList'; import useLexicalMounted from './lexical/composables/useLexicalMounted'; import useRichTextSetup from './lexical/composables/useRichTextSetup'; import useVariableSetup from './lexical/composables/useVariableSetup'; +import LexicalEditor from './lexical/LexicalEditor.vue'; import * as ImageNode from './lexical/nodes/ImageNode'; import * as VariableNode from './lexical/nodes/VariableNode'; import LexicalAutoFocusPlugin from './lexical/plugins/LexicalAutoFocusPlugin.vue'; @@ -152,6 +152,12 @@ import useSpider from './spider/useSpider'; import Switch from './switch/Switch.vue'; import ActionTab from './tab/ActionTab.vue'; import Tab from './tab/Tab.vue'; +import * as action from './table/action'; +import * as column from './table/column'; +import * as data from './table/data'; +import * as header from './table/header'; +import * as pagination from './table/pagination'; +import * as store from './table/store'; import Table from './table/Table.vue'; import TableActions from './table/TableActions.vue'; import TableCell from './table/TableCell.vue'; @@ -161,12 +167,6 @@ import TableHeaderAction from './table/TableHeaderAction.vue'; import TableHeaderDialog from './table/TableHeaderDialog.vue'; import TableHeaderDialogFilter from './table/TableHeaderDialogFilter.vue'; import TableHeaderDialogSort from './table/TableHeaderDialogSort.vue'; -import * as action from './table/action'; -import * as column from './table/column'; -import * as data from './table/data'; -import * as header from './table/header'; -import * as pagination from './table/pagination'; -import * as store from './table/store'; import CheckTag from './tag/CheckTag.vue'; import CheckTagGroup from './tag/CheckTagGroup.vue'; import LinkTag from './tag/LinkTag.vue'; @@ -199,10 +199,10 @@ export { Metric as ClMetric, ContextMenu as ClContextMenu, ContextMenuList as ClContextMenuList, + date as date, DateRangePicker as ClDateRangePicker, DateTimeRangePicker as ClDateTimeRangePicker, RangePicker as ClRangePicker, - date as date, ConfirmDialog as ClConfirmDialog, CreateEditDialog as ClCreateEditDialog, Dialog as ClDialog, @@ -225,6 +225,7 @@ export { FileDiff as ClFileDiff, FileEditor as ClFileEditor, FileEditorCreateWithAiDialog as ClFileEditorCreateWithAiDialog, + fileEditorDropZone as fileEditorDropZone, FileEditorNavMenu as ClFileEditorNavMenu, FileEditorNavMenuContextMenu as ClFileEditorNavMenuContextMenu, FileEditorNavTabs as ClFileEditorNavTabs, @@ -234,16 +235,15 @@ export { FileTab as ClFileTab, FileUpload as ClFileUpload, UploadFilesDialog as ClUploadFilesDialog, - fileEditorDropZone as fileEditorDropZone, + filter as filter, FilterCondition as ClFilterCondition, FilterConditionList as ClFilterConditionList, FilterInput as ClFilterInput, FilterSelect as ClFilterSelect, - filter as filter, Form as ClForm, FormItem as ClFormItem, - FormTableField as ClFormTableField, formTable as formTable, + FormTableField as ClFormTableField, useForm as useForm, CreateEditGitDialog as ClCreateEditGitDialog, CreateGitBranchDialog as ClCreateGitBranchDialog, @@ -260,11 +260,10 @@ export { UploadGitFilesDialog as ClUploadGitFilesDialog, useGit as useGit, AtomMaterialIcon as ClAtomMaterialIcon, + icon as icon, Icon as ClIcon, MenuItemIcon as ClMenuItemIcon, - icon as icon, InputList as ClInputList, - LexicalEditor as ClLexicalEditor, BlockOptionsDropdownList as ClBlockOptionsDropdownList, DropdownButton as ClDropdownButton, FloatLinkEditor as ClFloatLinkEditor, @@ -280,6 +279,7 @@ export { useLexicalMounted as useLexicalMounted, useRichTextSetup as useRichTextSetup, useVariableSetup as useVariableSetup, + LexicalEditor as ClLexicalEditor, ImageNode as ImageNode, VariableNode as VariableNode, LexicalAutoFocusPlugin as ClLexicalAutoFocusPlugin, @@ -343,6 +343,12 @@ export { Switch as ClSwitch, ActionTab as ClActionTab, Tab as ClTab, + action as action, + column as column, + data as data, + header as header, + pagination as pagination, + store as store, Table as ClTable, TableActions as ClTableActions, TableCell as ClTableCell, @@ -352,12 +358,6 @@ export { TableHeaderDialog as ClTableHeaderDialog, TableHeaderDialogFilter as ClTableHeaderDialogFilter, TableHeaderDialogSort as ClTableHeaderDialogSort, - action as action, - column as column, - data as data, - header as header, - pagination as pagination, - store as store, CheckTag as ClCheckTag, CheckTagGroup as ClCheckTagGroup, LinkTag as ClLinkTag, diff --git a/src/components/nav/NavTabs.vue b/src/components/nav/NavTabs.vue index 14dd995a73562..3d3b9eabd22d7 100644 --- a/src/components/nav/NavTabs.vue +++ b/src/components/nav/NavTabs.vue @@ -1,21 +1,5 @@ @@ -114,7 +62,7 @@ defineOptions({ name: 'ClNavTabs' }); :offset="[10, 10]" >
- + {{ item.title }}
diff --git a/src/components/tab/Tab.vue b/src/components/tab/Tab.vue index 765f06a1cb57c..0b30bb75829dd 100644 --- a/src/components/tab/Tab.vue +++ b/src/components/tab/Tab.vue @@ -3,8 +3,7 @@ import { computed } from 'vue'; import { useStore } from 'vuex'; import { useRouter } from 'vue-router'; import { Close } from '@element-plus/icons-vue'; -import { translate } from '@/utils'; -import { getPrimaryPath } from '@/utils/path'; +import { getPrimaryPath, translate } from '@/utils'; const props = withDefaults( defineProps<{ diff --git a/src/i18n/lang/en/layouts.ts b/src/i18n/lang/en/layouts.ts index 9236e68ba4dd8..79337766def2e 100644 --- a/src/i18n/lang/en/layouts.ts +++ b/src/i18n/lang/en/layouts.ts @@ -6,8 +6,8 @@ const layouts: LLayouts = { disclaimer: 'Disclaimer', }, sidebar: { - collapse: 'Collapse', - expand: 'Expand', + collapse: 'Collapse Sidebar', + expand: 'Expand Sidebar', }, }, detailLayout: { @@ -20,6 +20,101 @@ const layouts: LLayouts = { }, }, }, + routes: { + home: 'Home', + nodes: { + title: 'Nodes', + tabs: { + overview: 'Overview', + tasks: 'Tasks', + monitoring: 'Monitoring', + }, + }, + projects: { + title: 'Projects', + tabs: { + overview: 'Overview', + spiders: 'Spiders', + }, + }, + spiders: { + title: 'Spiders', + tabs: { + overview: 'Overview', + files: 'Files', + tasks: 'Tasks', + schedules: 'Schedules', + data: 'Data', + settings: 'Settings', + dependencies: 'Dependencies', + }, + }, + tasks: { + title: 'Tasks', + tabs: { + overview: 'Overview', + logs: 'Logs', + data: 'Data', + }, + }, + schedules: { + title: 'Schedules', + tabs: { + overview: 'Overview', + tasks: 'Tasks', + }, + }, + users: { + title: 'Users', + tabs: { + overview: 'Overview', + }, + }, + tokens: { + title: 'Tokens', + }, + dependencies: { + title: 'Dependencies', + settings: 'Settings', + lang: { + python: 'Python', + node: 'Node', + }, + }, + notifications: { + title: 'Notifications', + tabs: { + settings: 'Settings', + templates: 'Templates', + }, + }, + gits: { + title: 'Git Repo', + tabs: { + overview: 'Overview', + files: 'Files', + logs: 'Logs', + changes: 'Changes', + spiders: 'Spiders', + }, + }, + dataSources: { + title: 'Data Sources', + tabs: { + overview: 'Overview', + }, + }, + environments: { + title: 'Environments', + }, + system: { + title: 'System', + }, + misc: { + disclaimer: 'Disclaimer', + mySettings: 'My Settings', + }, + }, }; export default layouts; diff --git a/src/i18n/lang/zh/layouts.ts b/src/i18n/lang/zh/layouts.ts index 9a03003379a92..9c3b90e081109 100644 --- a/src/i18n/lang/zh/layouts.ts +++ b/src/i18n/lang/zh/layouts.ts @@ -6,8 +6,8 @@ const layouts: LLayouts = { disclaimer: '免责声明', }, sidebar: { - collapse: '折叠', - expand: '展开', + collapse: '折叠导航栏', + expand: '展开导航栏', }, }, detailLayout: { @@ -20,6 +20,101 @@ const layouts: LLayouts = { }, }, }, + routes: { + home: '首页', + nodes: { + title: '节点', + tabs: { + overview: '概览', + tasks: '任务', + monitoring: '监控', + }, + }, + projects: { + title: '项目', + tabs: { + overview: '概览', + spiders: '爬虫', + }, + }, + spiders: { + title: '爬虫', + tabs: { + overview: '概览', + files: '文件', + tasks: '任务', + schedules: '计划', + data: '数据', + settings: '设置', + dependencies: '依赖', + }, + }, + tasks: { + title: '任务', + tabs: { + overview: '概览', + logs: '日志', + data: '数据', + }, + }, + schedules: { + title: '计划', + tabs: { + overview: '概览', + tasks: '任务', + }, + }, + users: { + title: '用户', + tabs: { + overview: '概览', + }, + }, + tokens: { + title: '令牌', + }, + dependencies: { + title: '依赖', + settings: '设置', + lang: { + python: 'Python', + node: 'Node', + }, + }, + notifications: { + title: '通知', + tabs: { + settings: '设置', + templates: '模板', + }, + }, + gits: { + title: 'Git 仓库', + tabs: { + overview: '概览', + files: '文件', + logs: '日志', + changes: '变更', + spiders: '爬虫', + }, + }, + dataSources: { + title: '数据源', + tabs: { + overview: '概览', + }, + }, + environments: { + title: '环境', + }, + system: { + title: '系统', + }, + misc: { + disclaimer: '免责声明', + mySettings: '我的设置', + }, + }, }; export default layouts; diff --git a/src/interfaces/i18n/layouts.d.ts b/src/interfaces/i18n/layouts.d.ts index db91ebff323e3..d90ff3dd9a529 100644 --- a/src/interfaces/i18n/layouts.d.ts +++ b/src/interfaces/i18n/layouts.d.ts @@ -21,5 +21,100 @@ export declare global { }; }; }; + routes: { + home: string; + nodes: { + title: string; + tabs: { + overview: string; + tasks: string; + monitoring: string; + }; + }; + projects: { + title: string; + tabs: { + overview: string; + spiders: string; + }; + }; + spiders: { + title: string; + tabs: { + overview: string; + files: string; + tasks: string; + schedules: string; + data: string; + settings: string; + dependencies: string; + }; + }; + tasks: { + title: string; + tabs: { + overview: string; + logs: string; + data: string; + }; + }; + schedules: { + title: string; + tabs: { + overview: string; + tasks: string; + }; + }; + users: { + title: string; + tabs: { + overview: string; + }; + }; + tokens: { + title: string; + }; + dependencies: { + title: string; + settings: string; + lang: { + python: string; + node: string; + }; + }; + notification: { + title: string; + tabs: { + settings: string; + templates: string; + }; + }; + gits: { + title: string; + tabs: { + overview: string; + files: string; + logs: string; + changes: string; + spiders: string; + }; + }; + dataSources: { + title: string; + tabs: { + overview: string; + }; + }; + environments: { + title: string; + }; + system: { + title: string; + }; + misc: { + disclaimer: string; + mySettings: string; + }; + }; } } diff --git a/src/interfaces/models/nav.d.ts b/src/interfaces/models/nav.d.ts index 23bf7eb78d5c1..ad47a8483ec4d 100644 --- a/src/interfaces/models/nav.d.ts +++ b/src/interfaces/models/nav.d.ts @@ -1,5 +1,3 @@ -import { Component } from 'vue'; - export declare global { interface NavItem extends TreeNode> { id: string; diff --git a/src/interfaces/package/create-app.d.ts b/src/interfaces/package/create-app.d.ts index 879db26deba61..69ae4c0b29892 100644 --- a/src/interfaces/package/create-app.d.ts +++ b/src/interfaces/package/create-app.d.ts @@ -16,9 +16,9 @@ export declare global { loadExport?: boolean; mount?: boolean | string; store?: Store; - rootRoutes?: Array; - routes?: Array; - allRoutes?: Array; + rootRoutes?: Array; + routes?: Array; + allRoutes?: Array; createRouterOptions?: CreateRouterOptions; } } diff --git a/src/interfaces/router/index.d.ts b/src/interfaces/router/index.d.ts index 5769bc6340d1e..84710c6e3a9e1 100644 --- a/src/interfaces/router/index.d.ts +++ b/src/interfaces/router/index.d.ts @@ -1,8 +1,16 @@ +import { RouteRecordRaw } from 'vue-router'; + export declare global { interface CreateRouterOptions { routerAuth?: RouterAuthOptions; routerStats?: RouterStatsOptions; } + + interface ExtendedRouterRecord extends RouteRecordRaw { + title: string; + icon?: Icon; + children?: Array; + } } export * from './auth'; diff --git a/src/layouts/NormalLayout.vue b/src/layouts/NormalLayout.vue index 2e77dc0f9df0d..bedc2ebabb672 100644 --- a/src/layouts/NormalLayout.vue +++ b/src/layouts/NormalLayout.vue @@ -17,7 +17,6 @@ defineOptions({ name: 'ClNormalLayout' }); class="container" > -
@@ -46,9 +45,7 @@ defineOptions({ name: 'ClNormalLayout' }); .container-body { background-color: var(--cl-container-bg); - height: calc( - 100vh - var(--cl-header-height) - var(--cl-tabs-view-height) - ); + height: calc(100vh - var(--cl-header-height)); overflow: auto; } } diff --git a/src/layouts/components/Header.vue b/src/layouts/components/Header.vue index ef2bc4836fac8..1a8d4b5f473bc 100644 --- a/src/layouts/components/Header.vue +++ b/src/layouts/components/Header.vue @@ -1,11 +1,11 @@