inux ubuntu

pull/88/head
xiaojunnuo 2021-08-13 14:58:59 +08:00
parent 4dc04fb092
commit f5a4af9a87
5 changed files with 29 additions and 5 deletions

View File

@ -8,9 +8,9 @@ const executor = {
return true return true
}, },
async linux (exec, { certPath }) { async linux (exec, { certPath }) {
const cmds = ['open "' + certPath + '"'] const cmds = [`sudo cp ${certPath} /usr/local/share/ca-certificates`, 'sudo update-ca-certificates ']
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const ret = await exec(cmds, { type: 'cmd' }) const ret = await exec(cmds)
return true return true
}, },
async mac (exec, { certPath }) { async mac (exec, { certPath }) {

View File

@ -138,6 +138,7 @@ function getSystemPlatform () {
case 'linux': case 'linux':
return 'linux' return 'linux'
case 'win32': case 'win32':
return 'windows'
case 'win64': case 'win64':
return 'windows' return 'windows'
case 'unknown os': case 'unknown os':

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

View File

@ -75,6 +75,21 @@ function setTray (app) {
return appTray return appTray
} }
function isLinux () {
const platform = DevSidecar.api.shell.getSystemPlatform()
return platform === 'linux'
}
function hideWin () {
if (win) {
if (isLinux()) {
win.minimize()
} else {
win.hide()
}
}
}
function createWindow () { function createWindow () {
// Create the browser window. // Create the browser window.
@ -113,7 +128,7 @@ function createWindow () {
} }
if (startHideWindow) { if (startHideWindow) {
win.hide() hideWin()
} }
win.on('closed', async (e) => { win.on('closed', async (e) => {
@ -124,7 +139,7 @@ function createWindow () {
win.on('close', (e) => { win.on('close', (e) => {
if (!forceClose) { if (!forceClose) {
e.preventDefault() e.preventDefault()
win.hide() hideWin()
} }
}) })
} }

View File

@ -21,13 +21,16 @@
2然后按如下图步骤将随机生成的根证书设置为始终信任<br/> 2然后按如下图步骤将随机生成的根证书设置为始终信任<br/>
3可能需要重新启动应用和浏览器才能生效<br/> 3可能需要重新启动应用和浏览器才能生效<br/>
</template> </template>
<template v-else-if="this.systemPlatform === 'linux'">
1点击右上角点此去安装按钮,将自动安装到系统证书库中<br/>
2火狐chrome等浏览器不走系统证书需要手动安装(下图以chrome为例安装根证书)<br/>
</template>
<template v-else> <template v-else>
1点击右上角点此去安装按钮打开证书<br/> 1点击右上角点此去安装按钮打开证书<br/>
2然后按如下图步骤将根证书添加到<b>信任的根证书颁发机构</b><br/> 2然后按如下图步骤将根证书添加到<b>信任的根证书颁发机构</b><br/>
</template> </template>
</div> </div>
<img width="100%" :src="setupImage" /> <img width="100%" :src="setupImage" />
</a-drawer> </a-drawer>
</template> </template>
@ -59,6 +62,8 @@ export default {
setupImage () { setupImage () {
if (this.systemPlatform === 'mac') { if (this.systemPlatform === 'mac') {
return '/setup-mac.png' return '/setup-mac.png'
} else if (this.systemPlatform === 'linux') {
return '/setup-linux.png'
} else { } else {
return '/setup.png' return '/setup.png'
} }
@ -75,6 +80,9 @@ export default {
}, },
async doSetup () { async doSetup () {
this.$emit('setup') this.$emit('setup')
if (this.systemPlatform === 'linux') {
this.$message.success('根证书已成功安装到系统证书库(注意:浏览器仍然需要手动安装)')
}
} }
} }
} }