支持图像分类插件查看

This commit is contained in:
muwoo
2023-04-01 10:26:17 +08:00
parent a8006ec199
commit 35c9a32604
5 changed files with 109 additions and 48 deletions

View File

@@ -1,10 +1,10 @@
import axios from "axios";
import axios from 'axios';
let baseURL = "https://gitcode.net/rubickcenter/rubick-database/-/raw/master";
let access_token = "";
let baseURL = 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master';
let access_token = '';
try {
const dbdata = window.rubick.db.get("rubick-localhost-config");
const dbdata = window.rubick.db.get('rubick-localhost-config');
baseURL = dbdata.data.database;
access_token = dbdata.data.access_token;
} catch (e) {
@@ -12,40 +12,49 @@ try {
}
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 {
async getTotalPlugins() {
let targetPath = "plugins/total-plugins.json";
let targetPath = 'plugins/total-plugins.json';
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 getFinderDetail() {
let targetPath = "plugins/finder.json";
let targetPath = 'plugins/finder.json';
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 getSystemDetail() {
let targetPath = "plugins/system.json";
let targetPath = 'plugins/system.json';
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 getWorkerDetail() {
let targetPath = "plugins/worker.json";
let targetPath = 'plugins/worker.json';
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;
@@ -57,17 +66,31 @@ export default {
},
async getSearchDetail() {
let targetPath = "plugins/search.json";
let targetPath = 'plugins/search.json';
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 getDevDetail() {
let targetPath = "plugins/dev.json";
let targetPath = 'plugins/dev.json';
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);
return res.data;