mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-30 17:53:31 -04: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:
		
							
								
								
									
										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); | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user