Browse Source

Lint & Fix workdir in Dockerfile

pull/937/head
Sergei Birukov 2 years ago
parent
commit
2fc1cc4873
  1. 2
      Dockerfile
  2. 2
      src/lib/Server.js
  3. 7
      webui/src/store/store.js

2
Dockerfile

@ -48,5 +48,5 @@ RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy
ENV DEBUG=Server,WireGuard ENV DEBUG=Server,WireGuard
# Run Web UI # Run Web UI
WORKDIR /app/server WORKDIR /app
CMD ["/usr/bin/dumb-init", "node", "server.js"] CMD ["/usr/bin/dumb-init", "node", "server.js"]

2
src/lib/Server.js

@ -64,6 +64,7 @@ const isPasswordValid = (password) => {
}; };
module.exports = class Server { module.exports = class Server {
constructor() { constructor() {
const app = createApp(); const app = createApp();
this.app = app; this.app = app;
@ -340,4 +341,5 @@ module.exports = class Server {
createServer(toNodeListener(app)).listen(PORT, WEBUI_HOST); createServer(toNodeListener(app)).listen(PORT, WEBUI_HOST);
debug(`Listening on http://${WEBUI_HOST}:${PORT}`); debug(`Listening on http://${WEBUI_HOST}:${PORT}`);
} }
}; };

7
webui/src/store/store.js

@ -21,9 +21,7 @@ export const useStore = defineStore('store', () => {
const dateFnsLocale = ref(); const dateFnsLocale = ref();
const uiTheme = ref(localStorage.theme || 'auto'); const uiTheme = ref(localStorage.theme || 'auto');
const prefersDarkScheme = computed(() => const prefersDarkScheme = computed(() => window.matchMedia('(prefers-color-scheme: dark)'));
window.matchMedia('(prefers-color-scheme: dark)')
);
const uiChartType = ref(0); const uiChartType = ref(0);
const uiShowCharts = ref(localStorage.getItem('uiShowCharts') === '1'); const uiShowCharts = ref(localStorage.getItem('uiShowCharts') === '1');
@ -166,7 +164,8 @@ export const useStore = defineStore('store', () => {
} }
function setTheme() { function setTheme() {
const { classList } = document.documentElement; const { classList } = document.documentElement;
const shouldAddDarkClass = uiTheme.value === 'dark' || (uiTheme.value === 'auto' && prefersDarkScheme.value.matches); const shouldAddDarkClass =
uiTheme.value === 'dark' || (uiTheme.value === 'auto' && prefersDarkScheme.value.matches);
classList.toggle('dark', shouldAddDarkClass); classList.toggle('dark', shouldAddDarkClass);
} }

Loading…
Cancel
Save