mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
feat: admin maintenance page (#1096)
* fix build typo * generate types * setup maintenance api for common cleanup actions * admin maintenance page * remove duplicate use-with-caution
This commit is contained in:
parent
ffb3b45ac2
commit
4ef649231b
12 changed files with 376 additions and 2 deletions
30
frontend/api/admin/admin-maintenance.ts
Normal file
30
frontend/api/admin/admin-maintenance.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { BaseAPI } from "../_base";
|
||||
import { SuccessResponse } from "~/types/api-types/response";
|
||||
import { MaintenanceSummary } from "~/types/api-types/admin";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
const routes = {
|
||||
base: `${prefix}/admin/maintenance`,
|
||||
cleanImages: `${prefix}/admin/maintenance/clean/images`,
|
||||
cleanRecipeFolders: `${prefix}/admin/maintenance/clean/recipe-folders`,
|
||||
cleanLogFile: `${prefix}/admin/maintenance/clean/logs`,
|
||||
};
|
||||
|
||||
export class AdminMaintenanceApi extends BaseAPI {
|
||||
async getInfo() {
|
||||
return this.requests.get<MaintenanceSummary>(routes.base);
|
||||
}
|
||||
|
||||
async cleanImages() {
|
||||
return await this.requests.post<SuccessResponse>(routes.cleanImages, {});
|
||||
}
|
||||
|
||||
async cleanRecipeFolders() {
|
||||
return await this.requests.post<SuccessResponse>(routes.cleanRecipeFolders, {});
|
||||
}
|
||||
|
||||
async cleanLogFile() {
|
||||
return await this.requests.post<SuccessResponse>(routes.cleanLogFile, {});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue