Skip to content

Commit

Permalink
fix: update node disabled tabs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jul 4, 2024
1 parent a0e00af commit 06a9e39
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 40 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@types/getos": "^3.0.4",
"@types/humanize-duration": "^3.27.4",
"@types/javascript-time-ago": "^2.0.8",
"@types/lodash": "^4.17.6",
"@types/md5": "^2.3.5",
"@types/pinyin": "^2.10.2",
"@types/showdown": "^2.0.6",
Expand All @@ -76,6 +77,7 @@
"axios": "^1.7.2",
"chart.js": "^4.4.3",
"chartjs-adapter-date-fns": "^3.0.0",
"clipboard": "^2.0.11",
"core-js": "^3.37.1",
"crawlab-vue3-dropzone": "3.0.3",
"cron-parser": "^4.9.0",
Expand All @@ -85,6 +87,7 @@
"font-awesome": "^4.7.0",
"humanize-duration": "^3.32.1",
"javascript-time-ago": "^2.5.10",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"monaco-editor": "^0.50.0",
"normalize.css": "^8.0.1",
Expand Down
3 changes: 1 addition & 2 deletions src/components/chart/Chart.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue';
import { StyleValue } from '@vue/runtime-dom';
import { computed, StyleValue } from 'vue';
import { merge } from 'lodash';
import { Chart } from 'vue-chartjs';
import { ChartData, ChartOptions, ChartTypeRegistry } from 'chart.js';
Expand Down
48 changes: 24 additions & 24 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import Chart from './chart/Chart.vue';
import Metric from './chart/Metric.vue';
import ContextMenu from './context-menu/ContextMenu.vue';
import ContextMenuList from './context-menu/ContextMenuList.vue';
import * as date from './date/date';
import DateRangePicker from './date/DateRangePicker.vue';
import DateTimeRangePicker from './date/DateTimeRangePicker.vue';
import RangePicker from './date/RangePicker.vue';
import * as date from './date/date';
import ConfirmDialog from './dialog/ConfirmDialog.vue';
import CreateEditDialog from './dialog/CreateEditDialog.vue';
import Dialog from './dialog/Dialog.vue';
Expand All @@ -32,7 +32,6 @@ 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';
Expand All @@ -42,15 +41,16 @@ 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 filter from './filter/filter';
import * as fileEditorDropZone from './file/fileEditorDropZone';
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 * as formTable from './form/formTable';
import FormTableField from './form/FormTableField.vue';
import * as formTable from './form/formTable';
import useForm from './form/useForm';
import CreateEditGitDialog from './git/CreateEditGitDialog.vue';
import CreateGitBranchDialog from './git/CreateGitBranchDialog.vue';
Expand All @@ -67,9 +67,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';
Expand All @@ -92,8 +92,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 * as notification from './notification/notification';
import NotificationForm from './notification/NotificationForm.vue';
import * as notification from './notification/notification';
import CreateEditProjectDialog from './project/CreateEditProjectDialog.vue';
import ProjectForm from './project/ProjectForm.vue';
import useProject from './project/useProject';
Expand All @@ -114,12 +114,6 @@ 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';
Expand All @@ -129,6 +123,12 @@ 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';
Expand Down Expand Up @@ -160,10 +160,10 @@ export {
Metric as ClMetric,
ContextMenu as ClContextMenu,
ContextMenuList as ClContextMenuList,
date as date,
DateRangePicker as ClDateRangePicker,
DateTimeRangePicker as ClDateTimeRangePicker,
RangePicker as ClRangePicker,
date as date,
ConfirmDialog as ClConfirmDialog,
CreateEditDialog as ClCreateEditDialog,
Dialog as ClDialog,
Expand All @@ -185,7 +185,6 @@ export {
FileDiff as ClFileDiff,
FileEditor as ClFileEditor,
FileEditorCreateWithAiDialog as ClFileEditorCreateWithAiDialog,
fileEditorDropZone as fileEditorDropZone,
FileEditorNavMenu as ClFileEditorNavMenu,
FileEditorNavMenuContextMenu as ClFileEditorNavMenuContextMenu,
FileEditorNavTabs as ClFileEditorNavTabs,
Expand All @@ -195,15 +194,16 @@ export {
FileTab as ClFileTab,
FileUpload as ClFileUpload,
UploadFilesDialog as ClUploadFilesDialog,
filter as filter,
fileEditorDropZone as fileEditorDropZone,
FilterCondition as ClFilterCondition,
FilterConditionList as ClFilterConditionList,
FilterInput as ClFilterInput,
FilterSelect as ClFilterSelect,
filter as filter,
Form as ClForm,
FormItem as ClFormItem,
formTable as formTable,
FormTableField as ClFormTableField,
formTable as formTable,
useForm as useForm,
CreateEditGitDialog as ClCreateEditGitDialog,
CreateGitBranchDialog as ClCreateGitBranchDialog,
Expand All @@ -220,9 +220,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,
Expand All @@ -245,8 +245,8 @@ export {
NodeType as ClNodeType,
useNode as useNode,
CreateEditNotificationDialog as ClCreateEditNotificationDialog,
notification as notification,
NotificationForm as ClNotificationForm,
notification as notification,
CreateEditProjectDialog as ClCreateEditProjectDialog,
ProjectForm as ClProjectForm,
useProject as useProject,
Expand All @@ -267,12 +267,6 @@ 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,
Expand All @@ -282,6 +276,12 @@ 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,
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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';
Expand All @@ -8,10 +9,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,
Expand All @@ -21,5 +22,4 @@ export {
ListLayout as ClListLayout,
useList as useList,
SimpleLayout as ClSimpleLayout,
NormalLayout as ClNormalLayout,
};
20 changes: 10 additions & 10 deletions src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -34,8 +34,8 @@ import Home from './home/Home.vue';
import Login from './login/Login.vue';
import Disclaimer from './misc/Disclaimer.vue';
import MySettings from './misc/MySettings.vue';
import NodeDetailActionsCommon from './node/detail/actions/NodeDetailActionsCommon.vue';
import NodeDetail from './node/detail/NodeDetail.vue';
import NodeDetailActionsCommon from './node/detail/actions/NodeDetailActionsCommon.vue';
import NodeDetailTabMonitoring from './node/detail/tabs/NodeDetailTabMonitoring.vue';
import NodeDetailTabOverview from './node/detail/tabs/NodeDetailTabOverview.vue';
import NodeDetailTabTasks from './node/detail/tabs/NodeDetailTabTasks.vue';
Expand All @@ -59,11 +59,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';
Expand All @@ -74,20 +74,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 UserDetailTabOverview from './user/detail/tabs/UserDetailTabOverview.vue';
import UserDetail from './user/detail/UserDetail.vue';
import UserDetailTabOverview from './user/detail/tabs/UserDetailTabOverview.vue';
import useUserDetail from './user/detail/useUserDetail';
import UserList from './user/list/UserList.vue';
import useUserList from './user/list/useUserList';
Expand All @@ -112,11 +112,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,
Expand All @@ -129,8 +129,8 @@ export {
Login as ClLogin,
Disclaimer as ClDisclaimer,
MySettings as ClMySettings,
NodeDetailActionsCommon as ClNodeDetailActionsCommon,
NodeDetail as ClNodeDetail,
NodeDetailActionsCommon as ClNodeDetailActionsCommon,
NodeDetailTabMonitoring as ClNodeDetailTabMonitoring,
NodeDetailTabOverview as ClNodeDetailTabOverview,
NodeDetailTabTasks as ClNodeDetailTabTasks,
Expand All @@ -154,11 +154,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,
Expand All @@ -169,20 +169,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,
UserDetailTabOverview as ClUserDetailTabOverview,
UserDetail as ClUserDetail,
UserDetailTabOverview as ClUserDetailTabOverview,
useUserDetail as useUserDetail,
UserList as ClUserList,
useUserList as useUserList,
Expand Down
8 changes: 6 additions & 2 deletions src/views/node/detail/NodeDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import { TAB_NAME_MONITORING } from '@/constants';
const ns = 'node';
const store = useStore();
const { common: commonState } = store.state as RootStoreState;
onBeforeMount(() => {
const updateDisabledTabKeys = () => {
if (!isPro()) {
store.commit(`${ns}/setDisabledTabKeys`, [TAB_NAME_MONITORING]);
} else {
store.commit(`${ns}/setDisabledTabKeys`, []);
}
});
};
onBeforeMount(updateDisabledTabKeys);
watch(() => commonState.systemInfo, updateDisabledTabKeys);
defineOptions({ name: 'ClNodeDetail' });
</script>
Expand Down

0 comments on commit 06a9e39

Please sign in to comment.