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',
|
||||
'removeFailed',
|
||||
'queued',
|
||||
'cancelled',
|
||||
}
|
||||
|
||||
export enum DependenceTypes {
|
||||
|
|
|
@ -165,7 +165,10 @@ export default class DependenceService {
|
|||
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[]> {
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
"删除中": "Deleting",
|
||||
"已删除": "Deleted",
|
||||
"删除失败": "Deletion Failed",
|
||||
"已取消": "Cancelled",
|
||||
"序号": "Number",
|
||||
"备注": "Remarks",
|
||||
"更新时间": "Update Time",
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
"删除中": "删除中",
|
||||
"已删除": "已删除",
|
||||
"删除失败": "删除失败",
|
||||
"已取消": "已取消",
|
||||
"序号": "序号",
|
||||
"备注": "备注",
|
||||
"更新时间": "更新时间",
|
||||
|
|
|
@ -22,6 +22,7 @@ import {
|
|||
FileTextOutlined,
|
||||
CloseCircleOutlined,
|
||||
ClockCircleOutlined,
|
||||
MinusCircleOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import config from '@/utils/config';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
|
@ -77,6 +78,10 @@ const StatusMap: Record<number, { icon: React.ReactNode; color: string }> = {
|
|||
icon: <ClockCircleOutlined />,
|
||||
color: 'default',
|
||||
},
|
||||
7: {
|
||||
icon: <MinusCircleOutlined />,
|
||||
color: 'default',
|
||||
},
|
||||
};
|
||||
|
||||
const Dependence = () => {
|
||||
|
@ -129,6 +134,10 @@ const Dependence = () => {
|
|||
text: intl.get('删除失败'),
|
||||
value: DependenceStatus.removeFailed,
|
||||
},
|
||||
{
|
||||
text: intl.get('已取消'),
|
||||
value: DependenceStatus.cancelled,
|
||||
},
|
||||
],
|
||||
render: (text: string, record: any, index: number) => {
|
||||
return (
|
||||
|
@ -176,7 +185,7 @@ const Dependence = () => {
|
|||
const isPc = !isPhone;
|
||||
return (
|
||||
<Space size="middle">
|
||||
{![Status.队列中].includes(record.status) && (
|
||||
{![Status.队列中, Status.已取消].includes(record.status) && (
|
||||
<Tooltip title={isPc ? intl.get('日志') : ''}>
|
||||
<a
|
||||
onClick={() => {
|
||||
|
@ -187,7 +196,9 @@ const Dependence = () => {
|
|||
</a>
|
||||
</Tooltip>
|
||||
)}
|
||||
{[Status.队列中, Status.安装中, Status.删除中].includes(record.status) ? (
|
||||
{[Status.队列中, Status.安装中, Status.删除中].includes(
|
||||
record.status,
|
||||
) ? (
|
||||
<Tooltip title={isPc ? intl.get('取消安装') : ''}>
|
||||
<a onClick={() => cancelDependence(record)}>
|
||||
<IconFont type="ql-icon-quxiaoanzhuang" />
|
||||
|
@ -200,11 +211,13 @@ const Dependence = () => {
|
|||
<BugOutlined />
|
||||
</a>
|
||||
</Tooltip>
|
||||
{Status.已安装 === record.status && (
|
||||
<Tooltip title={isPc ? intl.get('删除') : ''}>
|
||||
<a onClick={() => deleteDependence(record, index)}>
|
||||
<DeleteOutlined />
|
||||
</a>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip title={isPc ? intl.get('强制删除') : ''}>
|
||||
<a onClick={() => deleteDependence(record, index, true)}>
|
||||
<DeleteFilled />
|
||||
|
|
|
@ -6,6 +6,7 @@ export enum DependenceStatus {
|
|||
'removed',
|
||||
'removeFailed',
|
||||
'queued',
|
||||
'cancelled',
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
|
@ -16,4 +17,5 @@ export enum Status {
|
|||
'已删除',
|
||||
'删除失败',
|
||||
'队列中',
|
||||
'已取消',
|
||||
}
|
Loading…
Reference in New Issue
Block a user