mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
依赖增加已取消状态
This commit is contained in:
parent
c47896e787
commit
6dba8ae72d
|
@ -32,6 +32,7 @@ export enum DependenceStatus {
|
||||||
'removed',
|
'removed',
|
||||||
'removeFailed',
|
'removeFailed',
|
||||||
'queued',
|
'queued',
|
||||||
|
'cancelled',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DependenceTypes {
|
export enum DependenceTypes {
|
||||||
|
|
|
@ -165,7 +165,10 @@ export default class DependenceService {
|
||||||
pid && (await killTask(pid));
|
pid && (await killTask(pid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.removeDb(ids);
|
await DependenceModel.update(
|
||||||
|
{ status: DependenceStatus.cancelled },
|
||||||
|
{ where: { id: ids } },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async find(query: any, sort: any = []): Promise<Dependence[]> {
|
private async find(query: any, sort: any = []): Promise<Dependence[]> {
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
"删除中": "Deleting",
|
"删除中": "Deleting",
|
||||||
"已删除": "Deleted",
|
"已删除": "Deleted",
|
||||||
"删除失败": "Deletion Failed",
|
"删除失败": "Deletion Failed",
|
||||||
|
"已取消": "Cancelled",
|
||||||
"序号": "Number",
|
"序号": "Number",
|
||||||
"备注": "Remarks",
|
"备注": "Remarks",
|
||||||
"更新时间": "Update Time",
|
"更新时间": "Update Time",
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
"删除中": "删除中",
|
"删除中": "删除中",
|
||||||
"已删除": "已删除",
|
"已删除": "已删除",
|
||||||
"删除失败": "删除失败",
|
"删除失败": "删除失败",
|
||||||
|
"已取消": "已取消",
|
||||||
"序号": "序号",
|
"序号": "序号",
|
||||||
"备注": "备注",
|
"备注": "备注",
|
||||||
"更新时间": "更新时间",
|
"更新时间": "更新时间",
|
||||||
|
|
|
@ -22,6 +22,7 @@ import {
|
||||||
FileTextOutlined,
|
FileTextOutlined,
|
||||||
CloseCircleOutlined,
|
CloseCircleOutlined,
|
||||||
ClockCircleOutlined,
|
ClockCircleOutlined,
|
||||||
|
MinusCircleOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import { PageContainer } from '@ant-design/pro-layout';
|
import { PageContainer } from '@ant-design/pro-layout';
|
||||||
|
@ -77,6 +78,10 @@ const StatusMap: Record<number, { icon: React.ReactNode; color: string }> = {
|
||||||
icon: <ClockCircleOutlined />,
|
icon: <ClockCircleOutlined />,
|
||||||
color: 'default',
|
color: 'default',
|
||||||
},
|
},
|
||||||
|
7: {
|
||||||
|
icon: <MinusCircleOutlined />,
|
||||||
|
color: 'default',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const Dependence = () => {
|
const Dependence = () => {
|
||||||
|
@ -129,6 +134,10 @@ const Dependence = () => {
|
||||||
text: intl.get('删除失败'),
|
text: intl.get('删除失败'),
|
||||||
value: DependenceStatus.removeFailed,
|
value: DependenceStatus.removeFailed,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: intl.get('已取消'),
|
||||||
|
value: DependenceStatus.cancelled,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
render: (text: string, record: any, index: number) => {
|
render: (text: string, record: any, index: number) => {
|
||||||
return (
|
return (
|
||||||
|
@ -176,7 +185,7 @@ const Dependence = () => {
|
||||||
const isPc = !isPhone;
|
const isPc = !isPhone;
|
||||||
return (
|
return (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
{![Status.队列中].includes(record.status) && (
|
{![Status.队列中, Status.已取消].includes(record.status) && (
|
||||||
<Tooltip title={isPc ? intl.get('日志') : ''}>
|
<Tooltip title={isPc ? intl.get('日志') : ''}>
|
||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -187,7 +196,9 @@ const Dependence = () => {
|
||||||
</a>
|
</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{[Status.队列中, Status.安装中, Status.删除中].includes(record.status) ? (
|
{[Status.队列中, Status.安装中, Status.删除中].includes(
|
||||||
|
record.status,
|
||||||
|
) ? (
|
||||||
<Tooltip title={isPc ? intl.get('取消安装') : ''}>
|
<Tooltip title={isPc ? intl.get('取消安装') : ''}>
|
||||||
<a onClick={() => cancelDependence(record)}>
|
<a onClick={() => cancelDependence(record)}>
|
||||||
<IconFont type="ql-icon-quxiaoanzhuang" />
|
<IconFont type="ql-icon-quxiaoanzhuang" />
|
||||||
|
@ -200,11 +211,13 @@ const Dependence = () => {
|
||||||
<BugOutlined />
|
<BugOutlined />
|
||||||
</a>
|
</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title={isPc ? intl.get('删除') : ''}>
|
{Status.已安装 === record.status && (
|
||||||
<a onClick={() => deleteDependence(record, index)}>
|
<Tooltip title={isPc ? intl.get('删除') : ''}>
|
||||||
<DeleteOutlined />
|
<a onClick={() => deleteDependence(record, index)}>
|
||||||
</a>
|
<DeleteOutlined />
|
||||||
</Tooltip>
|
</a>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
<Tooltip title={isPc ? intl.get('强制删除') : ''}>
|
<Tooltip title={isPc ? intl.get('强制删除') : ''}>
|
||||||
<a onClick={() => deleteDependence(record, index, true)}>
|
<a onClick={() => deleteDependence(record, index, true)}>
|
||||||
<DeleteFilled />
|
<DeleteFilled />
|
||||||
|
|
|
@ -6,6 +6,7 @@ export enum DependenceStatus {
|
||||||
'removed',
|
'removed',
|
||||||
'removeFailed',
|
'removeFailed',
|
||||||
'queued',
|
'queued',
|
||||||
|
'cancelled',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Status {
|
export enum Status {
|
||||||
|
@ -16,4 +17,5 @@ export enum Status {
|
||||||
'已删除',
|
'已删除',
|
||||||
'删除失败',
|
'删除失败',
|
||||||
'队列中',
|
'队列中',
|
||||||
|
'已取消',
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user