Skip to content

Commit

Permalink
Added opening in Terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
phppirate committed Apr 26, 2017
1 parent 2323140 commit ea6c8e8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 30 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
- Rebooting MySQL
- Rebooting Nginx
- Rebooting Postgres
- SSH into Server using iTerm (Native Terminal Coming soon)
- SSH into Server using iTerm
- SSH into Server using Terminal
- Viewing a Server on Forge Website
- Deploying Sites
- Toggle Quick Deploy
Expand Down
6 changes: 3 additions & 3 deletions app/js/app.js

Large diffs are not rendered by default.

55 changes: 31 additions & 24 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,36 @@ var mb = menubar({
mb.on('ready', () => {
// console.log('Some Item', mb.window)
// your app code here
// let template = [
// {
// label: "Anvil",
// submenu: [
// {
// role: 'about'
// },
// {
// role: 'reload'
// },
// {
// role: 'copy'
// },
// {
// role: 'paste'
// },
// {
// role: 'quit'
// }
// ]
// }
// ];
let template = [
{
label: "Anvil",
submenu: [
{
role: 'about'
},
{
label: 'Toggle Developer Tools',
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
click (item, focusedWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools()
}
},
{
role: 'reload'
},
{
role: 'copy'
},
{
role: 'paste'
},
{
role: 'quit'
}
]
}
];

// let menu = Menu.buildFromTemplate(template);
// Menu.setApplicationMenu(menu);
let menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"menubar": "^5.2.3"
"menubar": "^5.2.3",
"osap": "^1.0.2"
},
"devDependencies": {
"electron": "^1.6.6"
Expand Down
3 changes: 2 additions & 1 deletion src/js/pages/server-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

<div>
<button class="btn btn-block" @click="openSshInIterm">SSH In iTerm</button>
<button class="btn btn-block" @click="openSshInTerm">SSH In Terminal</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -129,7 +130,7 @@
osap(`tell application "iTerm"\rset newWindow to (create window with default profile command "ssh forge@${this.server.ip_address}")\rend tell`);
},
openSshInTerm(){
osap(`tell application "iTerm"\rset newWindow to (create window with default profile command "ssh forge@${this.server.ip_address}")\rend tell`);
osap(`tell application "Terminal"\rset currentTab to do script ("ssh forge@${this.server.ip_address}")\rend tell`);
}
}
}
Expand Down

0 comments on commit ea6c8e8

Please sign in to comment.