增加 dbStorage API

This commit is contained in:
muwoo
2021-12-18 16:17:49 +08:00
parent 7cb78e00a8
commit ced8aa846b
12 changed files with 75 additions and 12 deletions

View File

@@ -39,4 +39,10 @@ export default {
);
return res.data;
},
async getDevDetail(url: string) {
const res = await axios.get(
"https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/dev.json"
);
return res.data;
},
};

View File

@@ -1,13 +1,49 @@
<template>
<div class="system">
<PluginList
v-if="dev && !!dev.length"
@downloadSuccess="downloadSuccess"
title="开发"
:list="dev"
/>
</div>
</template>
<script>
export default {
name: "devlopment"
};
<script setup>
import { ref, computed, onBeforeMount } from "vue";
import request from "../../../assets/request/index";
import PluginList from "./plugin-list.vue";
import { useStore } from "vuex";
const store = useStore();
const totalPlugins = computed(() => store.state.totalPlugins);
const data = ref([]);
onBeforeMount(async () => {
data.value = await request.getDevDetail();
});
const dev = computed(() => {
const defaultData = data.value || [];
if (!defaultData.length) return [];
return defaultData.map((plugin) => {
let searchInfo = null;
totalPlugins.value.forEach((t) => {
if (t.name === plugin) {
searchInfo = t;
}
});
return searchInfo;
});
});
</script>
<style scoped>
<style lang="less">
.system {
width: 100%;
height: 100vh;
overflow-x: hidden;
box-sizing: border-box;
}
</style>

View File

@@ -70,12 +70,14 @@ import Finder from "./components/finder.vue";
import System from "./components/system.vue";
import Worker from "./components/worker.vue";
import Tools from "./components/tools.vue";
import Dev from "./components/devlopment.vue";
const Components = {
finder: Finder,
system: System,
worker: Worker,
tools: Tools,
dev: Dev,
};
const state = reactive({