Convert upload page to vue

This commit is contained in:
2025-05-03 20:37:15 +02:00
parent 3571f93e41
commit 457bab2c18
6 changed files with 134 additions and 19 deletions

View File

@@ -1,21 +1,27 @@
<script>
import Project from './components/project.vue';
import Admin from './components/admin.vue';
import Upload from './components/upload.vue';
const aoRoutes = {
'project': Project,
'admin': Admin
'project': Project,
'admin': Admin,
'upload': Upload
};
export default {
data() {
return {
hash: {}
hash: {},
consts: this.spot.consts,
user: this.spot.vars('user')
};
},
provide() {
return {
projects: this.spot.vars('projects')
projects: this.spot.vars('projects'),
consts: this.consts,
user: this.user
};
},
inject: ['spot'],
@@ -25,12 +31,15 @@ export default {
return aoRoutes[this.hash.page];
}
},
created() {
//User
this.user.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone || this.consts.default_timezone;
},
mounted() {
window.addEventListener('hashchange', () => {this.onHashChange();});
var oEvent = new Event('hashchange');
window.dispatchEvent(oEvent);
}
,
},
methods: {
_hash(hash, bReboot) {
bReboot = bReboot || false;