[web] Reorder methods and attributes

This commit is contained in:
Alain Nussbaumer 2024-04-26 23:09:45 +02:00
parent ea947df50a
commit de847a6711
5 changed files with 26 additions and 26 deletions

View File

@ -265,17 +265,6 @@ export default {
document.querySelector('html').classList.remove('is-clipped') 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() { update_lastfm() {
webapi.lastfm().then(({ data }) => { webapi.lastfm().then(({ data }) => {
this.$store.commit(types.UPDATE_LASTFM, data) this.$store.commit(types.UPDATE_LASTFM, data)
@ -299,12 +288,23 @@ export default {
this.$store.commit(types.UPDATE_LYRICS) this.$store.commit(types.UPDATE_LYRICS)
} }
}, },
update_outputs() {
webapi.outputs().then(({ data }) => {
this.$store.commit(types.UPDATE_OUTPUTS, data.outputs)
})
},
update_pairing() { update_pairing() {
webapi.pairing().then(({ data }) => { webapi.pairing().then(({ data }) => {
this.$store.commit(types.UPDATE_PAIRING, data) this.$store.commit(types.UPDATE_PAIRING, data)
this.pairing_active = data.active 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() { update_queue() {
webapi.queue().then(({ data }) => { webapi.queue().then(({ data }) => {
this.$store.commit(types.UPDATE_QUEUE, data) this.$store.commit(types.UPDATE_QUEUE, data)

View File

@ -74,8 +74,8 @@ export default {
data() { data() {
return { return {
disabled: true, disabled: true,
playlist_name: '', loading: false,
loading: false playlist_name: ''
} }
}, },

View File

@ -125,7 +125,7 @@ export default {
webapi.player_play_expression(this.play_expression, false) webapi.player_play_expression(this.play_expression, false)
}, },
transform(path) { transform(path) {
return { path, name: path.slice(path.lastIndexOf('/') + 1) } return { name: path.slice(path.lastIndexOf('/') + 1), path }
} }
} }
} }

View File

@ -76,8 +76,8 @@ export default {
data() { data() {
return { return {
cursor: mdiCancel,
INTERVAL, INTERVAL,
cursor: mdiCancel,
interval_id: 0, interval_id: 0,
is_dragged: false, is_dragged: false,
selected_item: {}, selected_item: {},

View File

@ -12,23 +12,23 @@ import vue from '@vitejs/plugin-vue'
const owntoneUrl = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689' const owntoneUrl = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689'
export default defineConfig({ export default defineConfig({
resolve: { alias: { '@': '/src' } }, build: {
outDir: '../htdocs',
rollupOptions: {
output: {
assetFileNames: `assets/[name].[ext]`,
chunkFileNames: `assets/[name].js`,
entryFileNames: `assets/[name].js`
}
}
},
plugins: [ plugins: [
vue(), vue(),
i18n({ i18n({
include: path.resolve(__dirname, './src/i18n/**.json') include: path.resolve(__dirname, './src/i18n/**.json')
}) })
], ],
build: { resolve: { alias: { '@': '/src' } },
outDir: '../htdocs',
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`
}
}
},
server: { server: {
proxy: { proxy: {
'/api': { '/api': {