diff --git a/package.json b/package.json index 622173d..8b11e28 100644 --- a/package.json +++ b/package.json @@ -58,9 +58,7 @@ }, "dependencies": { "ant-design-vue": "^1.7.5", - "anyproxy": "^4.1.3", "axios": "^0.18.1", - "chokidar": "^3.5.1", "download-git-repo": "^3.0.2", "electron-store": "^8.0.0", "marked": "^2.0.7", diff --git a/src/renderer/assets/api/config.js b/src/renderer/assets/api/config.js index cf6db5d..a0693f7 100644 --- a/src/renderer/assets/api/config.js +++ b/src/renderer/assets/api/config.js @@ -1,4 +1,4 @@ export default { development: 'http://localhost:7001', - production: 'http://localhost:7001', + production: 'http://rubick-server.qa.91jkys.com', }; diff --git a/src/renderer/assets/api/index.js b/src/renderer/assets/api/index.js index 03b18c4..d094b3a 100644 --- a/src/renderer/assets/api/index.js +++ b/src/renderer/assets/api/index.js @@ -1,5 +1,7 @@ import plugin from './list/plugin'; +import banner from './list/banner'; export default { - plugin + plugin, + banner } diff --git a/src/renderer/assets/api/list/banner.js b/src/renderer/assets/api/list/banner.js new file mode 100644 index 0000000..7f4e151 --- /dev/null +++ b/src/renderer/assets/api/list/banner.js @@ -0,0 +1,8 @@ +import instance from '../request'; + +export default { + async query(params) { + const result = await instance.get('/banner/query', {params}); + return result.data; + } +} diff --git a/src/renderer/assets/common/utils.js b/src/renderer/assets/common/utils.js index 60c3ff1..1238e95 100644 --- a/src/renderer/assets/common/utils.js +++ b/src/renderer/assets/common/utils.js @@ -44,7 +44,8 @@ function mkdirFolder(name) { }); } -function downloadFunc(downloadRepoUrl, name) { +function downloadFunc(downloadRepoUrl, name, gitUrl) { + const targetGit = gitUrl ? gitUrl : `github:clouDr-f2e/${name}`; const plugin_path = path.join(__static, './plugins'); return new Promise(async (resolve, reject) => { @@ -59,7 +60,7 @@ function downloadFunc(downloadRepoUrl, name) { await process.execSync(`rm -rf ${temp_dest}`); } - download(`github:clouDr-f2e/${name}`, temp_dest, function (err) { + download(targetGit, temp_dest, function (err) { console.log(err ? 'Error' : 'Success') if (err) { console.log(err); diff --git a/src/renderer/pages/search/index.vue b/src/renderer/pages/search/index.vue index e4240e6..c83a42e 100644 --- a/src/renderer/pages/search/index.vue +++ b/src/renderer/pages/search/index.vue @@ -14,8 +14,8 @@ 开发者 - - + + 设置 diff --git a/src/renderer/pages/search/subpages/market.vue b/src/renderer/pages/search/subpages/market.vue index cec93f0..def2a7a 100644 --- a/src/renderer/pages/search/subpages/market.vue +++ b/src/renderer/pages/search/subpages/market.vue @@ -12,10 +12,9 @@
-

1

-

2

-

3

-

4

+
+ +

插件

@@ -29,7 +28,7 @@ - {{ item.title }} +
{{ item.pluginName }}
- +
{{ plugin.pluginName }}
{{ plugin.description }}
diff --git a/src/renderer/pages/search/subpages/settings.vue b/src/renderer/pages/search/subpages/settings.vue new file mode 100644 index 0000000..a95dcbd --- /dev/null +++ b/src/renderer/pages/search/subpages/settings.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/src/renderer/router/index.js b/src/renderer/router/index.js index eed53e1..83858bc 100644 --- a/src/renderer/router/index.js +++ b/src/renderer/router/index.js @@ -3,6 +3,7 @@ import Router from 'vue-router' import Market from '../pages/search/subpages/market'; import Dev from '../pages/search/subpages/dev'; import Installed from '../pages/search/subpages/plugin'; +import Settings from '../pages/search/subpages/settings'; Vue.use(Router) @@ -25,6 +26,10 @@ export default new Router({ path: 'plugin', component: Installed }, + { + path: 'settings', + component: Settings + }, ] }, { diff --git a/src/renderer/store/modules/main.js b/src/renderer/store/modules/main.js index 4f01722..ea18a56 100644 --- a/src/renderer/store/modules/main.js +++ b/src/renderer/store/modules/main.js @@ -38,7 +38,7 @@ const mutations = { sysFile.savePlugins(state.devPlugins); }, deleteProdPlugin(state, payload) { - state.devPlugins = state.devPlugins.filter(plugin => plugin.name !== payload.name); + state.devPlugins = state.devPlugins.filter(plugin => plugin.id !== payload.id); sysFile.savePlugins(state.devPlugins); // todo 删除 static 目录下的对应插件 }, @@ -107,8 +107,9 @@ const actions = { const pluginConfig = { ...config, sourceFile: path.join(fileUrl, `../${config.main || 'index.html'}`), - name: uuidv4(), + id: uuidv4(), type: 'dev', + icon: 'image://' + path.join(fileUrl, `../${config.logo}`), subType: (() => { if (config.main) { return '' @@ -202,6 +203,7 @@ const actions = { const config = JSON.parse(fs.readFileSync(`${fileUrl}/plugin.json`, 'utf-8')); const pluginConfig = { ...config, + id: uuidv4(), sourceFile: `${fileUrl}/${config.main}`, type: 'prod' }; diff --git a/static/plugins/rubick-plugin-demo/.gitignore b/static/plugins/rubick-plugin-demo/.gitignore deleted file mode 100644 index eb79dd5..0000000 --- a/static/plugins/rubick-plugin-demo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.idea diff --git a/static/plugins/rubick-plugin-demo/index.html b/static/plugins/rubick-plugin-demo/index.html deleted file mode 100644 index bb225ed..0000000 --- a/static/plugins/rubick-plugin-demo/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - hello world123123 - - diff --git a/static/plugins/rubick-plugin-demo/logo.png b/static/plugins/rubick-plugin-demo/logo.png deleted file mode 100644 index 5641ad0..0000000 Binary files a/static/plugins/rubick-plugin-demo/logo.png and /dev/null differ diff --git a/static/plugins/rubick-plugin-demo/plugin.json b/static/plugins/rubick-plugin-demo/plugin.json deleted file mode 100644 index 63f3ab0..0000000 --- a/static/plugins/rubick-plugin-demo/plugin.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "pluginName": "测试插件", - "description": "我的第一个 rubick 插件", - "main": "index.html", - "version": "0.0.1", - "logo": "logo.png", - "features": [ - { - "code": "hello", - "explain": "这是一个测试的插件", - "cmds":["hello", "你好"] - } - ], - "preload": "preload.js" -} diff --git a/static/plugins/rubick-plugin-demo/preload.js b/static/plugins/rubick-plugin-demo/preload.js deleted file mode 100644 index 79efa8e..0000000 --- a/static/plugins/rubick-plugin-demo/preload.js +++ /dev/null @@ -1,6 +0,0 @@ -const { readFileSync } = require('fs') - -window.readConfig = function () { - const data = '123123' - return data -}