2023-02-19 17:13:33 +01:00
|
|
|
import { createApp } from 'vue';
|
2025-08-05 16:39:57 +02:00
|
|
|
|
|
|
|
|
import '@fontsource/inter';
|
|
|
|
|
|
2023-02-19 17:13:33 +01:00
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
2025-07-10 11:55:11 +02:00
|
|
|
import { tooltip } from '@cloudron/pankow';
|
2024-08-23 19:17:23 +02:00
|
|
|
import i18n from './i18n.js';
|
2024-10-04 21:37:17 +02:00
|
|
|
import FileManager from './components/FileManager.vue';
|
|
|
|
|
import FolderView from './components/FolderView.vue';
|
|
|
|
|
import FileViewer from './components/FileViewer.vue';
|
2025-08-05 16:39:57 +02:00
|
|
|
|
2025-03-19 17:13:58 +01:00
|
|
|
import './style.css';
|
|
|
|
|
|
2023-02-19 17:13:33 +01:00
|
|
|
const routes = [
|
2023-02-28 17:11:54 +01:00
|
|
|
{ path: '/', redirect: '/home' },
|
2024-10-04 21:37:17 +02:00
|
|
|
{ path: '/home/:type?/:resourceId?/:cwd*', component: FolderView },
|
|
|
|
|
{ path: '/viewer/:type/:resourceId/:filePath*', component: FileViewer }
|
2023-02-19 17:13:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
// 4. Provide the history implementation to use. We are using the hash history for simplicity here.
|
|
|
|
|
history: createWebHashHistory(),
|
2023-02-26 15:00:16 +01:00
|
|
|
routes,
|
2023-02-19 17:13:33 +01:00
|
|
|
});
|
|
|
|
|
|
2024-08-23 19:17:23 +02:00
|
|
|
(async function init() {
|
2023-07-12 14:22:58 +02:00
|
|
|
const app = createApp(FileManager);
|
2023-02-19 17:13:33 +01:00
|
|
|
|
2025-05-28 16:55:25 +02:00
|
|
|
app.directive('tooltip', tooltip);
|
|
|
|
|
|
2024-08-23 19:17:23 +02:00
|
|
|
app.use(await i18n());
|
2023-06-26 16:35:07 +02:00
|
|
|
app.use(router);
|
2023-02-19 17:13:33 +01:00
|
|
|
|
2023-06-26 16:35:07 +02:00
|
|
|
app.mount('#app');
|
|
|
|
|
})();
|