add and remove

This commit is contained in:
Sambo Chea 2020-02-13 19:30:26 +07:00
parent 0228160053
commit 5cb5ff7087
5 changed files with 26 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
package-lock.json
yarn.lock
dist

1
electron-builder.dev.yml Normal file
View File

@ -0,0 +1 @@
DR_URL=http://clinic.cubetiq.online?platform=desktop

View File

@ -0,0 +1 @@
DR_URL=http://sandbox.clinic.cubetiq.online?platform=desktop

11
main.js
View File

@ -1,10 +1,11 @@
const electron = require("electron");
const { app, BrowserWindow } = electron;
const DR_URL = process.env.DR_URL || "http://sandbox.clinic.cubetiq.online?platform=desktop&offline=true&source=" + (process.env.USERNAME || "unknown");
const DR_TITLE = "DR PROFESSIONAL CLINIC"
let mainApp;
app.allowRendererProcessReuse = true;
app.on("ready", () => {
mainApp = new BrowserWindow({
@ -16,8 +17,10 @@ app.on("ready", () => {
mainApp.webContents.executeJavaScript(`localStorage.setItem("IS_ELECTRON", true)`)
mainApp.setFullScreen(true)
mainApp.setTitle("DR PROFESSIONAL CLINIC");
mainApp.loadURL(process.env.DR_URL);
mainApp.setTitle(DR_TITLE);
console.log("Starting from:", DR_URL)
mainApp.loadURL(DR_URL);
mainApp.on("closed", () => {
mainApp = null;

View File

@ -3,6 +3,20 @@
"version": "1.0.0",
"description": "Clinic Application",
"main": "main.js",
"build": {
"productName": "Clinic-Sandbox",
"appId": "com.cubetiqs.clinic",
"mac": {
"category": "com.cubetiqs.pro.clinic"
},
"linux": {
"category": "com.cubetiqs.pro.clinic",
"target": ["AppImage", "deb"]
},
"win": {
"target": "nsis"
}
},
"devDependencies": {
"cross-env": "^7.0.0",
"electron": "^8.0.0",
@ -10,10 +24,9 @@
},
"scripts": {
"postinstall": "electron-builder install-app-deps",
"start": "yarn && electron ./main",
"start": "yarn && cross-env DR_URL=http://clinic.cubetiq.online?platform=desktop electron ./main",
"pack": "electron-builder --dir",
"dist": "cross-env DR_URL=http://clinic.cubetiq.online?platform=desktop electron-builder --config ./config/electron-builder-dev.json",
"sandbox": "cross-env DR_URL=http://sandbox.clinic.cubetiq.online?platform=desktop electron-builder --config ./config/electron-builder-sandbox.json",
"dist": "electron-builder",
"builder-help": "electron-builder --help",
"test": "echo \"Error: no test specified\" && exit 1"
},