Router bugfix, save and update route frontend

This commit is contained in:
2024-03-29 13:33:29 +01:00
parent 90e7024a73
commit 80b5ac07d0
13 changed files with 352 additions and 136 deletions

View File

@@ -217,6 +217,10 @@ export default class API {
return this.apiCall("routes/fetch");
}
async getRoute(id) {
return this.apiCall("routes/get", { id: id });
}
async enableRoute(id) {
return this.apiCall("routes/enable", { id: id });
}
@@ -229,14 +233,22 @@ export default class API {
return this.apiCall("routes/remove", { id: id });
}
async saveRoutes(routes) {
return this.apiCall("routes/save", { routes: routes });
}
async regenerateRouterCache() {
return this.apiCall("routes/generateCache");
}
async testRoute(pattern, path, exact = true) {
return this.apiCall("routes/check", { pattern: pattern, path: path, exact: exact });
}
async addRoute(pattern, type, target, extra, exact, active) {
return this.apiCall("routes/add", { pattern, type, target, extra, exact, active });
}
async updateRoute(id, pattern, type, target, extra, exact, active) {
return this.apiCall("routes/update", { id, pattern, type, target, extra, exact, active });
}
/** GroupAPI **/
async createGroup(name, color) {
return this.apiCall("groups/create", { name: name, color: color });