Skip to content

Commit

Permalink
FIX handling of external urls
Browse files Browse the repository at this point in the history
  • Loading branch information
RecuencoJones committed Nov 28, 2022
1 parent fe90a57 commit 6fcb384
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/background/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function registerIpcHandlers() {

ipcMain.on('openGitHubRepository', openGitHubRepository);
ipcMain.handle('openGitHubRepository', openGitHubRepository);
ipcMain.handle('openUrl', (event, url) => shell.openExternal(url));
}

module.exports = { registerIpcHandlers };
1 change: 1 addition & 0 deletions src/background/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contextBridge.exposeInMainWorld('api', {
'getContextOverview',
'getPreferences',
'savePreferences',
'openUrl',
'openGitHubRepository'
),
async subscribeToContainerLogs(contextName, podName, containerName, fn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<td>{{ item.metadata.name }}</td>
<td>
<template v-for="rule of formatRules(item.spec)" :key="rule">
<a :href="rule.url" target="_blank" rel="noopener noreferrer">{{ rule.url }}</a> &rarr; {{ rule.service }}
<a href="#" @click="openUrl(rule.url)">{{ rule.url }}</a> &rarr; {{ rule.service }}
<br/>
</template>
</td>
Expand Down Expand Up @@ -47,6 +47,9 @@ export default {
},
handleSelect(item) {
this.$emit('select', item);
},
async openUrl(url) {
await api.openUrl(url);
}
}
}
Expand Down

0 comments on commit 6fcb384

Please sign in to comment.