mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-27 15:22:46 +08:00
🐛 修复超级面板设置bug
This commit is contained in:
parent
562a13fdff
commit
4e59294b16
@ -18,7 +18,7 @@
|
|||||||
"code": "installed",
|
"code": "installed",
|
||||||
"explain": "已安装插件",
|
"explain": "已安装插件",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"已安装插件"
|
"已安装插件", "installed"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "settings",
|
"code": "settings",
|
||||||
|
@ -108,6 +108,7 @@ const changeMenu = (key: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.rubick.onPluginEnter(({ code }: { code: string }) => {
|
window.rubick.onPluginEnter(({ code }: { code: string }) => {
|
||||||
|
code = code === '已安装插件' ? 'installed' : code;
|
||||||
changeMenu(code);
|
changeMenu(code);
|
||||||
store.commit('commonUpdate', {active: [code]})
|
store.commit('commonUpdate', {active: [code]})
|
||||||
});
|
});
|
||||||
|
@ -185,7 +185,8 @@ const addCmdToSuperPanel = ({ cmd, code }) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
superPanelPlugins.value.data.push(plugin);
|
superPanelPlugins.value.data.push(plugin);
|
||||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
const { rev } = window.rubick.db.put(JSON.parse(JSON.stringify(superPanelPlugins.value)));
|
||||||
|
superPanelPlugins.value._rev = rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
const removePluginToSuperPanel = ({ cmd, name }) => {
|
const removePluginToSuperPanel = ({ cmd, name }) => {
|
||||||
@ -195,7 +196,8 @@ const removePluginToSuperPanel = ({ cmd, name }) => {
|
|||||||
return item.cmd !== cmd;
|
return item.cmd !== cmd;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
const { rev } = window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||||
|
superPanelPlugins.value._rev = rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasAdded = (cmd) => {
|
const hasAdded = (cmd) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "4.1.3",
|
"version": "4.1.4",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"code": "installed",
|
"code": "installed",
|
||||||
"explain": "已安装插件",
|
"explain": "已安装插件",
|
||||||
"cmds":[
|
"cmds":[
|
||||||
"已安装插件"
|
"已安装插件", "installed"
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
"code": "settings",
|
"code": "settings",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export const WINDOW_WIDTH = 688;
|
export const WINDOW_WIDTH = 800;
|
||||||
export const WINDOW_HEIGHT = 60;
|
export const WINDOW_HEIGHT = 60;
|
||||||
export const WINDOW_PLUGIN_HEIGHT = 600;
|
export const WINDOW_PLUGIN_HEIGHT = 600;
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import { runner, detach } from '../browsers';
|
|||||||
import DBInstance from './db';
|
import DBInstance from './db';
|
||||||
import getWinPosition from './getWinPosition';
|
import getWinPosition from './getWinPosition';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import commonConst from '@/common/utils/commonConst';
|
||||||
|
|
||||||
const runnerInstance = runner();
|
const runnerInstance = runner();
|
||||||
const detachInstance = detach();
|
const detachInstance = detach();
|
||||||
@ -97,7 +98,12 @@ class API extends DBInstance {
|
|||||||
? 'http://localhost:8083/#/'
|
? 'http://localhost:8083/#/'
|
||||||
: `file://${__static}/tpl/index.html`;
|
: `file://${__static}/tpl/index.html`;
|
||||||
}
|
}
|
||||||
if (!plugin.indexPath) {
|
if (plugin.name === 'rubick-system-feature') {
|
||||||
|
plugin.logo = plugin.logo || `file://${__static}/logo.png`;
|
||||||
|
plugin.indexPath = commonConst.dev()
|
||||||
|
? 'http://localhost:8081/#/'
|
||||||
|
: `file://${__static}/feature/index.html`;
|
||||||
|
} else if (!plugin.indexPath) {
|
||||||
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
||||||
plugin.indexPath = `file://${path.join(
|
plugin.indexPath = `file://${path.join(
|
||||||
pluginPath,
|
pluginPath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user