|
@ -90,6 +90,9 @@ new Vue({ |
|
|
|
|
|
|
|
|
uiChartType: 0, |
|
|
uiChartType: 0, |
|
|
uiShowLinks: false, |
|
|
uiShowLinks: false, |
|
|
|
|
|
enableSortClient: false, |
|
|
|
|
|
sortClient: true, // Sort clients by name, true = asc, false = desc
|
|
|
|
|
|
|
|
|
uiShowCharts: localStorage.getItem('uiShowCharts') === '1', |
|
|
uiShowCharts: localStorage.getItem('uiShowCharts') === '1', |
|
|
uiTheme: localStorage.theme || 'auto', |
|
|
uiTheme: localStorage.theme || 'auto', |
|
|
prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)'), |
|
|
prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)'), |
|
@ -175,8 +178,6 @@ new Vue({ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
enableSortClient: true, |
|
|
|
|
|
sortClient: true, // Sort clients by name, true = asc, false = desc
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
dateTime: (value) => { |
|
|
dateTime: (value) => { |
|
@ -252,7 +253,7 @@ new Vue({ |
|
|
return client; |
|
|
return client; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (enableSortClient) { |
|
|
if (this.enableSortClient) { |
|
|
this.clients = sortByProperty(this.clients, 'name', this.sortClient); |
|
|
this.clients = sortByProperty(this.clients, 'name', this.sortClient); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -424,6 +425,14 @@ new Vue({ |
|
|
this.uiShowLinks = false; |
|
|
this.uiShowLinks = false; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.api.getUiSortClients() |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
this.enableSortClient = res; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
this.enableSortClient = false; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Promise.resolve().then(async () => { |
|
|
Promise.resolve().then(async () => { |
|
|
const lang = await this.api.getLang(); |
|
|
const lang = await this.api.getLang(); |
|
|
if (lang !== localStorage.getItem('lang') && i18n.availableLocales.includes(lang)) { |
|
|
if (lang !== localStorage.getItem('lang') && i18n.availableLocales.includes(lang)) { |
|
@ -431,8 +440,6 @@ new Vue({ |
|
|
i18n.locale = lang; |
|
|
i18n.locale = lang; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.enableSortClient = await this.api.getUiSortClients(); |
|
|
|
|
|
|
|
|
|
|
|
const currentRelease = await this.api.getRelease(); |
|
|
const currentRelease = await this.api.getRelease(); |
|
|
const latestRelease = await fetch('https://wg-easy.github.io/wg-easy/changelog.json') |
|
|
const latestRelease = await fetch('https://wg-easy.github.io/wg-easy/changelog.json') |
|
|
.then((res) => res.json()) |
|
|
.then((res) => res.json()) |
|
|