exclusions editor fix: (#692)
- backend: fix updating model after exclusions change - frontend: don't check for new_cid, just success - fixes #691
This commit is contained in:
parent
7528f2ec6d
commit
de9212eec7
@ -619,7 +619,7 @@ class CrawlOps:
|
|||||||
)
|
)
|
||||||
|
|
||||||
await self.crawls.find_one_and_update(
|
await self.crawls.find_one_and_update(
|
||||||
{"_id": crawl_id, "oid": org.id}, {"$set": {"config": new_config}}
|
{"_id": crawl_id, "oid": org.id}, {"$set": {"config": new_config.dict()}}
|
||||||
)
|
)
|
||||||
|
|
||||||
resp = {"success": True}
|
resp = {"success": True}
|
||||||
|
@ -157,7 +157,7 @@ export class ExclusionEditor extends LiteElement {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data.new_cid) {
|
if (data.success) {
|
||||||
this.notify({
|
this.notify({
|
||||||
message: msg(html`Removed exclusion: <code>${regex}</code>`),
|
message: msg(html`Removed exclusion: <code>${regex}</code>`),
|
||||||
variant: "success",
|
variant: "success",
|
||||||
@ -165,9 +165,7 @@ export class ExclusionEditor extends LiteElement {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new CustomEvent("on-success", {
|
new CustomEvent("on-success")
|
||||||
detail: { cid: data.new_cid },
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw data;
|
throw data;
|
||||||
@ -229,7 +227,7 @@ export class ExclusionEditor extends LiteElement {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (data.new_cid) {
|
if (data.success) {
|
||||||
this.notify({
|
this.notify({
|
||||||
message: msg("Exclusion added."),
|
message: msg("Exclusion added."),
|
||||||
variant: "success",
|
variant: "success",
|
||||||
@ -242,9 +240,7 @@ export class ExclusionEditor extends LiteElement {
|
|||||||
|
|
||||||
onSuccess();
|
onSuccess();
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new CustomEvent("on-success", {
|
new CustomEvent("on-success")
|
||||||
detail: { cid: data.new_cid },
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw data;
|
throw data;
|
||||||
|
@ -22,7 +22,7 @@ const defaultValue = {
|
|||||||
},
|
},
|
||||||
tags: [],
|
tags: [],
|
||||||
crawlTimeout: null,
|
crawlTimeout: null,
|
||||||
jobType: "custom",
|
jobType: undefined,
|
||||||
scale: 1,
|
scale: 1,
|
||||||
} as WorkflowParams;
|
} as WorkflowParams;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export type SeedConfig = Pick<
|
|||||||
export type JobType = "url-list" | "seed-crawl" | "custom";
|
export type JobType = "url-list" | "seed-crawl" | "custom";
|
||||||
|
|
||||||
export type WorkflowParams = {
|
export type WorkflowParams = {
|
||||||
jobType: JobType;
|
jobType?: JobType;
|
||||||
name: string;
|
name: string;
|
||||||
schedule: string;
|
schedule: string;
|
||||||
scale: number;
|
scale: number;
|
||||||
|
Loading…
Reference in New Issue
Block a user