+
{t('task.confirm.execute.hosts', { count: hostCount })}
+
{t('task.confirm.execute.account', { account: values.account })}
+
{t('task.confirm.execute.script', { script: scriptFirstLine })}
+
+ ),
+ okText: t('task.save.execute'),
+ okButtonProps: { danger: true },
+ cancelText: t('common:btn.cancel'),
+ onOk: () => doSubmit(values),
});
+ return;
}
+ doSubmit(values);
};
useEffect(() => {
diff --git a/src/pages/task/detail.tsx b/src/pages/task/detail.tsx
deleted file mode 100644
index 7fa8a3486..000000000
--- a/src/pages/task/detail.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2022 Nightingale Team
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-import React, { useState, useEffect, useContext } from 'react';
-import { Link, useHistory } from 'react-router-dom';
-import { Spin, Divider, Button, Card } from 'antd';
-import { RollbackOutlined } from '@ant-design/icons';
-import moment from 'moment';
-import _ from 'lodash';
-import { useTranslation } from 'react-i18next';
-import request from '@/utils/request';
-import api from '@/utils/api';
-import PageLayout from '@/components/pageLayout';
-import { CommonStateContext } from '@/App';
-import Editor from '../taskTpl/editor';
-import './style.less';
-
-const Detail = (props: any) => {
- const history = useHistory();
- const { businessGroup } = useContext(CommonStateContext);
- const curBusiId = businessGroup.id!;
- const { t } = useTranslation('common');
- const taskId = _.get(props, 'match.params.id');
- const [loading, setLoading] = useState(false);
- const [data, setData] = useState({} as any);
-
- useEffect(() => {
- if (taskId !== undefined) {
- setLoading(true);
- request(`${api.task(curBusiId)}/${taskId}`)
- .then((data) => {
- setData({
- ...data.dat.meta,
- hosts: _.map(data.dat.hosts, (host) => {
- return host.host;
- }),
- });
- })
- .finally(() => {
- setLoading(false);
- });
- }
- }, [taskId]);
-
- return (
-