From 98dca413e65c52a9681a4e0db4efd2124df7d7ae Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Sat, 26 Sep 2020 13:09:02 +0700 Subject: [PATCH] updated build and remove some unused --- electron-builder.dev.yml | 1 - electron-builder.prod.yml | 1 - main.js | 29 +++++++++++++++++++---------- package.json | 13 ++++++++++--- 4 files changed, 29 insertions(+), 15 deletions(-) delete mode 100644 electron-builder.dev.yml delete mode 100644 electron-builder.prod.yml diff --git a/electron-builder.dev.yml b/electron-builder.dev.yml deleted file mode 100644 index 57aaf07..0000000 --- a/electron-builder.dev.yml +++ /dev/null @@ -1 +0,0 @@ -DR_URL=https://clinic-dev.cubetiqs.com?platform=desktop \ No newline at end of file diff --git a/electron-builder.prod.yml b/electron-builder.prod.yml deleted file mode 100644 index f8aa8b2..0000000 --- a/electron-builder.prod.yml +++ /dev/null @@ -1 +0,0 @@ -DR_URL=https://clinic.cubetiqs.com?platform=desktop \ No newline at end of file diff --git a/main.js b/main.js index c700be7..293c9cd 100644 --- a/main.js +++ b/main.js @@ -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 ")`) - mainApp.webContents.executeJavaScript(`localStorage.setItem("IS_ELECTRON", true)`) - - mainApp.setFullScreen(true) + mainApp.webContents.executeJavaScript( + `localStorage.setItem("author", "Sambo Chea ")` + ); + mainApp.webContents.executeJavaScript( + `localStorage.setItem("IS_ELECTRON", 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", () => { diff --git a/package.json b/package.json index eddfd7c..a03bb80 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,15 @@ }, "linux": { "category": "com.cubetiqs.pro.clinic", - "target": ["AppImage", "deb"] + "target": [ + "AppImage", + "deb" + ] }, "win": { "target": "nsis" } - }, + }, "devDependencies": { "cross-env": "^7.0.0", "electron": "^8.0.0", @@ -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" + } }