mirror of
https://github.com/joaovitoriasilva/endurain.git
synced 2026-01-10 08:17:59 -05:00
[backend] added login_photo_set column to server_settings [backend] added ENVIRONMENT env variable [backend] added server_images [backend] added protections to server_images and user_images logic [backend] fixed issue on gpx laps processing with no variables initialized [backend] CORS now in production only accept requests from ENDURAIN_HOST variable [docs] updated docs with new env variable and new volume [frontend] added support to new column on server settings store
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import { defineStore } from 'pinia';
|
|
import { serverSettings } from '@/services/serverSettingsService';
|
|
|
|
export const useServerSettingsStore = defineStore('serverSettings', {
|
|
state: () => ({
|
|
serverSettings: {
|
|
id: 1,
|
|
units: 1,
|
|
public_shareable_links: false,
|
|
public_shareable_links_user_info: false,
|
|
login_photo_set: false,
|
|
},
|
|
}),
|
|
actions: {
|
|
setServerSettings(serverSettings) {
|
|
this.serverSettings = serverSettings;
|
|
localStorage.setItem('serverSettings', JSON.stringify(this.serverSettings));
|
|
},
|
|
loadServerSettingsFromStorage() {
|
|
const storedServerSettings = localStorage.getItem('serverSettings');
|
|
if (storedServerSettings) {
|
|
this.serverSettings = JSON.parse(storedServerSettings);
|
|
} else {
|
|
this.loadServerSettingsFromServer();
|
|
}
|
|
},
|
|
async loadServerSettingsFromServer() {
|
|
const settings = await serverSettings.getPublicServerSettings();
|
|
this.setServerSettings(settings);
|
|
}
|
|
},
|
|
}); |