Correct windows bug and add icons

This commit is contained in:
Guille 2024-05-14 16:21:06 +02:00
parent d810fee04d
commit 6d34f470a4
6 changed files with 37 additions and 8 deletions

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,14 +1,17 @@
{ {
"name": "nextgeninstituteworkflowlauncher", "name": "WorkflowLauncher",
"version": "1.0.0", "version": "1.0.2",
"description": "NextGen Institute workflows", "description": "NextGen Institute workflows",
"main": "main.js", "main": "main.js",
"homepage": "https://nextgenerations-cities.encs.concordia.ca/gitea/g_gutierrez/workflow_launcher",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
"test": "test", "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 <guillermo.gutierrezmorote@concordia.ca>",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"devDependencies": { "devDependencies": {
"electron": "^28.2.3", "electron": "^28.2.3",
@ -18,5 +21,22 @@
"browser-fs-access": "^0.35.0", "browser-fs-access": "^0.35.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"filereader": "^0.10.3" "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
}
} }
} }

View File

@ -6,7 +6,11 @@ document.getElementById("runWorkflow").addEventListener("click", runWorkflow)
document.getElementById("geometry_file").addEventListener("change", (event) => { document.getElementById("geometry_file").addEventListener("change", (event) => {
const file = event.target.files[0] const file = event.target.files[0]
document.getElementById('parameters').style.visibility = 'visible' 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' document.getElementById('height').style.display = 'block'
} }
else { else {

View File

@ -6,10 +6,15 @@ document.getElementById("runWorkflow").addEventListener("click", runWorkflow)
document.getElementById("geometry_file").addEventListener("change", (event) => { document.getElementById("geometry_file").addEventListener("change", (event) => {
const file = event.target.files[0] const file = event.target.files[0]
document.getElementById('parameters').style.visibility = 'visible' 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' document.getElementById('height').style.display = 'block'
} }
else { else {
console.log(file.name.split('.')[1])
document.getElementById('height').style.display = 'none' document.getElementById('height').style.display = 'none'
} }
param['geometry_file'] = file.path param['geometry_file'] = file.path

View File

@ -3,8 +3,8 @@ let param = {
'application': '', 'application': '',
'buildings': [] 'buildings': []
} }
document.getElementById("runWorkflow").addEventListener("click", runScenario) document.getElementById("runWorkflow").addEventListener("click", runWorkflow)
async function runScenario() { async function runWorkflow() {
try { try {
document.getElementById('links').innerHTML = '<img id="spinner" src="../../img/spinner.gif" width="50px" />' document.getElementById('links').innerHTML = '<img id="spinner" src="../../img/spinner.gif" width="50px" />'
document.getElementById('buildings').style.backgroundColor = "#FFFFFF" document.getElementById('buildings').style.backgroundColor = "#FFFFFF"