mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 22:59:41 +02:00
refactor(frontend): 🚧 Migrate Dashboard to Nuxt
Add API and Functinality for Admin Dashboard. Stills needs to clean-up. See // TODO's
This commit is contained in:
parent
41a6916771
commit
9386cc320b
32 changed files with 671 additions and 113 deletions
51
frontend/api/class-interfaces/debug.ts
Normal file
51
frontend/api/class-interfaces/debug.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { BaseAPI } from "./_base";
|
||||
|
||||
export interface AppStatistics {
|
||||
totalRecipes: number;
|
||||
totalUsers: number;
|
||||
totalGroups: number;
|
||||
uncategorizedRecipes: number;
|
||||
untaggedRecipes: number;
|
||||
}
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
const routes = {
|
||||
debugVersion: `${prefix}/debug/version`,
|
||||
debug: `${prefix}/debug`,
|
||||
debugStatistics: `${prefix}/debug/statistics`,
|
||||
debugLastRecipeJson: `${prefix}/debug/last-recipe-json`,
|
||||
debugLog: `${prefix}/debug/log`,
|
||||
|
||||
debugLogNum: (num: number) => `${prefix}/debug/log/${num}`,
|
||||
};
|
||||
|
||||
export class DebugAPI extends BaseAPI {
|
||||
/** Returns the current version of mealie
|
||||
*/
|
||||
async getMealieVersion() {
|
||||
return await this.requests.get(routes.debugVersion);
|
||||
}
|
||||
|
||||
/** Returns general information about the application for debugging
|
||||
*/
|
||||
async getDebugInfo() {
|
||||
return await this.requests.get(routes.debug);
|
||||
}
|
||||
|
||||
async getAppStatistics() {
|
||||
return await this.requests.get<AppStatistics>(routes.debugStatistics);
|
||||
}
|
||||
|
||||
/** Doc Str
|
||||
*/
|
||||
async getLog(num: number) {
|
||||
return await this.requests.get(routes.debugLogNum(num));
|
||||
}
|
||||
|
||||
/** Returns a token to download a file
|
||||
*/
|
||||
async getLogFile() {
|
||||
return await this.requests.get(routes.debugLog);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue