Skip to content

Commit

Permalink
add view buttons to access pages local server and api logs directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Gkiokan committed Apr 4, 2022
1 parent b5aafa9 commit c8a5581
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 5 deletions.
13 changes: 12 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function hearthbeat(){
function registerChannel(){
ipcMain.on('server', (event, data) => windows.server.webContents.send('server', data) )
ipcMain.on('server-show', () => windows.server.show() )
ipcMain.on('show', (event, data) => showWindow(data) )

ipcMain.on('main', (event, data) => windows.main.webContents.send('main', data) )
ipcMain.on('main-error', (event, data) => windows.main.webContents.send('main-error', data) )
Expand All @@ -105,7 +106,7 @@ function registerChannel(){
ipcMain.on('ps4', (event, data) => windows.ps4.webContents.send('ps4', data) )

ipcMain.on('error', (event, data) => windows.main.webContents.send('error', data) )
ipcMain.on('notify', (event, data) => notify(data))
ipcMain.on('notify', (event, data) => notify(data) )
ipcMain.on('quit', () => app.quit() )
}

Expand Down Expand Up @@ -135,7 +136,17 @@ function notify(data){
new Notification(data).show()
}

// show window
function showWindow(data){
if(data == 'ps4')
windows.ps4.show()

if(data == 'server')
windows.server.show()

if(data == 'info')
windows.info.show()
}

// quit application when all windows are closed
app.on('window-all-closed', () => {
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export default {
ipcRenderer.send('server-show')
},
show(data){
ipcRenderer.send('show', data)
},
sendMain(msg){
console.log('sending to main', msg)
ipcRenderer.send('main', msg)
Expand Down
12 changes: 8 additions & 4 deletions src/renderer/layout/DefaultLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<el-menu-item index="settings">Settings</el-menu-item>

<div class='top_right_header'>
<el-dropdown class="window_dropdown">
<el-dropdown class="window_dropdown" @command="handleViewCallback">
<i class="el-icon-files" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> Local Server </el-dropdown-item>
<el-dropdown-item> PS4 API Logs </el-dropdown-item>
<el-dropdown-item> Info </el-dropdown-item>
<el-dropdown-item command="server"> Open Local Server </el-dropdown-item>
<el-dropdown-item command="ps4"> Open PS4 API Logs </el-dropdown-item>
<el-dropdown-item command="info"> Info </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

Expand Down Expand Up @@ -119,6 +119,10 @@ export default {
});
},
handleViewCallback(view){
ipcRenderer.send('show', view)
},
}
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/scss/titlebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ $titleBarColorDark: #0c0c0c;
height: 40px;
width: 40px;
margin-top: 2px;

&:focus {
outline: none !important;
}
}

&:focus {
Expand Down
Binary file added static/assets/rpsV2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions static/assets/rpsV2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c8a5581

Please sign in to comment.