Skip to content

Commit

Permalink
v0.1.1-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ksm committed Oct 26, 2020
2 parents 2fae771 + 68bf177 commit 23618a3
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 87 deletions.
162 changes: 80 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jumpspace",
"version": "0.1.0-beta",
"version": "0.1.1-beta",
"author": "@nameEO",
"description": "The visual SSH connection editor",
"scripts": {
Expand Down
23 changes: 22 additions & 1 deletion src/background.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
'use strict'
/* global __static */
import info from '../package.json'
import { app, protocol, ipcMain, BrowserWindow, Menu, Tray } from 'electron'
import {
app,
protocol,
ipcMain,
BrowserWindow,
Menu,
Tray,
shell,
dialog
} from 'electron'
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
import path from 'path'
Expand Down Expand Up @@ -29,6 +38,13 @@ const store = new Store()
const singleInstanceLock = app.requestSingleInstanceLock()

if (!singleInstanceLock) {
if (isDevelopment && !process.env.IS_TEST) {
dialog.showErrorBox(
'singleInstanceLock',
'Another instance is already running'
)
}

app.quit()
} else {
ipcMain.on('getStore', event => {
Expand Down Expand Up @@ -142,6 +158,11 @@ async function createWindow() {
win.show()
})

win.webContents.on('new-window', function(event, url) {
event.preventDefault()
shell.openExternal(url)
})

if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@
>
</b-input-group>
</b-form-group>
<b-form-group
class="mb-0"
label="Exec"
label-align="left"
label-cols-sm="3"
>
<b-form-input
v-model.trim="exec"
size="sm"
/>
</b-form-group>
</div>
</div>
</template>
Expand Down Expand Up @@ -273,6 +284,7 @@
v-if="isProxyJumpReady"
title="ProxyJump"
class="info-edit-item"
:class="{'danger': Boolean(exec)}"
height="24"
name="bolt"
scale="1.5"
Expand All @@ -283,6 +295,7 @@
v-if="isConnectable && !isProxyJumpReady"
title="Connect"
class="info-edit-item"
:class="{'danger': Boolean(exec)}"
height="24"
name="plug"
scale="1.5"
Expand Down Expand Up @@ -362,6 +375,7 @@ export default {
user: null,
host: null,
port: null,
exec: null,
diagram: null,
keyPath: null,
forwards: [],
Expand Down Expand Up @@ -427,8 +441,12 @@ export default {
this.keyPath
? `-i '${upath.toUnix(this.keyPath)}' `
: ''
}${this.user ? this.user + '@' : ''}${this.host} -p '${this.port}'"`
// console.log(command)
}${this.user ? this.user + '@' : ''}${this.host} -p '${this.port}' ${
this.exec
? `-tt '${this.exec}; exec $SHELL'`
: ''
}"`
console.log(command)
window.executeCommand(command)
},
openForward() {
Expand Down Expand Up @@ -482,6 +500,8 @@ export default {
str += `Host ${hostHash}\r\n`
str += `HostName ${host}\r\n`
str += `HostKeyAlias ${hostHash}\r\n`
str += 'StrictHostKeyChecking=accept-new\r\n'
str += `User ${user}\r\n`
str += `Port ${port}\r\n`
str += `Identityfile ${upath.toUnix(keyPath)}\r\n`
Expand All @@ -499,7 +519,11 @@ export default {
nodes
.map((x, i) => `echo '>>> [${x.host}]:${x.port}'`)
.join('&&')
} && ssh -o 'StrictHostKeyChecking=accept-new' -F "${configTempFilename}" -J ${jumpHosts.join(',')} ${destHost}"`
} && ssh -o 'StrictHostKeyChecking=accept-new' -F "${configTempFilename}" -J ${jumpHosts.join(',')} ${destHost} ${
this.exec
? `-tt '${this.exec}; exec $SHELL'`
: ''
}"`
window.executeCommand(command, (output) => {
setTimeout(() => window.unlinkFile(configTempFilename), 3000)
Expand Down Expand Up @@ -621,6 +645,14 @@ export default {
&-item {
margin-left: 4px;
&.warning {
color: #e3c000;
}
&.danger {
color: #dc3545;
}
}
&-text {
Expand Down Expand Up @@ -651,6 +683,14 @@ export default {
&-item {
margin-left: 4px;
&.warning {
color: #e3c000;
}
&.danger {
color: #dc3545;
}
}
&-text {
Expand Down

0 comments on commit 23618a3

Please sign in to comment.