mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-19 14:19:39 +08:00
✨ 增加 dbStorage API
This commit is contained in:
parent
7cb78e00a8
commit
ced8aa846b
@ -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;
|
||||
},
|
||||
};
|
||||
|
@ -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>
|
||||
|
@ -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({
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.0.1-beta.2",
|
||||
"version": "2.0.1-beta.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.12c0e429.css" rel="preload" as="style"><link href="js/app.d3f7d066.js" rel="preload" as="script"><link href="js/chunk-vendors.ebb3d342.js" rel="preload" as="script"><link href="css/app.12c0e429.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.ebb3d342.js"></script><script src="js/app.d3f7d066.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/app.f8214d90.css" rel="preload" as="style"><link href="js/app.07c58e42.js" rel="preload" as="script"><link href="js/chunk-vendors.ebb3d342.js" rel="preload" as="script"><link href="css/app.f8214d90.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.ebb3d342.js"></script><script src="js/app.07c58e42.js"></script></body></html>
|
2
public/feature/js/app.07c58e42.js
Normal file
2
public/feature/js/app.07c58e42.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/app.07c58e42.js.map
Normal file
1
public/feature/js/app.07c58e42.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -81,6 +81,24 @@ window.rubick = {
|
||||
bulkDocs: (docs) => ipcSendSync("dbBulkDocs", { docs }),
|
||||
allDocs: (key) => ipcSendSync("dbAllDocs", { key }),
|
||||
},
|
||||
dbStorage: {
|
||||
setItem: (key, value) => {
|
||||
const target = { _id: String(key) };
|
||||
const result = ipcSendSync("dbGet", { id: target._id });
|
||||
result && (target._rev = result._rev);
|
||||
target.value = value;
|
||||
const res = ipcSendSync("dbPut", { data: target });
|
||||
if (res.error) throw new Error(res.message);
|
||||
},
|
||||
getItem: (key) => {
|
||||
const res = ipcSendSync("dbGet", { id: key });
|
||||
return res && "value" in res ? res.value : null;
|
||||
},
|
||||
removeItem: (key) => {
|
||||
const res = ipcSendSync("dbGet", { id: key });
|
||||
res && ipcSendSync("dbRemove", { doc: res });
|
||||
},
|
||||
},
|
||||
isDarkColors() {
|
||||
return false;
|
||||
},
|
||||
|
@ -5,6 +5,7 @@ import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/main";
|
||||
|
||||
const getPreloadPath = (plugin, pluginIndexPath) => {
|
||||
const { name, preload, tplPath, indexPath } = plugin;
|
||||
if (!preload) return;
|
||||
if (commonConst.dev()) {
|
||||
if (name === "rubick-system-feature") {
|
||||
return path.resolve(__static, `../feature/public/preload.js`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user