Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
e758078a8d | |||
e8bf1e0d81 | |||
a8c5f3a694 | |||
8d47e4c4f5 |
@ -42,6 +42,7 @@ button
|
|||||||
max-width: 1024px
|
max-width: 1024px
|
||||||
|
|
||||||
.container.fluid
|
.container.fluid
|
||||||
|
width: 100%
|
||||||
max-width: 100%
|
max-width: 100%
|
||||||
margin: 0
|
margin: 0
|
||||||
|
|
||||||
|
12
assets/twig/about.twig
Normal file
12
assets/twig/about.twig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>About Sentry</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>This is a test.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
8
main.js
8
main.js
@ -1,5 +1,5 @@
|
|||||||
// Modules to control application life and create native browser window
|
// Modules to control application life and create native browser window
|
||||||
const {app, BrowserWindow} = require('electron');
|
const { app, BrowserWindow, Menu } = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
@ -7,6 +7,8 @@ function createWindow () {
|
|||||||
const mainWindow = new BrowserWindow({
|
const mainWindow = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 700,
|
height: 700,
|
||||||
|
minWidth: 735,
|
||||||
|
minHeight: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
@ -21,6 +23,10 @@ function createWindow () {
|
|||||||
// mainWindow.webContents.openDevTools()
|
// mainWindow.webContents.openDevTools()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the application menu
|
||||||
|
const menu = require('./src/menu').createMenu(app);
|
||||||
|
Menu.setApplicationMenu(menu);
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "sentry",
|
"name": "sentry",
|
||||||
"version": "0.3.2",
|
"version": "0.3.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sentry",
|
"name": "sentry",
|
||||||
"version": "0.3.2",
|
"version": "0.3.3",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"systeminformation": "^5.11.15"
|
"systeminformation": "^5.17.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^18.2.4",
|
"electron": "^18.2.4",
|
||||||
@ -4743,9 +4743,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/systeminformation": {
|
"node_modules/systeminformation": {
|
||||||
"version": "5.12.6",
|
"version": "5.17.12",
|
||||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.12.6.tgz",
|
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.17.12.tgz",
|
||||||
"integrity": "sha512-FkCvT5BOuH1OE3+8lFM25oXIYJ0CM8kq4Wgvz2jyBTrsOIgha/6gdJXgbF4rv+g0j/5wJqQLDKan7kc/p7uIvw==",
|
"integrity": "sha512-I3pfMW2vue53u+X08BNxaJieaHkRoMMKjWetY9lbYJeWFaeWPO6P4FkNc4XOCX8F9vbQ0HqQ25RJoz3U/B7liw==",
|
||||||
"os": [
|
"os": [
|
||||||
"darwin",
|
"darwin",
|
||||||
"linux",
|
"linux",
|
||||||
@ -9025,9 +9025,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"systeminformation": {
|
"systeminformation": {
|
||||||
"version": "5.12.6",
|
"version": "5.17.12",
|
||||||
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.12.6.tgz",
|
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.17.12.tgz",
|
||||||
"integrity": "sha512-FkCvT5BOuH1OE3+8lFM25oXIYJ0CM8kq4Wgvz2jyBTrsOIgha/6gdJXgbF4rv+g0j/5wJqQLDKan7kc/p7uIvw=="
|
"integrity": "sha512-I3pfMW2vue53u+X08BNxaJieaHkRoMMKjWetY9lbYJeWFaeWPO6P4FkNc4XOCX8F9vbQ0HqQ25RJoz3U/B7liw=="
|
||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "6.1.11",
|
"version": "6.1.11",
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
"grunt-twig-render": "^1.8.3"
|
"grunt-twig-render": "^1.8.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"systeminformation": "^5.11.15"
|
"systeminformation": "^5.17.12"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "tech.bitgoblin.sentry",
|
"appId": "tech.bitgoblin.sentry",
|
||||||
|
15
src/menu/help.js
Normal file
15
src/menu/help.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
const { BrowserWindow } = require('electron');
|
||||||
|
|
||||||
|
exports.about = function() {
|
||||||
|
const aboutWindow = new BrowserWindow({
|
||||||
|
width: 600,
|
||||||
|
height: 400,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// and load the about.html of the app.
|
||||||
|
aboutWindow.loadFile('public/about.html');
|
||||||
|
};
|
30
src/menu/index.js
Normal file
30
src/menu/index.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
const electron = require('electron');
|
||||||
|
|
||||||
|
// load event handlers
|
||||||
|
const helpHandlers = require('./help');
|
||||||
|
|
||||||
|
exports.createMenu = function(app) {
|
||||||
|
return electron.Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: 'File',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Close',
|
||||||
|
click: function() {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: 'Help',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'About',
|
||||||
|
click: helpHandlers.about
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user