From d0e7fab9e6f8002cd00b10335eaaed7fe99a0650 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 2 Jul 2024 09:37:11 +0800 Subject: [PATCH] chore: added definition files --- babel.config.js | 6 - package.json | 13 +- scripts/copy-dist-local.js | 39 ---- scripts/copy-dist-local.sh | 9 - scripts/gen-dts.js | 161 ++----------- scripts/gen-index.js | 11 +- src/components/index.ts | 48 ++-- src/layouts/index.ts | 4 +- src/views/index.ts | 16 +- typings/interfaces/common/action.d.ts | 38 ++++ typings/interfaces/common/color.d.ts | 16 ++ typings/interfaces/common/dataType.d.ts | 3 + typings/interfaces/common/index.d.ts | 5 + typings/interfaces/common/lang.d.ts | 3 + typings/interfaces/common/os.d.ts | 5 + .../interfaces/components/button/index.d.ts | 1 + .../interfaces/components/chart/Metric.d.ts | 16 ++ .../components/chart/MetricLineChart.d.ts | 3 + .../interfaces/components/chart/PieChart.d.ts | 8 + .../components/color/ColorPicker.d.ts | 6 + .../components/context-menu/ContextMenu.d.ts | 9 + .../context-menu/ContextMenuList.d.ts | 3 + typings/interfaces/components/date/date.d.ts | 22 ++ .../components/dialog/CreateEditDialog.d.ts | 18 ++ .../interfaces/components/dialog/Dialog.d.ts | 5 + .../components/drag/DraggableItem.d.ts | 13 ++ .../components/drag/DraggableItemContent.d.ts | 5 + typings/interfaces/components/drag/index.d.ts | 0 .../components/ds/DataSourceConnectType.d.ts | 5 + typings/interfaces/components/ds/index.d.ts | 3 + .../components/file/FileEditor.d.ts | 15 ++ .../components/file/FileEditorNavMenu.d.ts | 19 ++ .../components/file/FileEditorNavTabs.d.ts | 7 + .../components/file/FileUpload.d.ts | 25 ++ typings/interfaces/components/file/index.d.ts | 4 + .../components/filter/FilterCondition.d.ts | 7 + .../filter/FilterConditionList.d.ts | 3 + .../components/filter/FilterInput.d.ts | 6 + .../components/filter/FilterSelect.d.ts | 15 ++ .../interfaces/components/filter/index.d.ts | 12 + typings/interfaces/components/form/Form.d.ts | 51 +++++ .../interfaces/components/form/FormItem.d.ts | 16 ++ .../components/form/FormReadonlyValue.d.ts | 5 + .../interfaces/components/form/FormTable.d.ts | 17 ++ .../components/form/FormTableField.d.ts | 16 ++ typings/interfaces/components/form/index.d.ts | 5 + .../interfaces/components/git/GitFile.d.ts | 3 + .../interfaces/components/git/GitForm.d.ts | 5 + .../components/icon/AtomMaterialIcon.d.ts | 6 + typings/interfaces/components/icon/Icon.d.ts | 11 + typings/interfaces/components/icon/index.d.ts | 2 + typings/interfaces/components/index.d.ts | 4 + .../components/input/InputList.d.ts | 5 + .../components/input/InputWithButton.d.ts | 11 + .../interfaces/components/input/TagInput.d.ts | 8 + .../components/input/TagInputItem.d.ts | 6 + .../components/metric/MetricDashboard.d.ts | 3 + .../components/metric/MetricList.d.ts | 11 + .../components/metric/MetricProgress.d.ts | 34 +++ .../components/metric/MetricSnapshot.d.ts | 6 + .../components/metric/MetricTargetName.d.ts | 4 + .../components/metric/MetricTargetType.d.ts | 3 + .../interfaces/components/nav/NavAction.d.ts | 0 .../components/nav/NavActionBack.d.ts | 9 + .../interfaces/components/nav/NavActions.d.ts | 9 + .../interfaces/components/nav/NavLink.d.ts | 6 + .../interfaces/components/nav/NavSidebar.d.ts | 21 ++ .../components/nav/NavSidebarList.d.ts | 1 + .../components/nav/NavSidebarTree.d.ts | 5 + .../interfaces/components/nav/NavTabs.d.ts | 6 + typings/interfaces/components/nav/index.d.ts | 0 .../components/node/NodeActive.d.ts | 3 + .../components/node/NodeRunners.d.ts | 5 + .../interfaces/components/node/NodeType.d.ts | 4 + .../components/plugin/PluginPid.d.ts | 3 + .../components/plugin/PluginStatus.d.ts | 5 + .../plugin/PluginStatusMultiNode.d.ts | 4 + .../components/plugin/PublicPluginCard.d.ts | 7 + .../plugin/PublicPluginContent.d.ts | 6 + .../project/CreateProjectDialog.d.ts | 0 .../components/project/ProjectForm.d.ts | 0 .../components/project/ProjectTag.d.ts | 5 + .../components/result/ResultCell.d.ts | 7 + .../components/result/ResultCellDialog.d.ts | 3 + .../components/schedule/ScheduleCron.d.ts | 4 + .../components/select/SelectOption.d.ts | 7 + .../interfaces/components/select/index.d.ts | 1 + .../components/spider/CreateSpiderDialog.d.ts | 3 + .../components/spider/RunSpiderDialog.d.ts | 3 + .../components/spider/SpiderForm.d.ts | 3 + .../components/spider/SpiderStat.d.ts | 15 ++ .../components/spider/SpiderTag.d.ts | 3 + .../components/spider/SpiderType.d.ts | 12 + .../interfaces/components/switch/Switch.d.ts | 16 ++ .../interfaces/components/tab/ActionTab.d.ts | 4 + typings/interfaces/components/tab/Tab.d.ts | 8 + .../interfaces/components/table/Table.d.ts | 213 ++++++++++++++++++ .../components/table/TableActions.d.ts | 21 ++ .../components/table/TableCell.d.ts | 5 + .../table/TableColumnsTransfer.d.ts | 5 + .../components/table/TableHeader.d.ts | 14 ++ .../components/table/TableHeaderAction.d.ts | 8 + .../components/table/TableHeaderDialog.d.ts | 12 + .../table/TableHeaderDialogFilter.d.ts | 11 + .../table/TableHeaderDialogSort.d.ts | 3 + .../interfaces/components/table/index.d.ts | 1 + typings/interfaces/components/tag/tag.d.ts | 20 ++ .../interfaces/components/time/Duration.d.ts | 7 + typings/interfaces/components/time/Time.d.ts | 5 + .../components/transfer/Transfer.d.ts | 15 ++ .../components/transfer/TransferPanel.d.ts | 9 + .../interfaces/components/user/UserRole.d.ts | 4 + typings/interfaces/directives/auth/auth.d.ts | 3 + .../interfaces/directives/export/export.d.ts | 16 ++ typings/interfaces/directives/index.d.ts | 4 + .../interfaces/directives/locate/locate.d.ts | 3 + .../interfaces/directives/track/track.d.ts | 24 ++ typings/interfaces/echarts.d.ts | 24 ++ typings/interfaces/element/index.d.ts | 13 ++ typings/interfaces/global.d.ts | 19 ++ typings/interfaces/i18n/common.d.ts | 135 +++++++++++ typings/interfaces/i18n/components/chart.d.ts | 5 + typings/interfaces/i18n/components/date.d.ts | 24 ++ .../interfaces/i18n/components/dialog.d.ts | 13 ++ typings/interfaces/i18n/components/ds.d.ts | 86 +++++++ typings/interfaces/i18n/components/empty.d.ts | 3 + .../i18n/components/environment.d.ts | 8 + .../interfaces/i18n/components/export.d.ts | 16 ++ typings/interfaces/i18n/components/file.d.ts | 105 +++++++++ typings/interfaces/i18n/components/form.d.ts | 7 + typings/interfaces/i18n/components/git.d.ts | 198 ++++++++++++++++ typings/interfaces/i18n/components/index.d.ts | 31 +++ typings/interfaces/i18n/components/input.d.ts | 6 + .../interfaces/i18n/components/metric.d.ts | 121 ++++++++++ typings/interfaces/i18n/components/nav.d.ts | 15 ++ typings/interfaces/i18n/components/node.d.ts | 43 ++++ .../interfaces/i18n/components/plugin.d.ts | 71 ++++++ .../interfaces/i18n/components/project.d.ts | 7 + .../interfaces/i18n/components/result.d.ts | 22 ++ .../interfaces/i18n/components/schedule.d.ts | 35 +++ .../interfaces/i18n/components/spider.d.ts | 61 +++++ typings/interfaces/i18n/components/tab.d.ts | 3 + typings/interfaces/i18n/components/table.d.ts | 46 ++++ typings/interfaces/i18n/components/tag.d.ts | 7 + typings/interfaces/i18n/components/task.d.ts | 82 +++++++ .../interfaces/i18n/components/transfer.d.ts | 8 + typings/interfaces/i18n/components/user.d.ts | 27 +++ typings/interfaces/i18n/global.d.ts | 17 ++ typings/interfaces/i18n/index.d.ts | 22 ++ typings/interfaces/i18n/layouts.d.ts | 21 ++ typings/interfaces/i18n/router.d.ts | 33 +++ typings/interfaces/i18n/views/ds.d.ts | 31 +++ typings/interfaces/i18n/views/env.d.ts | 69 ++++++ .../interfaces/i18n/views/environment.d.ts | 14 ++ typings/interfaces/i18n/views/gits.d.ts | 15 ++ typings/interfaces/i18n/views/home.d.ts | 24 ++ typings/interfaces/i18n/views/index.d.ts | 22 ++ typings/interfaces/i18n/views/login.d.ts | 28 +++ typings/interfaces/i18n/views/misc.d.ts | 6 + typings/interfaces/i18n/views/nodes.d.ts | 42 ++++ .../interfaces/i18n/views/notification.d.ts | 47 ++++ typings/interfaces/i18n/views/plugins.d.ts | 22 ++ typings/interfaces/i18n/views/projects.d.ts | 11 + typings/interfaces/i18n/views/schedules.d.ts | 34 +++ typings/interfaces/i18n/views/spiders.d.ts | 25 ++ typings/interfaces/i18n/views/system.d.ts | 4 + typings/interfaces/i18n/views/tags.d.ts | 11 + typings/interfaces/i18n/views/tasks.d.ts | 48 ++++ typings/interfaces/i18n/views/tokens.d.ts | 14 ++ typings/interfaces/i18n/views/users.d.ts | 24 ++ typings/interfaces/index.d.ts | 29 +++ .../interfaces/layout/components/Sidebar.d.ts | 8 + .../layout/components/SidebarItem.d.ts | 3 + .../interfaces/layout/components/index.d.ts | 1 + .../layout/content/detail/DetailLayout.d.ts | 7 + typings/interfaces/layout/content/index.d.ts | 3 + .../layout/content/list/ListLayout.d.ts | 65 ++++++ .../layout/content/simple/SimpleLayout.d.ts | 3 + typings/interfaces/layout/index.d.ts | 2 + typings/interfaces/models/dataCollection.d.ts | 11 + typings/interfaces/models/dataField.d.ts | 31 +++ typings/interfaces/models/ds.d.ts | 52 +++++ typings/interfaces/models/envDeps.d.ts | 84 +++++++ typings/interfaces/models/environment.d.ts | 6 + typings/interfaces/models/export.d.ts | 13 ++ typings/interfaces/models/git.d.ts | 49 ++++ typings/interfaces/models/index.d.ts | 26 +++ typings/interfaces/models/map.d.ts | 3 + typings/interfaces/models/metric.d.ts | 1 + typings/interfaces/models/nav.d.ts | 17 ++ typings/interfaces/models/node.d.ts | 16 ++ typings/interfaces/models/notification.d.ts | 29 +++ typings/interfaces/models/plugin.d.ts | 91 ++++++++ typings/interfaces/models/project.d.ts | 6 + typings/interfaces/models/result.d.ts | 5 + typings/interfaces/models/setting.d.ts | 6 + typings/interfaces/models/spider.d.ts | 51 +++++ typings/interfaces/models/stats.d.ts | 7 + typings/interfaces/models/systemInfo.d.ts | 6 + typings/interfaces/models/token.d.ts | 7 + typings/interfaces/models/treeNode.d.ts | 5 + typings/interfaces/models/user.d.ts | 9 + typings/interfaces/package/create-app.d.ts | 25 ++ typings/interfaces/package/index.d.ts | 1 + typings/interfaces/router/auth.d.ts | 18 ++ typings/interfaces/router/index.d.ts | 8 + typings/interfaces/router/stats.d.ts | 6 + typings/interfaces/services/file.d.ts | 23 ++ typings/interfaces/services/git.d.ts | 3 + typings/interfaces/services/index.d.ts | 17 ++ typings/interfaces/services/request.d.ts | 51 +++++ typings/interfaces/services/spider.d.ts | 3 + typings/interfaces/static.d.ts | 5 + typings/interfaces/store/index.d.ts | 207 +++++++++++++++++ typings/interfaces/store/modules/common.d.ts | 29 +++ .../store/modules/dataCollection.d.ts | 57 +++++ typings/interfaces/store/modules/ds.d.ts | 21 ++ .../interfaces/store/modules/environment.d.ts | 16 ++ typings/interfaces/store/modules/file.d.ts | 23 ++ typings/interfaces/store/modules/git.d.ts | 83 +++++++ typings/interfaces/store/modules/layout.d.ts | 64 ++++++ typings/interfaces/store/modules/node.d.ts | 17 ++ .../store/modules/notification.d.ts | 27 +++ typings/interfaces/store/modules/plugin.d.ts | 36 +++ typings/interfaces/store/modules/project.d.ts | 23 ++ .../interfaces/store/modules/schedule.d.ts | 17 ++ typings/interfaces/store/modules/spider.d.ts | 27 +++ typings/interfaces/store/modules/system.d.ts | 25 ++ typings/interfaces/store/modules/tag.d.ts | 17 ++ typings/interfaces/store/modules/task.d.ts | 32 +++ typings/interfaces/store/modules/token.d.ts | 14 ++ typings/interfaces/store/modules/user.d.ts | 25 ++ typings/interfaces/store/utils/file.d.ts | 31 +++ typings/interfaces/views/dataSource.d.ts | 0 typings/interfaces/views/git.d.ts | 18 ++ typings/interfaces/views/index.d.ts | 10 + typings/interfaces/views/login.d.ts | 12 + typings/interfaces/views/node.d.ts | 14 ++ typings/interfaces/views/project.d.ts | 0 typings/interfaces/views/result.d.ts | 9 + typings/interfaces/views/schedule.d.ts | 15 ++ typings/interfaces/views/spider.d.ts | 8 + typings/interfaces/views/task.d.ts | 53 +++++ typings/interfaces/views/user.d.ts | 5 + typings/interfaces/vue3-sfc-loader.d.ts | 9 + 245 files changed, 4764 insertions(+), 247 deletions(-) delete mode 100644 babel.config.js delete mode 100644 scripts/copy-dist-local.js delete mode 100644 scripts/copy-dist-local.sh create mode 100644 typings/interfaces/common/action.d.ts create mode 100644 typings/interfaces/common/color.d.ts create mode 100644 typings/interfaces/common/dataType.d.ts create mode 100644 typings/interfaces/common/index.d.ts create mode 100644 typings/interfaces/common/lang.d.ts create mode 100644 typings/interfaces/common/os.d.ts create mode 100644 typings/interfaces/components/button/index.d.ts create mode 100644 typings/interfaces/components/chart/Metric.d.ts create mode 100644 typings/interfaces/components/chart/MetricLineChart.d.ts create mode 100644 typings/interfaces/components/chart/PieChart.d.ts create mode 100644 typings/interfaces/components/color/ColorPicker.d.ts create mode 100644 typings/interfaces/components/context-menu/ContextMenu.d.ts create mode 100644 typings/interfaces/components/context-menu/ContextMenuList.d.ts create mode 100644 typings/interfaces/components/date/date.d.ts create mode 100644 typings/interfaces/components/dialog/CreateEditDialog.d.ts create mode 100644 typings/interfaces/components/dialog/Dialog.d.ts create mode 100644 typings/interfaces/components/drag/DraggableItem.d.ts create mode 100644 typings/interfaces/components/drag/DraggableItemContent.d.ts create mode 100644 typings/interfaces/components/drag/index.d.ts create mode 100644 typings/interfaces/components/ds/DataSourceConnectType.d.ts create mode 100644 typings/interfaces/components/ds/index.d.ts create mode 100644 typings/interfaces/components/file/FileEditor.d.ts create mode 100644 typings/interfaces/components/file/FileEditorNavMenu.d.ts create mode 100644 typings/interfaces/components/file/FileEditorNavTabs.d.ts create mode 100644 typings/interfaces/components/file/FileUpload.d.ts create mode 100644 typings/interfaces/components/file/index.d.ts create mode 100644 typings/interfaces/components/filter/FilterCondition.d.ts create mode 100644 typings/interfaces/components/filter/FilterConditionList.d.ts create mode 100644 typings/interfaces/components/filter/FilterInput.d.ts create mode 100644 typings/interfaces/components/filter/FilterSelect.d.ts create mode 100644 typings/interfaces/components/filter/index.d.ts create mode 100644 typings/interfaces/components/form/Form.d.ts create mode 100644 typings/interfaces/components/form/FormItem.d.ts create mode 100644 typings/interfaces/components/form/FormReadonlyValue.d.ts create mode 100644 typings/interfaces/components/form/FormTable.d.ts create mode 100644 typings/interfaces/components/form/FormTableField.d.ts create mode 100644 typings/interfaces/components/form/index.d.ts create mode 100644 typings/interfaces/components/git/GitFile.d.ts create mode 100644 typings/interfaces/components/git/GitForm.d.ts create mode 100644 typings/interfaces/components/icon/AtomMaterialIcon.d.ts create mode 100644 typings/interfaces/components/icon/Icon.d.ts create mode 100644 typings/interfaces/components/icon/index.d.ts create mode 100644 typings/interfaces/components/index.d.ts create mode 100644 typings/interfaces/components/input/InputList.d.ts create mode 100644 typings/interfaces/components/input/InputWithButton.d.ts create mode 100644 typings/interfaces/components/input/TagInput.d.ts create mode 100644 typings/interfaces/components/input/TagInputItem.d.ts create mode 100644 typings/interfaces/components/metric/MetricDashboard.d.ts create mode 100644 typings/interfaces/components/metric/MetricList.d.ts create mode 100644 typings/interfaces/components/metric/MetricProgress.d.ts create mode 100644 typings/interfaces/components/metric/MetricSnapshot.d.ts create mode 100644 typings/interfaces/components/metric/MetricTargetName.d.ts create mode 100644 typings/interfaces/components/metric/MetricTargetType.d.ts create mode 100644 typings/interfaces/components/nav/NavAction.d.ts create mode 100644 typings/interfaces/components/nav/NavActionBack.d.ts create mode 100644 typings/interfaces/components/nav/NavActions.d.ts create mode 100644 typings/interfaces/components/nav/NavLink.d.ts create mode 100644 typings/interfaces/components/nav/NavSidebar.d.ts create mode 100644 typings/interfaces/components/nav/NavSidebarList.d.ts create mode 100644 typings/interfaces/components/nav/NavSidebarTree.d.ts create mode 100644 typings/interfaces/components/nav/NavTabs.d.ts create mode 100644 typings/interfaces/components/nav/index.d.ts create mode 100644 typings/interfaces/components/node/NodeActive.d.ts create mode 100644 typings/interfaces/components/node/NodeRunners.d.ts create mode 100644 typings/interfaces/components/node/NodeType.d.ts create mode 100644 typings/interfaces/components/plugin/PluginPid.d.ts create mode 100644 typings/interfaces/components/plugin/PluginStatus.d.ts create mode 100644 typings/interfaces/components/plugin/PluginStatusMultiNode.d.ts create mode 100644 typings/interfaces/components/plugin/PublicPluginCard.d.ts create mode 100644 typings/interfaces/components/plugin/PublicPluginContent.d.ts create mode 100644 typings/interfaces/components/project/CreateProjectDialog.d.ts create mode 100644 typings/interfaces/components/project/ProjectForm.d.ts create mode 100644 typings/interfaces/components/project/ProjectTag.d.ts create mode 100644 typings/interfaces/components/result/ResultCell.d.ts create mode 100644 typings/interfaces/components/result/ResultCellDialog.d.ts create mode 100644 typings/interfaces/components/schedule/ScheduleCron.d.ts create mode 100644 typings/interfaces/components/select/SelectOption.d.ts create mode 100644 typings/interfaces/components/select/index.d.ts create mode 100644 typings/interfaces/components/spider/CreateSpiderDialog.d.ts create mode 100644 typings/interfaces/components/spider/RunSpiderDialog.d.ts create mode 100644 typings/interfaces/components/spider/SpiderForm.d.ts create mode 100644 typings/interfaces/components/spider/SpiderStat.d.ts create mode 100644 typings/interfaces/components/spider/SpiderTag.d.ts create mode 100644 typings/interfaces/components/spider/SpiderType.d.ts create mode 100644 typings/interfaces/components/switch/Switch.d.ts create mode 100644 typings/interfaces/components/tab/ActionTab.d.ts create mode 100644 typings/interfaces/components/tab/Tab.d.ts create mode 100644 typings/interfaces/components/table/Table.d.ts create mode 100644 typings/interfaces/components/table/TableActions.d.ts create mode 100644 typings/interfaces/components/table/TableCell.d.ts create mode 100644 typings/interfaces/components/table/TableColumnsTransfer.d.ts create mode 100644 typings/interfaces/components/table/TableHeader.d.ts create mode 100644 typings/interfaces/components/table/TableHeaderAction.d.ts create mode 100644 typings/interfaces/components/table/TableHeaderDialog.d.ts create mode 100644 typings/interfaces/components/table/TableHeaderDialogFilter.d.ts create mode 100644 typings/interfaces/components/table/TableHeaderDialogSort.d.ts create mode 100644 typings/interfaces/components/table/index.d.ts create mode 100644 typings/interfaces/components/tag/tag.d.ts create mode 100644 typings/interfaces/components/time/Duration.d.ts create mode 100644 typings/interfaces/components/time/Time.d.ts create mode 100644 typings/interfaces/components/transfer/Transfer.d.ts create mode 100644 typings/interfaces/components/transfer/TransferPanel.d.ts create mode 100644 typings/interfaces/components/user/UserRole.d.ts create mode 100644 typings/interfaces/directives/auth/auth.d.ts create mode 100644 typings/interfaces/directives/export/export.d.ts create mode 100644 typings/interfaces/directives/index.d.ts create mode 100644 typings/interfaces/directives/locate/locate.d.ts create mode 100644 typings/interfaces/directives/track/track.d.ts create mode 100644 typings/interfaces/echarts.d.ts create mode 100644 typings/interfaces/element/index.d.ts create mode 100644 typings/interfaces/global.d.ts create mode 100644 typings/interfaces/i18n/common.d.ts create mode 100644 typings/interfaces/i18n/components/chart.d.ts create mode 100644 typings/interfaces/i18n/components/date.d.ts create mode 100644 typings/interfaces/i18n/components/dialog.d.ts create mode 100644 typings/interfaces/i18n/components/ds.d.ts create mode 100644 typings/interfaces/i18n/components/empty.d.ts create mode 100644 typings/interfaces/i18n/components/environment.d.ts create mode 100644 typings/interfaces/i18n/components/export.d.ts create mode 100644 typings/interfaces/i18n/components/file.d.ts create mode 100644 typings/interfaces/i18n/components/form.d.ts create mode 100644 typings/interfaces/i18n/components/git.d.ts create mode 100644 typings/interfaces/i18n/components/index.d.ts create mode 100644 typings/interfaces/i18n/components/input.d.ts create mode 100644 typings/interfaces/i18n/components/metric.d.ts create mode 100644 typings/interfaces/i18n/components/nav.d.ts create mode 100644 typings/interfaces/i18n/components/node.d.ts create mode 100644 typings/interfaces/i18n/components/plugin.d.ts create mode 100644 typings/interfaces/i18n/components/project.d.ts create mode 100644 typings/interfaces/i18n/components/result.d.ts create mode 100644 typings/interfaces/i18n/components/schedule.d.ts create mode 100644 typings/interfaces/i18n/components/spider.d.ts create mode 100644 typings/interfaces/i18n/components/tab.d.ts create mode 100644 typings/interfaces/i18n/components/table.d.ts create mode 100644 typings/interfaces/i18n/components/tag.d.ts create mode 100644 typings/interfaces/i18n/components/task.d.ts create mode 100644 typings/interfaces/i18n/components/transfer.d.ts create mode 100644 typings/interfaces/i18n/components/user.d.ts create mode 100644 typings/interfaces/i18n/global.d.ts create mode 100644 typings/interfaces/i18n/index.d.ts create mode 100644 typings/interfaces/i18n/layouts.d.ts create mode 100644 typings/interfaces/i18n/router.d.ts create mode 100644 typings/interfaces/i18n/views/ds.d.ts create mode 100644 typings/interfaces/i18n/views/env.d.ts create mode 100644 typings/interfaces/i18n/views/environment.d.ts create mode 100644 typings/interfaces/i18n/views/gits.d.ts create mode 100644 typings/interfaces/i18n/views/home.d.ts create mode 100644 typings/interfaces/i18n/views/index.d.ts create mode 100644 typings/interfaces/i18n/views/login.d.ts create mode 100644 typings/interfaces/i18n/views/misc.d.ts create mode 100644 typings/interfaces/i18n/views/nodes.d.ts create mode 100644 typings/interfaces/i18n/views/notification.d.ts create mode 100644 typings/interfaces/i18n/views/plugins.d.ts create mode 100644 typings/interfaces/i18n/views/projects.d.ts create mode 100644 typings/interfaces/i18n/views/schedules.d.ts create mode 100644 typings/interfaces/i18n/views/spiders.d.ts create mode 100644 typings/interfaces/i18n/views/system.d.ts create mode 100644 typings/interfaces/i18n/views/tags.d.ts create mode 100644 typings/interfaces/i18n/views/tasks.d.ts create mode 100644 typings/interfaces/i18n/views/tokens.d.ts create mode 100644 typings/interfaces/i18n/views/users.d.ts create mode 100644 typings/interfaces/index.d.ts create mode 100644 typings/interfaces/layout/components/Sidebar.d.ts create mode 100644 typings/interfaces/layout/components/SidebarItem.d.ts create mode 100644 typings/interfaces/layout/components/index.d.ts create mode 100644 typings/interfaces/layout/content/detail/DetailLayout.d.ts create mode 100644 typings/interfaces/layout/content/index.d.ts create mode 100644 typings/interfaces/layout/content/list/ListLayout.d.ts create mode 100644 typings/interfaces/layout/content/simple/SimpleLayout.d.ts create mode 100644 typings/interfaces/layout/index.d.ts create mode 100644 typings/interfaces/models/dataCollection.d.ts create mode 100644 typings/interfaces/models/dataField.d.ts create mode 100644 typings/interfaces/models/ds.d.ts create mode 100644 typings/interfaces/models/envDeps.d.ts create mode 100644 typings/interfaces/models/environment.d.ts create mode 100644 typings/interfaces/models/export.d.ts create mode 100644 typings/interfaces/models/git.d.ts create mode 100644 typings/interfaces/models/index.d.ts create mode 100644 typings/interfaces/models/map.d.ts create mode 100644 typings/interfaces/models/metric.d.ts create mode 100644 typings/interfaces/models/nav.d.ts create mode 100644 typings/interfaces/models/node.d.ts create mode 100644 typings/interfaces/models/notification.d.ts create mode 100644 typings/interfaces/models/plugin.d.ts create mode 100644 typings/interfaces/models/project.d.ts create mode 100644 typings/interfaces/models/result.d.ts create mode 100644 typings/interfaces/models/setting.d.ts create mode 100644 typings/interfaces/models/spider.d.ts create mode 100644 typings/interfaces/models/stats.d.ts create mode 100644 typings/interfaces/models/systemInfo.d.ts create mode 100644 typings/interfaces/models/token.d.ts create mode 100644 typings/interfaces/models/treeNode.d.ts create mode 100644 typings/interfaces/models/user.d.ts create mode 100644 typings/interfaces/package/create-app.d.ts create mode 100644 typings/interfaces/package/index.d.ts create mode 100644 typings/interfaces/router/auth.d.ts create mode 100644 typings/interfaces/router/index.d.ts create mode 100644 typings/interfaces/router/stats.d.ts create mode 100644 typings/interfaces/services/file.d.ts create mode 100644 typings/interfaces/services/git.d.ts create mode 100644 typings/interfaces/services/index.d.ts create mode 100644 typings/interfaces/services/request.d.ts create mode 100644 typings/interfaces/services/spider.d.ts create mode 100644 typings/interfaces/static.d.ts create mode 100644 typings/interfaces/store/index.d.ts create mode 100644 typings/interfaces/store/modules/common.d.ts create mode 100644 typings/interfaces/store/modules/dataCollection.d.ts create mode 100644 typings/interfaces/store/modules/ds.d.ts create mode 100644 typings/interfaces/store/modules/environment.d.ts create mode 100644 typings/interfaces/store/modules/file.d.ts create mode 100644 typings/interfaces/store/modules/git.d.ts create mode 100644 typings/interfaces/store/modules/layout.d.ts create mode 100644 typings/interfaces/store/modules/node.d.ts create mode 100644 typings/interfaces/store/modules/notification.d.ts create mode 100644 typings/interfaces/store/modules/plugin.d.ts create mode 100644 typings/interfaces/store/modules/project.d.ts create mode 100644 typings/interfaces/store/modules/schedule.d.ts create mode 100644 typings/interfaces/store/modules/spider.d.ts create mode 100644 typings/interfaces/store/modules/system.d.ts create mode 100644 typings/interfaces/store/modules/tag.d.ts create mode 100644 typings/interfaces/store/modules/task.d.ts create mode 100644 typings/interfaces/store/modules/token.d.ts create mode 100644 typings/interfaces/store/modules/user.d.ts create mode 100644 typings/interfaces/store/utils/file.d.ts create mode 100644 typings/interfaces/views/dataSource.d.ts create mode 100644 typings/interfaces/views/git.d.ts create mode 100644 typings/interfaces/views/index.d.ts create mode 100644 typings/interfaces/views/login.d.ts create mode 100644 typings/interfaces/views/node.d.ts create mode 100644 typings/interfaces/views/project.d.ts create mode 100644 typings/interfaces/views/result.d.ts create mode 100644 typings/interfaces/views/schedule.d.ts create mode 100644 typings/interfaces/views/spider.d.ts create mode 100644 typings/interfaces/views/task.d.ts create mode 100644 typings/interfaces/views/user.d.ts create mode 100644 typings/interfaces/vue3-sfc-loader.d.ts diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index ce6ed5cf75ab0..0000000000000 --- a/babel.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset', - '@babel/preset-typescript' - ] -} diff --git a/package.json b/package.json index f0156200e4272..dde1d2efed2c8 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "public", "src", "typings", - "babel.config.js", "vite.config.js" ], "typings": "typings/index.d.ts", @@ -40,22 +39,19 @@ "serve:dist": "serve dist", "gen:index": "node ./scripts/gen-index.js", "gen:svg": "node ./scripts/gen-svg.js", - "gen:dts": "pnpm run fix-memory-limit && vue-tsc --declaration --emitDeclarationOnly --declarationDir ./typings --rootDir ./src", + "gen:dts": "node ./scripts/gen-dts.js", "gen:dts:check": "vue-tsc --noEmit --rootDir ./src", "gen:interfaces": "node ./scripts/gen-interfaces.js", "prebuild": "pnpm run prebuild:gen", "prebuild:gen": "pnpm run gen:index && pnpm run gen:svg", "postbuild": "pnpm run postbuild:gen", "postbuild:gen": "pnpm run gen:interfaces", - "postbuild:dist:local": "node ./scripts/copy-dist-local.js", "build": "pnpm run prebuild && pnpm run build:lib && pnpm run postbuild", - "build:dist:local": "pnpm run build && pnpm run postbuild:dist:local", "build:docker": "vite build --mode docker", "build:local": "vite build --mode local", "build:lib": "vite build", "build:lib:watch": "vite build --target lib --mode production --watch src/index.ts", "build:lib:local": "vite build --target lib --mode local src/index.ts", - "build:lib:dist": "pnpm run build:lib && pnpm run postbuild:dist:local", "build:lib:analyze": "vite build --target lib --mode analyze src/index.ts", "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit", "lint": "vite lint", @@ -110,11 +106,6 @@ "@types/node": "^20.14.8", "@types/node-os-utils": "^1.3.4", "@vitejs/plugin-vue": "5.0.5", - "@vue/cli-plugin-babel": "^5.0.8", - "@vue/cli-plugin-router": "^5.0.8", - "@vue/cli-plugin-typescript": "^5.0.8", - "@vue/cli-plugin-vuex": "^5.0.8", - "@vue/cli-service": "^5.0.8", "@vue/compiler-sfc": "^3.4.29", "autoprefixer": "^10.4.19", "base64-img": "^1.0.4", @@ -137,7 +128,7 @@ "serve": "^14.2.3", "tailwindcss": "^3.4.4", "ts-morph": "^22.0.0", - "typescript": "^5.4.5", + "typescript": "^5", "vite": "^5", "vite-aliases": "^0.11.7", "vite-plugin-dynamic-import": "^1.5.0", diff --git a/scripts/copy-dist-local.js b/scripts/copy-dist-local.js deleted file mode 100644 index 74d12c483a530..0000000000000 --- a/scripts/copy-dist-local.js +++ /dev/null @@ -1,39 +0,0 @@ -import fs from 'fs-extra'; -import path from 'path'; - -import { dirname } from 'path'; -import { fileURLToPath } from 'url'; - -const __dirname = dirname(fileURLToPath(import.meta.url)); - -const files = [ - 'dist', - 'public', - 'src', - 'typings', - 'babel.config.js', - 'README.md', - 'package.json', -]; - -const sourceDir = path.resolve(path.join(__dirname, '..')); -const targetDir = path.resolve(path.join(__dirname, '..', 'dist_local')); - -fs.ensureDirSync(targetDir); -fs.emptyDirSync(targetDir); - -files.forEach(fileName => { - // source file path - const srcFilePath = path.join(sourceDir, fileName); - - if (fs.statSync(srcFilePath).isDirectory()) { - // directory - const tgtDirPath = path.join(targetDir, fileName); - fs.ensureDirSync(tgtDirPath); - fs.copySync(srcFilePath, tgtDirPath); - } else { - // file - const tgtFilePath = path.join(targetDir, fileName); - fs.copySync(srcFilePath, tgtFilePath); - } -}); diff --git a/scripts/copy-dist-local.sh b/scripts/copy-dist-local.sh deleted file mode 100644 index 502a45fb8a9d6..0000000000000 --- a/scripts/copy-dist-local.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -rm -rf ./dist_local | true -mkdir ./dist_local - -files="dist public src typings babel.config.js vue.config.js package.json" -for f in $files; do - copy -r $f dist_local/ -done diff --git a/scripts/gen-dts.js b/scripts/gen-dts.js index dae7e6dfe243c..a6d102555199b 100644 --- a/scripts/gen-dts.js +++ b/scripts/gen-dts.js @@ -1,148 +1,33 @@ -import path from 'path'; import fs from 'fs'; -import { Project } from 'ts-morph'; -import vueCompiler from '@vue/compiler-sfc'; -import klawSync from 'klaw-sync'; -import { dirname } from 'path'; +import { spawn } from 'child_process'; +import { resolve, join, dirname } from 'path'; import { fileURLToPath } from 'url'; import { log } from './utils.js'; const __dirname = dirname(fileURLToPath(import.meta.url)); -const TSCONFIG_PATH = path.resolve(__dirname, '../tsconfig.dts.json'); -const DEMO_RE = /\/demo\/\w+\.vue$/; -const TEST_RE = /__test__|__tests__/; -const excludedFiles = [ - 'mock', - 'package.json', - 'spec', - 'test', - 'tests', - 'css', - '.DS_Store', -]; -const includedFiles = ['.vue', '.ts']; -const exclude = path => !excludedFiles.some(f => path.includes(f)); -const include = path => includedFiles.some(f => path.includes(f)); - -/** - * fork = require( https://github.com/egoist/vue-dts-gen/blob/main/src/index.ts - */ -async function genVueTypes( - root, - outDir = path.resolve(__dirname, '../typings') -) { - const options = { - compilerOptions: { - allowJs: false, - declaration: true, - emitDeclarationOnly: true, - noEmitOnError: false, - outDir, - paths: { - '@': [path.resolve(__dirname, '../src')], - '@/*': [path.resolve(__dirname, '../src/*')], - }, - skipLibCheck: true, - }, - tsConfigFilePath: TSCONFIG_PATH, - skipAddingFilesFromTsConfig: true, - }; - const project = new Project(options); - - const start = Date.now(); - - log('Getting all files...', 'info'); - const filePaths = klawSync(root, { nodir: true }) - .map(item => item.path) - .filter(path => !DEMO_RE.test(path)) - .filter(path => !TEST_RE.test(path)) - .filter(exclude) - .filter(include); - - filePaths.forEach((file, i) => { - let sourceFile; - try { - if (file.endsWith('.vue')) { - // .vue file - const content = fs.readFileSync(file, 'utf-8'); - const sfc = vueCompiler.parse(content); - const { script, scriptSetup } = sfc.descriptor; - if (script || scriptSetup) { - let content = ''; - let isTS = false; - if (script && script.content) { - content += script.content; - if (script.lang === 'ts') isTS = true; - } - if (scriptSetup) { - const compiled = vueCompiler.compileScript(sfc.descriptor, { - id: 'xxx', - }); - content += compiled.content; - if (scriptSetup.lang === 'ts') isTS = true; - } - sourceFile = project.createSourceFile( - path.relative(process.cwd(), file) + (isTS ? '.ts' : '.js'), - content - ); - } - } else if (file.endsWith('.ts')) { - // .ts file - const content = fs.readFileSync(file, 'utf-8'); - sourceFile = project.createSourceFile( - path.relative(process.cwd(), file), - content - ); - } - - if (!sourceFile) return; - - log(`Processing ${sourceFile.getFilePath()}`, 'info'); - const emitOutput = sourceFile.getEmitOutput({ emitOnlyDtsFiles: true }); - log(`Emitting ${sourceFile.getFilePath()}`, 'info'); - const outputFiles = emitOutput.getOutputFiles(); - outputFiles.forEach(outputFile => { - const filepath = outputFile.getFilePath(); - fs.mkdirSync(path.dirname(filepath), { - recursive: true, - }); - fs.writeFileSync(filepath, outputFile.getText(), 'utf8'); - }); - - if (((i + 1) % 100 === 0 && i > 0) || i + 1 === filePaths.length) { - log(`Processed: ${i + 1}/${filePaths.length}`, 'info'); - } - } catch (e) { - console.error(e); - throw e; - } - }); - log('All definition files generated', 'success'); - - // export interfaces in typings/index.d.ts - log('Exporting interfaces...', 'info'); - const idxFilePath = path.resolve(__dirname, '../typings/index.d.ts'); - if (fs.existsSync(idxFilePath)) { - let fileContent = fs.readFileSync(idxFilePath); - const exportInterfacesLine = "export * from './interfaces';"; - if (!fileContent.includes(exportInterfacesLine)) { - fileContent = exportInterfacesLine + '\n' + fileContent; - } - fs.writeFileSync(idxFilePath, fileContent); +function main() { + const typingsPath = resolve(join(__dirname, '..', 'typings')); + if (fs.existsSync(typingsPath)) { + fs.rmSync(typingsPath, { recursive: true }); } - log('Interfaces exported', 'success'); - - const end = Date.now(); - const duration = ((end - start) / 1000).toFixed(1); - - log(`Done in ${duration}s`, 'success'); + const child = spawn( + 'vue-tsc', + '--declaration --emitDeclarationOnly --declarationDir ./typings --rootDir ./src'.split( + ' ' + ), + { shell: true } + ); + child.stdout.on('data', data => { + log(`${data}`, 'info'); + }); + child.stderr.on('data', data => { + log(`${data}`, 'error'); + }); + child.on('close', code => { + log(`child process exited with code ${code}`, 'info'); + }); } -(async function () { - await genVueTypes( - path.resolve(__dirname, '../src'), - path.resolve(__dirname, '../typings') - ); -})(); +main(); diff --git a/scripts/gen-index.js b/scripts/gen-index.js index babd1f454b223..c057935a3c7ae 100644 --- a/scripts/gen-index.js +++ b/scripts/gen-index.js @@ -3,16 +3,7 @@ import fs from 'fs'; import rd from 'rd'; import os from 'os'; -const EXPORT_MODULES = [ - 'components', - 'views', - 'directives', - 'layouts', - // 'services', - // 'store', - // 'utils', - // 'constants', -]; +const EXPORT_MODULES = ['components', 'views', 'directives', 'layouts']; const COMPONENT_PREFIX = 'Cl'; const INDEX_COMP_NAME = 'index'; diff --git a/src/components/index.ts b/src/components/index.ts index 5f1df8b3f5cf8..c240c7dae5964 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -9,10 +9,10 @@ import MetricLineChart from './chart/MetricLineChart.vue'; import PieChart from './chart/PieChart.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,9 +69,9 @@ 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 DetailTabList from './list/DetailTabList.vue'; import NavActionBack from './nav/NavActionBack.vue'; @@ -94,8 +94,8 @@ import NodeStatus from './node/NodeStatus.vue'; import NodeType from './node/NodeType.vue'; import useNode from './node/useNode'; import CreateEditNotificationDialog from './notification/CreateEditNotificationDialog.vue'; -import NotificationForm from './notification/NotificationForm.vue'; import * as notification from './notification/notification'; +import NotificationForm from './notification/NotificationForm.vue'; import CreateEditProjectDialog from './project/CreateEditProjectDialog.vue'; import ProjectForm from './project/ProjectForm.vue'; import useProject from './project/useProject'; @@ -116,6 +116,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'; @@ -125,12 +131,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'; @@ -164,10 +164,10 @@ export { PieChart as ClPieChart, 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, @@ -189,6 +189,7 @@ export { FileDiff as ClFileDiff, FileEditor as ClFileEditor, FileEditorCreateWithAiDialog as ClFileEditorCreateWithAiDialog, + fileEditorDropZone as fileEditorDropZone, FileEditorNavMenu as ClFileEditorNavMenu, FileEditorNavMenuContextMenu as ClFileEditorNavMenuContextMenu, FileEditorNavTabs as ClFileEditorNavTabs, @@ -198,16 +199,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, @@ -224,9 +224,9 @@ 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, DetailTabList as ClDetailTabList, NavActionBack as ClNavActionBack, @@ -249,8 +249,8 @@ export { NodeType as ClNodeType, useNode as useNode, CreateEditNotificationDialog as ClCreateEditNotificationDialog, - NotificationForm as ClNotificationForm, notification as notification, + NotificationForm as ClNotificationForm, CreateEditProjectDialog as ClCreateEditProjectDialog, ProjectForm as ClProjectForm, useProject as useProject, @@ -271,6 +271,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, @@ -280,12 +286,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/layouts/index.ts b/src/layouts/index.ts index 98e315c5d9ebc..31f4c535ff783 100644 --- a/src/layouts/index.ts +++ b/src/layouts/index.ts @@ -1,5 +1,4 @@ import BlankLayout from './BlankLayout.vue'; -import NormalLayout from './NormalLayout.vue'; import Header from './components/Header.vue'; import Sidebar from './components/Sidebar.vue'; import SidebarItem from './components/SidebarItem.vue'; @@ -9,10 +8,10 @@ import useDetail from './content/detail/useDetail'; import ListLayout from './content/list/ListLayout.vue'; import useList from './content/list/useList'; import SimpleLayout from './content/simple/SimpleLayout.vue'; +import NormalLayout from './NormalLayout.vue'; export { BlankLayout as ClBlankLayout, - NormalLayout as ClNormalLayout, Header as ClHeader, Sidebar as ClSidebar, SidebarItem as ClSidebarItem, @@ -22,4 +21,5 @@ export { ListLayout as ClListLayout, useList as useList, SimpleLayout as ClSimpleLayout, + NormalLayout as ClNormalLayout, }; diff --git a/src/views/index.ts b/src/views/index.ts index ac405017fb9e5..b53936bbc9598 100644 --- a/src/views/index.ts +++ b/src/views/index.ts @@ -17,11 +17,11 @@ import DataSourceList from './ds/list/DataSourceList.vue'; import useDataSourceList from './ds/list/useDataSourceList'; import EnvironmentList from './environment/list/EnvironmentList.vue'; import useEnvironmentList from './environment/list/useEnvironmentList'; -import GitDetail from './git/detail/GitDetail.vue'; import GitDetailActionsChanges from './git/detail/actions/GitDetailActionsChanges.vue'; import GitDetailActionsCommon from './git/detail/actions/GitDetailActionsCommon.vue'; import GitDetailActionsFiles from './git/detail/actions/GitDetailActionsFiles.vue'; import GitDetailActionsSpiders from './git/detail/actions/GitDetailActionsSpiders.vue'; +import GitDetail from './git/detail/GitDetail.vue'; import GitDetailTabChanges from './git/detail/tabs/GitDetailTabChanges.vue'; import GitDetailTabFiles from './git/detail/tabs/GitDetailTabFiles.vue'; import GitDetailTabLogs from './git/detail/tabs/GitDetailTabLogs.vue'; @@ -57,11 +57,11 @@ import ScheduleDetailTabTasks from './schedule/detail/tabs/ScheduleDetailTabTask import useScheduleDetail from './schedule/detail/useScheduleDetail'; import ScheduleList from './schedule/list/ScheduleList.vue'; import useScheduleList from './schedule/list/useScheduleList'; -import SpiderDetail from './spider/detail/SpiderDetail.vue'; import SpiderDetailActionsCommon from './spider/detail/actions/SpiderDetailActionsCommon.vue'; import SpiderDetailActionsData from './spider/detail/actions/SpiderDetailActionsData.vue'; import SpiderDetailActionsDataSource from './spider/detail/actions/SpiderDetailActionsDataSource.vue'; import SpiderDetailActionsFiles from './spider/detail/actions/SpiderDetailActionsFiles.vue'; +import SpiderDetail from './spider/detail/SpiderDetail.vue'; import SpiderDetailTabData from './spider/detail/tabs/SpiderDetailTabData.vue'; import SpiderDetailTabFiles from './spider/detail/tabs/SpiderDetailTabFiles.vue'; import SpiderDetailTabOverview from './spider/detail/tabs/SpiderDetailTabOverview.vue'; @@ -72,20 +72,20 @@ import useSpiderDetail from './spider/detail/useSpiderDetail'; import SpiderList from './spider/list/SpiderList.vue'; import useSpiderList from './spider/list/useSpiderList'; import SystemDetail from './system/detail/SystemDetail.vue'; -import TaskDetail from './task/detail/TaskDetail.vue'; import TaskDetailActionsCommon from './task/detail/actions/TaskDetailActionsCommon.vue'; import TaskDetailActionsData from './task/detail/actions/TaskDetailActionsData.vue'; import TaskDetailActionsLogs from './task/detail/actions/TaskDetailActionsLogs.vue'; import TaskDetailTabData from './task/detail/tabs/TaskDetailTabData.vue'; import TaskDetailTabLogs from './task/detail/tabs/TaskDetailTabLogs.vue'; import TaskDetailTabOverview from './task/detail/tabs/TaskDetailTabOverview.vue'; +import TaskDetail from './task/detail/TaskDetail.vue'; import useTaskDetail from './task/detail/useTaskDetail'; import TaskList from './task/list/TaskList.vue'; import useTaskList from './task/list/useTaskList'; import TokenList from './token/list/TokenList.vue'; import useTokenList from './token/list/useTokenList'; -import UserDetail from './user/detail/UserDetail.vue'; import UserDetailTabOverview from './user/detail/tabs/UserDetailTabOverview.vue'; +import UserDetail from './user/detail/UserDetail.vue'; import useUserDetail from './user/detail/useUserDetail'; import UserList from './user/list/UserList.vue'; import useUserList from './user/list/useUserList'; @@ -110,11 +110,11 @@ export { useDataSourceList as useDataSourceList, EnvironmentList as ClEnvironmentList, useEnvironmentList as useEnvironmentList, - GitDetail as ClGitDetail, GitDetailActionsChanges as ClGitDetailActionsChanges, GitDetailActionsCommon as ClGitDetailActionsCommon, GitDetailActionsFiles as ClGitDetailActionsFiles, GitDetailActionsSpiders as ClGitDetailActionsSpiders, + GitDetail as ClGitDetail, GitDetailTabChanges as ClGitDetailTabChanges, GitDetailTabFiles as ClGitDetailTabFiles, GitDetailTabLogs as ClGitDetailTabLogs, @@ -150,11 +150,11 @@ export { useScheduleDetail as useScheduleDetail, ScheduleList as ClScheduleList, useScheduleList as useScheduleList, - SpiderDetail as ClSpiderDetail, SpiderDetailActionsCommon as ClSpiderDetailActionsCommon, SpiderDetailActionsData as ClSpiderDetailActionsData, SpiderDetailActionsDataSource as ClSpiderDetailActionsDataSource, SpiderDetailActionsFiles as ClSpiderDetailActionsFiles, + SpiderDetail as ClSpiderDetail, SpiderDetailTabData as ClSpiderDetailTabData, SpiderDetailTabFiles as ClSpiderDetailTabFiles, SpiderDetailTabOverview as ClSpiderDetailTabOverview, @@ -165,20 +165,20 @@ export { SpiderList as ClSpiderList, useSpiderList as useSpiderList, SystemDetail as ClSystemDetail, - TaskDetail as ClTaskDetail, TaskDetailActionsCommon as ClTaskDetailActionsCommon, TaskDetailActionsData as ClTaskDetailActionsData, TaskDetailActionsLogs as ClTaskDetailActionsLogs, TaskDetailTabData as ClTaskDetailTabData, TaskDetailTabLogs as ClTaskDetailTabLogs, TaskDetailTabOverview as ClTaskDetailTabOverview, + TaskDetail as ClTaskDetail, useTaskDetail as useTaskDetail, TaskList as ClTaskList, useTaskList as useTaskList, TokenList as ClTokenList, useTokenList as useTokenList, - UserDetail as ClUserDetail, UserDetailTabOverview as ClUserDetailTabOverview, + UserDetail as ClUserDetail, useUserDetail as useUserDetail, UserList as ClUserList, useUserList as useUserList, diff --git a/typings/interfaces/common/action.d.ts b/typings/interfaces/common/action.d.ts new file mode 100644 index 0000000000000..d615adfc64f7c --- /dev/null +++ b/typings/interfaces/common/action.d.ts @@ -0,0 +1,38 @@ +import { + ACTION_CLONE, + ACTION_DELETE, + ACTION_EDIT, + ACTION_RUN, + ACTION_UPLOAD, + ACTION_VIEW, + ACTION_VIEW_LOGS, + ACTION_VIEW_DATA, + ACTION_RESTART, + ACTION_COPY, + ACTION_START, + ACTION_STOP, + ACTION_SAVE, + ACTION_BACK, + ACTION_ENABLE, +} from '@/constants/action'; + +export declare global { + type ActionName = + | ACTION_VIEW + | ACTION_EDIT + | ACTION_CLONE + | ACTION_RUN + | ACTION_DELETE + | ACTION_UPLOAD + | ACTION_RESTART + | ACTION_VIEW_LOGS + | ACTION_VIEW_DATA + | ACTION_COPY + | ACTION_START + | ACTION_STOP + | ACTION_SAVE + | ACTION_BACK + | ACTION_ENABLE; + + type GenericAction = ActionName | string; +} diff --git a/typings/interfaces/common/color.d.ts b/typings/interfaces/common/color.d.ts new file mode 100644 index 0000000000000..8ae8a69702270 --- /dev/null +++ b/typings/interfaces/common/color.d.ts @@ -0,0 +1,16 @@ +export declare global { + type Color = + | 'red' + | 'magenta' + | 'purple' + | 'geekBlue' + | 'blue' + | 'cyan' + | 'green' + | 'limeGreen' + | 'yellow' + | 'gold' + | 'orange'; + + type ColorFunc = (m: MetricMeta) => string; +} diff --git a/typings/interfaces/common/dataType.d.ts b/typings/interfaces/common/dataType.d.ts new file mode 100644 index 0000000000000..4c717b71a31b5 --- /dev/null +++ b/typings/interfaces/common/dataType.d.ts @@ -0,0 +1,3 @@ +export declare global { + type BoolFunc = (data: any) => boolean; +} diff --git a/typings/interfaces/common/index.d.ts b/typings/interfaces/common/index.d.ts new file mode 100644 index 0000000000000..489228fda9b36 --- /dev/null +++ b/typings/interfaces/common/index.d.ts @@ -0,0 +1,5 @@ +export * from './action'; +export * from './color'; +export * from './dataType'; +export * from './lang'; +export * from './os'; diff --git a/typings/interfaces/common/lang.d.ts b/typings/interfaces/common/lang.d.ts new file mode 100644 index 0000000000000..aab19978082f2 --- /dev/null +++ b/typings/interfaces/common/lang.d.ts @@ -0,0 +1,3 @@ +export declare global { + type Lang = 'en' | 'zh'; +} diff --git a/typings/interfaces/common/os.d.ts b/typings/interfaces/common/os.d.ts new file mode 100644 index 0000000000000..1577144831ab7 --- /dev/null +++ b/typings/interfaces/common/os.d.ts @@ -0,0 +1,5 @@ +import { OS_WINDOWS, OS_MAC, OS_LINUX } from '@/constants/os'; + +export declare global { + type OS = OS_WINDOWS | OS_MAC | OS_LINUX; +} diff --git a/typings/interfaces/components/button/index.d.ts b/typings/interfaces/components/button/index.d.ts new file mode 100644 index 0000000000000..ec8f93812573d --- /dev/null +++ b/typings/interfaces/components/button/index.d.ts @@ -0,0 +1 @@ +type ButtonType = 'button' | 'fa-icon' | 'icon' | 'label'; diff --git a/typings/interfaces/components/chart/Metric.d.ts b/typings/interfaces/components/chart/Metric.d.ts new file mode 100644 index 0000000000000..28667acab4d2f --- /dev/null +++ b/typings/interfaces/components/chart/Metric.d.ts @@ -0,0 +1,16 @@ +interface MetricProps { + title?: string; + value?: number | string; + icon?: Icon; + color?: string; + clickable?: boolean; +} + +interface MetricMeta { + name: string; + key: string; + value: number | string; + icon: Icon; + color?: string | ColorFunc; + path?: string; +} diff --git a/typings/interfaces/components/chart/MetricLineChart.d.ts b/typings/interfaces/components/chart/MetricLineChart.d.ts new file mode 100644 index 0000000000000..f0cfdfc25a9ad --- /dev/null +++ b/typings/interfaces/components/chart/MetricLineChart.d.ts @@ -0,0 +1,3 @@ +interface MetricLineChartProps extends LineChartProps { + metric?: string; +} diff --git a/typings/interfaces/components/chart/PieChart.d.ts b/typings/interfaces/components/chart/PieChart.d.ts new file mode 100644 index 0000000000000..4e484469831b7 --- /dev/null +++ b/typings/interfaces/components/chart/PieChart.d.ts @@ -0,0 +1,8 @@ +interface PieChartProps { + config: EChartsConfig; + width?: string; + height?: string; + theme?: string; + labelKey?: string; + valueKey?: string; +} diff --git a/typings/interfaces/components/color/ColorPicker.d.ts b/typings/interfaces/components/color/ColorPicker.d.ts new file mode 100644 index 0000000000000..b5f75e05e692c --- /dev/null +++ b/typings/interfaces/components/color/ColorPicker.d.ts @@ -0,0 +1,6 @@ +interface ColorPickerProps { + modelValue?: string; + disabled?: boolean; + predefine?: string[]; + showAlpha?: boolean; +} diff --git a/typings/interfaces/components/context-menu/ContextMenu.d.ts b/typings/interfaces/components/context-menu/ContextMenu.d.ts new file mode 100644 index 0000000000000..142ee9298af11 --- /dev/null +++ b/typings/interfaces/components/context-menu/ContextMenu.d.ts @@ -0,0 +1,9 @@ +// import {Placement} from '@popperjs/core/lib/enums'; +// +// declare global { +// interface ContextMenuProps { +// visible?: boolean; +// trigger: HTMLElement | string; +// placement?: Placement; +// } +// } diff --git a/typings/interfaces/components/context-menu/ContextMenuList.d.ts b/typings/interfaces/components/context-menu/ContextMenuList.d.ts new file mode 100644 index 0000000000000..c45d55e3e529e --- /dev/null +++ b/typings/interfaces/components/context-menu/ContextMenuList.d.ts @@ -0,0 +1,3 @@ +interface ContextMenuListProps { + items: ContextMenuItem[]; +} diff --git a/typings/interfaces/components/date/date.d.ts b/typings/interfaces/components/date/date.d.ts new file mode 100644 index 0000000000000..afbb7094ea176 --- /dev/null +++ b/typings/interfaces/components/date/date.d.ts @@ -0,0 +1,22 @@ +import { Dayjs } from 'dayjs'; + +export declare global { + interface DateRange { + start: Dayjs; + end: Dayjs; + } + + interface RangeItem { + key: RangeItemKey; + value?: DateRange; + } + + interface RangeItemOption extends SelectOption { + value?: RangeItem; + } + + type RangeItemValue = RangeItemValueFunc | DateRange; + type RangeItemValueFunc = () => DateRange; + type RangeItemKey = 'custom' | string; + type RangePickerType = 'daterange' | 'datetimerange'; +} diff --git a/typings/interfaces/components/dialog/CreateEditDialog.d.ts b/typings/interfaces/components/dialog/CreateEditDialog.d.ts new file mode 100644 index 0000000000000..99d895b5203a2 --- /dev/null +++ b/typings/interfaces/components/dialog/CreateEditDialog.d.ts @@ -0,0 +1,18 @@ +import { Ref } from 'vue'; + +declare global { + type CreateEditDialogType = 'create' | 'edit'; + + type CreateEditTabName = 'single' | 'batch'; + + interface CreateEditDialogActionFunctions { + onClose: () => void; + onConfirm: () => Promise; + onTabChange: (value: CreateEditTabName) => void; + onAdd: (rowIndex: number) => void; + onClone: (rowIndex: number) => void; + onDelete: (rowIndex: number) => void; + onFieldChange: (rowIndex: number, prop: string, value: any) => void; + onFieldRegister: (rowIndex: number, prop: string, formRef: Ref) => void; + } +} diff --git a/typings/interfaces/components/dialog/Dialog.d.ts b/typings/interfaces/components/dialog/Dialog.d.ts new file mode 100644 index 0000000000000..2af992c24c91e --- /dev/null +++ b/typings/interfaces/components/dialog/Dialog.d.ts @@ -0,0 +1,5 @@ +type DialogKey = 'create' | 'edit' | 'run' | 'uploadFiles' | 'logs' | 'diff'; + +interface DialogVisible { + createEdit: boolean; +} diff --git a/typings/interfaces/components/drag/DraggableItem.d.ts b/typings/interfaces/components/drag/DraggableItem.d.ts new file mode 100644 index 0000000000000..024defea5515a --- /dev/null +++ b/typings/interfaces/components/drag/DraggableItem.d.ts @@ -0,0 +1,13 @@ +export declare global { + interface DraggableItemData { + key: string; + dragging: boolean; + + [prop: string]: any; + } + + interface DraggableListInternalItems { + draggingItem?: DraggableItemData; + targetItem?: DraggableItemData; + } +} diff --git a/typings/interfaces/components/drag/DraggableItemContent.d.ts b/typings/interfaces/components/drag/DraggableItemContent.d.ts new file mode 100644 index 0000000000000..62035eca33714 --- /dev/null +++ b/typings/interfaces/components/drag/DraggableItemContent.d.ts @@ -0,0 +1,5 @@ +declare global { + interface DraggableItemContentProps { + item: DraggableItemData; + } +} diff --git a/typings/interfaces/components/drag/index.d.ts b/typings/interfaces/components/drag/index.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/components/ds/DataSourceConnectType.d.ts b/typings/interfaces/components/ds/DataSourceConnectType.d.ts new file mode 100644 index 0000000000000..37d9c30ff5b63 --- /dev/null +++ b/typings/interfaces/components/ds/DataSourceConnectType.d.ts @@ -0,0 +1,5 @@ +export declare global { + interface DataSourceConnectTypeProps { + dataSource?: DataSource; + } +} diff --git a/typings/interfaces/components/ds/index.d.ts b/typings/interfaces/components/ds/index.d.ts new file mode 100644 index 0000000000000..507a0679d87c6 --- /dev/null +++ b/typings/interfaces/components/ds/index.d.ts @@ -0,0 +1,3 @@ +export * from './DataSourceConnectType'; +export * from './DataSourceType'; +export * from './DataSource'; diff --git a/typings/interfaces/components/file/FileEditor.d.ts b/typings/interfaces/components/file/FileEditor.d.ts new file mode 100644 index 0000000000000..e457b88d6dabe --- /dev/null +++ b/typings/interfaces/components/file/FileEditor.d.ts @@ -0,0 +1,15 @@ +export declare global { + interface FileEditorOptions { + theme: 'vs' | 'vs-dark' | 'hc-black'; + } + + interface FileEditorStyles { + default: FileEditorStyle; + active: FileEditorStyle; + } + + interface FileEditorStyle { + backgroundColor?: string; + color?: string; + } +} diff --git a/typings/interfaces/components/file/FileEditorNavMenu.d.ts b/typings/interfaces/components/file/FileEditorNavMenu.d.ts new file mode 100644 index 0000000000000..1f0ec81b719ba --- /dev/null +++ b/typings/interfaces/components/file/FileEditorNavMenu.d.ts @@ -0,0 +1,19 @@ +export declare global { + interface FileEditorNavMenuCache { + [key: string]: T; + } + + interface FileNavItem { + id?: string; + is_dir?: boolean; + path?: string; + name?: string; + extension?: string; + children?: FileNavItem[]; + } + + interface FileEditorNavMenuClickStatus { + clicked: boolean; + item?: FileNavItem; + } +} diff --git a/typings/interfaces/components/file/FileEditorNavTabs.d.ts b/typings/interfaces/components/file/FileEditorNavTabs.d.ts new file mode 100644 index 0000000000000..b7f2a87674d2a --- /dev/null +++ b/typings/interfaces/components/file/FileEditorNavTabs.d.ts @@ -0,0 +1,7 @@ +export declare global { + interface FileEditorNavTabsProps { + activeTab?: FileNavItem; + tabs: FileNavItem[]; + style?: any; + } +} diff --git a/typings/interfaces/components/file/FileUpload.d.ts b/typings/interfaces/components/file/FileUpload.d.ts new file mode 100644 index 0000000000000..20e90c13932f0 --- /dev/null +++ b/typings/interfaces/components/file/FileUpload.d.ts @@ -0,0 +1,25 @@ +import { FILE_UPLOAD_MODE_DIR, FILE_UPLOAD_MODE_FILES } from '@/constants'; + +export declare global { + interface FileUploadModeOption { + label: string; + value: string; + } + + interface FileUploadInfo { + dirName?: string; + fileCount?: number; + filePaths?: string[]; + } + + type FileUploadMode = FILE_UPLOAD_MODE_DIR | FILE_UPLOAD_MODE_FILES; + + interface FileWithPath extends File { + path?: string; + } + + type InputFile = (FileWithPath | DataTransferItem) & { + path?: string; + size?: number; + }; +} diff --git a/typings/interfaces/components/file/index.d.ts b/typings/interfaces/components/file/index.d.ts new file mode 100644 index 0000000000000..aaca09ef9155a --- /dev/null +++ b/typings/interfaces/components/file/index.d.ts @@ -0,0 +1,4 @@ +export * from './FileEditor'; +export * from './FileEditorNavMenu'; +export * from './FileEditorNavTabs'; +export * from './FileUpload'; diff --git a/typings/interfaces/components/filter/FilterCondition.d.ts b/typings/interfaces/components/filter/FilterCondition.d.ts new file mode 100644 index 0000000000000..7e0971f5a3741 --- /dev/null +++ b/typings/interfaces/components/filter/FilterCondition.d.ts @@ -0,0 +1,7 @@ +export declare global { + interface FilterConditionData { + key?: string; + op?: string; + value?: any; + } +} diff --git a/typings/interfaces/components/filter/FilterConditionList.d.ts b/typings/interfaces/components/filter/FilterConditionList.d.ts new file mode 100644 index 0000000000000..422ed78ca637d --- /dev/null +++ b/typings/interfaces/components/filter/FilterConditionList.d.ts @@ -0,0 +1,3 @@ +interface FilterConditionListProps { + conditions: FilterConditionData[]; +} diff --git a/typings/interfaces/components/filter/FilterInput.d.ts b/typings/interfaces/components/filter/FilterInput.d.ts new file mode 100644 index 0000000000000..583b0e3b5a60d --- /dev/null +++ b/typings/interfaces/components/filter/FilterInput.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface FilterInputProps { + label?: string; + placeholder?: string; + } +} diff --git a/typings/interfaces/components/filter/FilterSelect.d.ts b/typings/interfaces/components/filter/FilterSelect.d.ts new file mode 100644 index 0000000000000..92c10a29f44db --- /dev/null +++ b/typings/interfaces/components/filter/FilterSelect.d.ts @@ -0,0 +1,15 @@ +export declare global { + interface FilterSelectOptionsRemote { + colName: string; + value?: string; + label?: string; + } + + interface FilterSelectProps { + label?: string; + placeholder?: string; + filterable?: boolean; + options?: SelectOption[]; + optionsRemote?: FilterSelectOptionsRemote; + } +} diff --git a/typings/interfaces/components/filter/index.d.ts b/typings/interfaces/components/filter/index.d.ts new file mode 100644 index 0000000000000..95d4ef23dab87 --- /dev/null +++ b/typings/interfaces/components/filter/index.d.ts @@ -0,0 +1,12 @@ +import { ASCENDING, DESCENDING, UNSORTED } from '@/constants/sort'; + +declare global { + type SortDirection = ASCENDING | DESCENDING | UNSORTED | undefined; + + interface SortData { + // key + key: string; + // direction + d?: string; + } +} diff --git a/typings/interfaces/components/form/Form.d.ts b/typings/interfaces/components/form/Form.d.ts new file mode 100644 index 0000000000000..7ed4e4fc7dac9 --- /dev/null +++ b/typings/interfaces/components/form/Form.d.ts @@ -0,0 +1,51 @@ +import { RuleItem } from 'async-validator'; +import { Ref } from 'vue'; +import { + FORM_FIELD_TYPE_CHECK_TAG_GROUP, + FORM_FIELD_TYPE_INPUT, + FORM_FIELD_TYPE_INPUT_TEXTAREA, + FORM_FIELD_TYPE_INPUT_WITH_BUTTON, + FORM_FIELD_TYPE_TAG_INPUT, + FORM_FIELD_TYPE_TAG_SELECT, +} from '@/constants/form'; + +declare global { + interface FormContext { + labelWidth?: string; + size?: string; + grid: number; + } + + interface FormModel { + [key: string]: any; + } + + interface FormRuleItem extends RuleItem { + trigger?: string; + } + + interface FormRules { + [key: string]: FormRuleItem | FormRuleItem[]; + } + + type FormValidateCallback = (valid: boolean) => void; + + interface FormComponentData { + formRef: Ref; + formList: Ref; + formTableFieldRefsMap: Ref; + } + + type FormTableFieldRefsMapKey = [number, string]; + type FormTableFieldRefsMap = Map; + + type DefaultFormFunc = () => T; + + type FormFieldType = + | FORM_FIELD_TYPE_INPUT + | FORM_FIELD_TYPE_INPUT_TEXTAREA + | FORM_FIELD_TYPE_INPUT_WITH_BUTTON + | FORM_FIELD_TYPE_TAG_INPUT + | FORM_FIELD_TYPE_TAG_SELECT + | FORM_FIELD_TYPE_CHECK_TAG_GROUP; +} diff --git a/typings/interfaces/components/form/FormItem.d.ts b/typings/interfaces/components/form/FormItem.d.ts new file mode 100644 index 0000000000000..3eb33a73888ba --- /dev/null +++ b/typings/interfaces/components/form/FormItem.d.ts @@ -0,0 +1,16 @@ +import { RuleItem } from 'async-validator'; + +declare global { + interface FormItemProps { + prop?: string; + label?: string; + labelTooltip?: string; + labelWidth?: string; + size?: string; + span: number; + offset: number; + required: boolean; + rules?: RuleItem | RuleItem[]; + notEditable?: boolean; + } +} diff --git a/typings/interfaces/components/form/FormReadonlyValue.d.ts b/typings/interfaces/components/form/FormReadonlyValue.d.ts new file mode 100644 index 0000000000000..3f1c94fc9200f --- /dev/null +++ b/typings/interfaces/components/form/FormReadonlyValue.d.ts @@ -0,0 +1,5 @@ +export declare global { + interface FormReadonlyValueProps { + value: string; + } +} diff --git a/typings/interfaces/components/form/FormTable.d.ts b/typings/interfaces/components/form/FormTable.d.ts new file mode 100644 index 0000000000000..6e55868357a25 --- /dev/null +++ b/typings/interfaces/components/form/FormTable.d.ts @@ -0,0 +1,17 @@ +export declare global { + interface FormTableProps { + data: TableData; + fields: FormTableField[]; + } + + interface FormTableField { + prop: string; + label: string; + width?: string; + fieldType: FormFieldType; + options?: SelectOption[]; + required?: boolean; + placeholder?: string; + disabled?: boolean | BoolFunc; + } +} diff --git a/typings/interfaces/components/form/FormTableField.d.ts b/typings/interfaces/components/form/FormTableField.d.ts new file mode 100644 index 0000000000000..eb2cd93d406e6 --- /dev/null +++ b/typings/interfaces/components/form/FormTableField.d.ts @@ -0,0 +1,16 @@ +import { Ref } from 'vue'; + +declare global { + interface FormTableFieldProps { + form: any; + formRules?: FormRuleItem[]; + prop: string; + fieldType: FormFieldType; + options?: SelectOption[]; + required?: boolean; + placeholder?: string; + disabled?: boolean; + onChange?: (value: any) => void; + onRegister?: (formRef: Ref) => void; + } +} diff --git a/typings/interfaces/components/form/index.d.ts b/typings/interfaces/components/form/index.d.ts new file mode 100644 index 0000000000000..ecb1472adf2ac --- /dev/null +++ b/typings/interfaces/components/form/index.d.ts @@ -0,0 +1,5 @@ +export * from './Form'; +export * from './FormItem'; +export * from './FormReadonlyValue'; +export * from './FormTable'; +export * from './FormTableField'; diff --git a/typings/interfaces/components/git/GitFile.d.ts b/typings/interfaces/components/git/GitFile.d.ts new file mode 100644 index 0000000000000..5afabcd722a2d --- /dev/null +++ b/typings/interfaces/components/git/GitFile.d.ts @@ -0,0 +1,3 @@ +interface GitFileProps { + fileStatus?: GitFileStatus; +} diff --git a/typings/interfaces/components/git/GitForm.d.ts b/typings/interfaces/components/git/GitForm.d.ts new file mode 100644 index 0000000000000..0f5b1779df071 --- /dev/null +++ b/typings/interfaces/components/git/GitForm.d.ts @@ -0,0 +1,5 @@ +export declare global { + interface GitFormProps { + branchSelectOptions?: SelectOption[]; + } +} diff --git a/typings/interfaces/components/icon/AtomMaterialIcon.d.ts b/typings/interfaces/components/icon/AtomMaterialIcon.d.ts new file mode 100644 index 0000000000000..1ff267e827b65 --- /dev/null +++ b/typings/interfaces/components/icon/AtomMaterialIcon.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface AtomMaterialIconProps { + name: string; + isDir?: boolean; + } +} diff --git a/typings/interfaces/components/icon/Icon.d.ts b/typings/interfaces/components/icon/Icon.d.ts new file mode 100644 index 0000000000000..11d1c18fdd217 --- /dev/null +++ b/typings/interfaces/components/icon/Icon.d.ts @@ -0,0 +1,11 @@ +export declare global { + interface IconProps { + icon?: Icon; + spinning?: boolean; + size: IconSize; + } + + type Icon = string | string[]; + + type IconSize = 'mini' | 'small' | 'normal' | 'large' | string; +} diff --git a/typings/interfaces/components/icon/index.d.ts b/typings/interfaces/components/icon/index.d.ts new file mode 100644 index 0000000000000..f2e8e6a0980bd --- /dev/null +++ b/typings/interfaces/components/icon/index.d.ts @@ -0,0 +1,2 @@ +export * from './Icon'; +export * from './AtomMaterialIcon'; diff --git a/typings/interfaces/components/index.d.ts b/typings/interfaces/components/index.d.ts new file mode 100644 index 0000000000000..bc13cec559fc0 --- /dev/null +++ b/typings/interfaces/components/index.d.ts @@ -0,0 +1,4 @@ +export * from './table'; +export * from './form'; +export * from './select'; +export * from './icon'; diff --git a/typings/interfaces/components/input/InputList.d.ts b/typings/interfaces/components/input/InputList.d.ts new file mode 100644 index 0000000000000..1abde0c9191c1 --- /dev/null +++ b/typings/interfaces/components/input/InputList.d.ts @@ -0,0 +1,5 @@ +export declare global { + interface InputListProps { + modelValue?: string[]; + } +} diff --git a/typings/interfaces/components/input/InputWithButton.d.ts b/typings/interfaces/components/input/InputWithButton.d.ts new file mode 100644 index 0000000000000..9bb63459bd48a --- /dev/null +++ b/typings/interfaces/components/input/InputWithButton.d.ts @@ -0,0 +1,11 @@ +interface InputWithButtonProps { + modelValue?: string; + placeholder?: string; + size?: string; + buttonLabel?: string; + buttonIcon?: Icon; + buttonType: BasicType; + disabled?: boolean; + id?: string; + className?: string; +} diff --git a/typings/interfaces/components/input/TagInput.d.ts b/typings/interfaces/components/input/TagInput.d.ts new file mode 100644 index 0000000000000..d736f26b022ce --- /dev/null +++ b/typings/interfaces/components/input/TagInput.d.ts @@ -0,0 +1,8 @@ +interface TagInputProps { + modelValue: Tag[]; + disabled: boolean; +} + +interface TagInputOption extends Tag { + isEdit?: boolean; +} diff --git a/typings/interfaces/components/input/TagInputItem.d.ts b/typings/interfaces/components/input/TagInputItem.d.ts new file mode 100644 index 0000000000000..19afdd9d796a9 --- /dev/null +++ b/typings/interfaces/components/input/TagInputItem.d.ts @@ -0,0 +1,6 @@ +interface TagInputItemProps { + modelValue?: Tag; + placeholder?: string; + size?: BasicSize; + disabled?: boolean; +} diff --git a/typings/interfaces/components/metric/MetricDashboard.d.ts b/typings/interfaces/components/metric/MetricDashboard.d.ts new file mode 100644 index 0000000000000..c18e374edc6c1 --- /dev/null +++ b/typings/interfaces/components/metric/MetricDashboard.d.ts @@ -0,0 +1,3 @@ +interface MetricDashboardProps { + metricDataFunc?: MetricDashboardDataFunc; +} diff --git a/typings/interfaces/components/metric/MetricList.d.ts b/typings/interfaces/components/metric/MetricList.d.ts new file mode 100644 index 0000000000000..0eaecd9494d73 --- /dev/null +++ b/typings/interfaces/components/metric/MetricList.d.ts @@ -0,0 +1,11 @@ +interface MetricListProps { + activeMetricSnapshotKey?: string; + metricSnapshots?: MetricSnapshot[]; + metrics?: NavItem[]; + metricDataFunc?: MetricListDataFunc; + metricTitleFunc?: MetricListTitleFunc; + dateRange?: RangeItem; + duration?: string; + durationOptions?: SelectOption[]; + defaultCheckedAll?: boolean; +} diff --git a/typings/interfaces/components/metric/MetricProgress.d.ts b/typings/interfaces/components/metric/MetricProgress.d.ts new file mode 100644 index 0000000000000..ad2f88fbd5908 --- /dev/null +++ b/typings/interfaces/components/metric/MetricProgress.d.ts @@ -0,0 +1,34 @@ +interface MetricProgressProps { + percentage?: number; + type?: MetricProgressType; + strokeWidth?: number; + textInside?: boolean; + intermediate?: boolean; + duration?: number; + width?: number; + showText?: boolean; + strokeLinecap?: MetricProgressStrokeLinecap; + format?: MetricProgressFormat; + label?: MetricProgressLabel | string; + labelIcon?: Icon; + detailMetrics?: SelectOption[]; + status?: MetricProgressStatus; +} + +type MetricProgressType = 'line' | 'circle' | 'dashboard'; +type MetricProgressStrokeLinecap = 'butt' | 'round' | 'square'; +type MetricProgressFormat = (percentage: number | null) => string; +type MetricProgressStatus = + | MetricProgressStatusData + | ((percentage: number | null) => MetricProgressStatusData | undefined); + +interface MetricProgressLabel { + key?: string; + title?: string; +} + +interface MetricProgressStatusData { + color?: string; + icon?: Icon; + label?: string; +} diff --git a/typings/interfaces/components/metric/MetricSnapshot.d.ts b/typings/interfaces/components/metric/MetricSnapshot.d.ts new file mode 100644 index 0000000000000..72f2375f209de --- /dev/null +++ b/typings/interfaces/components/metric/MetricSnapshot.d.ts @@ -0,0 +1,6 @@ +interface MetricSnapshotProps { + snapshot?: MetricSnapshot; + format?: MetricSnapshotFormat; +} + +type MetricSnapshotFormat = (percentage: number) => string; diff --git a/typings/interfaces/components/metric/MetricTargetName.d.ts b/typings/interfaces/components/metric/MetricTargetName.d.ts new file mode 100644 index 0000000000000..fc8c053ce80b0 --- /dev/null +++ b/typings/interfaces/components/metric/MetricTargetName.d.ts @@ -0,0 +1,4 @@ +interface MetricTargetNameProps { + name?: string; + type?: MetricTargetType; +} diff --git a/typings/interfaces/components/metric/MetricTargetType.d.ts b/typings/interfaces/components/metric/MetricTargetType.d.ts new file mode 100644 index 0000000000000..2ee615c6f53e5 --- /dev/null +++ b/typings/interfaces/components/metric/MetricTargetType.d.ts @@ -0,0 +1,3 @@ +interface MetricTargetTypeProps { + type?: MetricTargetType; +} diff --git a/typings/interfaces/components/nav/NavAction.d.ts b/typings/interfaces/components/nav/NavAction.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/components/nav/NavActionBack.d.ts b/typings/interfaces/components/nav/NavActionBack.d.ts new file mode 100644 index 0000000000000..1b2a9e01c9936 --- /dev/null +++ b/typings/interfaces/components/nav/NavActionBack.d.ts @@ -0,0 +1,9 @@ +interface NavActionBackProps { + buttonType: ButtonType; + label: string; + tooltip?: string; + icon: Icon; + type: BasicType; + size: BasicSize; + disabled: boolean; +} diff --git a/typings/interfaces/components/nav/NavActions.d.ts b/typings/interfaces/components/nav/NavActions.d.ts new file mode 100644 index 0000000000000..5da1d4232bc7d --- /dev/null +++ b/typings/interfaces/components/nav/NavActions.d.ts @@ -0,0 +1,9 @@ +interface NavActions { + getHeight: () => string; +} + +interface NavActionsProps { + collapsed?: boolean; + minHeight?: string; + height?: string; +} diff --git a/typings/interfaces/components/nav/NavLink.d.ts b/typings/interfaces/components/nav/NavLink.d.ts new file mode 100644 index 0000000000000..ae108f84b2a25 --- /dev/null +++ b/typings/interfaces/components/nav/NavLink.d.ts @@ -0,0 +1,6 @@ +interface NavLinkProps { + path?: string; + label?: string | number | boolean; + icon?: Icon; + external?: boolean; +} diff --git a/typings/interfaces/components/nav/NavSidebar.d.ts b/typings/interfaces/components/nav/NavSidebar.d.ts new file mode 100644 index 0000000000000..7acb31a5411ac --- /dev/null +++ b/typings/interfaces/components/nav/NavSidebar.d.ts @@ -0,0 +1,21 @@ +interface NavSidebar { + scroll: (id: string) => void; +} + +type NavSidebarType = 'list' | 'tree'; + +interface NavSidebarContent { + activeKey?: string; + items: NavItem[]; + showCheckBox?: boolean; +} + +interface NavSidebarProps extends NavSidebarContent { + type: NavSidebarType; + collapsed?: boolean; + showActions?: boolean; + defaultCheckedKeys?: string[]; + defaultExpandedKeys?: string[]; + defaultExpandAll?: boolean; + noSearch?: boolean; +} diff --git a/typings/interfaces/components/nav/NavSidebarList.d.ts b/typings/interfaces/components/nav/NavSidebarList.d.ts new file mode 100644 index 0000000000000..8b18950f8b31a --- /dev/null +++ b/typings/interfaces/components/nav/NavSidebarList.d.ts @@ -0,0 +1 @@ +type NavSidebarListProps = NavSidebarContent; diff --git a/typings/interfaces/components/nav/NavSidebarTree.d.ts b/typings/interfaces/components/nav/NavSidebarTree.d.ts new file mode 100644 index 0000000000000..379c47b2b4f71 --- /dev/null +++ b/typings/interfaces/components/nav/NavSidebarTree.d.ts @@ -0,0 +1,5 @@ +interface NavSidebarTreeProps extends NavSidebarContent { + defaultCheckedKeys?: string[]; + defaultExpandedKeys?: string[]; + defaultExpandAll?: boolean; +} diff --git a/typings/interfaces/components/nav/NavTabs.d.ts b/typings/interfaces/components/nav/NavTabs.d.ts new file mode 100644 index 0000000000000..55263c3ae006d --- /dev/null +++ b/typings/interfaces/components/nav/NavTabs.d.ts @@ -0,0 +1,6 @@ +interface NavTabsProps { + items: NavItem[]; + activeKey: string; + collapsed: boolean; + toggle: boolean; +} diff --git a/typings/interfaces/components/nav/index.d.ts b/typings/interfaces/components/nav/index.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/components/node/NodeActive.d.ts b/typings/interfaces/components/node/NodeActive.d.ts new file mode 100644 index 0000000000000..0dc3c067bc67e --- /dev/null +++ b/typings/interfaces/components/node/NodeActive.d.ts @@ -0,0 +1,3 @@ +interface NodeActiveProps { + active: boolean; +} diff --git a/typings/interfaces/components/node/NodeRunners.d.ts b/typings/interfaces/components/node/NodeRunners.d.ts new file mode 100644 index 0000000000000..294865af805d6 --- /dev/null +++ b/typings/interfaces/components/node/NodeRunners.d.ts @@ -0,0 +1,5 @@ +interface NodeRunnersProps { + available?: number; + max?: number; + size?: BasicSize; +} diff --git a/typings/interfaces/components/node/NodeType.d.ts b/typings/interfaces/components/node/NodeType.d.ts new file mode 100644 index 0000000000000..051e6c4ccf80c --- /dev/null +++ b/typings/interfaces/components/node/NodeType.d.ts @@ -0,0 +1,4 @@ +interface NodeTypeProps { + isMaster?: boolean; + label?: string; +} diff --git a/typings/interfaces/components/plugin/PluginPid.d.ts b/typings/interfaces/components/plugin/PluginPid.d.ts new file mode 100644 index 0000000000000..edc3cd209e281 --- /dev/null +++ b/typings/interfaces/components/plugin/PluginPid.d.ts @@ -0,0 +1,3 @@ +interface PluginPidProps { + status?: PluginStatus[]; +} diff --git a/typings/interfaces/components/plugin/PluginStatus.d.ts b/typings/interfaces/components/plugin/PluginStatus.d.ts new file mode 100644 index 0000000000000..b0db1fc079fc0 --- /dev/null +++ b/typings/interfaces/components/plugin/PluginStatus.d.ts @@ -0,0 +1,5 @@ +interface PluginStatusProps { + status?: string; + size?: BasicSize; + error?: string; +} diff --git a/typings/interfaces/components/plugin/PluginStatusMultiNode.d.ts b/typings/interfaces/components/plugin/PluginStatusMultiNode.d.ts new file mode 100644 index 0000000000000..4810e433cb1e4 --- /dev/null +++ b/typings/interfaces/components/plugin/PluginStatusMultiNode.d.ts @@ -0,0 +1,4 @@ +interface PluginStatusMultiNodeProps { + status?: PluginStatus[]; + size?: BasicSize; +} diff --git a/typings/interfaces/components/plugin/PublicPluginCard.d.ts b/typings/interfaces/components/plugin/PublicPluginCard.d.ts new file mode 100644 index 0000000000000..c2e94c4795c1a --- /dev/null +++ b/typings/interfaces/components/plugin/PublicPluginCard.d.ts @@ -0,0 +1,7 @@ +interface PublicPluginItemProps { + plugin?: PublicPlugin; + active: boolean; + clickable: boolean; + status?: string; + installed: boolean; +} diff --git a/typings/interfaces/components/plugin/PublicPluginContent.d.ts b/typings/interfaces/components/plugin/PublicPluginContent.d.ts new file mode 100644 index 0000000000000..5368be82fbb3f --- /dev/null +++ b/typings/interfaces/components/plugin/PublicPluginContent.d.ts @@ -0,0 +1,6 @@ +interface PublicPluginContentProps { + plugin?: PublicPlugin; + info?: PublicPluginInfo; + status?: string; + installed: boolean; +} diff --git a/typings/interfaces/components/project/CreateProjectDialog.d.ts b/typings/interfaces/components/project/CreateProjectDialog.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/components/project/ProjectForm.d.ts b/typings/interfaces/components/project/ProjectForm.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/components/project/ProjectTag.d.ts b/typings/interfaces/components/project/ProjectTag.d.ts new file mode 100644 index 0000000000000..0b9c566977f87 --- /dev/null +++ b/typings/interfaces/components/project/ProjectTag.d.ts @@ -0,0 +1,5 @@ +interface ProjectTagProps { + label?: string; + type?: BasicType; + color?: string; +} diff --git a/typings/interfaces/components/result/ResultCell.d.ts b/typings/interfaces/components/result/ResultCell.d.ts new file mode 100644 index 0000000000000..b8bbb305c2a2c --- /dev/null +++ b/typings/interfaces/components/result/ResultCell.d.ts @@ -0,0 +1,7 @@ +export declare global { + interface ResultCellProps { + fieldKey?: string; + type?: DataFieldType; + value?: any; + } +} diff --git a/typings/interfaces/components/result/ResultCellDialog.d.ts b/typings/interfaces/components/result/ResultCellDialog.d.ts new file mode 100644 index 0000000000000..01a3699b97d4b --- /dev/null +++ b/typings/interfaces/components/result/ResultCellDialog.d.ts @@ -0,0 +1,3 @@ +export declare global { + interface ResultCellDialogProps {} +} diff --git a/typings/interfaces/components/schedule/ScheduleCron.d.ts b/typings/interfaces/components/schedule/ScheduleCron.d.ts new file mode 100644 index 0000000000000..ced6266fca773 --- /dev/null +++ b/typings/interfaces/components/schedule/ScheduleCron.d.ts @@ -0,0 +1,4 @@ +interface ScheduleCronProps { + cron?: string; + iconOnly?: boolean; +} diff --git a/typings/interfaces/components/select/SelectOption.d.ts b/typings/interfaces/components/select/SelectOption.d.ts new file mode 100644 index 0000000000000..653a420de7a34 --- /dev/null +++ b/typings/interfaces/components/select/SelectOption.d.ts @@ -0,0 +1,7 @@ +export declare global { + interface SelectOption { + label?: string; + value?: any; + children?: SelectOption[]; + } +} diff --git a/typings/interfaces/components/select/index.d.ts b/typings/interfaces/components/select/index.d.ts new file mode 100644 index 0000000000000..4b1ab393667fb --- /dev/null +++ b/typings/interfaces/components/select/index.d.ts @@ -0,0 +1 @@ +export * from './SelectOption'; diff --git a/typings/interfaces/components/spider/CreateSpiderDialog.d.ts b/typings/interfaces/components/spider/CreateSpiderDialog.d.ts new file mode 100644 index 0000000000000..85457ac5c9be3 --- /dev/null +++ b/typings/interfaces/components/spider/CreateSpiderDialog.d.ts @@ -0,0 +1,3 @@ +interface CreateSpiderDialogProps { + visible: boolean; +} diff --git a/typings/interfaces/components/spider/RunSpiderDialog.d.ts b/typings/interfaces/components/spider/RunSpiderDialog.d.ts new file mode 100644 index 0000000000000..9b6cf8d8db917 --- /dev/null +++ b/typings/interfaces/components/spider/RunSpiderDialog.d.ts @@ -0,0 +1,3 @@ +interface RunSpiderDialogProps { + spider?: Spider; +} diff --git a/typings/interfaces/components/spider/SpiderForm.d.ts b/typings/interfaces/components/spider/SpiderForm.d.ts new file mode 100644 index 0000000000000..bc825c85d14dc --- /dev/null +++ b/typings/interfaces/components/spider/SpiderForm.d.ts @@ -0,0 +1,3 @@ +interface SpiderFormProps { + isCreate: boolean; +} diff --git a/typings/interfaces/components/spider/SpiderStat.d.ts b/typings/interfaces/components/spider/SpiderStat.d.ts new file mode 100644 index 0000000000000..3632efcf5247f --- /dev/null +++ b/typings/interfaces/components/spider/SpiderStat.d.ts @@ -0,0 +1,15 @@ +interface SpiderStatProps { + stat?: SpiderStat; +} + +interface SpiderStatTooltips { + tasks: string; + results: string; + duration: string; +} + +interface SpiderStatLabels { + tasks: string; + results: string; + duration: string; +} diff --git a/typings/interfaces/components/spider/SpiderTag.d.ts b/typings/interfaces/components/spider/SpiderTag.d.ts new file mode 100644 index 0000000000000..bba3f87ba66c8 --- /dev/null +++ b/typings/interfaces/components/spider/SpiderTag.d.ts @@ -0,0 +1,3 @@ +interface SpiderTagProps { + spider: Spider; +} diff --git a/typings/interfaces/components/spider/SpiderType.d.ts b/typings/interfaces/components/spider/SpiderType.d.ts new file mode 100644 index 0000000000000..2c6872c1ba45d --- /dev/null +++ b/typings/interfaces/components/spider/SpiderType.d.ts @@ -0,0 +1,12 @@ +import { + SPIDER_TYPE_CONFIGURABLE, + SPIDER_TYPE_CUSTOMIZED, +} from '@/constants/spider'; + +declare global { + interface SpiderTypeProps { + type: SpiderType; + } + + type SpiderType = SPIDER_TYPE_CUSTOMIZED | SPIDER_TYPE_CONFIGURABLE; +} diff --git a/typings/interfaces/components/switch/Switch.d.ts b/typings/interfaces/components/switch/Switch.d.ts new file mode 100644 index 0000000000000..e31e7f69f435e --- /dev/null +++ b/typings/interfaces/components/switch/Switch.d.ts @@ -0,0 +1,16 @@ +export declare global { + interface SwitchProps { + modelValue: boolean; + disabled?: boolean; + activeColor?: string; + inactiveColor?: string; + activeIcon?: Icon; + inactiveIcon?: Icon; + activeText?: string; + inactiveText?: string; + width?: number; + loading?: boolean; + inlinePrompt?: boolean; + tooltip?: string; + } +} diff --git a/typings/interfaces/components/tab/ActionTab.d.ts b/typings/interfaces/components/tab/ActionTab.d.ts new file mode 100644 index 0000000000000..8e748ff167fa7 --- /dev/null +++ b/typings/interfaces/components/tab/ActionTab.d.ts @@ -0,0 +1,4 @@ +interface ActionTabProps { + icon?: Icon; + title?: string; +} diff --git a/typings/interfaces/components/tab/Tab.d.ts b/typings/interfaces/components/tab/Tab.d.ts new file mode 100644 index 0000000000000..296bf25c8c016 --- /dev/null +++ b/typings/interfaces/components/tab/Tab.d.ts @@ -0,0 +1,8 @@ +export declare global { + interface Tab { + id?: number; + path: string; + dragging?: boolean; + isAction?: boolean; + } +} diff --git a/typings/interfaces/components/table/Table.d.ts b/typings/interfaces/components/table/Table.d.ts new file mode 100644 index 0000000000000..064b5d67d95f3 --- /dev/null +++ b/typings/interfaces/components/table/Table.d.ts @@ -0,0 +1,213 @@ +import { Ref, VNode } from 'vue'; +import { + AnyObject, + Store, + StoreMutations, + TableColumnCtx, +} from 'element-plus/lib/components/table/src/table/defaults'; +import { + TABLE_ACTION_CUSTOMIZE_COLUMNS, + TABLE_ACTION_EXPORT, + TABLE_PAGINATION_POSITION_ALL, + TABLE_PAGINATION_POSITION_BOTTOM, + TABLE_PAGINATION_POSITION_TOP, +} from '@/constants/table'; +import { + FilterMethods, + Filters, +} from 'element-plus/lib/components/table/src/table-column/defaults'; + +export declare global { + interface TableProps { + data: TableData; + columns: TableColumn[]; + selectedColumnKeys: string[]; + total: number; + page: number; + pageSize: number; + rowKey: string | ((row: any) => string); + selectable: boolean; + visibleButtons: BuiltInTableActionButtonName[]; + hideFooter: boolean; + selectableFunction?: TableSelectableFunction; + paginationLayout: string; + loading: boolean; + paginationPosition: TablePaginationPosition; + height?: string | number; + maxHeight?: string | number; + embedded?: boolean; + } + + interface TableColumn { + key: string; + label: string; + icon?: string | string[]; + width?: number | string; + minWidth?: number | string; + index?: number; + align?: string; + sortable?: boolean; + fixed?: string | boolean; + rowKey?: string; + buttons?: TableColumnButton[] | TableColumnButtonsFunction; + value?: TableValueFunction | any; + disableTransfer?: boolean; + defaultHidden?: boolean; + hasSort?: boolean; + hasFilter?: boolean; + filterItems?: SelectOption[]; + allowFilterSearch?: boolean; + allowFilterItems?: boolean; + required?: boolean; + className?: string; + proOnly?: boolean; + } + + type TableColumns = TableColumn[]; + + interface TableAnyRowData { + [key: string]: any; + } + + type TableData = T[]; + + interface TableDataWithTotal { + data: TableData; + total: number; + } + + interface TableColumnsMap { + [key: string]: TableColumn; + } + + interface TableColumnCtx { + id: string; + realWidth: number; + type: string; + label: string; + className: string; + labelClassName: string; + property: string; + prop: string; + width: string | number; + minWidth: string | number; + renderHeader: (data: CI) => VNode; + sortable: boolean | string; + sortMethod: (a: T, b: T) => number; + sortBy: string | ((row: T, index: number) => string) | string[]; + resizable: boolean; + columnKey: string; + rawColumnKey: string; + align: string; + headerAlign: string; + showTooltipWhenOverflow: boolean; + showOverflowTooltip: boolean; + fixed: boolean | string; + formatter: ( + row: T, + column: TableColumnCtx, + cellValue: any, + index: number + ) => VNode; + selectable: (row: T, index: number) => boolean; + reserveSelection: boolean; + filterMethod: FilterMethods; + filteredValue: string[]; + filters: Filters; + filterPlacement: string; + filterMultiple: boolean; + index: number | ((index: number) => number); + sortOrders: ('ascending' | 'descending' | null)[]; + renderCell: (data: any) => void; + colSpan: number; + rowSpan: number; + children: TableColumnCtx[]; + level: number; + filterable: boolean | FilterMethods | Filters; + order: string; + isColumnGroup: boolean; + columns: TableColumnCtx[]; + getColumnIndex: () => number; + no: number; + filterOpened?: boolean; + } + + interface TableColumnCtxMap { + [key: string]: TableColumnCtx; + } + + interface TableColumnButton { + key?: 'filter' | 'sort'; + type?: string; + size?: string; + icon?: Icon | TableValueFunction; + tooltip?: string | TableButtonTooltipFunction; + isHtml?: boolean; + disabled?: TableButtonDisabledFunction; + onClick?: TableButtonOnClickFunction; + id?: string; + className?: string; + action?: GenericAction; + } + + type TableColumnButtonsFunction = (row?: T) => TableColumnButton[]; + + type TableValueFunction = ( + row: T, + rowIndex?: number, + column?: TableColumn + ) => VNode; + type TableButtonOnClickFunction = ( + row: T, + rowIndex?: number, + column?: TableColumn + ) => void; + type TableButtonTooltipFunction = ( + row: T, + rowIndex?: number, + column?: TableColumn + ) => string; + type TableButtonDisabledFunction = ( + row: T, + rowIndex?: number, + column?: TableColumn + ) => boolean; + type TableFilterItemsFunction = ( + filter?: TableHeaderDialogFilterData, + column?: TableColumn + ) => SelectOption[]; + type TableSelectableFunction = ( + row: T, + rowIndex?: number + ) => boolean; + + interface TableStore extends Store { + mutations: TableStoreMutations; + commit: (mutation: string, payload: any) => void; + updateColumns: () => void; + } + + interface TableStoreMutations extends StoreMutations { + setColumns: (states: TableStoreStates, columns: TableColumnCtx[]) => void; + } + + interface TableStoreStates { + _data: Ref; + _columns: Ref; + } + + interface TablePagination { + page: number; + size: number; + } + + type TableActionName = + | ActionName + | TABLE_ACTION_EXPORT + | TABLE_ACTION_CUSTOMIZE_COLUMNS; + + type TablePaginationPosition = + | TABLE_PAGINATION_POSITION_TOP + | TABLE_PAGINATION_POSITION_BOTTOM + | TABLE_PAGINATION_POSITION_ALL; +} diff --git a/typings/interfaces/components/table/TableActions.d.ts b/typings/interfaces/components/table/TableActions.d.ts new file mode 100644 index 0000000000000..333cce3bce79c --- /dev/null +++ b/typings/interfaces/components/table/TableActions.d.ts @@ -0,0 +1,21 @@ +import { + TABLE_ACTION_ADD, + TABLE_ACTION_CUSTOMIZE_COLUMNS, + TABLE_ACTION_DELETE, + TABLE_ACTION_EDIT, + TABLE_ACTION_EXPORT, +} from '@/constants/table'; + +declare global { + interface TableActionsProps { + selection: TableData; + visibleButtons: BuiltInTableActionButtonName[]; + } + + type BuiltInTableActionButtonName = + | TABLE_ACTION_ADD + | TABLE_ACTION_EDIT + | TABLE_ACTION_DELETE + | TABLE_ACTION_EXPORT + | TABLE_ACTION_CUSTOMIZE_COLUMNS; +} diff --git a/typings/interfaces/components/table/TableCell.d.ts b/typings/interfaces/components/table/TableCell.d.ts new file mode 100644 index 0000000000000..6692903b39759 --- /dev/null +++ b/typings/interfaces/components/table/TableCell.d.ts @@ -0,0 +1,5 @@ +interface TableCellProps { + column: TableColumn; + row: any; + rowIndex: number; +} diff --git a/typings/interfaces/components/table/TableColumnsTransfer.d.ts b/typings/interfaces/components/table/TableColumnsTransfer.d.ts new file mode 100644 index 0000000000000..0fc34581a005f --- /dev/null +++ b/typings/interfaces/components/table/TableColumnsTransfer.d.ts @@ -0,0 +1,5 @@ +interface TableColumnsTransferProps { + visible: boolean; + columns: TableColumn[]; + selectedColumnKeys: string[]; +} diff --git a/typings/interfaces/components/table/TableHeader.d.ts b/typings/interfaces/components/table/TableHeader.d.ts new file mode 100644 index 0000000000000..e6418059cce85 --- /dev/null +++ b/typings/interfaces/components/table/TableHeader.d.ts @@ -0,0 +1,14 @@ +interface TableHeaderProps { + column: TableColumn; + index?: number; +} + +interface TableHeaderActionStatusMap { + filter: TableHeaderActionStatus; + sort: TableHeaderActionStatus; +} + +interface TableHeaderActionStatus { + active: boolean; + focused: boolean; +} diff --git a/typings/interfaces/components/table/TableHeaderAction.d.ts b/typings/interfaces/components/table/TableHeaderAction.d.ts new file mode 100644 index 0000000000000..143d353b7dfde --- /dev/null +++ b/typings/interfaces/components/table/TableHeaderAction.d.ts @@ -0,0 +1,8 @@ +interface TableHeaderActionProps { + key: string; + tooltip?: string; + isHtml?: boolean; + icon: string | string[]; + status?: TableHeaderActionStatus; + onClick?: () => void; +} diff --git a/typings/interfaces/components/table/TableHeaderDialog.d.ts b/typings/interfaces/components/table/TableHeaderDialog.d.ts new file mode 100644 index 0000000000000..cb3a9a0245e5a --- /dev/null +++ b/typings/interfaces/components/table/TableHeaderDialog.d.ts @@ -0,0 +1,12 @@ +interface TableHeaderDialogProps { + visible: boolean; + column: TableColumn; + actionStatusMap: TableHeaderActionStatusMap; + filter?: TableHeaderDialogFilterData; + sort?: SortData; +} + +interface TableHeaderDialogValue { + sort?: SortData; + filter?: TableHeaderDialogFilterData; +} diff --git a/typings/interfaces/components/table/TableHeaderDialogFilter.d.ts b/typings/interfaces/components/table/TableHeaderDialogFilter.d.ts new file mode 100644 index 0000000000000..0d6310f57cd0c --- /dev/null +++ b/typings/interfaces/components/table/TableHeaderDialogFilter.d.ts @@ -0,0 +1,11 @@ +interface TableHeaderDialogFilterProps { + column?: TableColumn; + searchString?: string; + conditions?: FilterConditionData[]; +} + +interface TableHeaderDialogFilterData { + searchString?: string; + conditions?: FilterConditionData[]; + items?: string[]; +} diff --git a/typings/interfaces/components/table/TableHeaderDialogSort.d.ts b/typings/interfaces/components/table/TableHeaderDialogSort.d.ts new file mode 100644 index 0000000000000..27daf92346a00 --- /dev/null +++ b/typings/interfaces/components/table/TableHeaderDialogSort.d.ts @@ -0,0 +1,3 @@ +interface TableHeaderDialogSortProps { + value?: string; +} diff --git a/typings/interfaces/components/table/index.d.ts b/typings/interfaces/components/table/index.d.ts new file mode 100644 index 0000000000000..75193adc339b0 --- /dev/null +++ b/typings/interfaces/components/table/index.d.ts @@ -0,0 +1 @@ +export * from './Table'; diff --git a/typings/interfaces/components/tag/tag.d.ts b/typings/interfaces/components/tag/tag.d.ts new file mode 100644 index 0000000000000..2c25ddc4938a2 --- /dev/null +++ b/typings/interfaces/components/tag/tag.d.ts @@ -0,0 +1,20 @@ +export declare global { + interface TagProps { + label?: string; + tooltip?: string; + type?: BasicType; + color?: string; + backgroundColor?: string; + borderColor?: string; + icon?: Icon; + suffixIcon?: Icon; + size?: BasicSize; + spinning?: boolean; + width?: string; + effect?: BasicEffect; + clickable?: boolean; + closable?: boolean; + disabled?: boolean; + className?: string; + } +} diff --git a/typings/interfaces/components/time/Duration.d.ts b/typings/interfaces/components/time/Duration.d.ts new file mode 100644 index 0000000000000..f8f134469f061 --- /dev/null +++ b/typings/interfaces/components/time/Duration.d.ts @@ -0,0 +1,7 @@ +interface DurationProps { + duration?: number; + isTag?: boolean; + size: BasicSize; + tooltip?: string; + icon?: Icon; +} diff --git a/typings/interfaces/components/time/Time.d.ts b/typings/interfaces/components/time/Time.d.ts new file mode 100644 index 0000000000000..c4b09f16ef3a9 --- /dev/null +++ b/typings/interfaces/components/time/Time.d.ts @@ -0,0 +1,5 @@ +interface TimeProps { + time?: Date | string; + ago: boolean; + format: string; +} diff --git a/typings/interfaces/components/transfer/Transfer.d.ts b/typings/interfaces/components/transfer/Transfer.d.ts new file mode 100644 index 0000000000000..f1753232b5a62 --- /dev/null +++ b/typings/interfaces/components/transfer/Transfer.d.ts @@ -0,0 +1,15 @@ +import { DataItem, Key } from 'element-plus/lib/el-transfer/src/transfer'; + +declare global { + interface TransferProps { + value: Key[]; + data: DataItem[]; + titles: string[]; + buttonTexts: string[]; + buttonTooltips: string[]; + } + + interface DataMap { + [key: string]: DataItem; + } +} diff --git a/typings/interfaces/components/transfer/TransferPanel.d.ts b/typings/interfaces/components/transfer/TransferPanel.d.ts new file mode 100644 index 0000000000000..2593409314e0f --- /dev/null +++ b/typings/interfaces/components/transfer/TransferPanel.d.ts @@ -0,0 +1,9 @@ +import { DataItem, Key } from 'element-plus/lib/el-transfer/src/transfer'; + +declare global { + interface TransferPanelProps { + checked: Key[]; + data: DataItem[]; + title: string; + } +} diff --git a/typings/interfaces/components/user/UserRole.d.ts b/typings/interfaces/components/user/UserRole.d.ts new file mode 100644 index 0000000000000..4bdff2ba0211a --- /dev/null +++ b/typings/interfaces/components/user/UserRole.d.ts @@ -0,0 +1,4 @@ +interface UserRoleProps { + role?: UserRole; + label?: string; +} diff --git a/typings/interfaces/directives/auth/auth.d.ts b/typings/interfaces/directives/auth/auth.d.ts new file mode 100644 index 0000000000000..5a37d7f414d4c --- /dev/null +++ b/typings/interfaces/directives/auth/auth.d.ts @@ -0,0 +1,3 @@ +export declare global { + type Auth = string | { action: string } | undefined; +} diff --git a/typings/interfaces/directives/export/export.d.ts b/typings/interfaces/directives/export/export.d.ts new file mode 100644 index 0000000000000..84cab2a204db2 --- /dev/null +++ b/typings/interfaces/directives/export/export.d.ts @@ -0,0 +1,16 @@ +export declare global { + type ExportType = 'csv' | 'json'; + + type ExportDirectiveTarget = string | (() => string); + + type ExportDirectiveConditions = + | FilterConditionData[] + | (() => FilterConditionData[]); + + interface ExportDirectivePayload { + target: ExportDirectiveTarget; + conditions?: ExportDirectiveConditions; + } + + type ExportDirective = ExportDirectiveTarget | ExportDirectivePayload; +} diff --git a/typings/interfaces/directives/index.d.ts b/typings/interfaces/directives/index.d.ts new file mode 100644 index 0000000000000..dfb6ed2a8d6af --- /dev/null +++ b/typings/interfaces/directives/index.d.ts @@ -0,0 +1,4 @@ +export * from './track/track'; +export * from './locate/locate'; +export * from './auth/auth'; +export * from './export/export'; diff --git a/typings/interfaces/directives/locate/locate.d.ts b/typings/interfaces/directives/locate/locate.d.ts new file mode 100644 index 0000000000000..386bedeeab033 --- /dev/null +++ b/typings/interfaces/directives/locate/locate.d.ts @@ -0,0 +1,3 @@ +export declare global { + type Locate = string | { name: string }; +} diff --git a/typings/interfaces/directives/track/track.d.ts b/typings/interfaces/directives/track/track.d.ts new file mode 100644 index 0000000000000..19b156df20fc6 --- /dev/null +++ b/typings/interfaces/directives/track/track.d.ts @@ -0,0 +1,24 @@ +export declare global { + interface Track { + code: string; + type?: TrackEventType; + params?: TrackEventParams; + events?: (keyof HTMLElementEventMap)[]; + } + + type TrackEventType = 'CLK' | 'EXP'; + + type TrackEventParamsWrapped = { [key: string]: any }; + + type TrackEventParams = { + [key: string]: string | number | boolean | Function | undefined; + }; + + type TrackEventListenerDict = { [key: string]: EventListener }; + + interface TrackSendEventPayload { + eventCode: string; + eventParams?: TrackEventParams; + eventType?: TrackEventType; + } +} diff --git a/typings/interfaces/echarts.d.ts b/typings/interfaces/echarts.d.ts new file mode 100644 index 0000000000000..1b3f92a6f4668 --- /dev/null +++ b/typings/interfaces/echarts.d.ts @@ -0,0 +1,24 @@ +export declare global { + type ECharts = echarts.ECharts; + type EChartOption = echarts.EChartOption; + type EChartSeries = echarts.EChartOption.Series; + type EChartYAxis = echarts.EChartOption.YAxis; + + interface EchartsDataMeta { + // value key + key: string; + // name of series + name: string; + // x-axis index + xAxisIndex?: number; + // y-axis index + yAxisIndex?: number; + } + + interface EChartsConfig { + dataMetas?: EchartsDataMeta[]; + data: StatsResult[]; + option: EChartOption; + itemStyleColorFunc?: (data: any) => string; + } +} diff --git a/typings/interfaces/element/index.d.ts b/typings/interfaces/element/index.d.ts new file mode 100644 index 0000000000000..df5450f40cb6f --- /dev/null +++ b/typings/interfaces/element/index.d.ts @@ -0,0 +1,13 @@ +export declare global { + type BasicType = 'primary' | 'success' | 'warning' | 'danger' | 'info'; + type BasicEffect = 'dark' | 'light' | 'plain'; + type BasicSize = 'small' | 'default' | 'large'; + + type ElFormValidator = (rule: any, value: any, callback: any) => void; + + interface ElFormRule { + required: boolean; + trigger: string; + validator: ElFormValidator; + } +} diff --git a/typings/interfaces/global.d.ts b/typings/interfaces/global.d.ts new file mode 100644 index 0000000000000..09d0bd9305411 --- /dev/null +++ b/typings/interfaces/global.d.ts @@ -0,0 +1,19 @@ +import { App } from 'vue'; + +declare global { + interface Window { + VITE_APP_API_BASE_URL?: string; + VUE_APP_INIT_UMENG?: string; + VUE_APP_INIT_BAIDU_TONGJI?: string; + threeJSApp?: any; + initCanvas?: () => void; + resetCanvas?: () => void; + disposeCanvas?: () => void; + _hmt?: Array; + 'vue3-sfc-loader'?: { loadModule }; + _app?: App; + _t?: (path: string, args?: any) => string; + _tc?: (path: string, c: number, args?: any) => string; + _tp?: (pluginName: string, path: string) => string; + } +} diff --git a/typings/interfaces/i18n/common.d.ts b/typings/interfaces/i18n/common.d.ts new file mode 100644 index 0000000000000..9afa65c9f6590 --- /dev/null +++ b/typings/interfaces/i18n/common.d.ts @@ -0,0 +1,135 @@ +export declare global { + interface LNavActions { + new: { + label: string; + tooltip: string; + }; + filter: { + search: { + placeholder: string; + }; + }; + } + + interface LCommon { + control: { + enabled: string; + disabled: string; + }; + actions: { + view: string; + edit: string; + clone: string; + delete: string; + run: string; + add: string; + bookmark: string; + restart: string; + cancel: string; + confirm: string; + copy: string; + create: string; + hide: string; + start: string; + stop: string; + clear: string; + apply: string; + search: string; + install: string; + uninstall: string; + viewLogs: string; + viewData: string; + viewFiles: string; + uploadFiles: string; + export: string; + configure: string; + update: string; + save: string; + change: string; + manage: string; + inferDataFieldsTypes: string; + }; + messageBox: { + confirm: { + delete: string; + restart: string; + cancel: string; + run: string; + stop: string; + install: string; + start: string; + deleteSelected: string; + proceed: string; + create: string; + }; + }; + message: { + success: { + delete: string; + restart: string; + run: string; + copy: string; + start: string; + save: string; + upload: string; + install: string; + uninstall: string; + startInstall: string; + startUninstall: string; + enabled: string; + disabled: string; + action: string; + update: string; + }; + info: { + cancel: string; + stop: string; + }; + error: { + login: string; + }; + }; + notification: { + loggedOut: string; + }; + tabs: { + overview: string; + spiders: string; + schedules: string; + tasks: string; + files: string; + git: string; + data: string; + settings: string; + logs: string; + dependencies: string; + triggers: string; + template: string; + remote: string; + branches: string; + tags: string; + references: string; + changes: string; + ignore: string; + }; + status: { + unassigned: string; + unknown: string; + invalid: string; + currentlyUnavailable: string; + unauthorized: string; + loading: string; + }; + mode: { + default: string; + other: string; + all: string; + }; + placeholder: { + empty: string; + }; + error: { + common: string; + }; + } +} diff --git a/typings/interfaces/i18n/components/chart.d.ts b/typings/interfaces/i18n/components/chart.d.ts new file mode 100644 index 0000000000000..6638ccad19873 --- /dev/null +++ b/typings/interfaces/i18n/components/chart.d.ts @@ -0,0 +1,5 @@ +interface LComponentsChart { + pieChart: { + noDataAvailable: string; + }; +} diff --git a/typings/interfaces/i18n/components/date.d.ts b/typings/interfaces/i18n/components/date.d.ts new file mode 100644 index 0000000000000..f3fcc47bf5990 --- /dev/null +++ b/typings/interfaces/i18n/components/date.d.ts @@ -0,0 +1,24 @@ +interface LComponentsDate { + dateRangePicker: { + options: { + today: string; + yesterday: string; + pastNMinutes: string; + pastNHours: string; + pastNDays: string; + pastNWeeks: string; + pastNMonths: string; + custom: string; + }; + }; + units: { + second: string; + minute: string; + hour: string; + day: string; + week: string; + month: string; + quarter: string; + year: string; + }; +} diff --git a/typings/interfaces/i18n/components/dialog.d.ts b/typings/interfaces/i18n/components/dialog.d.ts new file mode 100644 index 0000000000000..14993f112a911 --- /dev/null +++ b/typings/interfaces/i18n/components/dialog.d.ts @@ -0,0 +1,13 @@ +interface LComponentsDialog { + create: string; + edit: string; + dialog: string; + type: { + single: string; + batch: string; + }; + batch: { + add: string; + editAll: string; + }; +} diff --git a/typings/interfaces/i18n/components/ds.d.ts b/typings/interfaces/i18n/components/ds.d.ts new file mode 100644 index 0000000000000..52bd08889debd --- /dev/null +++ b/typings/interfaces/i18n/components/ds.d.ts @@ -0,0 +1,86 @@ +export declare global { + interface LComponentsDataSource { + label: { + text: string; + tooltip: string; + }; + form: { + name: string; + type: string; + status: string; + description: string; + host: string; + port: string; + url: string; + hosts: string; + address: string; + database: string; + username: string; + password: string; + changePassword: string; + connectType: string; + connectSettings: string; + mongo: { + authSource: string; + authMechanism: string; + }; + mysql: { + charset: string; + parseTime: string; + }; + postgresql: { + sslMode: string; + }; + default: { + host: string; + port: string; + url: string; + database: string; + }; + }; + type: { + default: string; + mongo: string; + mysql: string; + postgresql: string; + mssql: string; + sqlite: string; + cockroachdb: string; + elasticsearch: string; + kafka: string; + }; + status: { + label: { + online: string; + offline: string; + unknown: string; + }; + tooltip: { + online: string; + offline: string; + unknown: string; + }; + }; + default: { + host: string; + port: string; + }; + message: { + success: { + change: string; + }; + }; + connectType: { + label: { + standard: string; + url: string; + hosts: string; + }; + tips: { + standard: string; + url: string; + hosts: string; + }; + }; + } +} diff --git a/typings/interfaces/i18n/components/empty.d.ts b/typings/interfaces/i18n/components/empty.d.ts new file mode 100644 index 0000000000000..e0abaa0c2b91c --- /dev/null +++ b/typings/interfaces/i18n/components/empty.d.ts @@ -0,0 +1,3 @@ +interface LComponentsEmpty { + noDataAvailable: string; +} diff --git a/typings/interfaces/i18n/components/environment.d.ts b/typings/interfaces/i18n/components/environment.d.ts new file mode 100644 index 0000000000000..90d755f067d44 --- /dev/null +++ b/typings/interfaces/i18n/components/environment.d.ts @@ -0,0 +1,8 @@ +export declare global { + interface LComponentsEnvironment { + form: { + key: string; + value: string; + }; + } +} diff --git a/typings/interfaces/i18n/components/export.d.ts b/typings/interfaces/i18n/components/export.d.ts new file mode 100644 index 0000000000000..c3e3c531ac9c7 --- /dev/null +++ b/typings/interfaces/i18n/components/export.d.ts @@ -0,0 +1,16 @@ +interface LComponentsExport { + type: string; + types: { + csv: string; + json: string; + xlsx: string; + }; + exporting: { + csv: string; + json: string; + xlsx: string; + }; + status: { + exporting: string; + }; +} diff --git a/typings/interfaces/i18n/components/file.d.ts b/typings/interfaces/i18n/components/file.d.ts new file mode 100644 index 0000000000000..75bed66499317 --- /dev/null +++ b/typings/interfaces/i18n/components/file.d.ts @@ -0,0 +1,105 @@ +interface LComponentsFile { + editor: { + navTabs: { + close: string; + closeOthers: string; + closeAll: string; + showMore: string; + }; + navMenu: { + newFile: string; + newFileWithAi: string; + newDirectory: string; + rename: string; + duplicate: string; + delete: string; + }; + sidebar: { + search: { + placeholder: string; + }; + settings: string; + toggle: { + showFiles: string; + hideFiles: string; + }; + }; + empty: { + placeholder: string; + }; + messageBox: { + prompt: { + newFile: string; + newDirectory: string; + rename: string; + duplicate: string; + }; + validator: { + errorMessage: { + newNameNotSameAsOldName: string; + }; + }; + }; + settings: { + title: string; + form: { + theme: string; + }; + }; + createWithAi: { + title: string; + form: { + fileName: string; + url: string; + language: string; + framework: string; + prompt: string; + }; + }; + }; + upload: { + title: string; + form: { + mode: string; + targetDirectory: string; + }; + buttons: { + files: { + dragFilesHereOr: string; + clickToUpload: string; + }; + folder: { + clickToSelectFolderToUpload: string; + }; + }; + tooltip: { + folderName: string; + filesCount: string; + }; + mode: { + folder: string; + files: string; + }; + fileList: { + title: string; + }; + }; + actions: { + tooltip: { + fileEditorActions: string; + createWithAi: string; + createWithAiDisabled: string; + uploadFiles: string; + export: string; + fileEditorSettings: string; + }; + }; + rootDirectory: string; + diff: { + title: string; + form: { + original: string; + modified: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/form.d.ts b/typings/interfaces/i18n/components/form.d.ts new file mode 100644 index 0000000000000..4103c081cc8a3 --- /dev/null +++ b/typings/interfaces/i18n/components/form.d.ts @@ -0,0 +1,7 @@ +interface LComponentsForm { + table: { + field: { + defaultPlaceholder: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/git.d.ts b/typings/interfaces/i18n/components/git.d.ts new file mode 100644 index 0000000000000..12d36652ea845 --- /dev/null +++ b/typings/interfaces/i18n/components/git.d.ts @@ -0,0 +1,198 @@ +interface LComponentsGit { + form: { + repoUrl: string; + name: string; + currentBranch: string; + authType: string; + username: string; + password: string; + privateKey: string; + status: string; + error: string; + autoPull: string; + urlInvalid: string; + spider: string; + cloneLogs: string; + }; + common: { + currentBranch: string; + message: { + success: { + checkout: string; + pull: string; + commit: string; + push: string; + }; + }; + messageBox: { + confirm: { + branch: { + delete: string; + }; + push: string; + }; + prompt: { + branch: { + new: { + title: string; + validate: { + notEmpty: string; + notSame: string; + }; + }; + }; + commit: { + title: string; + placeholder: string; + validate: { + notEmpty: string; + }; + }; + }; + }; + box: { + title: { + pull: string; + push: string; + }; + }; + actions: { + pull: string; + commit: string; + }; + status: { + loading: { + label: string; + tooltip: string; + }; + }; + }; + branches: { + select: string; + new: string; + local: string; + remote: string; + pull: string; + commit: string; + push: string; + }; + tags: { + new: string; + }; + actions: { + title: string; + label: { + retry: string; + checkout: string; + pull: string; + commit: string; + rollback: string; + push: string; + }; + tooltip: { + retry: string; + checkout: string; + pull: string; + commit: string; + rollback: string; + push: string; + }; + }; + status: { + label: { + pending: string; + cloning: string; + ready: string; + error: string; + pulling: string; + pushing: string; + unknown: string; + }; + tooltip: { + pending: string; + cloning: string; + ready: string; + error: string; + pulling: string; + pushing: string; + unknown: string; + }; + }; + tabs: { + remote: string; + references: string; + logs: string; + changes: string; + ignore: string; + }; + checkout: { + type: string; + reference: string; + }; + references: { + type: { + branch: string; + tag: string; + }; + table: { + columns: { + timestamp: string; + }; + }; + }; + logs: { + table: { + columns: { + reference: string; + commitMessage: string; + author: string; + timestamp: string; + }; + }; + }; + changes: { + status: { + untracked: string; + modified: string; + added: string; + deleted: string; + renamed: string; + copied: string; + updatedButUnmerged: string; + }; + table: { + columns: { + changedFile: string; + status: string; + }; + actions: { + add: string; + rollback: string; + diff: string; + }; + empty: string; + }; + }; + spiders: { + title: string; + actions: { + label: { + create: string; + }; + tooltip: { + create: string; + }; + }; + gitRootPath: string; + }; + diff: { + title: string; + }; + providers: { + github: string; + bitbucket: string; + gitlab: string; + aws: string; + git: string; + }; +} diff --git a/typings/interfaces/i18n/components/index.d.ts b/typings/interfaces/i18n/components/index.d.ts new file mode 100644 index 0000000000000..e96b3c522fe4c --- /dev/null +++ b/typings/interfaces/i18n/components/index.d.ts @@ -0,0 +1,31 @@ +export declare global { + interface LComponents { + // common components + chart: LComponentsChart; + table: LComponentsTable; + dialog: LComponentsDialog; + transfer: LComponentsTransfer; + nav: LComponentsNav; + tab: LComponentsTab; + git: LComponentsGit; + empty: LComponentsEmpty; + form: LComponentsForm; + file: LComponentsFile; + date: LComponentsDate; + metric: LComponentsMetric; + export: LComponentsExport; + result: LComponentsResult; + ds: LComponentsDataSource; + environment: LComponentsEnvironment; + + // model-related components + node: LComponentsNode; + project: LComponentsProject; + spider: LComponentsSpider; + schedule: LComponentsSchedule; + task: LComponentsTask; + user: LComponentsUser; + tag: LComponentsTag; + plugin: LComponentsPlugin; + } +} diff --git a/typings/interfaces/i18n/components/input.d.ts b/typings/interfaces/i18n/components/input.d.ts new file mode 100644 index 0000000000000..d0d236cede5f7 --- /dev/null +++ b/typings/interfaces/i18n/components/input.d.ts @@ -0,0 +1,6 @@ +interface LComponentsInput { + tagInput: { + tagName: string; + addTag: string; + }; +} diff --git a/typings/interfaces/i18n/components/metric.d.ts b/typings/interfaces/i18n/components/metric.d.ts new file mode 100644 index 0000000000000..dde33482e9c27 --- /dev/null +++ b/typings/interfaces/i18n/components/metric.d.ts @@ -0,0 +1,121 @@ +interface LComponentsMetric { + filters: { + metricSource: string; + timeUnit: string; + timeRange: string; + }; + empty: { + noMetricsSelected: string; + }; + dashboard: { + columns: { + name: string; + type: string; + status: string; + metrics: { + title: string; + node: { + cpu: string; + memory: string; + disk: string; + net: string; + }; + mongo: {}; + }; + }; + }; + type: { + node: string; + mongo: string; + seaweedfs: string; + }; + progress: { + detail: { + name: string; + value: string; + }; + }; + snapshot: { + node: { + cpu: string; + mem: string; + disk: string; + net: string; + }; + mongo: { + fs: string; + db: string; + }; + }; + status: { + danger: string; + warning: string; + healthy: string; + unknown: string; + }; + metrics: { + 'performance:node:cpu:percent': string; + 'performance:node:mem:total': string; + 'performance:node:mem:available': string; + 'performance:node:mem:used': string; + 'performance:node:mem:used_percent': string; + 'performance:node:disk:total': string; + 'performance:node:disk:free': string; + 'performance:node:disk:used': string; + 'performance:node:disk:used_percent': string; + 'performance:node:disk:io_read_count': string; + 'performance:node:disk:io_read_bytes': string; + 'performance:node:disk:io_read_time': string; + 'performance:node:disk:io_write_count': string; + 'performance:node:disk:io_write_bytes': string; + 'performance:node:disk:io_write_time': string; + 'performance:node:disk:io_read_count_rate': string; + 'performance:node:disk:io_read_bytes_rate': string; + 'performance:node:disk:io_read_time_rate': string; + 'performance:node:disk:io_write_count_rate': string; + 'performance:node:disk:io_write_bytes_rate': string; + 'performance:node:disk:io_write_time_rate': string; + 'performance:node:net:io_bytes_sent': string; + 'performance:node:net:io_bytes_recv': string; + 'performance:node:net:io_packets_sent': string; + 'performance:node:net:io_packets_recv': string; + 'performance:node:net:io_errin': string; + 'performance:node:net:io_errout': string; + 'performance:node:net:io_dropin': string; + 'performance:node:net:io_dropout': string; + 'performance:node:net:io_fifoin': string; + 'performance:node:net:io_fifoout': string; + 'performance:node:net:io_bytes_sent_rate': string; + 'performance:node:net:io_bytes_recv_rate': string; + 'performance:node:net:io_packets_sent_rate': string; + 'performance:node:net:io_packets_recv_rate': string; + 'performance:node:net:io_errin_rate': string; + 'performance:node:net:io_errout_rate': string; + 'performance:node:net:io_dropin_rate': string; + 'performance:node:net:io_dropout_rate': string; + 'performance:node:net:io_fifoin_rate': string; + 'performance:node:net:io_fifoout_rate': string; + 'performance:mongo:size:fs_total_size': string; + 'performance:mongo:size:fs_used_size': string; + 'performance:mongo:size:total_size': string; + 'performance:mongo:size:total_free_storage_size': string; + 'performance:mongo:size:storage_size': string; + 'performance:mongo:size:data_size': string; + 'performance:mongo:size:free_storage_size': string; + 'performance:mongo:size:index_free_storage_size': string; + 'performance:mongo:size:index_size': string; + 'performance:mongo:size:avg_obj_size': string; + 'performance:mongo:size:fs_used_size_percent': string; + 'performance:mongo:size:total_size_percent': string; + 'performance:mongo:size:total_free_storage_size_percent': string; + 'performance:mongo:size:storage_size_percent': string; + 'performance:mongo:size:data_size_percent': string; + 'performance:mongo:size:free_storage_size_percent': string; + 'performance:mongo:size:index_free_storage_size_percent': string; + 'performance:mongo:size:index_size_percent': string; + 'performance:mongo:count:collections': string; + 'performance:mongo:count:objects': string; + 'performance:mongo:count:views': string; + 'performance:mongo:other:scale_factor': string; + }; +} diff --git a/typings/interfaces/i18n/components/nav.d.ts b/typings/interfaces/i18n/components/nav.d.ts new file mode 100644 index 0000000000000..7fdd08a844bf4 --- /dev/null +++ b/typings/interfaces/i18n/components/nav.d.ts @@ -0,0 +1,15 @@ +interface LComponentsNav { + actions: { + back: string; + save: string; + }; + tabs: { + toggle: { + collapse: string; + expand: string; + }; + }; + sidebar: { + search: string; + }; +} diff --git a/typings/interfaces/i18n/components/node.d.ts b/typings/interfaces/i18n/components/node.d.ts new file mode 100644 index 0000000000000..46d9f7ea7f117 --- /dev/null +++ b/typings/interfaces/i18n/components/node.d.ts @@ -0,0 +1,43 @@ +interface LComponentsNode { + form: { + key: string; + name: string; + tags: string; + type: string; + ip: string; + mac: string; + hostname: string; + enabled: string; + max_runners: string; + description: string; + }; + nodeType: { + label: { + master: string; + worker: string; + }; + }; + nodeStatus: { + label: { + unregistered: string; + registered: string; + online: string; + offline: string; + unknown: string; + }; + tooltip: { + unregistered: string; + registered: string; + online: string; + offline: string; + unknown: string; + }; + }; + nodeRunners: { + tooltip: { + unavailable: string; + running: string; + available: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/plugin.d.ts b/typings/interfaces/i18n/components/plugin.d.ts new file mode 100644 index 0000000000000..4e8e68294ef7f --- /dev/null +++ b/typings/interfaces/i18n/components/plugin.d.ts @@ -0,0 +1,71 @@ +interface LComponentsPlugin { + form: { + installType: string; + autoStart: string; + name: string; + installUrl: string; + installPath: string; + command: string; + description: string; + }; + installType: { + label: { + public: string; + git: string; + local: string; + }; + notice: { + public: string; + git: string; + local: string; + }; + }; + install: { + title: string; + repoUrl: string; + author: string; + pushedAt: string; + updatedAt: string; + }; + settings: { + title: string; + label: { + installSource: string; + goProxy: string; + }; + tips: { + installSource: string; + goProxy: string; + }; + goProxy: { + default: string; + }; + }; + status: { + label: { + installing: string; + stopped: string; + running: string; + error: string; + unknown: string; + installed: string; + }; + tooltip: { + installing: string; + stopped: string; + running: string; + error: string; + unknown: string; + installed: string; + }; + nodes: { + tooltip: { + installing: string; + stopped: string; + running: string; + error: string; + unknown: string; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/components/project.d.ts b/typings/interfaces/i18n/components/project.d.ts new file mode 100644 index 0000000000000..84b96d42ac99c --- /dev/null +++ b/typings/interfaces/i18n/components/project.d.ts @@ -0,0 +1,7 @@ +interface LComponentsProject { + form: { + name: string; + tags: string; + description: string; + }; +} diff --git a/typings/interfaces/i18n/components/result.d.ts b/typings/interfaces/i18n/components/result.d.ts new file mode 100644 index 0000000000000..9cac723b4f47a --- /dev/null +++ b/typings/interfaces/i18n/components/result.d.ts @@ -0,0 +1,22 @@ +interface LComponentsResult { + form: { + dataType: string; + }; + types: { + [key: string]: string; + }; + dedup: { + dialog: { + fields: { + title: string; + placeholder: string; + }; + }; + labels: { + dedupType: string; + }; + types: { + [key: string]: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/schedule.d.ts b/typings/interfaces/i18n/components/schedule.d.ts new file mode 100644 index 0000000000000..de4268bd55323 --- /dev/null +++ b/typings/interfaces/i18n/components/schedule.d.ts @@ -0,0 +1,35 @@ +interface LComponentsSchedule { + form: { + name: string; + spider: string; + cron: string; + cronInfo: string; + command: string; + param: string; + defaultMode: string; + enabled: string; + selectedTags: string; + selectedNodes: string; + description: string; + }; + rules: { + message: { + invalidCronExpression: string; + }; + }; + message: { + success: { + enable: string; + disable: string; + }; + }; + cron: { + title: { + cronDescription: string; + nextRun: string; + cron: string; + description: string; + next: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/spider.d.ts b/typings/interfaces/i18n/components/spider.d.ts new file mode 100644 index 0000000000000..1d47434cf128f --- /dev/null +++ b/typings/interfaces/i18n/components/spider.d.ts @@ -0,0 +1,61 @@ +interface LComponentsSpider { + form: { + name: string; + project: string; + command: string; + param: string; + defaultMode: string; + resultsCollection: string; + selectedTags: string; + selectedNodes: string; + description: string; + priority: string; + incrementalSync: string; + autoInstall: string; + autoInstallDisabled: string; + git: string; + gitRootPath: string; + }; + actions: { + files: { + tooltip: { + fileEditorActions: string; + uploadFiles: string; + fileEditorSettings: string; + export: string; + createWithAi: string; + createWithAiDisabled: string; + }; + }; + data: { + tooltip: { + dataActions: string; + export: string; + displayAllFields: string; + inferDataFieldsTypes: string; + dedup: { + enabled: string; + disabled: string; + fields: string; + }; + }; + }; + }; + stat: { + totalTasks: string; + totalResults: string; + averageWaitDuration: string; + averageRuntimeDuration: string; + averageTotalDuration: string; + }; + dialog: { + run: { + title: string; + }; + }; + message: { + success: { + scheduleTask: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/tab.d.ts b/typings/interfaces/i18n/components/tab.d.ts new file mode 100644 index 0000000000000..e55a4b141edfd --- /dev/null +++ b/typings/interfaces/i18n/components/tab.d.ts @@ -0,0 +1,3 @@ +interface LComponentsTab { + newTab: string; +} diff --git a/typings/interfaces/i18n/components/table.d.ts b/typings/interfaces/i18n/components/table.d.ts new file mode 100644 index 0000000000000..2338da12684d7 --- /dev/null +++ b/typings/interfaces/i18n/components/table.d.ts @@ -0,0 +1,46 @@ +interface LComponentsTable { + columns: { + actions: string; + }; + actions: { + editSelected: string; + deleteSelected: string; + export: string; + customizeColumns: string; + }; + columnsTransfer: { + title: string; + titles: { + left: string; + right: string; + }; + }; + header: { + sort: { + tooltip: { + sort: string; + sortAscending: string; + sortDescending: string; + }; + }; + filter: { + tooltip: { + filter: string; + search: string; + include: string; + }; + }; + dialog: { + sort: { + title: string; + clearSort: string; + ascending: string; + descending: string; + }; + filter: { + title: string; + search: string; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/components/tag.d.ts b/typings/interfaces/i18n/components/tag.d.ts new file mode 100644 index 0000000000000..9ef6fe32dce45 --- /dev/null +++ b/typings/interfaces/i18n/components/tag.d.ts @@ -0,0 +1,7 @@ +interface LComponentsTag { + form: { + name: string; + color: string; + description: string; + }; +} diff --git a/typings/interfaces/i18n/components/task.d.ts b/typings/interfaces/i18n/components/task.d.ts new file mode 100644 index 0000000000000..252543a869d13 --- /dev/null +++ b/typings/interfaces/i18n/components/task.d.ts @@ -0,0 +1,82 @@ +interface LComponentsTask { + form: { + spider: string; + node: string; + status: string; + command: string; + param: string; + mode: string; + priority: string; + selectedTags: string; + selectedNodes: string; + tooltip: { + goToSpider: string; + goToNode: string; + taskErrorMessage: string; + cancelTask: string; + customized: string; + }; + }; + actions: { + data: { + tooltip: { + dataActions: string; + export: string; + displayAllFields: string; + inferDataFieldsTypes: string; + }; + }; + }; + status: { + label: { + pending: string; + running: string; + finished: string; + error: string; + cancelled: string; + abnormal: string; + unknown: string; + }; + tooltip: { + pending: string; + running: string; + finished: string; + error: string; + cancelled: string; + abnormal: string; + unknown: string; + }; + }; + priority: { + high: string; + higher: string; + medium: string; + lower: string; + low: string; + }; + mode: { + label: { + randomNode: string; + allNodes: string; + selectedNodes: string; + selectedTags: string; + unknown: string; + }; + tooltip: { + randomNode: string; + allNodes: string; + selectedNodes: string; + selectedTags: string; + unknown: string; + }; + }; + results: { + results: string; + noResults: string; + }; + logs: { + actions: { + autoUpdateLogs: string; + }; + }; +} diff --git a/typings/interfaces/i18n/components/transfer.d.ts b/typings/interfaces/i18n/components/transfer.d.ts new file mode 100644 index 0000000000000..b0bc4b6c29e45 --- /dev/null +++ b/typings/interfaces/i18n/components/transfer.d.ts @@ -0,0 +1,8 @@ +interface LComponentsTransfer { + moveToLeft: string; + moveToRight: string; + titles: { + available: string; + enabled: string; + }; +} diff --git a/typings/interfaces/i18n/components/user.d.ts b/typings/interfaces/i18n/components/user.d.ts new file mode 100644 index 0000000000000..2038014bce11b --- /dev/null +++ b/typings/interfaces/i18n/components/user.d.ts @@ -0,0 +1,27 @@ +interface LComponentsUser { + form: { + username: string; + password: string; + changePassword: string; + email: string; + role: string; + newPassword: string; + }; + role: { + admin: string; + normal: string; + }; + delete: { + tooltip: { + adminUserNonDeletable: string; + }; + }; + messageBox: { + prompt: { + changePassword: string; + }; + }; + rules: { + invalidPassword: string; + }; +} diff --git a/typings/interfaces/i18n/global.d.ts b/typings/interfaces/i18n/global.d.ts new file mode 100644 index 0000000000000..c0a5efe87ae30 --- /dev/null +++ b/typings/interfaces/i18n/global.d.ts @@ -0,0 +1,17 @@ +export declare global { + interface LGlobal { + lang: string; + edition: { + community: string; + pro: string; + enterprise: string; + }; + title: string; + subTitle: string; + upgrade: { + pro: string; + }; + docs: string; + github: string; + } +} diff --git a/typings/interfaces/i18n/index.d.ts b/typings/interfaces/i18n/index.d.ts new file mode 100644 index 0000000000000..220005cb22b63 --- /dev/null +++ b/typings/interfaces/i18n/index.d.ts @@ -0,0 +1,22 @@ +import { LocaleMessageDictionary } from '@intlify/core-base'; +import { VueMessageType, I18n } from 'vue-i18n'; + +export declare global { + interface L extends LocaleMessageDictionary { + global: LGlobal; + common: LCommon; + layouts: LLayouts; + router: LRouter; + components: LComponents; + views: LViews; + } + + type LI18n = I18n<{ en: L; zh: L }, {}, {}, string, false>; +} + +export * from './components'; +export * from './views'; +export * from './common'; +export * from './global'; +export * from './layouts'; +export * from './router'; diff --git a/typings/interfaces/i18n/layouts.d.ts b/typings/interfaces/i18n/layouts.d.ts new file mode 100644 index 0000000000000..6849f06211059 --- /dev/null +++ b/typings/interfaces/i18n/layouts.d.ts @@ -0,0 +1,21 @@ +export declare global { + interface LLayouts { + components: { + header: { + disclaimer: string; + mySettings: string; + logout: string; + }; + }; + detailLayout: { + navTabs: { + toggle: { + tooltip: { + expand: string; + collapse: string; + }; + }; + }; + }; + } +} diff --git a/typings/interfaces/i18n/router.d.ts b/typings/interfaces/i18n/router.d.ts new file mode 100644 index 0000000000000..5b8ec7c9d66ad --- /dev/null +++ b/typings/interfaces/i18n/router.d.ts @@ -0,0 +1,33 @@ +export declare global { + interface LRouter { + menuItems: { + home: string; + nodes: string; + projects: string; + spiders: string; + schedules: string; + tasks: string; + git: string; + ds: string; + users: string; + tags: string; + tokens: string; + plugins: string; + env: { + deps: { + title: string; + settings: string; + python: string; + node: string; + }; + }; + notification: string; + environment: string; + system: string; + misc: { + disclaimer: string; + mySettings: string; + }; + }; + } +} diff --git a/typings/interfaces/i18n/views/ds.d.ts b/typings/interfaces/i18n/views/ds.d.ts new file mode 100644 index 0000000000000..b7a37b40bde9a --- /dev/null +++ b/typings/interfaces/i18n/views/ds.d.ts @@ -0,0 +1,31 @@ +export declare global { + interface LViewsDataSource { + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + type: { + label: string; + }; + status: { + label: string; + }; + connectType: { + label: string; + }; + database: { + label: string; + }; + username: { + label: string; + }; + }; + search: { + connectSettings: { + placeholder: string; + }; + }; + }; + }; + } +} diff --git a/typings/interfaces/i18n/views/env.d.ts b/typings/interfaces/i18n/views/env.d.ts new file mode 100644 index 0000000000000..a54a05e045a9a --- /dev/null +++ b/typings/interfaces/i18n/views/env.d.ts @@ -0,0 +1,69 @@ +interface LViewsEnv { + deps: { + settings: { + form: { + key: string; + name: string; + description: string; + enabled: string; + cmd: string; + proxy: string; + }; + lang: { + python: { + description: string; + }; + node: { + description: string; + }; + }; + }; + dependency: { + form: { + name: string; + latestVersion: string; + installedVersion: string; + installedNodes: string; + allNodes: string; + selectedNodes: string; + upgrade: string; + mode: string; + version: string; + }; + }; + task: { + tasks: string; + form: { + action: string; + node: string; + status: string; + dependencies: string; + time: string; + logs: string; + }; + }; + spider: { + form: { + name: string; + dependencyType: string; + requiredVersion: string; + installedVersion: string; + installedNodes: string; + }; + }; + common: { + status: { + installed: string; + installable: string; + upgradable: string; + downgradable: string; + noDependencyType: string; + }; + actions: { + installAndUpgrade: string; + installAndDowngrade: string; + searchDependencies: string; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/views/environment.d.ts b/typings/interfaces/i18n/views/environment.d.ts new file mode 100644 index 0000000000000..0014bcce77b06 --- /dev/null +++ b/typings/interfaces/i18n/views/environment.d.ts @@ -0,0 +1,14 @@ +interface LViewsEnvironments { + table: { + columns: { + key: string; + value: string; + }; + }; + navActions: LNavActions; + messageBox: { + prompt: { + create: string; + }; + }; +} diff --git a/typings/interfaces/i18n/views/gits.d.ts b/typings/interfaces/i18n/views/gits.d.ts new file mode 100644 index 0000000000000..c46d1f609fbf8 --- /dev/null +++ b/typings/interfaces/i18n/views/gits.d.ts @@ -0,0 +1,15 @@ +interface LViewGits { + table: { + columns: { + name: string; + status: string; + spiders: string; + }; + actions: { + tooltip: { + deleteNotAllowed: string; + }; + }; + }; + navActions: LNavActions; +} diff --git a/typings/interfaces/i18n/views/home.d.ts b/typings/interfaces/i18n/views/home.d.ts new file mode 100644 index 0000000000000..c7b3b09e7c142 --- /dev/null +++ b/typings/interfaces/i18n/views/home.d.ts @@ -0,0 +1,24 @@ +interface LViewsHome { + metrics: { + nodes: string; + projects: string; + spiders: string; + schedules: string; + tasks: string; + error_tasks: string; + results: string; + users: string; + }; + dailyConfig: { + title: string; + }; + tasksByStatusConfig: { + title: string; + }; + tasksByNodeConfig: { + title: string; + }; + tasksBySpiderConfig: { + title: string; + }; +} diff --git a/typings/interfaces/i18n/views/index.d.ts b/typings/interfaces/i18n/views/index.d.ts new file mode 100644 index 0000000000000..e8b30834fd012 --- /dev/null +++ b/typings/interfaces/i18n/views/index.d.ts @@ -0,0 +1,22 @@ +export declare global { + interface LViews { + login: LViewsLogin; + home: LViewsHome; + nodes: LViewsNodes; + projects: LViewProjects; + spiders: LViewsSpiders; + schedules: LViewsSchedules; + tasks: LViewsTasks; + users: LViewsUsers; + tags: LViewsTags; + tokens: LViewsTokens; + env: LViewsEnv; + notification: LViewsNotification; + plugins: LViewsPlugins; + misc: LViewsMisc; + gits: LViewGits; + ds: LViewsDataSource; + environment: LViewsEnvironments; + system: LViewsSystem; + } +} diff --git a/typings/interfaces/i18n/views/login.d.ts b/typings/interfaces/i18n/views/login.d.ts new file mode 100644 index 0000000000000..ce3268ec03923 --- /dev/null +++ b/typings/interfaces/i18n/views/login.d.ts @@ -0,0 +1,28 @@ +interface LViewsLogin { + loginForm: { + username: string; + password: string; + confirmPassword: string; + email: string; + signUp: string; + signIn: string; + }; + forgotPassword: { + label: string; + content: string; + }; + initial: { + title: string; + }; + documentation: string; + mobile: { + warning: string; + }; + errors: { + incorrectUsername: string; + passwordLength: string; + passwordSame: string; + unauthorized: string; + noTokenReturned: string; + }; +} diff --git a/typings/interfaces/i18n/views/misc.d.ts b/typings/interfaces/i18n/views/misc.d.ts new file mode 100644 index 0000000000000..289ec14d2f84f --- /dev/null +++ b/typings/interfaces/i18n/views/misc.d.ts @@ -0,0 +1,6 @@ +interface LViewsMisc { + disclaimer: { + title: string; + content: string; + }; +} diff --git a/typings/interfaces/i18n/views/nodes.d.ts b/typings/interfaces/i18n/views/nodes.d.ts new file mode 100644 index 0000000000000..cf07dd2857b12 --- /dev/null +++ b/typings/interfaces/i18n/views/nodes.d.ts @@ -0,0 +1,42 @@ +interface LViewsNodes { + table: { + columns: { + name: string; + nodeType: string; + status: string; + ip: string; + mac: string; + hostname: string; + runners: string; + enabled: string; + tags: string; + description: string; + }; + }; + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + type: { + label: string; + }; + status: { + label: string; + }; + enabled: { + label: string; + }; + }; + }; + }; + notice: { + create: { + title: string; + content: string; + link: { + label: string; + url: string; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/views/notification.d.ts b/typings/interfaces/i18n/views/notification.d.ts new file mode 100644 index 0000000000000..f6617ef97753e --- /dev/null +++ b/typings/interfaces/i18n/views/notification.d.ts @@ -0,0 +1,47 @@ +interface LViewsNotification { + navActions: LNavActions; + settings: { + form: { + name: string; + description: string; + type: string; + enabled: string; + title: string; + template: string; + templateContent: string; + mail: { + smtp: { + server: string; + port: string; + user: string; + password: string; + sender: { + email: string; + identity: string; + }; + }; + to: string; + cc: string; + }; + mobile: { + webhook: string; + }; + }; + type: { + mail: string; + mobile: string; + }; + }; + triggers: { + taskTrigger: string; + taskTriggerFinish: string; + taskTriggerError: string; + taskTriggerEmptyResults: string; + taskTriggerNever: string; + }; + tabs: { + overview: string; + triggers: string; + template: string; + }; +} diff --git a/typings/interfaces/i18n/views/plugins.d.ts b/typings/interfaces/i18n/views/plugins.d.ts new file mode 100644 index 0000000000000..29c0ec0929368 --- /dev/null +++ b/typings/interfaces/i18n/views/plugins.d.ts @@ -0,0 +1,22 @@ +interface LViewsPlugins { + table: { + columns: { + name: string; + status: string; + processId: string; + description: string; + }; + }; + navActions: LNavActionsPlugins; +} + +interface LNavActionsPlugins extends LNavActions { + install: { + label: string; + tooltip: string; + }; + settings: { + label: string; + tooltip: string; + }; +} diff --git a/typings/interfaces/i18n/views/projects.d.ts b/typings/interfaces/i18n/views/projects.d.ts new file mode 100644 index 0000000000000..202a720739c3d --- /dev/null +++ b/typings/interfaces/i18n/views/projects.d.ts @@ -0,0 +1,11 @@ +interface LViewProjects { + table: { + columns: { + name: string; + spiders: string; + tags: string; + description: string; + }; + }; + navActions: LNavActions; +} diff --git a/typings/interfaces/i18n/views/schedules.d.ts b/typings/interfaces/i18n/views/schedules.d.ts new file mode 100644 index 0000000000000..cfd59e3d78ca4 --- /dev/null +++ b/typings/interfaces/i18n/views/schedules.d.ts @@ -0,0 +1,34 @@ +interface LViewsSchedules { + table: { + columns: { + name: string; + spider: string; + mode: string; + cron: string; + enabled: string; + entryId: string; + description: string; + }; + }; + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + spider: { + label: string; + }; + mode: { + label: string; + }; + enabled: { + label: string; + }; + }; + search: { + cron: { + placeholder: string; + }; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/views/spiders.d.ts b/typings/interfaces/i18n/views/spiders.d.ts new file mode 100644 index 0000000000000..cb8f9463f05a7 --- /dev/null +++ b/typings/interfaces/i18n/views/spiders.d.ts @@ -0,0 +1,25 @@ +interface LViewsSpiders { + table: { + columns: { + name: string; + project: string; + git: string; + lastStatus: string; + lastRunAt: string; + stats: string; + createTs: string; + updateTs: string; + description: string; + }; + }; + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + project: { + label: string; + }; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/views/system.d.ts b/typings/interfaces/i18n/views/system.d.ts new file mode 100644 index 0000000000000..23c91e298be8e --- /dev/null +++ b/typings/interfaces/i18n/views/system.d.ts @@ -0,0 +1,4 @@ +interface LViewsSystem { + customizeSiteTitle: string; + siteTitle: string; +} diff --git a/typings/interfaces/i18n/views/tags.d.ts b/typings/interfaces/i18n/views/tags.d.ts new file mode 100644 index 0000000000000..29efe7250846b --- /dev/null +++ b/typings/interfaces/i18n/views/tags.d.ts @@ -0,0 +1,11 @@ +interface LViewsTags { + table: { + columns: { + name: string; + color: string; + model: string; + description: string; + }; + }; + navActions: LNavActions; +} diff --git a/typings/interfaces/i18n/views/tasks.d.ts b/typings/interfaces/i18n/views/tasks.d.ts new file mode 100644 index 0000000000000..edc760d377132 --- /dev/null +++ b/typings/interfaces/i18n/views/tasks.d.ts @@ -0,0 +1,48 @@ +interface LViewsTasks { + table: { + columns: { + node: string; + spider: string; + schedule: string; + priority: string; + status: string; + cmd: string; + stat: { + create_ts: string; + start_ts: string; + end_ts: string; + wait_duration: string; + runtime_duration: string; + total_duration: string; + results: string; + }; + }; + }; + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + node: { + label: string; + }; + spider: { + label: string; + }; + schedule: { + label: string; + }; + priority: { + label: string; + }; + status: { + label: string; + }; + }; + search: { + cmd: { + placeholder: string; + }; + }; + }; + }; +} diff --git a/typings/interfaces/i18n/views/tokens.d.ts b/typings/interfaces/i18n/views/tokens.d.ts new file mode 100644 index 0000000000000..c79061a70a43a --- /dev/null +++ b/typings/interfaces/i18n/views/tokens.d.ts @@ -0,0 +1,14 @@ +interface LViewsTokens { + table: { + columns: { + name: string; + token: string; + }; + }; + navActions: LNavActions; + messageBox: { + prompt: { + create: string; + }; + }; +} diff --git a/typings/interfaces/i18n/views/users.d.ts b/typings/interfaces/i18n/views/users.d.ts new file mode 100644 index 0000000000000..bfd1afa983382 --- /dev/null +++ b/typings/interfaces/i18n/views/users.d.ts @@ -0,0 +1,24 @@ +interface LViewsUsers { + table: { + columns: { + username: string; + email: string; + role: string; + }; + }; + navActions: LNavActions; + navActionsExtra: { + filter: { + select: { + role: { + label: string; + }; + }; + search: { + email: { + placeholder: string; + }; + }; + }; + }; +} diff --git a/typings/interfaces/index.d.ts b/typings/interfaces/index.d.ts new file mode 100644 index 0000000000000..99f8b217bc126 --- /dev/null +++ b/typings/interfaces/index.d.ts @@ -0,0 +1,29 @@ +declare module '*.js'; +declare module '*.jpg'; +declare module '*.png'; +declare module '*.svg'; + +export declare global { + type ElFormValidator = (rule: any, value: any, callback: any) => void; + + interface ElFormRule { + required: boolean; + trigger: string; + validator: ElFormValidator; + } +} + +// export modules interfaces. +export * from './common'; +export * from './components'; +export * from './views'; +export * from './directives'; +export * from './element'; +export * from './i18n'; +export * from './layout'; +export * from './models'; +export * from './router'; +export * from './package'; +export * from './services'; +export * from './store'; +export * from './echarts'; diff --git a/typings/interfaces/layout/components/Sidebar.d.ts b/typings/interfaces/layout/components/Sidebar.d.ts new file mode 100644 index 0000000000000..da8ac81216de9 --- /dev/null +++ b/typings/interfaces/layout/components/Sidebar.d.ts @@ -0,0 +1,8 @@ +export declare global { + interface MenuItem extends TreeNode { + title: string; + path?: string; + icon?: string | string[]; + hidden?: boolean; + } +} diff --git a/typings/interfaces/layout/components/SidebarItem.d.ts b/typings/interfaces/layout/components/SidebarItem.d.ts new file mode 100644 index 0000000000000..505999ed4e998 --- /dev/null +++ b/typings/interfaces/layout/components/SidebarItem.d.ts @@ -0,0 +1,3 @@ +interface SidebarItemProps { + item: MenuItem; +} diff --git a/typings/interfaces/layout/components/index.d.ts b/typings/interfaces/layout/components/index.d.ts new file mode 100644 index 0000000000000..c167c49f6f16a --- /dev/null +++ b/typings/interfaces/layout/components/index.d.ts @@ -0,0 +1 @@ +export * from './Sidebar'; diff --git a/typings/interfaces/layout/content/detail/DetailLayout.d.ts b/typings/interfaces/layout/content/detail/DetailLayout.d.ts new file mode 100644 index 0000000000000..e037f823e5264 --- /dev/null +++ b/typings/interfaces/layout/content/detail/DetailLayout.d.ts @@ -0,0 +1,7 @@ +interface DetailLayoutProps { + storeNamespace: ListStoreNamespace; + noSidebar?: boolean; + navItemNameKey: string; + showBackButton?: boolean; + showSaveButton?: boolean; +} diff --git a/typings/interfaces/layout/content/index.d.ts b/typings/interfaces/layout/content/index.d.ts new file mode 100644 index 0000000000000..30155e58aa970 --- /dev/null +++ b/typings/interfaces/layout/content/index.d.ts @@ -0,0 +1,3 @@ +export * from './detail/DetailLayout'; +export * from './list/ListLayout'; +export * from './simple/SimpleLayout'; diff --git a/typings/interfaces/layout/content/list/ListLayout.d.ts b/typings/interfaces/layout/content/list/ListLayout.d.ts new file mode 100644 index 0000000000000..a1fb5b43b8926 --- /dev/null +++ b/typings/interfaces/layout/content/list/ListLayout.d.ts @@ -0,0 +1,65 @@ +import { ComputedRef, Ref } from 'vue'; +import Table from '@/components/table/Table.vue'; + +export declare global { + interface ListLayoutComponentData { + navActions?: Ref; + tableColumns?: Ref>; + tableData: Ref>; + tableTotal: Ref; + tablePagination: Ref; + tableListFilter: Ref; + tableListSort: Ref; + actionFunctions: ListLayoutActionFunctions; + activeDialogKey: ComputedRef; + } + + interface UseListOptions { + navActions: Ref; + tableColumns: Ref>; + } + + interface ListActionGroup { + name?: string; + children?: (ListActionButton | ListActionFilter)[]; + } + + interface ListAction { + id?: string; + label?: string; + action?: GenericAction; + className?: string; + size?: BasicSize; + } + + interface ListActionButton extends ListAction { + buttonType?: ButtonType; + tooltip?: string; + icon?: Icon; + type?: BasicType; + disabled?: boolean | ListActionButtonDisabledFunc; + onClick?: () => void; + } + + interface ListActionFilter extends ListAction { + placeholder?: string; + options?: SelectOption[]; + optionsRemote?: FilterSelectOptionsRemote; + onChange?: (value: any) => void; + } + + interface ListLayoutActionFunctions { + setPagination: (pagination: TablePagination) => void; + getList: () => Promise; + getAll: () => Promise; + deleteList: (ids: string[]) => Promise; + deleteByIdConfirm: (row: BaseModel) => Promise; + onHeaderChange?: ( + column: TableColumn, + sort: SortData, + filter: TableHeaderDialogFilterData + ) => Promise; + } + + type ListActionButtonDisabledFunc = (table: typeof Table) => boolean; +} diff --git a/typings/interfaces/layout/content/simple/SimpleLayout.d.ts b/typings/interfaces/layout/content/simple/SimpleLayout.d.ts new file mode 100644 index 0000000000000..2795476bd30fa --- /dev/null +++ b/typings/interfaces/layout/content/simple/SimpleLayout.d.ts @@ -0,0 +1,3 @@ +interface SimpleLayoutProps { + background?: string; +} diff --git a/typings/interfaces/layout/index.d.ts b/typings/interfaces/layout/index.d.ts new file mode 100644 index 0000000000000..f8d74a118516f --- /dev/null +++ b/typings/interfaces/layout/index.d.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './content'; diff --git a/typings/interfaces/models/dataCollection.d.ts b/typings/interfaces/models/dataCollection.d.ts new file mode 100644 index 0000000000000..4965297bb7093 --- /dev/null +++ b/typings/interfaces/models/dataCollection.d.ts @@ -0,0 +1,11 @@ +export declare global { + interface DataCollection extends BaseModel { + name?: string; + fields?: DataField[]; + dedup?: { + enabled?: boolean; + keys?: string[]; + type?: string; + }; + } +} diff --git a/typings/interfaces/models/dataField.d.ts b/typings/interfaces/models/dataField.d.ts new file mode 100644 index 0000000000000..b1631aa32978d --- /dev/null +++ b/typings/interfaces/models/dataField.d.ts @@ -0,0 +1,31 @@ +import { + DATA_FIELD_TYPE_AUDIO, + DATA_FIELD_TYPE_CURRENCY, + DATA_FIELD_TYPE_TIME, + DATA_FIELD_TYPE_GENERAL, + DATA_FIELD_TYPE_IMAGE, + DATA_FIELD_TYPE_NUMERIC, + DATA_FIELD_TYPE_URL, + DATA_FIELD_TYPE_VIDEO, + DATA_FIELD_TYPE_HTML, + DATA_FIELD_TYPE_LONG_TEXT, +} from '@/constants/dataFields'; + +export declare global { + interface DataField { + key?: string; + type?: DataFieldType; + } + + type DataFieldType = + | DATA_FIELD_TYPE_GENERAL + | DATA_FIELD_TYPE_NUMERIC + | DATA_FIELD_TYPE_TIME + | DATA_FIELD_TYPE_CURRENCY + | DATA_FIELD_TYPE_URL + | DATA_FIELD_TYPE_IMAGE + | DATA_FIELD_TYPE_AUDIO + | DATA_FIELD_TYPE_VIDEO + | DATA_FIELD_TYPE_HTML + | DATA_FIELD_TYPE_LONG_TEXT; +} diff --git a/typings/interfaces/models/ds.d.ts b/typings/interfaces/models/ds.d.ts new file mode 100644 index 0000000000000..e284a4c78d56a --- /dev/null +++ b/typings/interfaces/models/ds.d.ts @@ -0,0 +1,52 @@ +import { + DATA_SOURCE_TYPE_MONGO, + DATA_SOURCE_TYPE_MYSQL, + DATA_SOURCE_TYPE_POSTGRESQL, + DATA_SOURCE_TYPE_MSSQL, + DATA_SOURCE_TYPE_SQLITE, + DATA_SOURCE_TYPE_COCKROACHDB, + DATA_SOURCE_TYPE_ELASTICSEARCH, + DATA_SOURCE_TYPE_KAFKA, + DATA_SOURCE_STATUS_ONLINE, + DATA_SOURCE_STATUS_OFFLINE, + DATA_SOURCE_CONNECT_TYPE_STANDARD, + DATA_SOURCE_CONNECT_TYPE_URL, + DATA_SOURCE_CONNECT_TYPE_HOSTS, +} from '@/constants/ds'; + +export declare global { + interface DataSource extends BaseModel { + name?: string; + type?: DataSourceType; + connect_type?: DataSourceConnectType; + status?: DataSourceStatus; + error?: string; + description?: string; + host?: string; + port?: string; + url?: string; + hosts?: string[]; + username?: string; + password?: string; + database?: string; + } + + type DataSourceType = + | DATA_SOURCE_TYPE_MONGO + | DATA_SOURCE_TYPE_MYSQL + | DATA_SOURCE_TYPE_POSTGRESQL + | DATA_SOURCE_TYPE_MSSQL + | DATA_SOURCE_TYPE_SQLITE + | DATA_SOURCE_TYPE_COCKROACHDB + | DATA_SOURCE_TYPE_ELASTICSEARCH + | DATA_SOURCE_TYPE_KAFKA; + + type DataSourceStatus = + | DATA_SOURCE_STATUS_ONLINE + | DATA_SOURCE_STATUS_OFFLINE; + + type DataSourceConnectType = + | DATA_SOURCE_CONNECT_TYPE_STANDARD + | DATA_SOURCE_CONNECT_TYPE_URL + | DATA_SOURCE_CONNECT_TYPE_HOSTS; +} diff --git a/typings/interfaces/models/envDeps.d.ts b/typings/interfaces/models/envDeps.d.ts new file mode 100644 index 0000000000000..9fc0d68e8d08c --- /dev/null +++ b/typings/interfaces/models/envDeps.d.ts @@ -0,0 +1,84 @@ +export declare global { + interface EnvDepsSetting extends BaseModel { + key?: string; + name?: string; + description?: string; + enabled?: string; + cmd?: string; + proxy?: string; + last_update_ts?: string; + } + + interface EnvDepsTask extends BaseModel { + status?: string; + error?: string; + setting_id?: string; + type?: string; + node_id?: string; + action?: string; + dep_names?: string[]; + upgrade?: boolean; + update_ts?: string; + } + + interface EnvDepsDependency extends BaseModel { + node_id?: string; + type?: string; + name?: string; + version?: string; + latest_version?: string; + description?: string; + result?: EnvDepsDependencyResult; + } + + interface EnvDepsDependencyResult { + name?: string; + node_ids?: string[]; + versions?: string[]; + latest_version?: string; + count?: number; + upgradable?: boolean; + downgradable?: boolean; + installable?: boolean; + } + + interface EnvDepsTask extends BaseModel { + status?: string; + error?: string; + setting_id?: string; + type?: string; + node_id?: string; + action?: string; + dep_names?: string[]; + upgrade?: boolean; + update_ts?: string; + } + + interface EnvDepsLog extends BaseModel { + task_id?: string; + content?: string; + update_ts?: string; + } + + interface EnvDepsInstallPayload { + // Names []string `json:"names"` + // Mode string `json:"mode"` + // Upgrade bool `json:"upgrade"` + // NodeIds []primitive.ObjectID `json:"node_ids"` + // UseConfig bool `json:"use_config"` + // SpiderId primitive.ObjectID `json:"spider_id"` + names: string[]; + mode?: string; + upgrade?: boolean; + node_ids?: string[]; + use_config?: boolean; + spider_id?: string; + } + + interface EnvDepsUninstallPayload { + mode?: string; + names?: string[]; + nodes?: CNode[]; + node_ids?: string[]; + } +} diff --git a/typings/interfaces/models/environment.d.ts b/typings/interfaces/models/environment.d.ts new file mode 100644 index 0000000000000..c33192e7fcd78 --- /dev/null +++ b/typings/interfaces/models/environment.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface Environment extends BaseModel { + key?: string; + value?: string; + } +} diff --git a/typings/interfaces/models/export.d.ts b/typings/interfaces/models/export.d.ts new file mode 100644 index 0000000000000..b37160b4c4b94 --- /dev/null +++ b/typings/interfaces/models/export.d.ts @@ -0,0 +1,13 @@ +export declare global { + interface Export { + id?: string; + type?: ExportType; + target?: string; + // filter?: any; + status?: string; + start_ts?: string; + end_ts?: string; + file_name?: string; + download_path?: string; + } +} diff --git a/typings/interfaces/models/git.d.ts b/typings/interfaces/models/git.d.ts new file mode 100644 index 0000000000000..05a94db4ffd8b --- /dev/null +++ b/typings/interfaces/models/git.d.ts @@ -0,0 +1,49 @@ +export declare global { + interface GitChange { + path?: string; + name?: string; + is_dir?: boolean; + staging?: string; + worktree?: string; + extra?: string; + children?: GitChange[]; + } + + interface GitLog { + hash?: string; + msg?: string; + branch?: string; + author_name?: string; + author_email?: string; + timestamp?: string; + refs?: GitRef[]; + } + + interface GitRef { + type?: 'branch' | 'tag'; + name?: string; + full_name?: string; + hash?: string; + timestamp?: string; + remote_track?: string; + } + + interface GitDiff { + current_content?: string; + parent_content?: string; + } + + interface Git extends BaseModel { + url?: string; + name?: string; + auth_type?: string; + username?: string; + password?: string; + current_branch?: string; + status?: GitStatus; + error?: string; + auto_pull?: boolean; + spiders?: Spider[]; + clone_logs?: string[]; + } +} diff --git a/typings/interfaces/models/index.d.ts b/typings/interfaces/models/index.d.ts new file mode 100644 index 0000000000000..293d001f7b19f --- /dev/null +++ b/typings/interfaces/models/index.d.ts @@ -0,0 +1,26 @@ +export declare global { + interface BaseModel { + _id?: string; + + [field: string]: any; + } +} + +export * from './dataCollection'; +export * from './git'; +export * from './node'; +export * from './plugin'; +export * from './project'; +export * from './result'; +export * from './setting'; +export * from './spider'; +export * from './stats'; +export * from './systemInfo'; +export * from './tag'; +export * from './token'; +export * from './metric'; +export * from './range'; +export * from './nav'; +export * from './map'; +export * from './treeNode'; +export * from './user'; diff --git a/typings/interfaces/models/map.d.ts b/typings/interfaces/models/map.d.ts new file mode 100644 index 0000000000000..9b176285d1e7f --- /dev/null +++ b/typings/interfaces/models/map.d.ts @@ -0,0 +1,3 @@ +export declare global { + type StringMap = { [key: string]: string }; +} diff --git a/typings/interfaces/models/metric.d.ts b/typings/interfaces/models/metric.d.ts new file mode 100644 index 0000000000000..a9bb7490d2aad --- /dev/null +++ b/typings/interfaces/models/metric.d.ts @@ -0,0 +1 @@ +export declare global {} diff --git a/typings/interfaces/models/nav.d.ts b/typings/interfaces/models/nav.d.ts new file mode 100644 index 0000000000000..23bf7eb78d5c1 --- /dev/null +++ b/typings/interfaces/models/nav.d.ts @@ -0,0 +1,17 @@ +import { Component } from 'vue'; + +export declare global { + interface NavItem extends TreeNode> { + id: string; + title?: string; + subtitle?: string; + data?: T; + icon?: string[] | string; + tooltip?: string; + emphasis?: boolean; + style?: any; + disabled?: boolean; + badge?: string | number; + badgeType?: BasicType; + } +} diff --git a/typings/interfaces/models/node.d.ts b/typings/interfaces/models/node.d.ts new file mode 100644 index 0000000000000..816fee9575e56 --- /dev/null +++ b/typings/interfaces/models/node.d.ts @@ -0,0 +1,16 @@ +export declare global { + interface CNode extends BaseModel { + name?: string; + ip?: string; + mac?: string; + hostname?: string; + description?: string; + key?: string; + is_master?: boolean; + status?: string; + enabled?: boolean; + active?: boolean; + available_runners?: number; + max_runners?: number; + } +} diff --git a/typings/interfaces/models/notification.d.ts b/typings/interfaces/models/notification.d.ts new file mode 100644 index 0000000000000..a4b0cea692da6 --- /dev/null +++ b/typings/interfaces/models/notification.d.ts @@ -0,0 +1,29 @@ +export declare global { + interface NotificationSetting extends BaseModel { + type?: string; + name?: string; + description?: string; + enabled?: boolean; + global?: boolean; + title?: string; + template?: string; + task_trigger?: string; + mail?: NotificationSettingMail; + mobile?: NotificationSettingMobile; + } + + interface NotificationSettingMail { + server?: string; + port?: string; + user?: string; + password?: string; + sender_email?: string; + sender_identity?: string; + to?: string; + cc?: string; + } + + interface NotificationSettingMobile { + webhook?: string; + } +} diff --git a/typings/interfaces/models/plugin.d.ts b/typings/interfaces/models/plugin.d.ts new file mode 100644 index 0000000000000..0778d31dc694d --- /dev/null +++ b/typings/interfaces/models/plugin.d.ts @@ -0,0 +1,91 @@ +import { + PLUGIN_DEPLOY_MODE_ALL, + PLUGIN_DEPLOY_MODE_MASTER, + PLUGIN_STATUS_ERROR, + PLUGIN_STATUS_RUNNING, + PLUGIN_STATUS_STOPPED, + PLUGIN_INSTALL_TYPE_PUBLIC, + PLUGIN_INSTALL_TYPE_GIT, + PLUGIN_INSTALL_TYPE_LOCAL, +} from '@/constants/plugin'; + +export declare global { + interface CPlugin extends BaseModel { + name?: string; + full_name?: string; + description?: string; + type?: string; + proto?: string; + active?: boolean; + endpoint?: string; + cmd?: string; + event_key?: { + include?: string; + exclude?: string; + }; + install_type?: PluginInstallType; + install_url?: string; + deploy_mode?: PluginDeployMode; + auto_start?: boolean; + ui_components?: PluginUIComponent[]; + ui_sidebar_navs?: MenuItem[]; + ui_assets?: PluginUIAsset[]; + status?: PluginStatus[]; + } + + interface PublicPlugin { + id: number; + name: string; + full_name: string; + description: string; + html_url: string; + pushed_at: string; + created_at: string; + updated_at: string; + owner: { + id: number; + login: string; + html_url: string; + }; + } + + interface PublicPluginInfo { + repo: PublicPlugin; + pluginJson: CPlugin; + readme: string; + } + + interface PluginUIComponent { + name?: string; + title?: string; + src?: string; + type?: string; + path?: string; + parent_paths?: string[]; + children?: PluginUIComponent[]; + } + + interface PluginUIAsset { + path?: string; + type?: string; + } + + type PluginDeployMode = PLUGIN_DEPLOY_MODE_MASTER | PLUGIN_DEPLOY_MODE_ALL; + + interface PluginStatus extends BaseModel { + plugin_id?: string; + node_id?: string; + node?: CNode; + status?: + | PLUGIN_STATUS_STOPPED + | PLUGIN_STATUS_RUNNING + | PLUGIN_STATUS_ERROR; + pid?: number; + error?: string; + } + + type PluginInstallType = + | PLUGIN_INSTALL_TYPE_PUBLIC + | PLUGIN_INSTALL_TYPE_GIT + | PLUGIN_INSTALL_TYPE_LOCAL; +} diff --git a/typings/interfaces/models/project.d.ts b/typings/interfaces/models/project.d.ts new file mode 100644 index 0000000000000..6de0fa1f3bca1 --- /dev/null +++ b/typings/interfaces/models/project.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface Project extends BaseModel { + name?: string; + description?: string; + } +} diff --git a/typings/interfaces/models/result.d.ts b/typings/interfaces/models/result.d.ts new file mode 100644 index 0000000000000..d33bdf70d3a11 --- /dev/null +++ b/typings/interfaces/models/result.d.ts @@ -0,0 +1,5 @@ +export declare global { + interface Result { + [key: string]: any; + } +} diff --git a/typings/interfaces/models/setting.d.ts b/typings/interfaces/models/setting.d.ts new file mode 100644 index 0000000000000..e7a205fe84070 --- /dev/null +++ b/typings/interfaces/models/setting.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface Setting extends BaseModel { + key: string; + value: { [key: string]: any }; + } +} diff --git a/typings/interfaces/models/spider.d.ts b/typings/interfaces/models/spider.d.ts new file mode 100644 index 0000000000000..c613d9227bbd6 --- /dev/null +++ b/typings/interfaces/models/spider.d.ts @@ -0,0 +1,51 @@ +export declare global { + interface Spider extends BaseModel { + name?: string; + display_name?: string; + spider_type?: string; + cmd?: string; + param?: string; + priority?: number; + col_id?: string; + col_name?: string; + data_source_id?: string; + mode?: TaskMode; + node_ids?: string[]; + node_tags?: string[]; + project_id?: string; + project_name?: string; + description?: string; + update_ts?: string; + create_ts?: string; + last_task?: Task; + stat?: SpiderStat; + incremental_sync?: boolean; + auto_install?: boolean; + git_id?: string; + git_root_path?: string; + git?: Git; + } + + interface SpiderStat { + _id: number; + last_task?: Task; + tasks: number; + results: number; + wait_duration: number; + runtime_duration: number; + total_duration: number; + average_wait_duration: number; + average_runtime_duration: number; + average_total_duration: number; + } + + interface SpiderRunOptions { + mode?: string; + node_ids?: string[]; + node_tags?: string[]; + cmd?: string; + param?: string; + schedule_id?: string; + priority?: number; + } +} diff --git a/typings/interfaces/models/stats.d.ts b/typings/interfaces/models/stats.d.ts new file mode 100644 index 0000000000000..020c43cb5887e --- /dev/null +++ b/typings/interfaces/models/stats.d.ts @@ -0,0 +1,7 @@ +import { Dayjs } from 'dayjs'; + +export declare global { + interface StatsResult extends Result { + date?: string | number; + } +} diff --git a/typings/interfaces/models/systemInfo.d.ts b/typings/interfaces/models/systemInfo.d.ts new file mode 100644 index 0000000000000..73af8bceb8d3e --- /dev/null +++ b/typings/interfaces/models/systemInfo.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface SystemInfo { + edition?: string; + version?: string; + } +} diff --git a/typings/interfaces/models/token.d.ts b/typings/interfaces/models/token.d.ts new file mode 100644 index 0000000000000..8cbe91a9e773a --- /dev/null +++ b/typings/interfaces/models/token.d.ts @@ -0,0 +1,7 @@ +export declare global { + interface Token extends BaseModel { + name?: string; + token?: string; + _visible?: boolean; + } +} diff --git a/typings/interfaces/models/treeNode.d.ts b/typings/interfaces/models/treeNode.d.ts new file mode 100644 index 0000000000000..0abb6e8939267 --- /dev/null +++ b/typings/interfaces/models/treeNode.d.ts @@ -0,0 +1,5 @@ +interface TreeNode { + label?: string; + value?: any; + children?: T[]; +} diff --git a/typings/interfaces/models/user.d.ts b/typings/interfaces/models/user.d.ts new file mode 100644 index 0000000000000..5f6d2b94ec71d --- /dev/null +++ b/typings/interfaces/models/user.d.ts @@ -0,0 +1,9 @@ +export declare global { + interface User { + _id?: string; + username?: string; + password?: string; + role?: string; + email?: string; + } +} diff --git a/typings/interfaces/package/create-app.d.ts b/typings/interfaces/package/create-app.d.ts new file mode 100644 index 0000000000000..1853ce37b5b75 --- /dev/null +++ b/typings/interfaces/package/create-app.d.ts @@ -0,0 +1,25 @@ +import { RouteRecordRaw } from 'vue-router'; +import { Store } from 'vuex'; + +export declare global { + interface CreateAppOptions { + initBaiduTongji?: boolean; + initClarity?: boolean; + initDemo?: boolean; + loadStore?: boolean; + loadRouter?: boolean; + loadElementPlus?: boolean; + loadCrawlabUI?: boolean; + loadI18n?: boolean; + loadFontAwesome?: boolean; + loadLocate?: boolean; + loadAuth?: boolean; + loadExport?: boolean; + mount?: boolean | string; + store?: Store; + rootRoutes?: Array; + routes?: Array; + allRoutes?: Array; + createRouterOptions?: CreateRouterOptions; + } +} diff --git a/typings/interfaces/package/index.d.ts b/typings/interfaces/package/index.d.ts new file mode 100644 index 0000000000000..5ee5b693be80c --- /dev/null +++ b/typings/interfaces/package/index.d.ts @@ -0,0 +1 @@ +export * from './create-app'; diff --git a/typings/interfaces/router/auth.d.ts b/typings/interfaces/router/auth.d.ts new file mode 100644 index 0000000000000..1630bc87661d5 --- /dev/null +++ b/typings/interfaces/router/auth.d.ts @@ -0,0 +1,18 @@ +import { RouteLocationNormalized } from 'vue-router'; + +export declare global { + interface RouterAuthOptions { + beforeEachFn?: ( + to?: RouteLocationNormalized, + from?: RouteLocationNormalized + ) => void; + afterEachFn?: ( + to?: RouteLocationNormalized, + from?: RouteLocationNormalized + ) => void; + validateFn?: ( + to: RouteLocationNormalized, + from?: RouteLocationNormalized + ) => boolean; + } +} diff --git a/typings/interfaces/router/index.d.ts b/typings/interfaces/router/index.d.ts new file mode 100644 index 0000000000000..5769bc6340d1e --- /dev/null +++ b/typings/interfaces/router/index.d.ts @@ -0,0 +1,8 @@ +export declare global { + interface CreateRouterOptions { + routerAuth?: RouterAuthOptions; + routerStats?: RouterStatsOptions; + } +} + +export * from './auth'; diff --git a/typings/interfaces/router/stats.d.ts b/typings/interfaces/router/stats.d.ts new file mode 100644 index 0000000000000..55a57bde39774 --- /dev/null +++ b/typings/interfaces/router/stats.d.ts @@ -0,0 +1,6 @@ +export declare global { + interface RouterStatsOptions { + beforeEachFn?: Function; + afterEachFn?: Function; + } +} diff --git a/typings/interfaces/services/file.d.ts b/typings/interfaces/services/file.d.ts new file mode 100644 index 0000000000000..0427237aac4c7 --- /dev/null +++ b/typings/interfaces/services/file.d.ts @@ -0,0 +1,23 @@ +interface FileServices extends Services { + listDir: ( + id: string, + path: string + ) => Promise>; + listRootDir: (id: string) => Promise>; + getFile: (id: string, path: string) => Promise>; + getFileInfo: ( + id: string, + path: string + ) => Promise>; + saveFile: (id: string, path: string, data: string) => Promise; + saveFileBinary: (id: string, path: string, file: File) => Promise; + saveFilesBinary: ( + id: string, + files: { path: string; file: File }[], + targetDirectory?: string + ) => Promise; + saveDir: (id: string, path: string) => Promise; + renameFile: (id: string, path: string, new_path: string) => Promise; + deleteFile: (id: string, path: string) => Promise; + copyFile: (id: string, path: string, new_path: string) => Promise; +} diff --git a/typings/interfaces/services/git.d.ts b/typings/interfaces/services/git.d.ts new file mode 100644 index 0000000000000..a58390d6ddffa --- /dev/null +++ b/typings/interfaces/services/git.d.ts @@ -0,0 +1,3 @@ +export declare global { + type GitServices = FileServices; +} diff --git a/typings/interfaces/services/index.d.ts b/typings/interfaces/services/index.d.ts new file mode 100644 index 0000000000000..916ca70a60e2d --- /dev/null +++ b/typings/interfaces/services/index.d.ts @@ -0,0 +1,17 @@ +export declare global { + interface Services { + getById: (id: string) => Promise>; + create: (form: T) => Promise>; + updateById: (id: string, form: T) => Promise>; + deleteById: (id: string) => Promise; + getList: (params?: ListRequestParams) => Promise>; + getAll: () => Promise>; + createList: (data: T[]) => Promise>; + updateList: (ids: string[], data: T, fields: string[]) => Promise; + deleteList: (ids: string[]) => Promise; + } +} + +export * from './request'; +export * from './spider'; +export * from './git'; diff --git a/typings/interfaces/services/request.d.ts b/typings/interfaces/services/request.d.ts new file mode 100644 index 0000000000000..a3e567777fcf4 --- /dev/null +++ b/typings/interfaces/services/request.d.ts @@ -0,0 +1,51 @@ +export declare global { + interface ListRequestParams { + page?: number; + size?: number; + conditions?: FilterConditionData[] | string; + all?: boolean | string | number; + } + + interface BatchRequestPayload { + ids: string[]; + } + + interface BatchRequestPayloadWithData extends BatchRequestPayload { + data: T; + fields: string[]; + } + + type BatchRequestPayloadWithJsonStringData = + BatchRequestPayloadWithData; + + interface FileRequestPayload { + id?: string; + path?: string; + new_path?: string; + data?: string; + file?: File; + } + + interface SaveFilesRequestPayload { + id: string; + files: { path: string; file: File }[]; + targetDirectory?: string; + } + + interface Response { + status: string; + message: string; + error?: string; + } + + type HttpResponse = Response; + + interface ResponseWithData extends Response { + data?: T; + } + + interface ResponseWithListData extends ResponseWithData { + data?: T[]; + total: number; + } +} diff --git a/typings/interfaces/services/spider.d.ts b/typings/interfaces/services/spider.d.ts new file mode 100644 index 0000000000000..c565909bad548 --- /dev/null +++ b/typings/interfaces/services/spider.d.ts @@ -0,0 +1,3 @@ +export declare global { + type SpiderServices = FileServices; +} diff --git a/typings/interfaces/static.d.ts b/typings/interfaces/static.d.ts new file mode 100644 index 0000000000000..2da6178d63dcf --- /dev/null +++ b/typings/interfaces/static.d.ts @@ -0,0 +1,5 @@ +declare module '*.js'; +declare module '*.jpg'; +declare module '*.png'; +declare module '*.svg'; +declare module '*.css'; diff --git a/typings/interfaces/store/index.d.ts b/typings/interfaces/store/index.d.ts new file mode 100644 index 0000000000000..59c42f7535515 --- /dev/null +++ b/typings/interfaces/store/index.d.ts @@ -0,0 +1,207 @@ +import { + ActionContext, + ActionTree, + GetterTree, + Module, + MutationTree, + Store, +} from 'vuex'; + +export declare global { + interface RootStoreState { + common: CommonStoreState; + layout: LayoutStoreState; + node: NodeStoreState; + project: ProjectStoreState; + spider: SpiderStoreState; + task: TaskStoreState; + file: FileStoreState; + dataCollection: DataCollectionStoreState; + schedule: ScheduleStoreState; + user: UserStoreState; + token: TokenStoreState; + plugin: PluginStoreState; + git: GitStoreState; + notification: NotificationStoreState; + ds: DataSourceStoreState; + environment: EnvironmentStoreState; + system: SystemStoreState; + } + + type StoreGetter = ( + state: S, + getters: GetterTree, + rootState: R, + rootGetters: any + ) => T; + + type StoreMutation = (state: S, payload: P) => void; + + type StoreActionHandler = ( + this: Store, + ctx: ActionContext, + payload?: P + ) => T; + + interface StoreActionObject { + root?: boolean; + handler: StoreActionHandler; + } + + type StoreAction = + | StoreActionHandler + | StoreActionObject; + + interface BaseModule + extends Module { + getters: G; + mutations: M; + actions: A; + } + + interface BaseStoreState { + ns: StoreNamespace; + dialogVisible: DialogVisible; + activeDialogKey: DialogKey | undefined; + form: T; + isSelectiveForm: boolean; + selectedFormFields: string[]; + readonlyFormFields: string[]; + formList: T[]; + newFormFn: DefaultFormFunc; + confirmLoading: boolean; + tableData: TableData; + tableTotal: number; + tablePagination: TablePagination; + tableListFilter: FilterConditionData[]; + tableListSort: SortData[]; + allList: T[]; + sidebarCollapsed: boolean; + actionsCollapsed: boolean; + tabs: NavItem[]; + disabledTabKeys: string[]; + afterSave: (() => Promise)[]; + } + + interface BaseStoreGetters + extends GetterTree { + dialogVisible: StoreGetter; + formListIds: StoreGetter; + allListSelectOptions: StoreGetter; + allDict: StoreGetter>; + } + + interface BaseStoreMutations + extends MutationTree> { + showDialog: StoreMutation, DialogKey>; + hideDialog: StoreMutation>; + setForm: StoreMutation, T>; + resetForm: StoreMutation>; + setIsSelectiveForm: StoreMutation, boolean>; + setSelectedFormFields: StoreMutation, string[]>; + resetSelectedFormFields: StoreMutation>; + setReadonlyFormFields: StoreMutation, string[]>; + resetReadonlyFormFields: StoreMutation>; + setFormList: StoreMutation, T[]>; + resetFormList: StoreMutation>; + setConfirmLoading: StoreMutation, boolean>; + setTableData: StoreMutation, TableDataWithTotal>; + resetTableData: StoreMutation>; + setTablePagination: StoreMutation, TablePagination>; + resetTablePagination: StoreMutation>; + setTableListFilter: StoreMutation, FilterConditionData[]>; + resetTableListFilter: StoreMutation>; + setTableListFilterByKey: StoreMutation< + BaseStoreState, + { key: string; conditions: FilterConditionData[] } + >; + resetTableListFilterByKey: StoreMutation, string>; + setTableListSort: StoreMutation, SortData[]>; + resetTableListSort: StoreMutation>; + setTableListSortByKey: StoreMutation< + BaseStoreState, + { key: string; sort: SortData } + >; + resetTableListSortByKey: StoreMutation, string>; + setAllList: StoreMutation, T[]>; + resetAllList: StoreMutation>; + expandSidebar: StoreMutation>; + collapseSidebar: StoreMutation>; + expandActions: StoreMutation>; + collapseActions: StoreMutation>; + setTabs: StoreMutation; + setDisabledTabKeys: StoreMutation; + resetDisabledTabKeys: StoreMutation; + setAfterSave: StoreMutation, (() => Promise)[]>; + } + + interface BaseStoreActions + extends ActionTree, R> { + getById: StoreAction, string>; + create: StoreAction, T>; + updateById: StoreAction, { id: string; form: T }>; + deleteById: StoreAction, string>; + getList: StoreAction>; + getListWithParams: StoreAction, ListRequestParams>; + getAllList: StoreAction>; + createList: StoreAction, T[]>; + updateList: StoreAction, BatchRequestPayloadWithData>; + deleteList: StoreAction, BatchRequestPayload>; + } + + type StoreActionContext< + S = BaseStoreState, + R = RootStoreState, + > = ActionContext; + + type StoreNamespace = + | 'layout' + | 'node' + | 'project' + | 'spider' + | 'task' + | 'schedule' + | 'file' + | 'tag' + | 'dataCollection' + | 'user' + | 'token' + | 'plugin' + | 'git' + | 'notification' + | 'ds' + | 'environment'; + type ListStoreNamespace = + | 'node' + | 'project' + | 'spider' + | 'task' + | 'tag' + | 'dataCollection' + | 'schedule' + | 'user' + | 'token' + | 'plugin' + | 'git' + | 'notification' + | 'ds' + | 'environment'; + + interface StoreContext { + namespace: StoreNamespace; + store: Store; + state: BaseStoreState; + } + + interface ListStoreContext extends StoreContext { + namespace: ListStoreNamespace; + state: R[ListStoreNamespace]; + } + + type DetailStoreContext = ListStoreContext; + + interface GetDefaultStoreGettersOptions { + selectOptionValueKey?: string; + selectOptionLabelKey?: string; + } +} diff --git a/typings/interfaces/store/modules/common.d.ts b/typings/interfaces/store/modules/common.d.ts new file mode 100644 index 0000000000000..716fd588f9f6b --- /dev/null +++ b/typings/interfaces/store/modules/common.d.ts @@ -0,0 +1,29 @@ +import { Module, GetterTree, MutationTree, ActionTree } from 'vuex'; + +declare global { + interface CommonStoreModule extends Module { + getters: CommonStoreGetters; + mutations: CommonStoreMutations; + actions: CommonStoreActions; + } + + interface CommonStoreState { + lang?: Lang; + systemInfo?: SystemInfo; + } + + interface CommonStoreGetters + extends GetterTree { + isPro: StoreGetter; + } + + interface CommonStoreMutations extends MutationTree { + setLang: StoreMutation; + setSystemInfo: StoreMutation; + } + + interface CommonStoreActions + extends ActionTree { + getSystemInfo: StoreAction; + } +} diff --git a/typings/interfaces/store/modules/dataCollection.d.ts b/typings/interfaces/store/modules/dataCollection.d.ts new file mode 100644 index 0000000000000..181a5a5642c7c --- /dev/null +++ b/typings/interfaces/store/modules/dataCollection.d.ts @@ -0,0 +1,57 @@ +type DataCollectionStoreModule = BaseModule< + DataCollectionStoreState, + DataCollectionStoreGetters, + DataCollectionStoreMutations, + DataCollectionStoreActions +>; + +interface DataCollectionStoreState extends BaseStoreState { + resultTableData: TableData; + resultTableTotal: number; + resultTablePagination: TablePagination; + resultTableFilter: FilterConditionData[]; + resultDialogVisible: boolean; + resultDialogContent: any; + resultDialogType?: DataFieldType; + resultDialogKey: string; + dedupFieldsDialogVisible: boolean; +} + +interface DataCollectionStoreGetters + extends BaseStoreGetters { + resultFields: StoreGetter; +} + +interface DataCollectionStoreMutations + extends BaseStoreMutations { + setResultTableData: StoreMutation< + DataCollectionStoreState, + TableDataWithTotal + >; + resetResultTableData: StoreMutation; + setResultTablePagination: StoreMutation< + DataCollectionStoreState, + TablePagination + >; + resetResultTablePagination: StoreMutation; + setResultTableFilter: StoreMutation< + DataCollectionStoreState, + FilterConditionData[] + >; + resetResultTableFilter: StoreMutation; + setResultDialogVisible: StoreMutation; + setResultDialogContent: StoreMutation; + resetResultDialogContent: StoreMutation; + setResultDialogType: StoreMutation; + resetResultDialogType: StoreMutation; + setResultDialogKey: StoreMutation; + resetResultDialogKey: StoreMutation; + setDedupFieldsDialogVisible: StoreMutation; +} + +interface DataCollectionStoreActions extends BaseStoreActions { + getResultData: StoreAction< + DataCollectionStoreState, + { string; ListRequestParams } + >; +} diff --git a/typings/interfaces/store/modules/ds.d.ts b/typings/interfaces/store/modules/ds.d.ts new file mode 100644 index 0000000000000..53b018bc20c9a --- /dev/null +++ b/typings/interfaces/store/modules/ds.d.ts @@ -0,0 +1,21 @@ +export declare global { + type DataSourceStoreModule = BaseModule< + DataSourceStoreState, + DataSourceStoreGetters, + DataSourceStoreMutations, + DataSourceStoreActions + >; + + type DataSourceStoreState = BaseStoreState; + + type DataSourceStoreGetters = BaseStoreGetters; + + type DataSourceStoreMutations = BaseStoreMutations; + + interface DataSourceStoreActions extends BaseStoreActions { + changePassword: StoreAction< + DataSourceStoreState, + { id: string; password: string } + >; + } +} diff --git a/typings/interfaces/store/modules/environment.d.ts b/typings/interfaces/store/modules/environment.d.ts new file mode 100644 index 0000000000000..39627e4163b20 --- /dev/null +++ b/typings/interfaces/store/modules/environment.d.ts @@ -0,0 +1,16 @@ +export declare global { + type EnvironmentStoreModule = BaseModule< + EnvironmentStoreState, + EnvironmentStoreGetters, + EnvironmentStoreMutations, + EnvironmentStoreActions + >; + + type EnvironmentStoreState = BaseStoreState; + + type EnvironmentStoreGetters = BaseStoreGetters; + + type EnvironmentStoreMutations = BaseStoreMutations; + + type EnvironmentStoreActions = BaseStoreActions; +} diff --git a/typings/interfaces/store/modules/file.d.ts b/typings/interfaces/store/modules/file.d.ts new file mode 100644 index 0000000000000..a204879bd5b5f --- /dev/null +++ b/typings/interfaces/store/modules/file.d.ts @@ -0,0 +1,23 @@ +import { Module, MutationTree } from 'vuex'; + +declare global { + interface FileStoreModule extends Module { + mutations: FileStoreMutations; + } + + interface FileStoreState { + editorOptions: FileEditorOptions; + editorSettingsDialogVisible: boolean; + editorCreateWithAiDialogVisible: boolean; + editorFileNavItem?: FileNavItem; + } + + interface FileStoreMutations extends MutationTree { + setEditorOptions: StoreMutation; + resetEditorOptions: StoreMutation; + setEditorSettingsDialogVisible: StoreMutation; + setEditorCreateWithAiDialogVisible: StoreMutation; + resetEditorFileNavItem: StoreMutation; + setEditorFileNavItem: StoreMutation; + } +} diff --git a/typings/interfaces/store/modules/git.d.ts b/typings/interfaces/store/modules/git.d.ts new file mode 100644 index 0000000000000..bdaa8915dd279 --- /dev/null +++ b/typings/interfaces/store/modules/git.d.ts @@ -0,0 +1,83 @@ +type GitStoreModule = BaseModule< + GitStoreState, + GitStoreGetters, + GitStoreMutations, + GitStoreActions +>; + +interface GitStoreState extends BaseStoreState, BaseFileStoreState { + activeDialogKey?: DialogKey | 'createBranch'; + gitChangeSelection: TableData; + gitRemoteRefs: GitRef[]; + currentBranch?: GitRef; + gitBranches: GitRef[]; + gitRemoteBranches: GitRef[]; + gitChanges: GitChange[]; + gitLogs: GitLog[]; + gitDiff: GitDiff; + activeFilePath?: string; +} + +interface GitStoreGetters extends BaseStoreGetters { + gitBranchSelectOptions: StoreGetter; + + [key: string]: any; +} + +interface GitStoreMutations + extends BaseStoreMutations, + BaseFileStoreMutations { + setGitChangeSelection: StoreMutation; + resetGitChangeSelection: StoreMutation; + setGitRemoteRefs: StoreMutation; + resetGitRemoteRefs: StoreMutation; + setCurrentBranch: StoreMutation; + resetCurrentBranch: StoreMutation; + setGitBranches: StoreMutation; + resetGitBranches: StoreMutation; + setGitRemoteBranches: StoreMutation; + resetGitRemoteBranches: StoreMutation; + setGitChanges: StoreMutation; + resetGitChanges: StoreMutation; + setGitLogs: StoreMutation; + resetGitLogs: StoreMutation; + setGitDiff: StoreMutation; + resetGitDiff: StoreMutation; + setActiveFilePath: StoreMutation; + resetActiveFilePath: StoreMutation; +} + +interface GitStoreActions + extends BaseStoreActions, + BaseFileStoreActions { + cloneGit: StoreAction; + getGitRemoteRefs: StoreAction; + getCurrentBranch: StoreAction; + getBranches: StoreAction; + getRemoteBranches: StoreAction; + newBranch: StoreAction< + GitStoreState, + { id: string; sourceBranch: string; targetBranch: string } + >; + deleteBranch: StoreAction; + checkoutBranch: StoreAction; + checkoutRemoteBranch: StoreAction< + GitStoreState, + { id: string; branch: string } + >; + getChanges: StoreAction; + addChanges: StoreAction; + deleteChanges: StoreAction< + GitStoreState, + { id: string; changes: GitChange[] } + >; + commit: StoreAction; + pull: StoreAction; + push: StoreAction; + getLogs: StoreAction; + gitCheckoutTag: StoreAction; + gitPull: StoreAction; + gitCommit: StoreAction; + createSpider: StoreAction; + getFileDiff: StoreAction; +} diff --git a/typings/interfaces/store/modules/layout.d.ts b/typings/interfaces/store/modules/layout.d.ts new file mode 100644 index 0000000000000..69cdb05579df2 --- /dev/null +++ b/typings/interfaces/store/modules/layout.d.ts @@ -0,0 +1,64 @@ +import { GetterTree, Module, MutationTree } from 'vuex'; + +declare global { + interface LayoutStoreModule extends Module { + getters: LayoutStoreGetters; + mutations: LayoutStoreMutations; + } + + interface LayoutStoreState { + // sidebar + sidebarCollapsed: boolean; + menuItems: MenuItem[]; + + // tabs view + maxTabId: number; + tabs: Tab[]; + activeTabId?: number; + draggingTab?: Tab; + targetTab?: Tab; + isTabsDragging: boolean; + + // nav + navVisibleFn: (path: string) => boolean; + + // detail + detailTabVisibleFn: (ns: StoreNamespace, item: NavItem) => boolean; + + // action + actionVisibleFn: (target: string, action: string) => boolean; + } + + interface LayoutStoreGetters + extends GetterTree { + tabs: StoreGetter; + activeTab: StoreGetter; + sidebarMenuItems: StoreGetter; + normalizedMenuItems: StoreGetter; + } + + interface LayoutStoreMutations extends MutationTree { + setMenuItems: StoreMutation; + setSideBarCollapsed: StoreMutation; + setTabs: StoreMutation; + setActiveTabId: StoreMutation; + addTab: StoreMutation; + updateTab: StoreMutation; + removeTab: StoreMutation; + removeAllTabs: StoreMutation; + setDraggingTab: StoreMutation; + resetDraggingTab: StoreMutation; + setTargetTab: StoreMutation; + resetTargetTab: StoreMutation; + setIsTabsDragging: StoreMutation; + setNavVisibleFn: StoreMutation boolean>; + setDetailTabVisibleFn: StoreMutation< + LayoutStoreState, + (ns: StoreNamespace, tab: NavItem) => boolean + >; + setActionVisibleFn: StoreMutation< + LayoutStoreState, + (target: string, action: string) => boolean + >; + } +} diff --git a/typings/interfaces/store/modules/node.d.ts b/typings/interfaces/store/modules/node.d.ts new file mode 100644 index 0000000000000..0a4d44e0328f0 --- /dev/null +++ b/typings/interfaces/store/modules/node.d.ts @@ -0,0 +1,17 @@ +type NodeStoreModule = BaseModule< + NodeStoreState, + NodeStoreGetters, + NodeStoreMutations, + NodeStoreActions +>; + +type NodeStoreState = BaseStoreState; + +type NodeStoreGetters = BaseStoreGetters; + +interface NodeStoreMutations extends BaseStoreMutations { + setAllNodeSelectOptions: StoreMutation, SelectOption[]>; + setAllNodeTags: StoreMutation, string[]>; +} + +type NodeStoreActions = BaseStoreActions; diff --git a/typings/interfaces/store/modules/notification.d.ts b/typings/interfaces/store/modules/notification.d.ts new file mode 100644 index 0000000000000..05a78ca40bcef --- /dev/null +++ b/typings/interfaces/store/modules/notification.d.ts @@ -0,0 +1,27 @@ +type NotificationStoreModule = BaseModule< + NotificationStoreState, + NotificationStoreGetters, + NotificationStoreMutations, + NotificationStoreActions +>; + +interface NotificationStoreState extends BaseStoreState { + triggersList: string[]; +} + +type NotificationStoreGetters = BaseStoreGetters; + +interface NotificationStoreMutations + extends BaseStoreMutations { + setTriggersList: StoreMutation; + resetTriggersList: StoreMutation; + setTriggersEnabled: StoreMutation; + resetTriggersEnabled: StoreMutation; + setTemplateTitle: StoreMutation; + resetTemplateTitle: StoreMutation; + setTemplateContent: StoreMutation; + resetTemplateContent: StoreMutation; +} + +interface NotificationStoreActions + extends BaseStoreActions {} diff --git a/typings/interfaces/store/modules/plugin.d.ts b/typings/interfaces/store/modules/plugin.d.ts new file mode 100644 index 0000000000000..e96468f860520 --- /dev/null +++ b/typings/interfaces/store/modules/plugin.d.ts @@ -0,0 +1,36 @@ +type PluginStoreModule = BaseModule< + PluginStoreState, + PluginStoreGetters, + PluginStoreMutations, + PluginStoreActions +>; + +interface PluginStoreState extends BaseStoreState { + settings: Setting; + publicPlugins: PublicPlugin[]; + activePublicPlugin?: PublicPlugin; + activePublicPluginInfo?: PublicPluginInfo; + installType: string; +} + +type PluginStoreGetters = BaseStoreGetters; + +interface PluginStoreMutations extends BaseStoreMutations { + setSettings: StoreMutation; + setSettingsByKey: StoreMutation; + setPublicPlugins: StoreMutation; + resetPublicPlugins: StoreMutation; + setActivePublicPlugin: StoreMutation; + resetActivePublicPlugin: StoreMutation; + setActivePublicPluginInfo: StoreMutation; + resetActivePublicPluginInfo: StoreMutation; + setInstallType: StoreMutation; + resetInstallType: StoreMutation; +} + +interface PluginStoreActions extends BaseStoreActions { + getSettings: StoreAction; + saveSettings: StoreAction; + getPublicPluginList: StoreAction; + getPublicPluginInfo: StoreAction; +} diff --git a/typings/interfaces/store/modules/project.d.ts b/typings/interfaces/store/modules/project.d.ts new file mode 100644 index 0000000000000..ae7623dd7d92c --- /dev/null +++ b/typings/interfaces/store/modules/project.d.ts @@ -0,0 +1,23 @@ +type ProjectStoreModule = BaseModule< + ProjectStoreState, + ProjectStoreGetters, + ProjectStoreMutations, + ProjectStoreActions +>; + +interface ProjectStoreState extends BaseStoreState { + allProjectSelectOptions: SelectOption[]; + allProjectTags: string[]; +} + +type ProjectStoreGetters = BaseStoreGetters; + +interface ProjectStoreMutations extends BaseStoreMutations { + setAllProjectSelectOptions: StoreMutation; + setAllProjectTags: StoreMutation; +} + +interface ProjectStoreActions extends BaseStoreActions { + getAllProjectSelectOptions: StoreAction; + getAllProjectTags: StoreAction; +} diff --git a/typings/interfaces/store/modules/schedule.d.ts b/typings/interfaces/store/modules/schedule.d.ts new file mode 100644 index 0000000000000..7aab465c33d13 --- /dev/null +++ b/typings/interfaces/store/modules/schedule.d.ts @@ -0,0 +1,17 @@ +type ScheduleStoreModule = BaseModule< + ScheduleStoreState, + ScheduleStoreGetters, + ScheduleStoreMutations, + ScheduleStoreActions +>; + +type ScheduleStoreState = BaseStoreState; + +type ScheduleStoreGetters = BaseStoreGetters; + +type ScheduleStoreMutations = BaseStoreMutations; + +interface ScheduleStoreActions extends BaseStoreActions { + enable: StoreAction; + disable: StoreAction; +} diff --git a/typings/interfaces/store/modules/spider.d.ts b/typings/interfaces/store/modules/spider.d.ts new file mode 100644 index 0000000000000..6d9cf17b0b6f1 --- /dev/null +++ b/typings/interfaces/store/modules/spider.d.ts @@ -0,0 +1,27 @@ +type SpiderStoreModule = BaseModule< + SpiderStoreState, + SpiderStoreGetters, + SpiderStoreMutations, + SpiderStoreActions +>; + +interface SpiderStoreState extends BaseStoreState, BaseFileStoreState { + dataDisplayAllFields: boolean; +} + +type SpiderStoreGetters = BaseStoreGetters; + +interface SpiderStoreMutations + extends BaseStoreMutations, + BaseFileStoreMutations { + setDataDisplayAllFields: StoreMutation; +} + +interface SpiderStoreActions + extends BaseStoreActions, + BaseFileStoreActions { + runById: StoreAction< + SpiderStoreState, + { id: string; options: SpiderRunOptions } + >; +} diff --git a/typings/interfaces/store/modules/system.d.ts b/typings/interfaces/store/modules/system.d.ts new file mode 100644 index 0000000000000..ba03fa52890ea --- /dev/null +++ b/typings/interfaces/store/modules/system.d.ts @@ -0,0 +1,25 @@ +import { GetterTree, Module, MutationTree } from 'vuex'; + +declare global { + interface SystemStoreModule extends Module { + getters: SystemStoreGetters; + mutations: SystemStoreMutations; + actions: SystemStoreActions; + } + + interface SystemStoreState { + siteTitle: Setting; + } + + interface SystemStoreGetters + extends GetterTree {} + + interface SystemStoreMutations extends MutationTree { + setSiteTitle: StoreMutation; + } + + interface SystemStoreActions extends BaseStoreActions { + getSiteTitle: StoreAction; + saveSiteTitle: StoreAction; + } +} diff --git a/typings/interfaces/store/modules/tag.d.ts b/typings/interfaces/store/modules/tag.d.ts new file mode 100644 index 0000000000000..d8f7563cd08cf --- /dev/null +++ b/typings/interfaces/store/modules/tag.d.ts @@ -0,0 +1,17 @@ +type TagStoreModule = BaseModule< + TagStoreState, + TagStoreGetters, + TagStoreMutations, + TagStoreActions +>; + +type TagStoreState = BaseStoreState; + +type TagStoreGetters = BaseStoreGetters; + +interface TagStoreMutations extends BaseStoreMutations { + setAllTagSelectOptions: StoreMutation, SelectOption[]>; + setAllTagTags: StoreMutation, string[]>; +} + +type TagStoreActions = BaseStoreActions; diff --git a/typings/interfaces/store/modules/task.d.ts b/typings/interfaces/store/modules/task.d.ts new file mode 100644 index 0000000000000..a52fa6767da17 --- /dev/null +++ b/typings/interfaces/store/modules/task.d.ts @@ -0,0 +1,32 @@ +type TaskStoreModule = BaseModule< + TaskStoreState, + TaskStoreGetters, + TaskStoreMutations, + TaskStoreActions +>; + +interface TaskStoreState extends BaseStoreState { + logContent: string; + logPagination: TablePagination; + logTotal: number; + logAutoUpdate: boolean; + dataDisplayAllFields: boolean; +} + +interface TaskStoreGetters extends BaseStoreGetters {} + +interface TaskStoreMutations extends BaseStoreMutations { + setLogContent: StoreMutation; + resetLogContent: StoreMutation; + setLogPagination: StoreMutation; + resetLogPagination: StoreMutation; + setLogTotal: StoreMutation; + resetLogTotal: StoreMutation; + enableLogAutoUpdate: StoreMutation; + disableLogAutoUpdate: StoreMutation; + setDataDisplayAllFields: StoreMutation; +} + +interface TaskStoreActions extends BaseStoreActions { + getLogs: StoreAction; +} diff --git a/typings/interfaces/store/modules/token.d.ts b/typings/interfaces/store/modules/token.d.ts new file mode 100644 index 0000000000000..e9fda802997b3 --- /dev/null +++ b/typings/interfaces/store/modules/token.d.ts @@ -0,0 +1,14 @@ +type TokenStoreModule = BaseModule< + TokenStoreState, + TokenStoreGetters, + TokenStoreMutations, + TokenStoreActions +>; + +type TokenStoreState = BaseStoreState; + +type TokenStoreGetters = BaseStoreGetters; + +type TokenStoreMutations = BaseStoreMutations; + +type TokenStoreActions = BaseStoreActions; diff --git a/typings/interfaces/store/modules/user.d.ts b/typings/interfaces/store/modules/user.d.ts new file mode 100644 index 0000000000000..c9b761c86c5b9 --- /dev/null +++ b/typings/interfaces/store/modules/user.d.ts @@ -0,0 +1,25 @@ +type UserStoreModule = BaseModule< + UserStoreState, + UserStoreGetters, + UserStoreMutations, + UserStoreActions +>; + +interface UserStoreState extends BaseStoreState { + me?: User; +} + +interface UserStoreGetters extends BaseStoreGetters { + me: StoreGetter; +} + +interface UserStoreMutations extends BaseStoreMutations { + setMe: StoreMutation; + resetMe: StoreMutation; +} + +interface UserStoreActions extends BaseStoreActions { + changePassword: StoreAction; + getMe: StoreAction; + putMe: StoreAction; +} diff --git a/typings/interfaces/store/utils/file.d.ts b/typings/interfaces/store/utils/file.d.ts new file mode 100644 index 0000000000000..936523a2c4d3c --- /dev/null +++ b/typings/interfaces/store/utils/file.d.ts @@ -0,0 +1,31 @@ +interface BaseFileStoreState { + fileNavItems: FileNavItem[]; + activeNavItem?: FileNavItem; + fileContent: string; + defaultFilePaths: string[]; +} + +interface BaseFileStoreMutations { + setFileNavItems: StoreMutation; + resetFileNavItems: StoreMutation; + setActiveFileNavItem: StoreMutation; + resetActiveFileNavItem: StoreMutation; + setFileContent: StoreMutation; + resetFileContent: StoreMutation; + setDefaultFilePaths: StoreMutation; + resetDefaultFilePaths: StoreMutation; +} + +interface BaseFileStoreActions { + listDir: StoreAction; + getFile: StoreAction; + getFileInfo: StoreAction; + saveFile: StoreAction; + saveFileBinary: StoreAction; + saveFilesBinary: StoreAction; + saveDir: StoreAction; + renameFile: StoreAction; + deleteFile: StoreAction; + copyFile: StoreAction; + exportFiles: StoreAction; +} diff --git a/typings/interfaces/views/dataSource.d.ts b/typings/interfaces/views/dataSource.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/views/git.d.ts b/typings/interfaces/views/git.d.ts new file mode 100644 index 0000000000000..b925d30b121c6 --- /dev/null +++ b/typings/interfaces/views/git.d.ts @@ -0,0 +1,18 @@ +import { + GIT_STATUS_PENDING, + GIT_STATUS_CLONING, + GIT_STATUS_READY, + GIT_STATUS_ERROR, + GIT_STATUS_PULLING, + GIT_STATUS_PUSHING, +} from '@/constants/git'; + +declare global { + type GitStatus = + | GIT_STATUS_PENDING + | GIT_STATUS_CLONING + | GIT_STATUS_READY + | GIT_STATUS_ERROR + | GIT_STATUS_PULLING + | GIT_STATUS_PUSHING; +} diff --git a/typings/interfaces/views/index.d.ts b/typings/interfaces/views/index.d.ts new file mode 100644 index 0000000000000..73da98bac26e8 --- /dev/null +++ b/typings/interfaces/views/index.d.ts @@ -0,0 +1,10 @@ +export * from './dataSource'; +export * from './git'; +export * from './login'; +export * from './node'; +export * from './project'; +export * from './result'; +export * from './schedule'; +export * from './spider'; +export * from './task'; +export * from './user'; diff --git a/typings/interfaces/views/login.d.ts b/typings/interfaces/views/login.d.ts new file mode 100644 index 0000000000000..fb98b48ae0165 --- /dev/null +++ b/typings/interfaces/views/login.d.ts @@ -0,0 +1,12 @@ +interface LoginForm { + username: string; + password: string; + confirmPassword?: string; + email?: string; +} + +interface LoginRules { + username: ElFormRule[]; + password: ElFormRule[]; + confirmPassword: ElFormRule[]; +} diff --git a/typings/interfaces/views/node.d.ts b/typings/interfaces/views/node.d.ts new file mode 100644 index 0000000000000..98b73a6869bf9 --- /dev/null +++ b/typings/interfaces/views/node.d.ts @@ -0,0 +1,14 @@ +import { + NODE_STATUS_OFFLINE, + NODE_STATUS_ONLINE, + NODE_STATUS_REGISTERED, + NODE_STATUS_UNREGISTERED, +} from '@/constants/node'; + +declare global { + type NodeStatus = + | NODE_STATUS_OFFLINE + | NODE_STATUS_ONLINE + | NODE_STATUS_REGISTERED + | NODE_STATUS_UNREGISTERED; +} diff --git a/typings/interfaces/views/project.d.ts b/typings/interfaces/views/project.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/typings/interfaces/views/result.d.ts b/typings/interfaces/views/result.d.ts new file mode 100644 index 0000000000000..95a65f1ac74ab --- /dev/null +++ b/typings/interfaces/views/result.d.ts @@ -0,0 +1,9 @@ +interface ResultListProps { + id: string; + dataSourceId?: string; + noActions?: boolean; + embedded?: boolean; + visibleButtons?: BuiltInTableActionButtonName[]; + filter?: FilterConditionData[] | (() => FilterConditionData[]); + displayAllFields: boolean; +} diff --git a/typings/interfaces/views/schedule.d.ts b/typings/interfaces/views/schedule.d.ts new file mode 100644 index 0000000000000..d44a3d18d50f9 --- /dev/null +++ b/typings/interfaces/views/schedule.d.ts @@ -0,0 +1,15 @@ +interface Schedule { + _id?: string; + name?: string; + description?: string; + spider_id?: string; + spider_name?: string; + cron?: string; + cmd?: string; + param?: string; + priority?: number; + mode?: TaskMode; + node_ids?: string[]; + node_tags?: string[]; + enabled?: boolean; +} diff --git a/typings/interfaces/views/spider.d.ts b/typings/interfaces/views/spider.d.ts new file mode 100644 index 0000000000000..5b056f3f7a1d4 --- /dev/null +++ b/typings/interfaces/views/spider.d.ts @@ -0,0 +1,8 @@ +type SpiderTabName = 'overview' | 'files' | 'tasks' | 'settings'; + +interface SpiderDialogVisible extends DialogVisible { + run: boolean; + uploadFiles: boolean; +} + +type SpiderDialogKey = DialogKey | 'run' | 'uploadFiles'; diff --git a/typings/interfaces/views/task.d.ts b/typings/interfaces/views/task.d.ts new file mode 100644 index 0000000000000..6ce71d3877434 --- /dev/null +++ b/typings/interfaces/views/task.d.ts @@ -0,0 +1,53 @@ +import { + TASK_MODE_ALL_NODES, + TASK_MODE_RANDOM, + TASK_MODE_SELECTED_NODES, +} from '@/constants/task'; + +export declare global { + interface Task extends BaseModel { + spider_id?: string; + spider_name?: string; + status?: TaskStatus; + node_id?: string; + node_name?: string; + pid?: number; + schedule_id?: string; + schedule_name?: string; + type?: string; + mode?: TaskMode; + parent_id?: string; + cmd?: string; + param?: string; + error?: string; + stat?: TaskStat; + priority?: number; + + // view model + spider?: Spider; + } + + interface TaskStat { + create_ts?: string; + start_ts?: string; + end_ts?: string; + result_count?: number; + error_log_count?: number; + wait_duration?: number; + runtime_duration?: number; + total_duration?: number; + } + + type TaskMode = + | TASK_MODE_RANDOM + | TASK_MODE_ALL_NODES + | TASK_MODE_SELECTED_NODES; + + type TaskStatus = + | 'abnormal' + | 'cancelled' + | 'error' + | 'finished' + | 'running' + | 'pending'; +} diff --git a/typings/interfaces/views/user.d.ts b/typings/interfaces/views/user.d.ts new file mode 100644 index 0000000000000..6c03089a9d119 --- /dev/null +++ b/typings/interfaces/views/user.d.ts @@ -0,0 +1,5 @@ +import { ROLE_ADMIN, ROLE_NORMAL } from '@/constants/user'; + +declare global { + type UserRole = ROLE_ADMIN | ROLE_NORMAL; +} diff --git a/typings/interfaces/vue3-sfc-loader.d.ts b/typings/interfaces/vue3-sfc-loader.d.ts new file mode 100644 index 0000000000000..212e9e831c74f --- /dev/null +++ b/typings/interfaces/vue3-sfc-loader.d.ts @@ -0,0 +1,9 @@ +// declare module 'vue3-sfc-loader' { +// import {AbstractPath, ModuleExport, Options} from 'vue3-sfc-loader/dist/types/vue3/types'; +// +// declare function loadModule(path: AbstractPath, options?: Options): Promise; +// +// declare type AbstractPath = { +// toString(): string; +// } +// }