diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 311fc8da4..f49f3257e 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,47 +1,36 @@
-
-
-
-
-
- {{ snackbarStatus.msg }}
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
diff --git a/frontend/src/components/AppBar/Base.vue b/frontend/src/components/AppBar/Base.vue
new file mode 100644
index 000000000..196f74ebf
--- /dev/null
+++ b/frontend/src/components/AppBar/Base.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/AppBar/HomeBtn.vue b/frontend/src/components/AppBar/HomeBtn.vue
new file mode 100644
index 000000000..2b7666968
--- /dev/null
+++ b/frontend/src/components/AppBar/HomeBtn.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+ RomM
+
+
diff --git a/frontend/src/components/AppBar/PlatformsBtn.vue b/frontend/src/components/AppBar/PlatformsBtn.vue
new file mode 100644
index 000000000..20c043825
--- /dev/null
+++ b/frontend/src/components/AppBar/PlatformsBtn.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/AppBar/SearchBar.vue b/frontend/src/components/AppBar/SearchBar.vue
new file mode 100644
index 000000000..f16c45cc9
--- /dev/null
+++ b/frontend/src/components/AppBar/SearchBar.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/frontend/src/components/AppBar/SettingsBtn.vue b/frontend/src/components/AppBar/SettingsBtn.vue
new file mode 100644
index 000000000..02e35e2b2
--- /dev/null
+++ b/frontend/src/components/AppBar/SettingsBtn.vue
@@ -0,0 +1,16 @@
+
+
+
+
+ mdi-cog
+
+
\ No newline at end of file
diff --git a/frontend/src/components/AppBar/UploadBtn.vue b/frontend/src/components/AppBar/UploadBtn.vue
new file mode 100644
index 000000000..750e80fbc
--- /dev/null
+++ b/frontend/src/components/AppBar/UploadBtn.vue
@@ -0,0 +1,19 @@
+
+
+
+
+ mdi-upload
+
+
\ No newline at end of file
diff --git a/frontend/src/components/Navigation.vue b/frontend/src/components/Navigation.vue
deleted file mode 100644
index 55abd72e7..000000000
--- a/frontend/src/components/Navigation.vue
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
-
-
-
-
- Settings
-
-
-
-
-
-
-
-
-
-
- Scan
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RomM v{{ ROMM_VERSION }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- RomM
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-upload
-
-
-
-
- mdi-cog
-
-
-
-
-
-
-
-
-
- {{ rail ? '' : platform.name }}
-
-
-
-
- {{ platform.n_roms }}
-
-
-
-
-
-
- mdi-arrow-collapse-right
- mdi-arrow-collapse-left
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/Notification.vue b/frontend/src/components/Notification.vue
new file mode 100644
index 000000000..50d19b310
--- /dev/null
+++ b/frontend/src/components/Notification.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+ {{ snackbarStatus.msg }}
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/PlatformsDrawer.vue b/frontend/src/components/PlatformsDrawer.vue
new file mode 100644
index 000000000..1927ae490
--- /dev/null
+++ b/frontend/src/components/PlatformsDrawer.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+ {{ rail ? '' : platform.name }}
+
+
+
+
+ {{ platform.n_roms }}
+
+
+
+
+
+
+ mdi-arrow-collapse-right
+ mdi-arrow-collapse-left
+
+
+
+
+
+
+
diff --git a/frontend/src/components/SettingsDrawer.vue b/frontend/src/components/SettingsDrawer.vue
new file mode 100644
index 000000000..dd1d50c35
--- /dev/null
+++ b/frontend/src/components/SettingsDrawer.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+ Settings
+
+
+
+
+
+
+
+
+
+
+ Scan
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RomM v{{ ROMM_VERSION }}
+
+
+
+
diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js
index 0f255f8d3..fae2377e8 100644
--- a/frontend/src/router/index.js
+++ b/frontend/src/router/index.js
@@ -4,11 +4,11 @@ import { createRouter, createWebHistory } from 'vue-router'
const routes = [
{
path: '/',
- component: () => import('@/components/RomsGallery.vue')
+ component: () => import('@/views/Gallery.vue')
},
{
path: '/details',
- component: () => import('@/components/RomDetails.vue')
+ component: () => import('@/views/Details.vue')
}
]
diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js
index 81a2a0c51..bba7b92e9 100644
--- a/frontend/src/utils/utils.js
+++ b/frontend/src/utils/utils.js
@@ -4,28 +4,22 @@ import { saveAs } from 'file-saver'
export async function downloadRom(rom, emitter, filesToDownload=[]) {
- console.log("Downloading "+rom.file_name)
emitter.emit('snackbarScan', {'msg': "Downloading "+rom.file_name+"...", 'icon': 'mdi-download', 'color': 'green'})
if(rom.multi){
+ const zip = new JSZip()
+ var zipFilename = rom.file_name+".zip"
var files = []
toRaw(filesToDownload).forEach(f => {files.push(toRaw(f))})
- var zipFilename = rom.file_name+".zip"
- const zip = new JSZip()
- var count = 0
if (files.length == 0){ files = rom.files }
+ var count = 0
files.forEach(async function (file_part) {
var file_full_path = "/assets"+rom.file_path+"/"+rom.file_name+"/"+file_part
- console.log("downloading part: "+file_full_path)
var file = await fetch(file_full_path)
var fileBlob = await file.blob()
var f = zip.folder(rom.file_name);
f.file(file_part, fileBlob, { binary: true });
count ++
- if (count == files.length) {
- zip.generateAsync({ type: 'blob' }).then(function (content) {
- saveAs(content, zipFilename);
- });
- }
+ if (count == files.length) { zip.generateAsync({ type: 'blob' }).then(function (content) { saveAs(content, zipFilename); }); }
})
}
else{
@@ -36,6 +30,4 @@ export async function downloadRom(rom, emitter, filesToDownload=[]) {
}
}
-export async function downloadSave(rom, emitter) {
- console.log("Downloading "+rom.file_name+" save file")
-}
+export async function downloadSave(rom, emitter) { console.log("Downloading "+rom.file_name+" save file") }
diff --git a/frontend/src/components/RomDetails.vue b/frontend/src/views/Details.vue
similarity index 97%
rename from frontend/src/components/RomDetails.vue
rename to frontend/src/views/Details.vue
index 3353d49a2..8c49a6ab5 100644
--- a/frontend/src/components/RomDetails.vue
+++ b/frontend/src/views/Details.vue
@@ -27,11 +27,9 @@ emitter.on('currentRom', (currentRom) => { rom.value = currentRom })
async function searchRomIGDB() {
searching.value = true
dialogSearchRom.value = true
- console.log("searching for rom... "+rom.value.file_name)
await axios.put('/api/search/roms/igdb', {
rom: rom.value
}).then((response) => {
- console.log(response.data.data)
matchedRoms.value = response.data.data
}).catch((error) => {console.log(error)})
searching.value = false
@@ -48,12 +46,10 @@ async function updateRom(updatedRom=Object.assign({},rom.value), newName=rom.val
else{
updatedRom.file_name = newName
}
- console.log(rom.value)
await axios.patch('/api/platforms/'+rom.value.p_slug+'/roms', {
rom: rom.value,
updatedRom: updatedRom
}).then((response) => {
- console.log('updated rom: '+JSON.stringify(rom.value))
localStorage.setItem('currentRom', JSON.stringify(response.data.data))
emitter.emit('snackbarScan', {'msg': rom.value.file_name+" updated successfully!", 'icon': 'mdi-check-bold', 'color': 'green'})
rom.value = response.data.data
@@ -66,10 +62,8 @@ async function updateRom(updatedRom=Object.assign({},rom.value), newName=rom.val
}
async function deleteRom() {
- console.log('deleting rom '+ rom.value.file_name)
await axios.delete('/api/platforms/'+rom.value.p_slug+'/roms/'+rom.value.file_name+'?filesystem='+deleteFromFs.value)
.then((response) => {
- console.log(response)
emitter.emit('snackbarScan', {'msg': rom.value.file_name+" deleted successfully!", 'icon': 'mdi-check-bold', 'color': 'green'})
router.push(import.meta.env.BASE_URL)
}).catch((error) => {
diff --git a/frontend/src/components/RomsGallery.vue b/frontend/src/views/Gallery.vue
similarity index 91%
rename from frontend/src/components/RomsGallery.vue
rename to frontend/src/views/Gallery.vue
index 17e262700..6b95aa461 100644
--- a/frontend/src/components/RomsGallery.vue
+++ b/frontend/src/views/Gallery.vue
@@ -16,18 +16,15 @@ const saveFiles = ref(false)
// Event listeners bus
const emitter = inject('emitter')
-emitter.on('currentPlatform', (platform) => { getRoms(platform.slug) })
-emitter.on('romsFilter', (filter) => { setFilter(filter) })
+emitter.on('selectedPlatform', (platform) => { getRoms(platform.slug) })
+emitter.on('filter', (filter) => { setFilter(filter) })
// Functions
async function getRoms(platform) {
noRoms.value = false
- console.log("Getting roms...")
emitter.emit('gettingRoms', true)
gettingRoms.value = true
await axios.get('/api/platforms/'+platform+'/roms').then((response) => {
- console.log("Roms loaded!")
- console.log(response.data.data)
roms.value = response.data.data
setFilter(currentFilter.value)
}).catch((error) => {console.log(error)})
@@ -37,7 +34,6 @@ async function getRoms(platform) {
}
async function selectRom(rom) {
- console.log("Selected rom "+rom.name)
localStorage.setItem('currentRom', JSON.stringify(rom))
await router.push(import.meta.env.BASE_URL+'details')
emitter.emit('currentRom', rom)
@@ -54,7 +50,7 @@ function setFilter(filter) {
})
}
-onMounted(() => { if(localStorage.getItem('currentPlatform')){ getRoms(JSON.parse(localStorage.getItem('currentPlatform')).slug) } })
+onMounted(() => { if(localStorage.getItem('selectedPlatform')){ getRoms(JSON.parse(localStorage.getItem('selectedPlatform')).slug) } })