diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..9d8466a Binary files /dev/null and b/icon.ico differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..de03d51 Binary files /dev/null and b/icon.png differ diff --git a/package.json b/package.json index cccea26..442cda5 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,17 @@ { - "name": "nextgeninstituteworkflowlauncher", - "version": "1.0.0", + "name": "WorkflowLauncher", + "version": "1.0.2", "description": "NextGen Institute workflows", "main": "main.js", + "homepage": "https://nextgenerations-cities.encs.concordia.ca/gitea/g_gutierrez/workflow_launcher", "scripts": { "start": "electron .", "test": "test", - "dist-windows": "electron-builder --windows portable" + "dist-windows": "electron-builder --windows portable", + "dist-mac": "electron-builder --mac", + "dist-linux": "electron-builder" }, - "author": "Guille Gutierrez", + "author": "Guille Gutierrez ", "license": "GPL-3.0-or-later", "devDependencies": { "electron": "^28.2.3", @@ -18,5 +21,22 @@ "browser-fs-access": "^0.35.0", "dotenv": "^16.4.5", "filereader": "^0.10.3" + }, + "build": { + "appId": "ca.concordia", + "win": { + "icon": "./icon.ico" + }, + "linux": { + "icon": "./icon.png", + "category": "Science", + "target": [ + "deb" + ] + }, + "mac": { + "category": "public.app-category.education", + "identity": null + } } } diff --git a/workflows/energy_plus/run.js b/workflows/energy_plus/run.js index 2f6f3f3..81eae42 100644 --- a/workflows/energy_plus/run.js +++ b/workflows/energy_plus/run.js @@ -6,7 +6,11 @@ document.getElementById("runWorkflow").addEventListener("click", runWorkflow) document.getElementById("geometry_file").addEventListener("change", (event) => { const file = event.target.files[0] document.getElementById('parameters').style.visibility = 'visible' - if (file.type == 'application/geo+json') { + var extension = 'unknown' + if (file.name.split('.').length == 2) { + extension == file.name.split('.')[1] + } + if (file.type == 'application/geo+json' || extension == 'geojson') { document.getElementById('height').style.display = 'block' } else { diff --git a/workflows/meb/run.js b/workflows/meb/run.js index 70ec33a..5346aa9 100644 --- a/workflows/meb/run.js +++ b/workflows/meb/run.js @@ -6,10 +6,15 @@ document.getElementById("runWorkflow").addEventListener("click", runWorkflow) document.getElementById("geometry_file").addEventListener("change", (event) => { const file = event.target.files[0] document.getElementById('parameters').style.visibility = 'visible' - if (file.type == 'application/geo+json') { + var extension = 'unknown' + if (file.name.split('.').length == 2) { + extension == file.name.split('.')[1] + } + if (file.type == 'application/geo+json' || extension == 'geojson') { document.getElementById('height').style.display = 'block' } else { + console.log(file.name.split('.')[1]) document.getElementById('height').style.display = 'none' } param['geometry_file'] = file.path diff --git a/workflows/retrofit/run.js b/workflows/retrofit/run.js index 9ad29f2..de15b76 100644 --- a/workflows/retrofit/run.js +++ b/workflows/retrofit/run.js @@ -3,8 +3,8 @@ let param = { 'application': '', 'buildings': [] } -document.getElementById("runWorkflow").addEventListener("click", runScenario) -async function runScenario() { +document.getElementById("runWorkflow").addEventListener("click", runWorkflow) +async function runWorkflow() { try { document.getElementById('links').innerHTML = '' document.getElementById('buildings').style.backgroundColor = "#FFFFFF"