updated build and remove some unused

This commit is contained in:
Sambo Chea 2020-09-26 13:09:02 +07:00
parent 90868221b5
commit 98dca413e6
4 changed files with 29 additions and 15 deletions

View File

@ -1 +0,0 @@
DR_URL=https://clinic-dev.cubetiqs.com?platform=desktop

View File

@ -1 +0,0 @@
DR_URL=https://clinic.cubetiqs.com?platform=desktop

27
main.js
View File

@ -1,25 +1,34 @@
const electron = require("electron");
const { app, BrowserWindow } = electron;
const DR_URL = process.env.DR_URL || "https://clinic.cubetiqs.com?platform=desktop&offline=true&source=" + (process.env.USERNAME || "unknown");
const DR_TITLE = "CUBETIQ CLINIC"
const URL = "https://app.drprofessionalglobal.com";
const DR_URL =
process.env.DR_URL ||
URL +
"?platform=desktop&offline=true&source=" +
(process.env.USERNAME || "unknown");
const DR_TITLE = "CUBETIQ CLINIC";
let mainApp;
app.allowRendererProcessReuse = true;
app.on("ready", () => {
mainApp = new BrowserWindow({
width: 1000,
height: 700
width: 1024,
height: 768,
});
mainApp.webContents.executeJavaScript(`localStorage.setItem("author", "Sambo Chea <sombochea@cubetiqs.com>")`)
mainApp.webContents.executeJavaScript(`localStorage.setItem("IS_ELECTRON", true)`)
mainApp.webContents.executeJavaScript(
`localStorage.setItem("author", "Sambo Chea <sombochea@cubetiqs.com>")`
);
mainApp.webContents.executeJavaScript(
`localStorage.setItem("IS_ELECTRON", true)`
);
mainApp.setFullScreen(true)
mainApp.setFullScreen(true);
mainApp.setTitle(DR_TITLE);
console.log("Starting from:", DR_URL)
console.log("Starting from:", DR_URL);
mainApp.loadURL(DR_URL);
mainApp.on("closed", () => {

View File

@ -11,7 +11,10 @@
},
"linux": {
"category": "com.cubetiqs.pro.clinic",
"target": ["AppImage", "deb"]
"target": [
"AppImage",
"deb"
]
},
"win": {
"target": "nsis"
@ -27,6 +30,7 @@
"start": "yarn && cross-env DR_URL=https://clinic.cubetiqs.com?platform=desktop electron ./main",
"pack": "electron-builder --dir",
"dist": "electron-builder --publish never",
"build-icon": "electron-icon-builder --input=icon.png --output=dist/icons",
"builder-help": "electron-builder --help",
"test": "echo \"Error: no test specified\" && exit 1"
},
@ -45,5 +49,8 @@
"bugs": {
"url": "https://github.com/CUBETIQ/sandbox-clinic/issues"
},
"homepage": "https://github.com/CUBETIQ/sandbox-clinic#readme"
"homepage": "https://github.com/CUBETIQ/sandbox-clinic#readme",
"dependencies": {
"electron-icon-builder": "^1.0.2"
}
}