mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-08 19:54:05 +08:00
✨ 支持图像分类插件查看
This commit is contained in:
parent
a8006ec199
commit
35c9a32604
@ -1,10 +1,10 @@
|
|||||||
import axios from "axios";
|
import axios from 'axios';
|
||||||
|
|
||||||
let baseURL = "https://gitcode.net/rubickcenter/rubick-database/-/raw/master";
|
let baseURL = 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master';
|
||||||
let access_token = "";
|
let access_token = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const dbdata = window.rubick.db.get("rubick-localhost-config");
|
const dbdata = window.rubick.db.get('rubick-localhost-config');
|
||||||
baseURL = dbdata.data.database;
|
baseURL = dbdata.data.database;
|
||||||
access_token = dbdata.data.access_token;
|
access_token = dbdata.data.access_token;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -12,40 +12,49 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL: baseURL || "https://gitcode.net/rubickcenter/rubick-database/-/raw/master",
|
baseURL:
|
||||||
|
baseURL || 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async getTotalPlugins() {
|
async getTotalPlugins() {
|
||||||
let targetPath = "plugins/total-plugins.json";
|
let targetPath = 'plugins/total-plugins.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getFinderDetail() {
|
async getFinderDetail() {
|
||||||
let targetPath = "plugins/finder.json";
|
let targetPath = 'plugins/finder.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getSystemDetail() {
|
async getSystemDetail() {
|
||||||
let targetPath = "plugins/system.json";
|
let targetPath = 'plugins/system.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async getWorkerDetail() {
|
async getWorkerDetail() {
|
||||||
let targetPath = "plugins/worker.json";
|
let targetPath = 'plugins/worker.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
@ -57,17 +66,31 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getSearchDetail() {
|
async getSearchDetail() {
|
||||||
let targetPath = "plugins/search.json";
|
let targetPath = 'plugins/search.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
async getDevDetail() {
|
async getDevDetail() {
|
||||||
let targetPath = "plugins/dev.json";
|
let targetPath = 'plugins/dev.json';
|
||||||
if (access_token) {
|
if (access_token) {
|
||||||
targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
|
}
|
||||||
|
const res = await instance.get(targetPath);
|
||||||
|
return res.data;
|
||||||
|
},
|
||||||
|
async getImageDetail() {
|
||||||
|
let targetPath = 'plugins/image.json';
|
||||||
|
if (access_token) {
|
||||||
|
targetPath = `${encodeURIComponent(
|
||||||
|
targetPath
|
||||||
|
)}/raw?access_token=${access_token}&ref=master`;
|
||||||
}
|
}
|
||||||
const res = await instance.get(targetPath);
|
const res = await instance.get(targetPath);
|
||||||
return res.data;
|
return res.data;
|
||||||
|
@ -1,13 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="system">
|
||||||
|
<PluginList
|
||||||
|
v-if="system && !!system.length"
|
||||||
|
@downloadSuccess="downloadSuccess"
|
||||||
|
title="系统插件"
|
||||||
|
:list="system"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import { ref, computed, onBeforeMount } from "vue";
|
||||||
name: "image"
|
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.getImageDetail();
|
||||||
|
});
|
||||||
|
|
||||||
|
const system = 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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="less">
|
||||||
|
.system {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-x: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -71,11 +71,13 @@ import System from "./components/system.vue";
|
|||||||
import Worker from "./components/worker.vue";
|
import Worker from "./components/worker.vue";
|
||||||
import Tools from "./components/tools.vue";
|
import Tools from "./components/tools.vue";
|
||||||
import Dev from "./components/devlopment.vue";
|
import Dev from "./components/devlopment.vue";
|
||||||
|
import Image from "./components/image.vue";
|
||||||
|
|
||||||
const Components = {
|
const Components = {
|
||||||
finder: Finder,
|
finder: Finder,
|
||||||
system: System,
|
system: System,
|
||||||
worker: Worker,
|
worker: Worker,
|
||||||
|
image: Image,
|
||||||
tools: Tools,
|
tools: Tools,
|
||||||
dev: Dev,
|
dev: Dev,
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "2.1.6",
|
"version": "2.1.7",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -21,7 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@better-scroll/core": "^2.4.2",
|
"@better-scroll/core": "^2.4.2",
|
||||||
"ant-design-vue": "^2.2.8",
|
"ant-design-vue": "^2.2.8",
|
||||||
"axios": "^1.3.4",
|
"axios": q"^1.3.4",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"extract-file-icon": "^0.3.2",
|
"extract-file-icon": "^0.3.2",
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
"use strict";
|
'use strict';
|
||||||
import electron, {
|
import electron, {
|
||||||
app,
|
app,
|
||||||
globalShortcut,
|
globalShortcut,
|
||||||
protocol,
|
protocol,
|
||||||
BrowserWindow
|
BrowserWindow,
|
||||||
} from "electron";
|
} from 'electron';
|
||||||
import { main } from "./browsers";
|
import { main } from './browsers';
|
||||||
import commonConst from "../common/utils/commonConst";
|
import commonConst from '../common/utils/commonConst';
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import API from "./common/api";
|
import API from './common/api';
|
||||||
import createTray from "./common/tray";
|
import createTray from './common/tray';
|
||||||
import registerHotKey from "./common/registerHotKey";
|
import registerHotKey from './common/registerHotKey';
|
||||||
|
|
||||||
import "../common/utils/localPlugin";
|
import '../common/utils/localPlugin';
|
||||||
import "../common/utils/localConfig";
|
import '../common/utils/localConfig';
|
||||||
|
|
||||||
import registerySystemPlugin from "./common/registerySystemPlugin";
|
import registerySystemPlugin from './common/registerySystemPlugin';
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
public windowCreator: { init: () => void; getWindow: () => BrowserWindow };
|
public windowCreator: { init: () => void; getWindow: () => BrowserWindow };
|
||||||
@ -24,7 +24,7 @@ class App {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
protocol.registerSchemesAsPrivileged([
|
protocol.registerSchemesAsPrivileged([
|
||||||
{ scheme: "app", privileges: { secure: true, standard: true } }
|
{ scheme: 'app', privileges: { secure: true, standard: true } },
|
||||||
]);
|
]);
|
||||||
this.windowCreator = main();
|
this.windowCreator = main();
|
||||||
const gotTheLock = app.requestSingleInstanceLock();
|
const gotTheLock = app.requestSingleInstanceLock();
|
||||||
@ -66,14 +66,14 @@ class App {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
if (!app.isReady()) {
|
if (!app.isReady()) {
|
||||||
app.on("ready", readyFunction);
|
app.on('ready', readyFunction);
|
||||||
} else {
|
} else {
|
||||||
readyFunction();
|
readyFunction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRunning() {
|
onRunning() {
|
||||||
app.on("second-instance", () => {
|
app.on('second-instance', () => {
|
||||||
// 当运行第二个实例时,将会聚焦到myWindow这个窗口
|
// 当运行第二个实例时,将会聚焦到myWindow这个窗口
|
||||||
const win = this.windowCreator.getWindow();
|
const win = this.windowCreator.getWindow();
|
||||||
if (win) {
|
if (win) {
|
||||||
@ -83,7 +83,7 @@ class App {
|
|||||||
win.focus();
|
win.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.on("activate", () => {
|
app.on('activate', () => {
|
||||||
if (!this.windowCreator.getWindow()) {
|
if (!this.windowCreator.getWindow()) {
|
||||||
this.createWindow();
|
this.createWindow();
|
||||||
}
|
}
|
||||||
@ -94,25 +94,25 @@ class App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onQuit() {
|
onQuit() {
|
||||||
app.on("window-all-closed", () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== "darwin") {
|
if (process.platform !== 'darwin') {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on("will-quit", () => {
|
app.on('will-quit', () => {
|
||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (commonConst.dev()) {
|
if (commonConst.dev()) {
|
||||||
if (process.platform === "win32") {
|
if (process.platform === 'win32') {
|
||||||
process.on("message", data => {
|
process.on('message', (data) => {
|
||||||
if (data === "graceful-exit") {
|
if (data === 'graceful-exit') {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
process.on("SIGTERM", () => {
|
process.on('SIGTERM', () => {
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user