From de847a671151c51fb5463dff30e650f4aec09b1e Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Fri, 26 Apr 2024 23:09:45 +0200 Subject: [PATCH] [web] Reorder methods and attributes --- web-src/src/App.vue | 22 +++++++++---------- .../components/ModalDialogPlaylistSave.vue | 4 ++-- web-src/src/pages/PageFiles.vue | 2 +- web-src/src/pages/PageNowPlaying.vue | 2 +- web-src/vite.config.js | 22 +++++++++---------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/web-src/src/App.vue b/web-src/src/App.vue index 5fd2c825..25d2ea03 100644 --- a/web-src/src/App.vue +++ b/web-src/src/App.vue @@ -265,17 +265,6 @@ export default { document.querySelector('html').classList.remove('is-clipped') } }, - update_outputs() { - webapi.outputs().then(({ data }) => { - this.$store.commit(types.UPDATE_OUTPUTS, data.outputs) - }) - }, - update_player_status() { - webapi.player_status().then(({ data }) => { - this.$store.commit(types.UPDATE_PLAYER_STATUS, data) - this.update_lyrics() - }) - }, update_lastfm() { webapi.lastfm().then(({ data }) => { this.$store.commit(types.UPDATE_LASTFM, data) @@ -299,12 +288,23 @@ export default { this.$store.commit(types.UPDATE_LYRICS) } }, + update_outputs() { + webapi.outputs().then(({ data }) => { + this.$store.commit(types.UPDATE_OUTPUTS, data.outputs) + }) + }, update_pairing() { webapi.pairing().then(({ data }) => { this.$store.commit(types.UPDATE_PAIRING, data) this.pairing_active = data.active }) }, + update_player_status() { + webapi.player_status().then(({ data }) => { + this.$store.commit(types.UPDATE_PLAYER_STATUS, data) + this.update_lyrics() + }) + }, update_queue() { webapi.queue().then(({ data }) => { this.$store.commit(types.UPDATE_QUEUE, data) diff --git a/web-src/src/components/ModalDialogPlaylistSave.vue b/web-src/src/components/ModalDialogPlaylistSave.vue index 16d399a3..4d033a10 100644 --- a/web-src/src/components/ModalDialogPlaylistSave.vue +++ b/web-src/src/components/ModalDialogPlaylistSave.vue @@ -74,8 +74,8 @@ export default { data() { return { disabled: true, - playlist_name: '', - loading: false + loading: false, + playlist_name: '' } }, diff --git a/web-src/src/pages/PageFiles.vue b/web-src/src/pages/PageFiles.vue index 02e42a72..794fc49a 100644 --- a/web-src/src/pages/PageFiles.vue +++ b/web-src/src/pages/PageFiles.vue @@ -125,7 +125,7 @@ export default { webapi.player_play_expression(this.play_expression, false) }, transform(path) { - return { path, name: path.slice(path.lastIndexOf('/') + 1) } + return { name: path.slice(path.lastIndexOf('/') + 1), path } } } } diff --git a/web-src/src/pages/PageNowPlaying.vue b/web-src/src/pages/PageNowPlaying.vue index 842fad86..e1012cef 100644 --- a/web-src/src/pages/PageNowPlaying.vue +++ b/web-src/src/pages/PageNowPlaying.vue @@ -76,8 +76,8 @@ export default { data() { return { - cursor: mdiCancel, INTERVAL, + cursor: mdiCancel, interval_id: 0, is_dragged: false, selected_item: {}, diff --git a/web-src/vite.config.js b/web-src/vite.config.js index 87933a3b..ded9fd15 100644 --- a/web-src/vite.config.js +++ b/web-src/vite.config.js @@ -12,23 +12,23 @@ import vue from '@vitejs/plugin-vue' const owntoneUrl = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689' export default defineConfig({ - resolve: { alias: { '@': '/src' } }, + build: { + outDir: '../htdocs', + rollupOptions: { + output: { + assetFileNames: `assets/[name].[ext]`, + chunkFileNames: `assets/[name].js`, + entryFileNames: `assets/[name].js` + } + } + }, plugins: [ vue(), i18n({ include: path.resolve(__dirname, './src/i18n/**.json') }) ], - build: { - outDir: '../htdocs', - rollupOptions: { - output: { - entryFileNames: `assets/[name].js`, - chunkFileNames: `assets/[name].js`, - assetFileNames: `assets/[name].[ext]` - } - } - }, + resolve: { alias: { '@': '/src' } }, server: { proxy: { '/api': {