From 045b6b918d0b744c1821e927de2f4829b88590fb Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Wed, 24 Jul 2024 14:57:11 +0800 Subject: [PATCH] feat: Add support for viewing templates and channels in notification settings --- .../setting/NotificationSettingForm.vue | 56 +++++++++- .../NotificationSettingTriggerSelect.vue | 76 +++++++++++++ src/components/index.ts | 53 ++++----- src/i18n/lang/en/common.ts | 2 + src/i18n/lang/en/components/notification.ts | 57 +++++++++- src/i18n/lang/en/views/notification.ts | 3 + src/i18n/lang/zh/common.ts | 2 + src/i18n/lang/zh/components/notification.ts | 56 ++++++++++ src/i18n/lang/zh/views/notification.ts | 3 + src/interfaces/i18n/common.d.ts | 2 + .../i18n/components/notification.d.ts | 16 +++ src/interfaces/i18n/views/notification.d.ts | 3 + src/interfaces/models/notification.d.ts | 6 ++ src/layouts/index.ts | 4 +- src/utils/notification.ts | 77 +++++++++++++ src/views/index.ts | 30 +++--- ...NotificationSettingDetailActionsCommon.vue | 101 ++---------------- ...tificationSettingDetailActionsTemplate.vue | 23 ++-- ...NotificationSettingDetailTabMailConfig.vue | 2 +- .../list/useNotificationSettingList.tsx | 20 ++++ 20 files changed, 438 insertions(+), 154 deletions(-) create mode 100644 src/components/core/notification/setting/NotificationSettingTriggerSelect.vue diff --git a/src/components/core/notification/setting/NotificationSettingForm.vue b/src/components/core/notification/setting/NotificationSettingForm.vue index c84c8edf163d0..868dd9f9d9aba 100644 --- a/src/components/core/notification/setting/NotificationSettingForm.vue +++ b/src/components/core/notification/setting/NotificationSettingForm.vue @@ -1,7 +1,9 @@ @@ -37,6 +59,7 @@ defineOptions({ name: 'ClNotificationSettingForm' }); > + + + - - diff --git a/src/components/core/notification/setting/NotificationSettingTriggerSelect.vue b/src/components/core/notification/setting/NotificationSettingTriggerSelect.vue new file mode 100644 index 0000000000000..cf52efb3ae48a --- /dev/null +++ b/src/components/core/notification/setting/NotificationSettingTriggerSelect.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/index.ts b/src/components/index.ts index fe598975f6b51..f5dbd9bb08bba 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -33,6 +33,7 @@ import NotificationChannelForm from './core/notification/channel/NotificationCha import useNotificationChannel from './core/notification/channel/useNotificationChannel'; import CreateEditNotificationSettingDialog from './core/notification/setting/CreateEditNotificationSettingDialog.vue'; import NotificationSettingForm from './core/notification/setting/NotificationSettingForm.vue'; +import NotificationSettingTriggerSelect from './core/notification/setting/NotificationSettingTriggerSelect.vue'; import useNotificationSetting from './core/notification/setting/useNotificationSetting'; import CreateEditProjectDialog from './core/project/CreateEditProjectDialog.vue'; import ProjectForm from './core/project/ProjectForm.vue'; @@ -73,10 +74,10 @@ import Chart from './ui/chart/Chart.vue'; import Metric from './ui/chart/Metric.vue'; import ContextMenu from './ui/context-menu/ContextMenu.vue'; import ContextMenuList from './ui/context-menu/ContextMenuList.vue'; -import * as date from './ui/date/date'; import DateRangePicker from './ui/date/DateRangePicker.vue'; import DateTimeRangePicker from './ui/date/DateTimeRangePicker.vue'; import RangePicker from './ui/date/RangePicker.vue'; +import * as date from './ui/date/date'; import ConfirmDialog from './ui/dialog/ConfirmDialog.vue'; import CreateEditDialog from './ui/dialog/CreateEditDialog.vue'; import Dialog from './ui/dialog/Dialog.vue'; @@ -90,7 +91,6 @@ import FileActions from './ui/file/FileActions.vue'; import FileDiff from './ui/file/FileDiff.vue'; import FileEditor from './ui/file/FileEditor.vue'; import FileEditorCreateWithAiDialog from './ui/file/FileEditorCreateWithAiDialog.vue'; -import * as fileEditorDropZone from './ui/file/fileEditorDropZone'; import FileEditorNavMenu from './ui/file/FileEditorNavMenu.vue'; import FileEditorNavMenuContextMenu from './ui/file/FileEditorNavMenuContextMenu.vue'; import FileEditorNavTabs from './ui/file/FileEditorNavTabs.vue'; @@ -100,21 +100,23 @@ import FileEditorSettingsDialog from './ui/file/FileEditorSettingsDialog.vue'; import FileTab from './ui/file/FileTab.vue'; import FileUpload from './ui/file/FileUpload.vue'; import UploadFilesDialog from './ui/file/UploadFilesDialog.vue'; -import * as filter from './ui/filter/filter'; +import * as fileEditorDropZone from './ui/file/fileEditorDropZone'; import FilterCondition from './ui/filter/FilterCondition.vue'; import FilterConditionList from './ui/filter/FilterConditionList.vue'; import FilterInput from './ui/filter/FilterInput.vue'; import FilterSelect from './ui/filter/FilterSelect.vue'; +import * as filter from './ui/filter/filter'; import Form from './ui/form/Form.vue'; import FormItem from './ui/form/FormItem.vue'; -import * as formTable from './ui/form/formTable'; import FormTableField from './ui/form/FormTableField.vue'; +import * as formTable from './ui/form/formTable'; import useForm from './ui/form/useForm'; import AtomMaterialIcon from './ui/icon/AtomMaterialIcon.vue'; -import * as icon from './ui/icon/icon'; import Icon from './ui/icon/Icon.vue'; import MenuItemIcon from './ui/icon/MenuItemIcon.vue'; +import * as icon from './ui/icon/icon'; import InputList from './ui/input/InputList.vue'; +import LexicalEditor from './ui/lexical/LexicalEditor.vue'; import BlockOptionsDropdownList from './ui/lexical/components/BlockOptionsDropdownList.vue'; import DropdownButton from './ui/lexical/components/DropdownButton.vue'; import FloatLinkEditor from './ui/lexical/components/FloatLinkEditor.vue'; @@ -130,7 +132,6 @@ import useLexicalList from './ui/lexical/composables/useLexicalList'; import useLexicalMounted from './ui/lexical/composables/useLexicalMounted'; import useRichTextSetup from './ui/lexical/composables/useRichTextSetup'; import useVariableSetup from './ui/lexical/composables/useVariableSetup'; -import LexicalEditor from './ui/lexical/LexicalEditor.vue'; import * as ImageNode from './ui/lexical/nodes/ImageNode'; import * as VariableNode from './ui/lexical/nodes/VariableNode'; import LexicalAutoFocusPlugin from './ui/lexical/plugins/LexicalAutoFocusPlugin.vue'; @@ -149,6 +150,7 @@ import * as autoLink from './ui/lexical/utils/autoLink'; import * as getSelectedNode from './ui/lexical/utils/getSelectedNode'; import * as markdownTransformers from './ui/lexical/utils/markdownTransformers'; import * as node from './ui/lexical/utils/node'; +import * as theme from './ui/lexical/utils/theme'; import DetailTabList from './ui/list/DetailTabList.vue'; import MarkdownEditor from './ui/markdown/MarkdownEditor.vue'; import MarkdownEditorToolbar from './ui/markdown/MarkdownEditorToolbar.vue'; @@ -166,12 +168,6 @@ import NavSidebarTree from './ui/nav/NavSidebarTree.vue'; import NavTabs from './ui/nav/NavTabs.vue'; import Switch from './ui/switch/Switch.vue'; import ActionTab from './ui/tab/ActionTab.vue'; -import * as action from './ui/table/action'; -import * as column from './ui/table/column'; -import * as data from './ui/table/data'; -import * as header from './ui/table/header'; -import * as pagination from './ui/table/pagination'; -import * as store from './ui/table/store'; import Table from './ui/table/Table.vue'; import TableActions from './ui/table/TableActions.vue'; import TableCell from './ui/table/TableCell.vue'; @@ -181,6 +177,12 @@ import TableHeaderAction from './ui/table/TableHeaderAction.vue'; import TableHeaderDialog from './ui/table/TableHeaderDialog.vue'; import TableHeaderDialogFilter from './ui/table/TableHeaderDialogFilter.vue'; import TableHeaderDialogSort from './ui/table/TableHeaderDialogSort.vue'; +import * as action from './ui/table/action'; +import * as column from './ui/table/column'; +import * as data from './ui/table/data'; +import * as header from './ui/table/header'; +import * as pagination from './ui/table/pagination'; +import * as store from './ui/table/store'; import CheckTag from './ui/tag/CheckTag.vue'; import CheckTagGroup from './ui/tag/CheckTagGroup.vue'; import LinkTag from './ui/tag/LinkTag.vue'; @@ -226,6 +228,7 @@ export { useNotificationChannel as useNotificationChannel, CreateEditNotificationSettingDialog as ClCreateEditNotificationSettingDialog, NotificationSettingForm as ClNotificationSettingForm, + NotificationSettingTriggerSelect as ClNotificationSettingTriggerSelect, useNotificationSetting as useNotificationSetting, CreateEditProjectDialog as ClCreateEditProjectDialog, ProjectForm as ClProjectForm, @@ -266,10 +269,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, @@ -283,7 +286,6 @@ export { FileDiff as ClFileDiff, FileEditor as ClFileEditor, FileEditorCreateWithAiDialog as ClFileEditorCreateWithAiDialog, - fileEditorDropZone as fileEditorDropZone, FileEditorNavMenu as ClFileEditorNavMenu, FileEditorNavMenuContextMenu as ClFileEditorNavMenuContextMenu, FileEditorNavTabs as ClFileEditorNavTabs, @@ -293,21 +295,23 @@ 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, AtomMaterialIcon as ClAtomMaterialIcon, - icon as icon, Icon as ClIcon, MenuItemIcon as ClMenuItemIcon, + icon as icon, InputList as ClInputList, + LexicalEditor as ClLexicalEditor, BlockOptionsDropdownList as ClBlockOptionsDropdownList, DropdownButton as ClDropdownButton, FloatLinkEditor as ClFloatLinkEditor, @@ -323,7 +327,6 @@ export { useLexicalMounted as useLexicalMounted, useRichTextSetup as useRichTextSetup, useVariableSetup as useVariableSetup, - LexicalEditor as ClLexicalEditor, ImageNode as ImageNode, VariableNode as VariableNode, LexicalAutoFocusPlugin as ClLexicalAutoFocusPlugin, @@ -342,6 +345,7 @@ export { getSelectedNode as getSelectedNode, markdownTransformers as markdownTransformers, node as node, + theme as theme, DetailTabList as ClDetailTabList, MarkdownEditor as ClMarkdownEditor, MarkdownEditorToolbar as ClMarkdownEditorToolbar, @@ -359,13 +363,6 @@ export { NavTabs as ClNavTabs, 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, @@ -375,6 +372,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, diff --git a/src/i18n/lang/en/common.ts b/src/i18n/lang/en/common.ts index fd5b52917316c..7350ece8b4231 100644 --- a/src/i18n/lang/en/common.ts +++ b/src/i18n/lang/en/common.ts @@ -38,6 +38,8 @@ const common: LCommon = { unlink: 'Unlink', goto: 'Go To', selectAll: 'Select All', + viewTemplate: 'View Template', + viewChannels: 'View Channels', }, messageBox: { confirm: { diff --git a/src/i18n/lang/en/components/notification.ts b/src/i18n/lang/en/components/notification.ts index 28aa1dacf83e0..23f43ceebc9ff 100644 --- a/src/i18n/lang/en/components/notification.ts +++ b/src/i18n/lang/en/components/notification.ts @@ -103,7 +103,6 @@ const notification: LComponentsNotification = { averageTotalDuration: 'Average Total Duration (sec)', }, schedule: { - id: 'ID', name: 'Name', description: 'Description', cron: 'Cron', @@ -118,6 +117,62 @@ const notification: LComponentsNotification = { label: 'Channel', tooltip: 'Notification channels', }, + setting: { + templates: { + task_finish: { + label: 'Task Finish', + name: 'Task Finish', + description: 'Task finish notification template', + title: 'Task Finish', + template_markdown: `# Task Finished + +- Spider Name: \${spider:name} +- Schedule Name: \${schedule:name} +- Node Name: \${node:name} +- Task ID: \${task:id} +- Task Status: \${task:status} +- Task Error: \${task:error} +- Task Mode: \${task:mode} +- Task Command: \${task:cmd} +- Task Parameter: \${task:param} +- Task Priority: \${task:priority} +- Task Created By: \${task:created_by} +- Task Created At: \${task:created_ts} +- Task Started At: \${task_stat:start_ts} +- Task Ended At: \${task_stat:ended_ts} +- Task Wait Duration: \${task_stat:wait_duration} +- Task Runtime Duration: \${task_stat:runtime_duration} +- Task Total Duration: \${task_stat:total_duration} +- Task Result Count: \${task_stat:result_count}`, + }, + task_error: { + label: 'Task Error', + name: 'Task Error', + description: 'Task error notification template', + title: 'Task Error', + template_markdown: `# Task Error + +- Spider Name: \${spider:name} +- Schedule Name: \${schedule:name} +- Node Name: \${node:name} +- Task ID: \${task:id} +- Task Status: \${task:status} +- Task Error: \${task:error} +- Task Mode: \${task:mode} +- Task Command: \${task:cmd} +- Task Parameter: \${task:param} +- Task Priority: \${task:priority} +- Task Created By: \${task:created_by} +- Task Created At: \${task:created_ts} +- Task Started At: \${task_stat:start_ts} +- Task Ended At: \${task_stat:end_ts} +- Task Wait Duration: \${task_stat:wait_duration} +- Task Runtime Duration: \${task_stat:runtime_duration} +- Task Total Duration: \${task_stat:total_duration} +- Task Result Count: \${task_stat:result_count}`, + }, + }, + }, }; export default notification; diff --git a/src/i18n/lang/en/views/notification.ts b/src/i18n/lang/en/views/notification.ts index 6797a16963a60..bdd5ce7f42319 100644 --- a/src/i18n/lang/en/views/notification.ts +++ b/src/i18n/lang/en/views/notification.ts @@ -56,6 +56,9 @@ const notification: LViewsNotification = { content: 'The notification setting is valid.', }, }, + templates: { + label: 'Select Template', + }, }, channels: { navActions: { diff --git a/src/i18n/lang/zh/common.ts b/src/i18n/lang/zh/common.ts index a167acf2f1172..00621b7b34aeb 100644 --- a/src/i18n/lang/zh/common.ts +++ b/src/i18n/lang/zh/common.ts @@ -38,6 +38,8 @@ const common: LCommon = { unlink: '取消链接', goto: '访问', selectAll: '全选', + viewTemplate: '查看模板', + viewChannels: '查看通知渠道', }, messageBox: { confirm: { diff --git a/src/i18n/lang/zh/components/notification.ts b/src/i18n/lang/zh/components/notification.ts index 437c6145fe05a..fb9e9add0329f 100644 --- a/src/i18n/lang/zh/components/notification.ts +++ b/src/i18n/lang/zh/components/notification.ts @@ -117,6 +117,62 @@ const notification: LComponentsNotification = { label: '通知渠道', tooltip: '消息通知渠道设置', }, + setting: { + templates: { + task_finish: { + label: '任务完成', + name: '任务完成', + description: '任务完成通知模板', + title: '任务完成', + template_markdown: `# 任务完成 + +- 爬虫名称: \${spider:name} +- 定时任务名称: \${schedule:name} +- 节点名称: \${node:name} +- 任务 ID: \${task:id} +- 任务状态: \${task:status} +- 任务错误: \${task:error} +- 任务模式: \${task:mode} +- 任务命令: \${task:cmd} +- 任务参数: \${task:param} +- 任务优先级: \${task:priority} +- 任务创建者: \${task:created_by} +- 任务创建时间: \${task:created_ts} +- 任务开始时间: \${task_stat:start_ts} +- 任务结束时间: \${task_stat:end_ts} +- 任务等待时长: \${task_stat:wait_duration} +- 任务运行时长: \${task_stat:runtime_duration} +- 任务总时长: \${task_stat:total_duration} +- 任务结果数: \${task_stat:result_count}`, + }, + task_error: { + label: '任务错误', + name: '任务错误', + description: '任务错误通知模板', + title: '任务错误', + template_markdown: `# 任务错误 + +- 爬虫名称: \${spider:name} +- 定时任务名称: \${schedule:name} +- 节点名称: \${node:name} +- 任务 ID: \${task:id} +- 任务状态: \${task:status} +- 任务错误: \${task:error} +- 任务模式: \${task:mode} +- 任务命令: \${task:cmd} +- 任务参数: \${task:param} +- 任务优先级: \${task:priority} +- 任务创建者: \${task:created_by} +- 任务创建时间: \${task:created_ts} +- 任务开始时间: \${task_stat:start_ts} +- 任务结束时间: \${task_stat:end_ts} +- 任务等待时长 (秒): \${task_stat:wait_duration} +- 任务运行时长 (秒): \${task_stat:runtime_duration} +- 任务总时长 (秒): \${task_stat:total_duration} +- 任务结果数: \${task_stat:result_count}`, + }, + }, + }, }; export default notification; diff --git a/src/i18n/lang/zh/views/notification.ts b/src/i18n/lang/zh/views/notification.ts index c013d47ac6aff..b6be9e6ac419c 100644 --- a/src/i18n/lang/zh/views/notification.ts +++ b/src/i18n/lang/zh/views/notification.ts @@ -56,6 +56,9 @@ const notification: LViewsNotification = { content: '通知配置有效。', }, }, + templates: { + label: '选择模板', + }, }, channels: { navActions: { diff --git a/src/interfaces/i18n/common.d.ts b/src/interfaces/i18n/common.d.ts index fcbedd3a32bbe..ce489b59adebf 100644 --- a/src/interfaces/i18n/common.d.ts +++ b/src/interfaces/i18n/common.d.ts @@ -51,6 +51,8 @@ export declare global { unlink: string; goto: string; selectAll: string; + viewTemplate: string; + viewChannels: string; }; messageBox: { confirm: { diff --git a/src/interfaces/i18n/components/notification.d.ts b/src/interfaces/i18n/components/notification.d.ts index a0b82bff6f7fb..048b02a3d6231 100644 --- a/src/interfaces/i18n/components/notification.d.ts +++ b/src/interfaces/i18n/components/notification.d.ts @@ -1,3 +1,12 @@ +interface SettingTemplate { + label: string; + name: string; + description: string; + title: string; + template_markdown?: string; + template_rich_text?: string; +} + interface LComponentsNotification { dialog: { insertVariable: { @@ -110,10 +119,17 @@ interface LComponentsNotification { param: string; priority: string; mode: string; + enabled: string; }; }; channel: { label: string; tooltip: string; }; + setting: { + templates: { + task_finish: SettingTemplate; + task_error: SettingTemplate; + }; + }; } diff --git a/src/interfaces/i18n/views/notification.d.ts b/src/interfaces/i18n/views/notification.d.ts index 1d7045f60b8ea..67011bbaa7ebb 100644 --- a/src/interfaces/i18n/views/notification.d.ts +++ b/src/interfaces/i18n/views/notification.d.ts @@ -45,6 +45,9 @@ interface LViewsNotification { content: string; }; }; + templates: { + label: string; + }; }; channels: { navActions: LNavActions; diff --git a/src/interfaces/models/notification.d.ts b/src/interfaces/models/notification.d.ts index e7b848806c850..af0a5c6eab429 100644 --- a/src/interfaces/models/notification.d.ts +++ b/src/interfaces/models/notification.d.ts @@ -35,12 +35,18 @@ export declare global { channels?: NotificationChannel[]; } + interface NotificationSettingTemplate extends NotificationSetting { + key: string; + } + type NotificationTemplateMode = 'rich-text' | 'markdown'; type NotificationVariableCategory = | 'task' + | 'task_stat' | 'node' | 'spider' + | 'spider_stat' | 'git' | 'project' | 'schedule' diff --git a/src/layouts/index.ts b/src/layouts/index.ts index 31f4c535ff783..98e315c5d9ebc 100644 --- a/src/layouts/index.ts +++ b/src/layouts/index.ts @@ -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'; @@ -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, @@ -21,5 +22,4 @@ export { ListLayout as ClListLayout, useList as useList, SimpleLayout as ClSimpleLayout, - NormalLayout as ClNormalLayout, }; diff --git a/src/utils/notification.ts b/src/utils/notification.ts index 85d2f999975c0..76d48d4d742fd 100644 --- a/src/utils/notification.ts +++ b/src/utils/notification.ts @@ -1,4 +1,5 @@ import { translate } from '@/utils/i18n'; +import { toneMappingExposure } from 'three/examples/jsm/nodes/display/ToneMappingNode'; const t = translate; @@ -364,3 +365,79 @@ export const isValidVariable = ({ return allVariables.some(v => v.category === category && v.name === name); }; + +export const allTemplates: NotificationSettingTemplate[] = [ + { + key: 'task_finish', + name: 'components.notification.setting.templates.task_finish.name', + description: + 'components.notification.setting.templates.task_finish.description', + trigger_target: 'task', + trigger: 'task_finish', + template_mode: 'markdown', + title: 'components.notification.setting.templates.task_finish.title', + template_markdown: + 'components.notification.setting.templates.task_finish.template_markdown', + }, + { + key: 'task_error', + name: 'components.notification.setting.templates.task_error.name', + description: + 'components.notification.setting.templates.task_error.description', + trigger_target: 'task', + trigger: 'task_error', + template_mode: 'markdown', + title: 'components.notification.setting.templates.task_error.title', + template_markdown: + 'components.notification.setting.templates.task_error.template_markdown', + }, +]; + +export const getTriggerOptions = () => [ + { + label: t('views.notification.settings.triggerTargets.task'), + icon: ['fa', 'tasks'], + children: [ + { + label: t('views.notification.settings.triggers.task.finish'), + value: 'task_finish', + icon: ['fa', 'flag-checkered'], + }, + { + label: t('views.notification.settings.triggers.task.error'), + value: 'task_error', + icon: ['fa', 'times'], + }, + { + label: t('views.notification.settings.triggers.task.emptyResults'), + value: 'task_empty_results', + icon: ['fa', 'exclamation-circle'], + }, + ], + }, + { + label: t('views.notification.settings.triggerTargets.node'), + icon: ['fa', 'server'], + disabled: true, + children: [ + { + label: t('views.notification.settings.triggers.node.statusChange'), + value: 'node_status_change', + icon: ['fa', 'exchange-alt'], + disabled: true, + }, + { + label: t('views.notification.settings.triggers.node.online'), + value: 'node_online', + icon: ['fa', 'check-circle'], + disabled: true, + }, + { + label: t('views.notification.settings.triggers.node.offline'), + value: 'node_offline', + icon: ['fa', 'times-circle'], + disabled: true, + }, + ], + }, +]; diff --git a/src/views/index.ts b/src/views/index.ts index 3ba92b32a458e..7bb25274811ff 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'; @@ -34,22 +34,23 @@ 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'; import NodeList from './node/list/NodeList.vue'; import useNodeList from './node/list/useNodeList'; -import NotificationChannelDetailActionsCommon from './notification/channel/detail/actions/NotificationChannelDetailActionsCommon.vue'; import NotificationChannelDetail from './notification/channel/detail/NotificationChannelDetail.vue'; +import NotificationChannelDetailActionsCommon from './notification/channel/detail/actions/NotificationChannelDetailActionsCommon.vue'; import NotificationChannelDetailTabOverview from './notification/channel/detail/tabs/NotificationChannelDetailTabOverview.vue'; import NotificationChannelList from './notification/channel/list/NotificationChannelList.vue'; import useNotificationChannelList from './notification/channel/list/useNotificationChannelList'; +import NotificationSettingDetail from './notification/setting/detail/NotificationSettingDetail.vue'; import NotificationSettingDetailActionsCommon from './notification/setting/detail/actions/NotificationSettingDetailActionsCommon.vue'; import NotificationSettingDetailActionsTemplate from './notification/setting/detail/actions/NotificationSettingDetailActionsTemplate.vue'; -import NotificationSettingDetail from './notification/setting/detail/NotificationSettingDetail.vue'; import NotificationSettingDetailTabChannels from './notification/setting/detail/tabs/NotificationSettingDetailTabChannels.vue'; +import NotificationSettingDetailTabMailConfig from './notification/setting/detail/tabs/NotificationSettingDetailTabMailConfig.vue'; import NotificationSettingDetailTabOverview from './notification/setting/detail/tabs/NotificationSettingDetailTabOverview.vue'; import NotificationSettingDetailTabTemplate from './notification/setting/detail/tabs/NotificationSettingDetailTabTemplate.vue'; import useNotificationSettingDetail from './notification/setting/detail/useNotificationSettingDetail'; @@ -66,11 +67,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'; @@ -81,20 +82,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'; @@ -119,11 +120,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, @@ -136,22 +137,23 @@ 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, NodeList as ClNodeList, useNodeList as useNodeList, - NotificationChannelDetailActionsCommon as ClNotificationChannelDetailActionsCommon, NotificationChannelDetail as ClNotificationChannelDetail, + NotificationChannelDetailActionsCommon as ClNotificationChannelDetailActionsCommon, NotificationChannelDetailTabOverview as ClNotificationChannelDetailTabOverview, NotificationChannelList as ClNotificationChannelList, useNotificationChannelList as useNotificationChannelList, + NotificationSettingDetail as ClNotificationSettingDetail, NotificationSettingDetailActionsCommon as ClNotificationSettingDetailActionsCommon, NotificationSettingDetailActionsTemplate as ClNotificationSettingDetailActionsTemplate, - NotificationSettingDetail as ClNotificationSettingDetail, NotificationSettingDetailTabChannels as ClNotificationSettingDetailTabChannels, + NotificationSettingDetailTabMailConfig as ClNotificationSettingDetailTabMailConfig, NotificationSettingDetailTabOverview as ClNotificationSettingDetailTabOverview, NotificationSettingDetailTabTemplate as ClNotificationSettingDetailTabTemplate, useNotificationSettingDetail as useNotificationSettingDetail, @@ -168,11 +170,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, @@ -183,20 +185,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, diff --git a/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsCommon.vue b/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsCommon.vue index efaa2a12af8e0..420adfd685701 100644 --- a/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsCommon.vue +++ b/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsCommon.vue @@ -1,8 +1,8 @@ @@ -170,29 +105,10 @@ defineOptions({ name: 'ClNotificationSettingDetailActionsCommon' }); :tooltip="t('components.notification.trigger.tooltip')" /> - - - - + @@ -205,8 +121,3 @@ defineOptions({ name: 'ClNotificationSettingDetailActionsCommon' }); } } - diff --git a/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsTemplate.vue b/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsTemplate.vue index 51f2ca728f33a..01822e91f839d 100644 --- a/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsTemplate.vue +++ b/src/views/notification/setting/detail/actions/NotificationSettingDetailActionsTemplate.vue @@ -1,5 +1,5 @@