Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ import './global.variable.less';

// 顶层路由组件懒加载:SharedDetail 会连带引入事件详情 + 全部数据源插件注册表(近千个模块),
// 只在 /share/alert-his-events 路由用到,改为懒加载后登录页等页面不再 eager 拉起这些依赖。
const TaskOutput = React.lazy(() => import('@/pages/taskOutput'));
const TaskHostOutput = React.lazy(() => import('@/pages/taskOutput/host'));
const SharedDetail = React.lazy(() => import('@/pages/event/DetailNG/SharedDetail'));

interface IProfile {
Expand Down Expand Up @@ -349,8 +347,6 @@ function App() {
>
<React.Suspense fallback={<Spin spinning style={{ width: '100%', height: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center' }} />}>
<Switch>
<Route exact path='/job-task/:busiId/output/:taskId/:outputType' component={TaskOutput} />
<Route exact path='/job-task/:busiId/output/:taskId/:host/:outputType' component={TaskHostOutput} />
<Route exact path='/share/alert-his-events/:eventId' component={SharedDetail} />
<>
{location.pathname !== `${basePrefix}/out-of-service` && <HeaderMenu />}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const en_US = {
alert_subscribes: 'Subscription rules',
job: 'Self-healing',
job_tpls: 'Self-Healing script',
job_tasks: 'Task history',
job_tasks: 'Execution history',
events: 'Events',
cur_events: 'Active events',
his_events: 'Historical events',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/locale/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ja_JP = {
alert_subscribes: 'サブスクリプションルール',
job: 'アラート自動修復',
job_tpls: '自動修復スクリプト',
job_tasks: '履歴タスク',
job_tasks: '実行履歴',
events: 'アラートイベント',
cur_events: 'アクティブアラート',
his_events: '履歴アラート',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/locale/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ru_RU = {
alert_subscribes: 'Подписки',
job: 'Самовосстановление',
job_tpls: 'Скрипт самовосстановления',
job_tasks: 'Задача самовосстановления',
job_tasks: 'История выполнения',
events: 'Оповещения',
cur_events: 'Действующие оповещения',
his_events: 'История оповещений',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const zh_CN = {
alert_subscribes: '订阅规则',
job: '告警自愈',
job_tpls: '自愈脚本',
job_tasks: '历史任务',
job_tasks: '执行历史',
events: '告警事件',
cur_events: '活跃告警',
his_events: '历史告警',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/locale/zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const zh_HK = {
alert_subscribes: '訂閱規則',
job: '告警自癒',
job_tpls: '自癒腳本',
job_tasks: '歷史任務',
job_tasks: '執行歷史',
events: '告警事件',
cur_events: '活躍告警',
his_events: '歷史告警',
Expand Down
14 changes: 14 additions & 0 deletions src/locales/common/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ const en_US = {
'If your role is an administrator, you can execute the script on any machine; otherwise, you can only execute the script on the machines under the business group with administrative rights',
'task.allOptionLabel': 'All tasks',
'task.error.no_group': 'Business group does not exist, cannot create task. Please contact the administrator',
'task.host.label': 'Target hosts',
'task.confirm.execute.title': 'Execute now?',
'task.confirm.execute.hosts': 'The script will run on {{count}} host(s)',
'task.confirm.execute.account': 'Run as: {{account}}',
'task.confirm.execute.script': 'First line: {{script}}',
'task.action.start': 'Start',
'task.action.pause': 'Pause',
'task.action.cancel': 'Cancel',
'task.action.kill': 'Kill',
'task.action.ignore': 'Ignore',
'task.action.redo': 'Redo',
'task.confirm.cancel': 'Cancel this task? Hosts not yet started will be skipped',
'task.confirm.kill': 'Kill? Running processes will be forcibly terminated',
'task.confirm.host.kill': 'Kill the execution on this host?',

'last.1.days': 'Last 1 day',
'last.7.days': 'Last 7 days',
Expand Down
16 changes: 15 additions & 1 deletion src/locales/common/locale/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const ja_JP = {
'tpl.callback': '警報自己修復コールバックアドレス',
'tpl.allOptionLabel': '全スクリプト',

task: '自己修復タスク',
task: '実行履歴',
'task.create': 'タスクを作成',
'task.title': 'タイトル',
'task.done': '完了したか',
Expand Down Expand Up @@ -254,6 +254,20 @@ const ja_JP = {
'task.tip.content': 'もしロールが管理者なら、どのマシンでもスクリプトを実行できます。それ以外は、管理権限のあるビジネスグループのマシンでのみスクリプトを実行できます',
'task.allOptionLabel': '全スクリプト',
'task.error.no_group': 'ビジネスグループが存在しないためタスクを作成できません。管理者にお問い合わせください',
'task.host.label': '実行マシン',
'task.confirm.execute.title': '今すぐ実行しますか?',
'task.confirm.execute.hosts': '{{count}} 台のホストでスクリプトを実行します',
'task.confirm.execute.account': '実行アカウント:{{account}}',
'task.confirm.execute.script': 'スクリプト先頭行:{{script}}',
'task.action.start': '開始',
'task.action.pause': '一時停止',
'task.action.cancel': '実行をキャンセル',
'task.action.kill': '強制終了',
'task.action.ignore': '無視',
'task.action.redo': '再実行',
'task.confirm.cancel': 'このタスクをキャンセルしますか?未開始のマシンは実行されません',
'task.confirm.kill': '強制終了しますか?実行中のプロセスが kill されます',
'task.confirm.host.kill': 'このホストの実行を強制終了しますか?',

'last.1.days': '最近 1 日',
'last.7.days': '最近 7 日',
Expand Down
16 changes: 15 additions & 1 deletion src/locales/common/locale/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const ru_RU = {
'tpl.create.task': 'Создать задачу',
'tpl.callback': 'Адрес обратного вызова для самовосстановления предупреждения',
'tpl.allOptionLabel': 'Все скрипты',
task: 'Задача самовосстановления',
task: 'История выполнения',
'task.create': 'Создать задачу',
'task.title': 'Заголовок',
'task.done': 'Завершено ли',
Expand Down Expand Up @@ -254,6 +254,20 @@ const ru_RU = {
'Если ваша роль - администратор, вы можете выполнять скрипты на любом хосте; в противном случае вы можете выполнять скрипты только для бизнес-группы, к которой относится хост',
'task.allOptionLabel': 'Все задачи',
'task.error.no_group': 'Бизнес-группа не существует, невозможно создать задачу. Обратитесь к администратору',
'task.host.label': 'Целевые хосты',
'task.confirm.execute.title': 'Выполнить сейчас?',
'task.confirm.execute.hosts': 'Скрипт будет запущен на {{count}} хост(ах)',
'task.confirm.execute.account': 'Учётная запись: {{account}}',
'task.confirm.execute.script': 'Первая строка: {{script}}',
'task.action.start': 'Старт',
'task.action.pause': 'Пауза',
'task.action.cancel': 'Отменить',
'task.action.kill': 'Завершить',
'task.action.ignore': 'Игнорировать',
'task.action.redo': 'Повторить',
'task.confirm.cancel': 'Отменить задачу? Незапущенные хосты будут пропущены',
'task.confirm.kill': 'Завершить? Запущенные процессы будут принудительно остановлены',
'task.confirm.host.kill': 'Завершить выполнение на этом хосте?',
'last.1.days': 'Последние 1 дней',
'last.7.days': 'Последние 7 дней',
'last.14.days': 'Последние 14 дней',
Expand Down
16 changes: 15 additions & 1 deletion src/locales/common/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const zh_CN = {
'tpl.callback': '告警自愈回调地址',
'tpl.allOptionLabel': '全部脚本',

task: '自愈任务',
task: '执行历史',
'task.create': '创建任务',
'task.title': '标题',
'task.done': '是否完成',
Expand Down Expand Up @@ -253,6 +253,20 @@ const zh_CN = {
'task.tip.content': '如果你的角色是管理员,则可以在任意机器执行脚本;否则,只能对有管理权限的业务组下的机器执行脚本',
'task.allOptionLabel': '全部任务',
'task.error.no_group': '业务组不存在无法创建任务,请联系管理员',
'task.host.label': '执行机器',
'task.confirm.execute.title': '确认立刻执行?',
'task.confirm.execute.hosts': '将在 {{count}} 台主机上执行脚本',
'task.confirm.execute.account': '执行账号:{{account}}',
'task.confirm.execute.script': '脚本首行:{{script}}',
'task.action.start': '开始',
'task.action.pause': '暂停',
'task.action.cancel': '取消执行',
'task.action.kill': '强制终止',
'task.action.ignore': '忽略',
'task.action.redo': '重跑',
'task.confirm.cancel': '确认取消该任务?未开始的机器将不再执行',
'task.confirm.kill': '确认强制终止?正在执行的进程会被 kill',
'task.confirm.host.kill': '确认强制终止该主机上的执行?',

'last.1.days': '最近 1 天',
'last.7.days': '最近 7 天',
Expand Down
16 changes: 15 additions & 1 deletion src/locales/common/locale/zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const zh_HK = {
'tpl.callback': '警告自癒回呼地址',
'tpl.allOptionLabel': '全部腳本',

task: '自癒任務',
task: '執行歷史',
'task.create': '創建任務',
'task.title': '標題',
'task.done': '是否完成',
Expand Down Expand Up @@ -252,6 +252,20 @@ const zh_HK = {
'task.tip.content': '如果你的角色是管理員,則可以在任意機器執行腳本;否則,只能對有管理權限的業務組下的機器執行腳本',
'task.allOptionLabel': '全部任務',
'task.error.no_group': '業務組不存在無法建立任務,請聯絡管理員',
'task.host.label': '執行機器',
'task.confirm.execute.title': '確認立刻執行?',
'task.confirm.execute.hosts': '將在 {{count}} 台主機上執行腳本',
'task.confirm.execute.account': '執行帳號:{{account}}',
'task.confirm.execute.script': '腳本首行:{{script}}',
'task.action.start': '開始',
'task.action.pause': '暫停',
'task.action.cancel': '取消執行',
'task.action.kill': '強制終止',
'task.action.ignore': '忽略',
'task.action.redo': '重跑',
'task.confirm.cancel': '確認取消該任務?未開始的機器將不再執行',
'task.confirm.kill': '確認強制終止?正在執行的進程會被 kill',
'task.confirm.host.kill': '確認強制終止該主機上的執行?',

'last.1.days': '最近 1 天',
'last.7.days': '最近 7 天',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/alertRules/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ const en_US = {
},
},
task_tpls: {
title: 'Self-healing template',
title: 'Self-healing',
add_btn: 'Create',
tpl_id: 'Template',
tpl_id_msg: 'Template is required',
tpl_id: 'Self-healing script',
tpl_id_msg: 'Self-healing script is required',
host: 'Host',
host_placeholder: 'Optional, the host to be executed will be obtained from the ident tag in the event',
host_placeholder: 'Optional; the host is taken from the event\'s ident tag. If the event has no ident (e.g. some query-type alerts), it will silently not run',
},
trigger: {
title: 'Threshold Judgment',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/alertRules/locale/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ const ja_JP = {
},
task_tpls: {
title: 'アラート自己治癒',
add_btn: '自己治癒テンプレートを作成',
tpl_id: '自己治癒テンプレート',
tpl_id_msg: '自己治癒テンプレートは空にできません',
add_btn: '自己治癒スクリプトを作成',
tpl_id: '自己治癒スクリプト',
tpl_id_msg: '自己治癒スクリプトは空にできません',
host: '実行マシン',
host_placeholder: 'デフォルトは空にできます。イベントの ident ラベルから実行するマシンを取得します',
host_placeholder: '空欄可。イベントの ident ラベルから実行マシンを取得します。イベントに ident がない場合(一部のクエリ型アラートなど)は何も実行されません',
},
trigger: {
title: '閾値判定',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/alertRules/locale/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ const ru_RU = {
},
task_tpls: {
title: 'Самовосстановление оповещения',
add_btn: 'Создать шаблон самовосстановления',
tpl_id: 'Шаблон самовосстановления',
tpl_id_msg: 'Шаблон самовосстановления не может быть пустым',
add_btn: 'Создать скрипт самовосстановления',
tpl_id: 'Скрипт самовосстановления',
tpl_id_msg: 'Скрипт самовосстановления не может быть пустым',
host: 'Исполняющий хост',
host_placeholder: 'По умолчанию можно оставить пустым, хост для выполнения будет получен из метки ident в событии',
host_placeholder: 'Можно оставить пустым; хост берётся из метки ident события. Если у события нет ident (напр. некоторые query-оповещения), запуск молча не произойдёт',
},
trigger: {
title: 'Пороговая проверка',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/alertRules/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ const zh_CN = {
},
task_tpls: {
title: '告警自愈',
add_btn: '创建自愈模板',
tpl_id: '自愈模板',
tpl_id_msg: '自愈模板不能为空',
add_btn: '创建自愈脚本',
tpl_id: '自愈脚本',
tpl_id_msg: '自愈脚本不能为空',
host: '执行机器',
host_placeholder: '默认可留空,会从事件中的 ident 标签获取要执行的机器',
host_placeholder: '默认可留空,会从事件的 ident 标签获取要执行的机器;若事件没有 ident(如部分查询类告警),将静默不执行',
},
trigger: {
title: '阈值判断',
Expand Down
10 changes: 5 additions & 5 deletions src/pages/alertRules/locale/zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ const zh_HK = {
},
},
task_tpls: {
title: '自愈模板',
add_btn: '創建自愈模板',
tpl_id: '自愈模板',
tpl_id_msg: '自愈模板不能為空',
title: '告警自愈',
add_btn: '創建自愈腳本',
tpl_id: '自愈腳本',
tpl_id_msg: '自愈腳本不能為空',
host: '機器',
host_placeholder: '預設可留空,會從事件中的 ident 標籤取得要執行的機器',
host_placeholder: '預設可留空,會從事件的 ident 標籤取得要執行的機器;若事件沒有 ident(如部分查詢類告警),將靜默不執行',
},
trigger: {
title: '閾值判斷',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const en_US = {
alert_aggr_events_link: 'Aggregated events',
},
task_tpls: {
label: 'Self-healing template',
label: 'Self-healing script',
},
step_tip: 'Time interval of the curve, in seconds',
query_label: 'Query',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/locale/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ja_JP = {
alert_aggr_events_link: '集約イベント',
},
task_tpls: {
label: '自動回復テンプレート',
label: '自己治癒スクリプト',
},
step_tip: 'グラフの時間間隔、単位は秒',
query_label: 'クエリ条件',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/locale/ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ru_RU = {
alert_aggr_events_link: 'Собранные события',
},
task_tpls: {
label: 'Шаблоны самовосстановления',
label: 'Скрипты самовосстановления',
},
step_tip: 'Интервал времени кривой в секундах',
query_label: 'Условия запроса',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const zh_CN = {
alert_aggr_events_link: '聚合事件',
},
task_tpls: {
label: '自愈模板',
label: '自愈脚本',
},
step_tip: '曲线时间间隔,单位秒',
query_label: '查询条件',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/locale/zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const zh_HK = {
alert_aggr_events_link: '聚合事件',
},
task_tpls: {
label: '自癒模板',
label: '自愈腳本',
},
step_tip: '曲線時間間隔,單位秒',
query_label: '查詢條件',
Expand Down
6 changes: 4 additions & 2 deletions src/pages/task/MetaDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ interface Props {
data: any;
hosts: { host: string }[];
taskId: string;
/** 任务所属业务组,克隆时需带上,否则「全部任务」视图下会用当前选中组请求到错误的 busi-group */
busiId?: number;
hideCloneTask?: boolean;
}

Expand All @@ -44,7 +46,7 @@ type SizeType = 'small' | 'middle' | 'large';
export default function MetaDrawer(props: Props) {
const { t } = useTranslation('common');
const { t: tn } = useTranslation('navigableDrawer');
const { visible, loading = false, onClose, data, hosts, taskId, hideCloneTask } = props;
const { visible, loading = false, onClose, data, hosts, taskId, busiId, hideCloneTask } = props;
const [size, setSize] = useState<SizeType>('middle');

return (
Expand All @@ -67,7 +69,7 @@ export default function MetaDrawer(props: Props) {
}
footer={
!hideCloneTask && (
<Link to={{ pathname: '/job-tasks/add', search: `task=${taskId}` }}>
<Link to={{ pathname: '/job-tasks/add', search: busiId ? `task=${taskId}&gid=${busiId}` : `task=${taskId}` }}>
<Button type='primary'>{t('task.clone.new')}</Button>
</Link>
)
Expand Down
Loading