🐛 修复部分问题

This commit is contained in:
muwoo 2023-09-01 17:56:16 +08:00
parent f4f91e1639
commit 6dffd1a793
17 changed files with 68 additions and 30 deletions

View File

@ -94,7 +94,7 @@
:title="$t('feature.installed.removeFromPanel')"
>
<MinusCircleOutlined
@click="removePluginToSuperPanel(cmd)"
@click="removePluginToSuperPanel({ cmd })"
/>
</a-tooltip>
</template>
@ -145,9 +145,9 @@ const pluginDetail = computed(() => {
});
const superPanelPlugins = ref(
window.rubick.db.get('super-panel-plugins') || {
window.rubick.db.get('super-panel-user-plugins') || {
data: [],
_id: 'super-panel-plugins',
_id: 'super-panel-user-plugins',
}
);
@ -165,9 +165,10 @@ const addCmdToSuperPanel = ({ cmd, code }) => {
window.rubick.db.put(toRaw(superPanelPlugins.value));
};
const removePluginToSuperPanel = (cmd) => {
const removePluginToSuperPanel = ({ cmd, name }) => {
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter(
(item) => {
if (name) return item.name !== name;
return item.cmd !== cmd;
}
);
@ -224,9 +225,12 @@ const deletePlugin = async (plugin) => {
message.error('卸载超时,请重试!');
}, 20000);
await window.market.deletePlugin(plugin);
removePluginToSuperPanel({ name: plugin.name });
updateLocalPlugin();
clearTimeout(timer);
};
</script>
<style lang="less" scoped>

View File

@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "2.4.5",
"version": "3.0.0",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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.518884da.css" rel="preload" as="style"><link href="css/chunk-vendors.7f9dcb72.css" rel="preload" as="style"><link href="js/app.e81c0c2f.js" rel="preload" as="script"><link href="js/chunk-vendors.cc39b888.js" rel="preload" as="script"><link href="css/chunk-vendors.7f9dcb72.css" rel="stylesheet"><link href="css/app.518884da.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.cc39b888.js"></script><script src="js/app.e81c0c2f.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.4e3502cb.css" rel="preload" as="style"><link href="css/chunk-vendors.7f9dcb72.css" rel="preload" as="style"><link href="js/app.5fe607e9.js" rel="preload" as="script"><link href="js/chunk-vendors.73a23bae.js" rel="preload" as="script"><link href="css/chunk-vendors.7f9dcb72.css" rel="stylesheet"><link href="css/app.4e3502cb.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.73a23bae.js"></script><script src="js/app.5fe607e9.js"></script></body></html>

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

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,16 @@
const {remote} = require("electron");
const remote = require('@electron/remote');
window.market = {
getLocalPlugins() {
return remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
return remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
},
downloadPlugin(plugin) {
return remote.getGlobal("LOCAL_PLUGINS").downloadPlugin(plugin);
return remote.getGlobal('LOCAL_PLUGINS').downloadPlugin(plugin);
},
deletePlugin(plugin) {
return remote.getGlobal("LOCAL_PLUGINS").deletePlugin(plugin);
return remote.getGlobal('LOCAL_PLUGINS').deletePlugin(plugin);
},
refreshPlugin(plugin) {
return remote.getGlobal("LOCAL_PLUGINS").refreshPlugin(plugin);
return remote.getGlobal('LOCAL_PLUGINS').refreshPlugin(plugin);
},
};

View File

@ -10,6 +10,8 @@ export default () => {
event.returnValue = data;
});
createWindow(pluginInfo, viewInfo, view);
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('@electron/remote/main').enable(win.webContents);
};
const createWindow = async (pluginInfo, viewInfo, view) => {

View File

@ -24,7 +24,12 @@ module.exports = {
nodeIntegration: true,
mainProcessFile: 'src/main/index.ts',
mainProcessWatch: ['src/main'],
externals: ['pouchdb', 'extract-file-icon', 'electron-screenshots'],
externals: [
'pouchdb',
'extract-file-icon',
'electron-screenshots',
'@electron/remote',
],
// Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
builderOptions: {
productName: 'rubick2',

View File

@ -8083,7 +8083,7 @@ node-gyp-build@~4.1.0:
node-key-sender@^1.0.11:
version "1.0.11"
resolved "https://registry.npmmirror.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
resolved "https://registry.yarnpkg.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
integrity sha512-vv2IXd8QdZBFYXaIy02uy2rK6EKj+tOTEuoTxJKS9l8zw8Cz6DeLffR8ompj7N2A3h6XK7aiy+YAcTaeOqwp2Q==
node-libs-browser@^2.2.1: