Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
Sambo Chea | 6f022cdde4 | ||
Sambo Chea | b235b7994f | ||
Sambo Chea | b4c173759c | ||
Sambo Chea | b8fcde6a0d | ||
Sambo Chea | d85a4f556f | ||
Sambo Chea | 57ca98a652 | ||
Sambo Chea | afd81b1dfb | ||
Sambo Chea | b9ccb55bf9 | ||
Sambo Chea | 98dca413e6 |
|
@ -1,6 +1,9 @@
|
|||
name: Sandbox Clinic Desktop
|
||||
name: Sandbox Clinic System
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -9,7 +12,6 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
# os: [windows-latest]
|
||||
|
||||
steps:
|
||||
- name: Starting Context
|
||||
|
@ -20,16 +22,19 @@ jobs:
|
|||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js 10.x
|
||||
- name: Use Node.js 16.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.x
|
||||
node-version: 16.x
|
||||
- name: yarn install
|
||||
run: |
|
||||
yarn install
|
||||
- name: Publish
|
||||
run: |
|
||||
yarn run dist
|
||||
node build.js clinic && yarn dist
|
||||
node build.js dr && yarn dist
|
||||
node build.js em && yarn dist
|
||||
node build.js kesor && yarn dist
|
||||
- name: Cleanup artifacts Linux and macOS
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
node_modules
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
dist
|
||||
dist
|
||||
electron-builder.env
|
||||
lib.js
|
|
@ -1,4 +1,4 @@
|
|||
# CUBETIQ Clinic Application
|
||||
# CUBETIQ Clinic System Management
|
||||
|
||||
![Sandbox Clinic Desktop](https://github.com/CUBETIQ/sandbox-clinic/workflows/Sandbox%20Clinic%20Desktop/badge.svg)
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -0,0 +1,62 @@
|
|||
const fs = require("fs");
|
||||
const argProfile = process.argv.slice(2);
|
||||
// const { exec } = require('child_process');
|
||||
|
||||
if (argProfile.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
argProfile.forEach((profile) => {
|
||||
const profileEnv = `./profile/${profile}.dev`;
|
||||
const profileJs = `./profile/${profile}.js`;
|
||||
|
||||
console.log("Generating for electron-builder.env");
|
||||
fs.readFile(profileEnv, "utf8", (err, data) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
|
||||
fs.writeFile("./electron-builder.env", data, "utf8", (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("file saved");
|
||||
});
|
||||
});
|
||||
|
||||
console.log("Generating for lib.js");
|
||||
fs.readFile(profileJs, "utf8", (err, data) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
|
||||
fs.writeFile("./lib.js", data, "utf8", (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("file saved");
|
||||
});
|
||||
});
|
||||
|
||||
// console.log("Building for " + profile + "...!");
|
||||
// exec('yarn dist', (err, stdout, stderr) => {
|
||||
// if (err) {
|
||||
// console.log(err);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// console.log(`stdout: ${stdout}`);
|
||||
// console.log(`stderr: ${stderr}`);
|
||||
// });
|
||||
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
BUILD_PROFILE=${1:-clinic}
|
||||
echo "Build for profile ${BUILD_PROFILE}"
|
||||
|
||||
cat profile/${BUILD_PROFILE}.js > lib.js
|
||||
cat profile/${BUILD_PROFILE}.dev > electron-builder.env
|
||||
|
||||
echo "Verify lib.js and electron-builder.env"
|
||||
cat lib.js
|
||||
cat electron-builder.env
|
||||
|
||||
yarn dist
|
|
@ -2,10 +2,10 @@
|
|||
"productName": "Clinic-Dev",
|
||||
"appId": "com.cubetiqs.clinic",
|
||||
"mac": {
|
||||
"category": "com.cubetiqs.pro.clinic"
|
||||
"category": "com.cubetiqs.clinic"
|
||||
},
|
||||
"linux": {
|
||||
"category": "com.cubetiqs.pro.clinic",
|
||||
"category": "com.cubetiqs.clinic",
|
||||
"target": ["AppImage", "deb"]
|
||||
},
|
||||
"win": {
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
"productName": "Clinic-Sandbox",
|
||||
"appId": "com.cubetiqs.clinic",
|
||||
"mac": {
|
||||
"category": "com.cubetiqs.pro.clinic"
|
||||
"category": "com.cubetiqs.clinic"
|
||||
},
|
||||
"linux": {
|
||||
"category": "com.cubetiqs.pro.clinic",
|
||||
"category": "com.cubetiqs.clinic",
|
||||
"target": ["AppImage", "deb"]
|
||||
},
|
||||
"win": {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
DR_URL=https://clinic-dev.cubetiqs.com?platform=desktop
|
|
@ -1 +0,0 @@
|
|||
DR_URL=https://clinic.cubetiqs.com?platform=desktop
|
|
@ -0,0 +1,42 @@
|
|||
appId: "github.com/cubetiq/sandbox-clinic"
|
||||
artifactName: ${name}-${version}-${os}-${arch}-${env.ARTIFACT_NAME_POSTFIX}.${ext}
|
||||
productName: "Sandbox Clinic"
|
||||
publish: { provider: github, releaseType: draft, vPrefixedTagName: true }
|
||||
forceCodeSigning: false
|
||||
compression: normal
|
||||
npmRebuild: false
|
||||
asar: true
|
||||
|
||||
directories:
|
||||
output: ./dist
|
||||
buildResources: build
|
||||
app: .
|
||||
|
||||
mac:
|
||||
category: public.app-category.productivity
|
||||
darkModeSupport: true
|
||||
target:
|
||||
- { target: dmg }
|
||||
|
||||
dmg:
|
||||
contents:
|
||||
- { x: 380, y: 240, type: link, path: /Applications }
|
||||
- { x: 122, y: 240, type: file }
|
||||
|
||||
linux:
|
||||
category: Productivity
|
||||
packageCategory: Productivity
|
||||
executableArgs:
|
||||
- '--js-flags="--max-old-space-size=12288"'
|
||||
target:
|
||||
- target: deb
|
||||
- target: AppImage
|
||||
|
||||
win:
|
||||
artifactName: ${name}-${version}-windows-${arch}-${env.ARTIFACT_NAME_POSTFIX}.${ext}
|
||||
icon: ./assets/images/icon.ico
|
||||
target:
|
||||
- { target: nsis }
|
||||
|
||||
nsis:
|
||||
artifactName: ${name}-${version}-nsis-${arch}-${env.ARTIFACT_NAME_POSTFIX}.${ext}
|
30
main.js
30
main.js
|
@ -1,26 +1,34 @@
|
|||
const electron = require("electron");
|
||||
const { app, BrowserWindow } = electron;
|
||||
const os = require("os");
|
||||
const APP_URL = require("./lib");
|
||||
|
||||
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 = APP_URL || "https://clinic.cubetiqs.com";
|
||||
const MAIN_URL = `${URL}?platform=desktop&offline=true&os=${os.platform()}&hostname=${os.hostname()}&arch=${os.arch()}&source=${process.env.USERNAME || "unknown"}`
|
||||
const APP_TITLE = "Clinic System";
|
||||
|
||||
let mainApp;
|
||||
app.allowRendererProcessReuse = true;
|
||||
app.on("ready", () => {
|
||||
|
||||
mainApp = new BrowserWindow({
|
||||
width: 1000,
|
||||
height: 700
|
||||
width: 1024,
|
||||
height: 768,
|
||||
title: APP_TITLE,
|
||||
});
|
||||
|
||||
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.setFullScreen(true)
|
||||
mainApp.setTitle(DR_TITLE);
|
||||
mainApp.webContents.executeJavaScript(
|
||||
`localStorage.setItem("IS_ELECTRON", true)`
|
||||
);
|
||||
|
||||
console.log("Starting from:", DR_URL)
|
||||
mainApp.loadURL(DR_URL);
|
||||
mainApp.setFullScreen(true);
|
||||
mainApp.setTitle(APP_TITLE);
|
||||
|
||||
console.log("Starting from:", MAIN_URL);
|
||||
mainApp.loadURL(MAIN_URL);
|
||||
|
||||
mainApp.on("closed", () => {
|
||||
mainApp = null;
|
||||
|
|
34
package.json
34
package.json
|
@ -1,32 +1,21 @@
|
|||
{
|
||||
"name": "clinic",
|
||||
"version": "1.0.0",
|
||||
"description": "Clinic Application",
|
||||
"name": "sandbox-clinic",
|
||||
"version": "1.0.3",
|
||||
"description": "CUBETIQ Clinic System Management",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"icon": "./assets/images/icon.ico",
|
||||
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.0",
|
||||
"electron": "^8.0.0",
|
||||
"electron-builder": "^22.3.2"
|
||||
"electron": "^9.4.0",
|
||||
"electron-builder": "^22.11.7"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"start": "yarn && cross-env DR_URL=https://clinic.cubetiqs.com?platform=desktop electron ./main",
|
||||
"start": "yarn && cross-env APP_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 +34,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": "^2.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ARTIFACT_NAME_POSTFIX=cubetiqclinic
|
|
@ -0,0 +1,3 @@
|
|||
const APP_URL = 'https://clinic.cubetiqs.com';
|
||||
|
||||
module.exports = APP_URL;
|
|
@ -0,0 +1 @@
|
|||
ARTIFACT_NAME_POSTFIX=drclinic
|
|
@ -0,0 +1,3 @@
|
|||
const APP_URL = 'https://app.drprofessionalglobal.com';
|
||||
|
||||
module.exports = APP_URL;
|
|
@ -0,0 +1 @@
|
|||
ARTIFACT_NAME_POSTFIX=emclinic
|
|
@ -0,0 +1,3 @@
|
|||
const APP_URL = 'https://app.embeautyclinic.com';
|
||||
|
||||
module.exports = APP_URL;
|
|
@ -0,0 +1 @@
|
|||
ARTIFACT_NAME_POSTFIX=kesorclinic
|
|
@ -0,0 +1,3 @@
|
|||
const APP_URL = 'https://claris.cubetiqs.com';
|
||||
|
||||
module.exports = APP_URL;
|
Loading…
Reference in New Issue
Block a user