支持定时任务视图筛选条件关系切换

This commit is contained in:
whyour
2022-11-10 01:31:21 +08:00
parent c72abd29ec
commit 7038e15ad2
12 changed files with 127 additions and 64 deletions
+5 -1
View File
@@ -7,7 +7,8 @@ interface SortType {
}
interface FilterType {
type: 'or' | 'and';
property: string;
operation: string;
value: string;
}
@@ -18,6 +19,7 @@ export class CrontabView {
isDisabled?: 1 | 0;
filters?: FilterType[];
sorts?: SortType[];
filterRelation?: 'and' | 'or';
constructor(options: CrontabView) {
this.name = options.name;
@@ -26,6 +28,7 @@ export class CrontabView {
this.isDisabled = options.isDisabled || 0;
this.filters = options.filters;
this.sorts = options.sorts;
this.filterRelation = options.filterRelation;
}
}
@@ -43,5 +46,6 @@ export const CrontabViewModel = sequelize.define<CronViewInstance>(
isDisabled: DataTypes.NUMBER,
filters: DataTypes.JSON,
sorts: DataTypes.JSON,
filterRelation: { type: DataTypes.STRING, defaultValue: 'and' },
},
);
+3
View File
@@ -28,6 +28,7 @@ export class Subscription {
extensions?: string;
sub_before?: string;
sub_after?: string;
proxy?: string;
constructor(options: Subscription) {
this.id = options.id;
@@ -54,6 +55,7 @@ export class Subscription {
this.extensions = options.extensions;
this.sub_before = options.sub_before;
this.sub_after = options.sub_after;
this.proxy = options.proxy;
}
}
@@ -102,5 +104,6 @@ export const SubscriptionModel = sequelize.define<SubscriptionInstance>(
log_path: DataTypes.STRING,
schedule_type: DataTypes.STRING,
alias: { type: DataTypes.STRING, unique: 'alias' },
proxy: { type: DataTypes.STRING, allowNull: true },
},
);