feat: 支持截屏,下载方式调整

This commit is contained in:
muwoo
2021-06-22 15:35:46 +08:00
parent 1e77613565
commit e3838738db
27 changed files with 1519 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import {
sysFile,
mergePlugins,
find,
downloadZip,
} from '../../assets/common/utils';
import systemMethod from '../../assets/common/system';
import fs from "fs";
@@ -179,7 +180,7 @@ const actions = {
...cmds.map((cmd) => ({
name: cmd,
value: 'plugin',
icon: 'image://' + path.join(plugin.sourceFile, `../${plugin.logo}`),
icon: plugin.sourceFile ? 'image://' + path.join(plugin.sourceFile, `../${plugin.logo}`) : plugin.logo,
desc: fe.explain,
type: plugin.type,
click: (router) => {
@@ -199,8 +200,8 @@ const actions = {
});
},
async downloadPlugin({commit}, payload) {
await downloadFunc(payload.gitUrl, payload.name);
const fileUrl = find(path.join(__static, `plugins/${payload.name}`));
await downloadZip(payload.gitUrl, payload.name);
const fileUrl = find(path.join(__static, `plugins/${payload.name}-master`));
// 复制文件
const config = JSON.parse(fs.readFileSync(`${fileUrl}/plugin.json`, 'utf-8'));
const pluginConfig = {
@@ -221,7 +222,7 @@ const actions = {
icon: 'image://' + path.join(plugin.sourceFile, `../${plugin.logo}`),
},
searchValue: '',
showMain: true,
showMain: true
});
ipcRenderer.send('changeWindowSize-rubick', {
height: getWindowHeight(),