Compare commits
No commits in common. "8d7f658f4a44d7463427fb7b7aa6d793b9155ed4" and "91a3218fc75a61f827a13047ea286a5625d28be5" have entirely different histories.
8d7f658f4a
...
91a3218fc7
@ -17,7 +17,6 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"url": "^0.11.4",
|
"url": "^0.11.4",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.1",
|
|
||||||
"vuetify": "^3.8.0-beta.0"
|
"vuetify": "^3.8.0-beta.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app>
|
<v-app>
|
||||||
<v-main>
|
<v-main>
|
||||||
<router-view />
|
<download-list />
|
||||||
</v-main>
|
</v-main>
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import DownloadList from './components/DownloadList.vue'
|
||||||
|
</script>
|
||||||
|
@ -47,17 +47,12 @@
|
|||||||
<span
|
<span
|
||||||
v-if="item.isDir"
|
v-if="item.isDir"
|
||||||
class="blue--text text--darken-2"
|
class="blue--text text--darken-2"
|
||||||
|
@click="enterFolder(item.path)"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
>
|
>
|
||||||
<v-icon small class="me-2">mdi-folder-outline</v-icon>
|
<v-icon small class="me-2">mdi-folder-outline</v-icon>
|
||||||
|
|
||||||
<a
|
{{ item.name }}
|
||||||
:href="`${API_BASE_URL}/${item.path}`"
|
|
||||||
class="blue--text text--darken-2"
|
|
||||||
style="text-decoration: none"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
|
||||||
</a>
|
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<v-icon small class="me-2">mdi-file-outline</v-icon>
|
<v-icon small class="me-2">mdi-file-outline</v-icon>
|
||||||
@ -91,6 +86,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, nextTick } from "vue";
|
import { defineComponent, ref, nextTick } from "vue";
|
||||||
|
|
||||||
|
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
|
||||||
|
|
||||||
interface FolderItem {
|
interface FolderItem {
|
||||||
name: string;
|
name: string;
|
||||||
path: string;
|
path: string;
|
||||||
@ -131,8 +128,7 @@ export default defineComponent({
|
|||||||
{ title: "Size", key: "size", width: "120px" },
|
{ title: "Size", key: "size", width: "120px" },
|
||||||
{ title: "Last Modified", key: "lastModified", width: "200px" },
|
{ title: "Last Modified", key: "lastModified", width: "200px" },
|
||||||
],
|
],
|
||||||
DOWNLOAD_BASE_URL: import.meta.env.VITE_DOWNLOAD_BASE_URL,
|
DOWNLOAD_BASE_URL: import.meta.env.VITE_DOWNLOAD_BASE_URL
|
||||||
API_BASE_URL: import.meta.env.VITE_API_BASE_URL,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -173,17 +169,12 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
async fetchList(reset = false) {
|
async fetchList(reset = false) {
|
||||||
if (this.loading) return;
|
if (this.loading) return;
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
const url = new URL(`${this.API_BASE_URL}/api/list`);
|
const url = new URL(`${API_BASE_URL}/api/list`);
|
||||||
|
|
||||||
console.log(this.currentPath);
|
|
||||||
url.searchParams.set("prefix", this.currentPath);
|
url.searchParams.set("prefix", this.currentPath);
|
||||||
url.searchParams.set("limit", "50");
|
url.searchParams.set("limit", "50");
|
||||||
|
|
||||||
if (this.search) url.searchParams.set("search", this.search);
|
if (this.search) url.searchParams.set("search", this.search);
|
||||||
|
|
||||||
if (this.nextToken && !reset) {
|
if (this.nextToken && !reset) {
|
||||||
url.searchParams.set("token", this.nextToken);
|
url.searchParams.set("token", this.nextToken);
|
||||||
}
|
}
|
||||||
@ -209,9 +200,14 @@ export default defineComponent({
|
|||||||
this.nextToken = null;
|
this.nextToken = null;
|
||||||
this.fetchList(true);
|
this.fetchList(true);
|
||||||
},
|
},
|
||||||
|
enterFolder(path: string) {
|
||||||
|
this.currentPath = path;
|
||||||
|
this.nextToken = null;
|
||||||
|
this.fetchList(true);
|
||||||
|
},
|
||||||
goToBreadcrumb(path: string) {
|
goToBreadcrumb(path: string) {
|
||||||
this.currentPath = path;
|
this.currentPath = path;
|
||||||
this.$router.push("/" + path);
|
this.nextToken = null;
|
||||||
this.fetchList(true);
|
this.fetchList(true);
|
||||||
},
|
},
|
||||||
extractFolderName(path: string): string {
|
extractFolderName(path: string): string {
|
||||||
@ -224,19 +220,6 @@ export default defineComponent({
|
|||||||
return size + " B";
|
return size + " B";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
// Remove leading slash if it exists
|
|
||||||
this.currentPath = this.$route?.path.replace(/^\/+/, "") || "";
|
|
||||||
|
|
||||||
// Check if the path ends in `.bz2` (case-sensitive)
|
|
||||||
if (this.currentPath.endsWith(".bz2")) {
|
|
||||||
window.open(`${this.DOWNLOAD_BASE_URL}${this.currentPath}`, '_blank', 'popup');
|
|
||||||
this.currentPath = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only add trailing slash if there's something left
|
|
||||||
this.currentPath = this.currentPath ? this.currentPath.replace(/\/?$/, "/") : "";
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchList(true);
|
this.fetchList(true);
|
||||||
},
|
},
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import { vuetify } from './plugins/vuetify'
|
import { vuetify } from './plugins/vuetify'
|
||||||
import router from './router'
|
|
||||||
import '@mdi/font/css/materialdesignicons.css'
|
import '@mdi/font/css/materialdesignicons.css'
|
||||||
import './main.css';
|
import './main.css';
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
app.use(vuetify)
|
app.use(vuetify)
|
||||||
app.use(router)
|
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
@ -1,17 +0,0 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
|
||||||
import DownloadList from '../components/DownloadList.vue'
|
|
||||||
|
|
||||||
const routes = [
|
|
||||||
{
|
|
||||||
path: '/:catchAll(.*)*', // catches anything
|
|
||||||
name: 'DownloadList',
|
|
||||||
component: DownloadList,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const router = createRouter({
|
|
||||||
history: createWebHistory(),
|
|
||||||
routes,
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
|
@ -1 +1 @@
|
|||||||
{"root":["./src/app.vue","./src/main.ts","./src/vite-env.d.ts","./src/components/downloadlist.vue","./src/plugins/vuetify.ts","./src/router/index.ts"],"version":"5.8.3"}
|
{"root":["./src/app.vue","./src/main.ts","./src/vite-env.d.ts","./src/components/downloadlist.vue","./src/plugins/vuetify.ts"],"version":"5.8.3"}
|
Loading…
Reference in New Issue
Block a user