-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Electron app release through CD (#171)
* Build base image in CI and some changes in dockerfile * Re-add image names in docker-compose.yml * stop building Base image and update package.json version * [fix] working electron app on linux * 0.8.0 * [fixed] working electron app on macOS * Add detail error message and increase log element height * refactor html-placeholder and electron/main.js
- Loading branch information
1 parent
2687e7e
commit 810bbe5
Showing
13 changed files
with
348 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
exports.getErrorDetail = (msg) => { | ||
const errTextsObject = { | ||
"errorduringconnect:thiserrormayindicatethatthedockerdaemonisnotrunning": { | ||
message: "Docker Not Running!", | ||
detail: | ||
"It seems like your docker is not running. Please start docker service and restart this app.", | ||
}, | ||
isnotrecognizedasaninternalorexternalcommand: { | ||
message: "Docker Not Found!", | ||
detail: | ||
"It seems like docker is not installed on your machine or docker path is missing in PATH environment.", | ||
}, | ||
"docker-compose:commandnotfound": { | ||
message: "Docker-compose Not Found!", | ||
detail: | ||
"It looks like docker-compose is not installed on your machine. Please install docker-compose and restart the app.", | ||
}, | ||
"docker:commandnotfound": { | ||
message: "Docker Not Found!", | ||
detail: | ||
"It seems like docker is not installed on your machine or docker path is missing in PATH environment.", | ||
}, | ||
isnotrecognizedasanameofacmdlet: { | ||
message: "Docker Not Found!", | ||
detail: | ||
"It seems like docker is not installed on your machine or docker path is missing in PATH environment.", | ||
}, | ||
unknownshorthandflag: { | ||
message: "Docker Compose is not installed!", | ||
detail: | ||
"Docker Compose is not found on your machine. Installing Docker-desktop or docker-compose may solve this problem.", | ||
}, | ||
permissiondeniedwhiletryingtoconnectto: { | ||
message: "Permission denied!", | ||
detail: | ||
"Permission denied while trying to connect to Docker. Give docker permission to current user may solve this issue.", | ||
}, | ||
"docker-credential-desktopresolvestoexecutableincurrentdirectory": { | ||
message: "Error getting credentials", | ||
detail: | ||
"This is because a wrong entry in ~/.docker/config.json was created. Namely credsStore instead of credStore. Changing the entry in ~/.docker/config.json may solve the problem.", | ||
}, | ||
}; | ||
const errTextObjKeys = Object.keys(errTextsObject); | ||
const errorIndex = errTextObjKeys.findIndex((key) => | ||
msg.split(" ").join("").includes(key) | ||
); | ||
if (errorIndex === -1) { | ||
return { | ||
message: "Docker compose error!", | ||
detail: msg, | ||
}; | ||
} | ||
return errTextsObject[errTextObjKeys[errorIndex]]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="shortcut icon" href="../assets/favicon.ico" type="image/x-icon"> | ||
<title>Flojoy</title> | ||
<style> | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
} | ||
|
||
.main_container { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
min-height: 90vh; | ||
} | ||
|
||
.logo_container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
|
||
.log_container { | ||
height: 150px; | ||
width: 75%; | ||
padding: 5px; | ||
background-color: black; | ||
color: white; | ||
} | ||
|
||
.log_output { | ||
overflow: hidden; | ||
overflow-y: scroll; | ||
height: 100%; | ||
} | ||
|
||
.log-message-container { | ||
list-style: none; | ||
width: fit-content; | ||
padding: 5px; | ||
margin: 0; | ||
} | ||
|
||
.log-message-container > li { | ||
padding-right: 10px; | ||
white-space: break-spaces; | ||
width: 100%; | ||
padding-bottom: 5px; | ||
|
||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="main_container"> | ||
<h1 style="text-align: center;">Flojoy Desktop</h1> | ||
<div class="logo_container"> | ||
<img src="../assets/favicon.png" height="125px" width="125px" alt="Flojoy"> | ||
<p id="app-status"></p> | ||
</div> | ||
<div class="log_container"> | ||
<div class="log_output"> | ||
<ul class="log-message-container" id="log-message" style="font-family: monospace; font-size: 18px;"> </ul> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { ipcRenderer } = require("electron"); | ||
|
||
window.addEventListener("DOMContentLoaded", (_) => { | ||
const outputList = document.getElementById("log-message"); | ||
const appStatusElem = document.getElementById("app-status"); | ||
ipcRenderer.send("ping"); | ||
ipcRenderer.on("msg", (_, arg) => { | ||
const output = document.createElement("li"); | ||
output.innerText = arg; | ||
outputList.appendChild(output); | ||
output.children | ||
.item(output.children.length - 1) | ||
.scrollIntoView({ behavior: "smooth" }); | ||
}); | ||
|
||
ipcRenderer.on("err", (_, arg) => { | ||
const output = document.createElement("li"); | ||
output.innerText = arg; | ||
outputList.appendChild(output); | ||
output.children | ||
.item(output.children.length - 1) | ||
.scrollIntoView({ behavior: "smooth" }); | ||
}); | ||
ipcRenderer.on("app_status", (_, arg) => { | ||
appStatusElem.innerHTML = arg.toString(); | ||
}); | ||
}); |
Oops, something went wrong.