Adds in dashboard page showing basic Mantis statistics

This commit is contained in:
Cameron Redmore 2025-04-26 09:32:59 +01:00
parent 7564937faa
commit 92230f8a07
13 changed files with 595 additions and 19 deletions

View file

@ -1,14 +1,30 @@
import { boot } from 'quasar/wrappers';
import axios from 'axios';
// Be careful when using SSR for cross-request state pollution
// due to creating a Singleton instance here;
// If any client changes this (global) instance, it might be a
// good idea to move this instance creation inside of the
// "export default () => {}" function below (which runs individually
// for each client)
import SuperJSON from 'superjson';
axios.defaults.withCredentials = true; // Enable sending cookies with requests
// Export the API instance so you can import it easily elsewhere, e.g. stores
axios.interceptors.response.use(
(response) =>
{
//If the response content type is application/json, we want to parse it with SuperJSON
if (response.headers['content-type'] && response.headers['content-type'].includes('application/json'))
{
try
{
response.data = SuperJSON.parse(JSON.stringify(response.data));
}
catch (error)
{
console.error('Error deserializing response data:', error);
}
}
return response;
},
(error) =>
{
// Handle errors here if needed
return Promise.reject(error);
}
);
export default axios;