mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 05:27:56 +00:00
Fix base href for electron env
This commit is contained in:
parent
f4fbfe1ed3
commit
d7529e93fd
5
main.js
5
main.js
@ -76,6 +76,7 @@ function createWindow () {
|
|||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
nodeIntegration: false,
|
||||||
preload: path.join(__dirname, 'sentry.js')
|
preload: path.join(__dirname, 'sentry.js')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -117,8 +118,8 @@ function createWindow () {
|
|||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
app.on('ready', createWindow);
|
app.on('ready', createWindow);
|
||||||
|
|
||||||
app.on('ready', createServerProc);
|
// app.on('ready', createServerProc);
|
||||||
app.on('will-quit', exitServerProc);
|
// app.on('will-quit', exitServerProc);
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
app.on('window-all-closed', function () {
|
app.on('window-all-closed', function () {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const { init } = require('@sentry/electron');
|
const { init } = require('@sentry/electron');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { ipcMain } = require('electron');
|
|
||||||
|
const { ipcRenderer } = require('electron')
|
||||||
|
|
||||||
let crashReportsEnabled = true;
|
let crashReportsEnabled = true;
|
||||||
const DSN =
|
const DSN =
|
||||||
@ -15,7 +16,7 @@ const shouldSendCallback = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ipcMain.on('settings.changed', function (event, settings) {
|
ipcRenderer.on('settings.changed', function (event, settings) {
|
||||||
crashReportsEnabled = settings.crash_reports;
|
crashReportsEnabled = settings.crash_reports;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
if (userAgent.indexOf(' electron/') > -1) {
|
if (userAgent.indexOf(' electron/') > -1) {
|
||||||
var base = document.getElementsByTagName('base');
|
var base = document.getElementsByTagName('base');
|
||||||
if(base.length > 0) {
|
if(base.length > 0) {
|
||||||
base.href ='./';
|
base[0].href ='./';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
document.write('<base href="./" />');
|
document.write('<base href="./" />');
|
||||||
|
Loading…
Reference in New Issue
Block a user