diff --git a/packages/core/src/config.js b/packages/core/src/config.js index 82288e7..a36dabd 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -2,10 +2,10 @@ const lodash = require('lodash') const defConfig = require('./config/index.js') let configTarget = defConfig -function _deleteDisabledItem(target,objKey){ - const obj = lodash.get(target,objKey) - for (let key in obj) { - if(obj[key]===false){ +function _deleteDisabledItem (target, objKey) { + const obj = lodash.get(target, objKey) + for (const key in obj) { + if (obj[key] === false) { delete obj[key] } } @@ -15,14 +15,14 @@ module.exports = { return configTarget }, set (newConfig) { - if(newConfig == null){ + if (newConfig == null) { return } const clone = lodash.cloneDeep(defConfig) lodash.merge(clone, newConfig) - _deleteDisabledItem(clone,'intercepts') - _deleteDisabledItem(clone,'dns.mapping') + _deleteDisabledItem(clone, 'intercepts') + _deleteDisabledItem(clone, 'dns.mapping') configTarget = clone return configTarget }, diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js index 777093e..c539dea 100644 --- a/packages/core/src/config/index.js +++ b/packages/core/src/config/index.js @@ -75,12 +75,12 @@ module.exports = { ], 'clients*.google.com': [ { - abort:true + abort: true } ], 'lh*.googleusercontent.com': [ { - abort:true + abort: true } ] }, @@ -109,7 +109,8 @@ module.exports = { server: true, proxy: { system: true, - npm: true + npm: true, + yarn: true } } } diff --git a/packages/core/src/expose.js b/packages/core/src/expose.js index 7302736..513686e 100644 --- a/packages/core/src/expose.js +++ b/packages/core/src/expose.js @@ -27,10 +27,9 @@ module.exports = { proxy, config, startup: async (newConfig) => { - if(newConfig){ + if (newConfig) { config.set(newConfig) } - try { if (config.get().setting.startup.server) { server.start(newConfig) diff --git a/packages/core/src/lib/proxy/tls/CertAndKeyContainer.js b/packages/core/src/lib/proxy/tls/CertAndKeyContainer.js index d034436..f0f3e12 100644 --- a/packages/core/src/lib/proxy/tls/CertAndKeyContainer.js +++ b/packages/core/src/lib/proxy/tls/CertAndKeyContainer.js @@ -51,7 +51,7 @@ module.exports = class CertAndKeyContainer { } } let certObj - const fast = true + const fast = false if (fast) { certObj = tlsUtils.createFakeCertificateByDomain(this.caKey, this.caCert, hostname) _resolve(certObj) diff --git a/packages/core/src/switch/proxy/impl/npm-proxy.js b/packages/core/src/switch/proxy/impl/npm-proxy.js index 9b8583c..31400de 100644 --- a/packages/core/src/switch/proxy/impl/npm-proxy.js +++ b/packages/core/src/switch/proxy/impl/npm-proxy.js @@ -2,7 +2,7 @@ const cmd = require('node-cmd') const util = require('util') const winExec = util.promisify(cmd.get, { multiArgs: true, context: cmd }) const os = require('os') - +const config = require('../../../lib/proxy/common/config') class SystemProxy { static async setProxy (ip, port) { throw new Error('You have to implement the method setProxy!') @@ -41,8 +41,8 @@ class WindowsSystemProxy extends SystemProxy { await winExec('npm config delete https-proxy') console.log('npm https proxy unset success') - // await winExec(`npm config delete cafile`) - // console.log('npm cafile unset success') + await winExec('npm config delete cafile') + console.log('npm cafile unset success') await winExec(' npm config delete strict-ssl') console.log('npm strict-ssl true success') } diff --git a/packages/core/src/lib/switch/proxy/impl/yarn-proxy.js b/packages/core/src/switch/proxy/impl/yarn-proxy.js similarity index 91% rename from packages/core/src/lib/switch/proxy/impl/yarn-proxy.js rename to packages/core/src/switch/proxy/impl/yarn-proxy.js index eeb1bd6..73c9442 100644 --- a/packages/core/src/lib/switch/proxy/impl/yarn-proxy.js +++ b/packages/core/src/switch/proxy/impl/yarn-proxy.js @@ -2,7 +2,8 @@ const cmd = require('node-cmd') const util = require('util') const winExec = util.promisify(cmd.get, { multiArgs: true, context: cmd }) const os = require('os') - +// eslint-disable-next-line no-unused-vars +const config = require('../../../lib/proxy/common/config') class SystemProxy { static async setProxy (ip, port) { throw new Error('You have to implement the method setProxy!') @@ -41,8 +42,8 @@ class WindowsSystemProxy extends SystemProxy { await winExec('yarn config delete https-proxy') console.log('yarn https proxy unset success') - // await winExec(`yarn config delete cafile`) - // console.log('yarn cafile unset success') + await winExec('yarn config delete cafile') + console.log('yarn cafile unset success') await winExec(' yarn config delete strict-ssl') console.log('yarn strict-ssl true success') } diff --git a/packages/core/src/switch/proxy/index.js b/packages/core/src/switch/proxy/index.js index a56f0bc..78f7c5c 100644 --- a/packages/core/src/switch/proxy/index.js +++ b/packages/core/src/switch/proxy/index.js @@ -1,5 +1,6 @@ const systemProxy = require('./impl/system-proxy') const npmProxy = require('./impl/npm-proxy') +const yarnProxy = require('./impl/yarn-proxy') const event = require('../../event') const config = require('../../config') function createProxyApi (type, impl) { @@ -28,5 +29,6 @@ function createProxyApi (type, impl) { module.exports = { system: createProxyApi('system', systemProxy), - npm: createProxyApi('npm', npmProxy) + npm: createProxyApi('npm', npmProxy), + yarn: createProxyApi('yarn', yarnProxy) } diff --git a/packages/gui/extra/favicon.ico b/packages/gui/extra/favicon.ico index 08cc502..090e3e3 100644 Binary files a/packages/gui/extra/favicon.ico and b/packages/gui/extra/favicon.ico differ diff --git a/packages/gui/package.json b/packages/gui/package.json index e8060f0..aaa14ad 100644 --- a/packages/gui/package.json +++ b/packages/gui/package.json @@ -2,6 +2,7 @@ "name": "@docmirror/dev-sidecar-gui", "version": "1.0.0", "private": false, + "license": "MPL2.0", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", @@ -13,14 +14,14 @@ }, "main": "background.js", "dependencies": { + "@docmirror/dev-sidecar": "1.0.0", "ant-design-vue": "^1.6.5", "core-js": "^3.6.5", + "es-abstract": "^1.17.7", + "json5": "^2.1.3", "lodash": "^4.17.20", "vue": "^2.6.11", - "vue-json-editor": "^1.4.2", - "@docmirror/dev-sidecar": "1.0.0", - "json5": "^2.1.3", - "es-abstract": "^1.17.7" + "vue-json-editor": "^1.4.2" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", @@ -30,6 +31,7 @@ "babel-eslint": "^10.1.0", "electron": "^10.1.3", "electron-devtools-installer": "^3.1.0", + "electron-icon-builder": "^1.0.2", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", @@ -60,4 +62,4 @@ "not dead" ], "__npminstall_done": false -} \ No newline at end of file +} diff --git a/packages/gui/public/favicon.ico b/packages/gui/public/favicon.ico index 08cc502..090e3e3 100644 Binary files a/packages/gui/public/favicon.ico and b/packages/gui/public/favicon.ico differ diff --git a/packages/gui/public/logo-1.svg b/packages/gui/public/logo/logo-1.svg similarity index 100% rename from packages/gui/public/logo-1.svg rename to packages/gui/public/logo/logo-1.svg diff --git a/packages/gui/public/logo/logo-lang.svg b/packages/gui/public/logo/logo-lang.svg new file mode 100644 index 0000000..7c01ee6 --- /dev/null +++ b/packages/gui/public/logo/logo-lang.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/gui/public/logo/logo-only.png b/packages/gui/public/logo/logo-only.png new file mode 100644 index 0000000..4ffc996 Binary files /dev/null and b/packages/gui/public/logo/logo-only.png differ diff --git a/packages/gui/public/logo/logo-only.svg b/packages/gui/public/logo/logo-only.svg new file mode 100644 index 0000000..b2e68be --- /dev/null +++ b/packages/gui/public/logo/logo-only.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/gui/public/logo/logo-only2.png b/packages/gui/public/logo/logo-only2.png new file mode 100644 index 0000000..8725a03 Binary files /dev/null and b/packages/gui/public/logo/logo-only2.png differ diff --git a/packages/gui/public/logo/logo-only4.png b/packages/gui/public/logo/logo-only4.png new file mode 100644 index 0000000..2475a89 Binary files /dev/null and b/packages/gui/public/logo/logo-only4.png differ diff --git a/packages/gui/public/logo/logo-simple.svg b/packages/gui/public/logo/logo-simple.svg new file mode 100644 index 0000000..73c63ae --- /dev/null +++ b/packages/gui/public/logo/logo-simple.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/gui/public/logo/logo-text.svg b/packages/gui/public/logo/logo-text.svg new file mode 100644 index 0000000..feb3406 --- /dev/null +++ b/packages/gui/public/logo/logo-text.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/gui/public/logo.svg b/packages/gui/public/logo/logo.svg similarity index 100% rename from packages/gui/public/logo.svg rename to packages/gui/public/logo/logo.svg diff --git a/packages/gui/src/assets/logo.png b/packages/gui/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/packages/gui/src/assets/logo.png and /dev/null differ diff --git a/packages/gui/src/view/components/App.vue b/packages/gui/src/view/components/App.vue index e976df7..3e9b0e4 100644 --- a/packages/gui/src/view/components/App.vue +++ b/packages/gui/src/view/components/App.vue @@ -2,7 +2,7 @@