From d69e41158117a30f1934d316f87ba24510e7824c Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 29 Jul 2020 15:56:29 +0200 Subject: [PATCH] Moved to electron 9 --- README.md | 8 +++++++- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/main/index.js | 24 ++++++++++++------------ src/main/ipc-handlers/application.js | 7 +++++++ src/main/ipc-handlers/index.js | 2 ++ src/renderer/components/TheTitleBar.vue | 4 ++-- src/renderer/i18n/it-IT.js | 7 ++++--- 8 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 src/main/ipc-handlers/application.js diff --git a/README.md b/README.md index 6a159492..dbd8afd8 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,14 @@ # Antares SQL Client +![GitHub package.json version](https://img.shields.io/github/package-json/v/estarium/antares) [![Build Status](https://travis-ci.com/EStarium/antares.svg?branch=master)](https://travis-ci.com/EStarium/antares) ![GitHub All Releases](https://img.shields.io/github/downloads/estarium/antares/total) ![GitHub](https://img.shields.io/github/license/estarium/antares) + Antares is an SQL client based on Electron.js and Vue.js that aims to become a useful tool, especially for developers. My target is to support as many databases as possible, and all major operating systems, including the ARM versions. At the moment this application is in a development state, it lacks many features, and is'nt ready as a main SQL client. However i'm actively working on it, hoping to provide all essential features as soon as possible. -If you are curious to try this early state of Antares you can download and install the [latest release](https://github.com/EStarium/antares/releases), and stay tuned for updates. At moment is only available for Windows. +If you are curious to try this early state of Antares you can download and install the [latest release](https://github.com/EStarium/antares/releases), and stay tuned for updates. At moment i'm testing only on Windows. ## Currently supported @@ -27,3 +29,7 @@ If you are curious to try this early state of Antares you can download and insta - [x] Windows - [ ] Linux - [ ] MacOS + +## Translations + +[Giuseppe Gigliotti](https://github.com/ReverbOD) / [Italian Translation](https://github.com/EStarium/antares/pull/20) diff --git a/package-lock.json b/package-lock.json index 48c48218..182ad739 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1528,9 +1528,9 @@ }, "dependencies": { "@types/node": { - "version": "8.10.61", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.61.tgz", - "integrity": "sha512-l+zSbvT8TPRaCxL1l9cwHCb0tSqGAGcjPJFItGGYat5oCTiq1uQQKYg5m7AF1mgnEBzFXGLJ2LRmNjtreRX76Q==" + "version": "8.10.62", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.62.tgz", + "integrity": "sha512-76fupxOYVxk36kb7O/6KtrAPZ9jnSK3+qisAX4tQMEuGNdlvl7ycwatlHqjoE6jHfVtXFM3pCrCixZOidc5cuw==" } } }, @@ -4083,9 +4083,9 @@ } }, "electron": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-8.4.0.tgz", - "integrity": "sha512-SpgyccM5rjDJSGcpQjiviUBT44fZlSyhcjy8RpKSnAad+co4xY1vYj6T25U1CfSk0PH/dhvcp63P2sdXHCwq/Q==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-9.1.2.tgz", + "integrity": "sha512-xEYadr3XqIqJ4ktBPo0lhzPdovv4jLCpiUUGc2M1frUhFhwqXokwhPaTUcE+zfu5+uf/ONDnQApwjzznBsRrgQ==", "dev": true, "requires": { "@electron/get": "^1.0.1", @@ -7116,9 +7116,9 @@ "dev": true }, "iconv-lite": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.1.tgz", - "integrity": "sha512-ONHr16SQvKZNSqjQT9gy5z24Jw+uqfO02/ngBSBoqChZ+W8qXX7GPRa1RoUnzGADw8K63R1BXUMzarCVQBpY8Q==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz", + "integrity": "sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } diff --git a/package.json b/package.json index ac9f17a3..c91ce00a 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "devDependencies": { "babel-eslint": "^10.1.0", "cross-env": "^7.0.2", - "electron": "^8.4.0", + "electron": "^9.1.2", "electron-builder": "^22.8.0", "electron-devtools-installer": "^3.1.1", "electron-webpack": "^2.8.2", diff --git a/src/main/index.js b/src/main/index.js index 6216a81b..78018c83 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -12,7 +12,7 @@ process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'; // global reference to mainWindow (necessary to prevent window from being garbage collected) let mainWindow; -function createMainWindow () { +async function createMainWindow () { const icon = require('../renderer/images/logo-32.png'); const window = new BrowserWindow({ width: 1600, @@ -24,23 +24,16 @@ function createMainWindow () { icon: nativeImage.createFromDataURL(icon.default), webPreferences: { nodeIntegration: true, - 'web-security': false + 'web-security': false, + enableRemoteModule: true }, frame: false, backgroundColor: '#1d1d1d' }); - if (isDevelopment) - window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`); - else { - window.loadURL(formatUrl({ - pathname: path.join(__dirname, 'index.html'), - protocol: 'file', - slashes: true - })); - } - if (isDevelopment) { + await window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`); + const { default: installExtension, VUEJS_DEVTOOLS } = require('electron-devtools-installer'); window.webContents.openDevTools(); @@ -52,6 +45,13 @@ function createMainWindow () { console.log(err); }); } + else { + await window.loadURL(formatUrl({ + pathname: path.join(__dirname, 'index.html'), + protocol: 'file', + slashes: true + })); + } window.on('closed', () => { mainWindow = null; diff --git a/src/main/ipc-handlers/application.js b/src/main/ipc-handlers/application.js new file mode 100644 index 00000000..bc5956c8 --- /dev/null +++ b/src/main/ipc-handlers/application.js @@ -0,0 +1,7 @@ +import { app, ipcMain } from 'electron'; + +export default () => { + ipcMain.on('closeApp', () => { + app.exit(); + }); +}; diff --git a/src/main/ipc-handlers/index.js b/src/main/ipc-handlers/index.js index 36cac2d1..ebe5e0d7 100644 --- a/src/main/ipc-handlers/index.js +++ b/src/main/ipc-handlers/index.js @@ -1,6 +1,7 @@ import connection from './connection'; import tables from './tables'; import updates from './updates'; +import application from './application'; const connections = {}; @@ -8,4 +9,5 @@ export default () => { connection(connections); tables(connections); updates(); + application(); }; diff --git a/src/renderer/components/TheTitleBar.vue b/src/renderer/components/TheTitleBar.vue index b914bb5c..5f712ec5 100644 --- a/src/renderer/components/TheTitleBar.vue +++ b/src/renderer/components/TheTitleBar.vue @@ -37,7 +37,7 @@