Merge pull request #147 from ghotso/develop-fix_max_retries_issue

fix(services-form): make retry attempts select controlled and synced with form state
This commit is contained in:
Tola Leng
2025-08-24 13:49:31 +07:00
committed by GitHub
3 changed files with 314 additions and 299 deletions
@@ -96,7 +96,7 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) {
<FormItem> <FormItem>
<FormLabel>{t("retryAttempts")}</FormLabel> <FormLabel>{t("retryAttempts")}</FormLabel>
<FormControl> <FormControl>
<Select onValueChange={field.onChange} defaultValue={field.value}> <Select onValueChange={field.onChange} value={field.value ?? "3"}>
<SelectTrigger> <SelectTrigger>
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
@@ -1,137 +1,144 @@
/// <reference path="../pb_data/types.d.ts" /> /// <reference path="../pb_data/types.d.ts" />
migrate((app) => { migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_2018671343"); try {
const collection = app.findCollectionByNameOrId("pbc_2018671343");
return app.delete(collection); return app.delete(collection);
} catch (e) {
console.warn("Skip delete (server_processes):", e?.message);
}
}, (app) => { }, (app) => {
const collection = new Collection({ try {
"createRule": "", const collection = new Collection({
"deleteRule": "", "createRule": "",
"fields": [ "deleteRule": "",
{ "fields": [
"autogeneratePattern": "[a-z0-9]{15}", {
"hidden": false, "autogeneratePattern": "[a-z0-9]{15}",
"id": "text3208210256", "hidden": false,
"max": 15, "id": "text3208210256",
"min": 15, "max": 15,
"name": "id", "min": 15,
"pattern": "^[a-z0-9]+$", "name": "id",
"presentable": false, "pattern": "^[a-z0-9]+$",
"primaryKey": true, "presentable": false,
"required": true, "primaryKey": true,
"system": true, "required": true,
"type": "text" "system": true,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text407168695", "hidden": false,
"max": 0, "id": "text407168695",
"min": 0, "max": 0,
"name": "server_id", "min": 0,
"pattern": "", "name": "server_id",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text1431356653", "hidden": false,
"max": 0, "id": "text1431356653",
"min": 0, "max": 0,
"name": "pid", "min": 0,
"pattern": "", "name": "pid",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text1579384326", "hidden": false,
"max": 0, "id": "text1579384326",
"min": 0, "max": 0,
"name": "name", "min": 0,
"pattern": "", "name": "name",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"hidden": false, {
"id": "number1391558374", "hidden": false,
"max": null, "id": "number1391558374",
"min": null, "max": null,
"name": "memory_percent", "min": null,
"onlyInt": false, "name": "memory_percent",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "number2651913466", "hidden": false,
"max": null, "id": "number2651913466",
"min": null, "max": null,
"name": "cpu_percent", "min": null,
"onlyInt": false, "name": "cpu_percent",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text2063623452", "hidden": false,
"max": 0, "id": "text2063623452",
"min": 0, "max": 0,
"name": "status", "min": 0,
"pattern": "", "name": "status",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"hidden": false, {
"id": "autodate2990389176", "hidden": false,
"name": "created", "id": "autodate2990389176",
"onCreate": true, "name": "created",
"onUpdate": false, "onCreate": true,
"presentable": false, "onUpdate": false,
"system": false, "presentable": false,
"type": "autodate" "system": false,
}, "type": "autodate"
{ },
"hidden": false, {
"id": "autodate3332085495", "hidden": false,
"name": "updated", "id": "autodate3332085495",
"onCreate": true, "name": "updated",
"onUpdate": true, "onCreate": true,
"presentable": false, "onUpdate": true,
"system": false, "presentable": false,
"type": "autodate" "system": false,
} "type": "autodate"
], }
"id": "pbc_2018671343", ],
"indexes": [], "id": "pbc_2018671343",
"listRule": "", "indexes": [],
"name": "server_processes", "listRule": "",
"system": false, "name": "server_processes",
"type": "base", "system": false,
"updateRule": "", "type": "base",
"viewRule": "" "updateRule": "",
}); "viewRule": ""
});
return app.save(collection); return app.save(collection);
}) } catch (e) {
console.warn("Skip rollback (server_processes):", e?.message);
}
});
@@ -1,170 +1,178 @@
/// <reference path="../pb_data/types.d.ts" /> /// <reference path="../pb_data/types.d.ts" />
migrate((app) => { migrate((app) => {
const collection = app.findCollectionByNameOrId("pbc_3414192583");
return app.delete(collection); try {
const collection = app.findCollectionByNameOrId("pbc_3414192583");
return app.delete(collection);
} catch (e) {
console.warn("Skip delete (server_notifications):", e?.message);
}
}, (app) => { }, (app) => {
const collection = new Collection({ try {
"createRule": "", const collection = new Collection({
"deleteRule": "", "createRule": "",
"fields": [ "deleteRule": "",
{ "fields": [
"autogeneratePattern": "[a-z0-9]{15}", {
"hidden": false, "autogeneratePattern": "[a-z0-9]{15}",
"id": "text3208210256", "hidden": false,
"max": 15, "id": "text3208210256",
"min": 15, "max": 15,
"name": "id", "min": 15,
"pattern": "^[a-z0-9]+$", "name": "id",
"presentable": false, "pattern": "^[a-z0-9]+$",
"primaryKey": true, "presentable": false,
"required": true, "primaryKey": true,
"system": true, "required": true,
"type": "text" "system": true,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text407168695", "hidden": false,
"max": 0, "id": "text407168695",
"min": 0, "max": 0,
"name": "server_id", "min": 0,
"pattern": "", "name": "server_id",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text3065852031", "hidden": false,
"max": 0, "id": "text3065852031",
"min": 0, "max": 0,
"name": "message", "min": 0,
"pattern": "", "name": "message",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"autogeneratePattern": "", {
"hidden": false, "autogeneratePattern": "",
"id": "text887233555", "hidden": false,
"max": 0, "id": "text887233555",
"min": 0, "max": 0,
"name": "notification_type", "min": 0,
"pattern": "", "name": "notification_type",
"presentable": false, "pattern": "",
"primaryKey": false, "presentable": false,
"required": false, "primaryKey": false,
"system": false, "required": false,
"type": "text" "system": false,
}, "type": "text"
{ },
"hidden": false, {
"id": "date3805952114", "hidden": false,
"max": "", "id": "date3805952114",
"min": "", "max": "",
"name": "read_at", "min": "",
"presentable": false, "name": "read_at",
"required": false, "presentable": false,
"system": false, "required": false,
"type": "date" "system": false,
}, "type": "date"
{ },
"hidden": false, {
"id": "number1377725610", "hidden": false,
"max": null, "id": "number1377725610",
"min": null, "max": null,
"name": "cpu_threshold", "min": null,
"onlyInt": false, "name": "cpu_threshold",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "number3087505384", "hidden": false,
"max": null, "id": "number3087505384",
"min": null, "max": null,
"name": "ram_threshold", "min": null,
"onlyInt": false, "name": "ram_threshold",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "number2833320134", "hidden": false,
"max": null, "id": "number2833320134",
"min": null, "max": null,
"name": "disk_threshold", "min": null,
"onlyInt": false, "name": "disk_threshold",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "number1826572927", "hidden": false,
"max": null, "id": "number1826572927",
"min": null, "max": null,
"name": "network_threshold", "min": null,
"onlyInt": false, "name": "network_threshold",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "number2184331740", "hidden": false,
"max": null, "id": "number2184331740",
"min": null, "max": null,
"name": "notification_config_id", "min": null,
"onlyInt": false, "name": "notification_config_id",
"presentable": false, "onlyInt": false,
"required": false, "presentable": false,
"system": false, "required": false,
"type": "number" "system": false,
}, "type": "number"
{ },
"hidden": false, {
"id": "autodate2990389176", "hidden": false,
"name": "created", "id": "autodate2990389176",
"onCreate": true, "name": "created",
"onUpdate": false, "onCreate": true,
"presentable": false, "onUpdate": false,
"system": false, "presentable": false,
"type": "autodate" "system": false,
}, "type": "autodate"
{ },
"hidden": false, {
"id": "autodate3332085495", "hidden": false,
"name": "updated", "id": "autodate3332085495",
"onCreate": true, "name": "updated",
"onUpdate": true, "onCreate": true,
"presentable": false, "onUpdate": true,
"system": false, "presentable": false,
"type": "autodate" "system": false,
} "type": "autodate"
], }
"id": "pbc_3414192583", ],
"indexes": [], "id": "pbc_3414192583",
"listRule": "", "indexes": [],
"name": "server_notifications", "listRule": "",
"system": false, "name": "server_notifications",
"type": "base", "system": false,
"updateRule": "", "type": "base",
"viewRule": "" "updateRule": "",
}); "viewRule": ""
});
return app.save(collection); return app.save(collection);
}) } catch (e) {
console.warn("Skip rollback (server_notifications):", e?.message);
}
});