export consts to common files

This commit is contained in:
Miao Wang 2024-04-08 15:13:27 +08:00
parent c2c62efc49
commit c8fd12ed2e
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
<script setup>
import { ref, defineEmits, computed, onMounted, nextTick } from "vue";
import { ISOINFO_JSON_PATH } from "../lib/consts";
const distroList = ref([]);
const selected = ref({});
@ -13,7 +14,7 @@ const knownCategories = {
const emit = defineEmits(["ready"]);
fetch("/static/status/isoinfo.json").then((res) => res.json()).then((isoinfo) => {
fetch(ISOINFO_JSON_PATH).then((res) => res.json()).then((isoinfo) => {
distroList.value = isoinfo;
availableCategories.value = [...new Set(isoinfo.map((x) => x.category))];
curCategory.value = availableCategories.value[0];

2
_src/lib/consts.js Normal file
View File

@ -0,0 +1,2 @@
export const TUNASYNC_JSON_PATH = "/static/tunasync.json";
export const ISOINFO_JSON_PATH = "/static/status/isoinfo.json";