diff --git a/web/index.html b/web/index.html index 31553a2..bbc4f95 100644 --- a/web/index.html +++ b/web/index.html @@ -12,7 +12,7 @@

MSW Open Music Project

diff --git a/web/index.js b/web/index.js index fa0c26f..dcde135 100644 --- a/web/index.js +++ b/web/index.js @@ -347,8 +347,48 @@ const component_search_files = { }, } +const component_get_random_files = { + emits: ['play_audio'], + data() { + return { + files: [], + } + }, + template: ` + + + + + + + + + + + + + + + + +
IDFilenameFolder NameSizeAction
+`, + mounted() { + this.get_random_files() + }, + methods: { + get_random_files() { + axios.get('/api/v1/get_random_files' + ).then(response => { + this.files = response.data.files; + }) + } + }, +} + const routes = [ - { path: '/', component: component_search_files}, + { path: '/', component: component_get_random_files}, + { path: '/search_files', component: component_search_files}, { path: '/search_folders', component: component_search_folders}, { path: '/update_database', component: component_update_database}, ] @@ -376,6 +416,7 @@ app.component('component-update-database', component_update_database) app.component('component-file', component_file) app.component('component-audio-player', component_audio_player) app.component('component-search-files', component_search_files) +app.component('component-get-random-files', component_get_random_files) app.use(router)