mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
Prettified Code!
This commit is contained in:
parent
4f2671c359
commit
37702af344
|
@ -1,10 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
<meta
|
||||||
|
http-equiv="Content-Security-Policy"
|
||||||
|
content="script-src 'self' 'unsafe-inline';"
|
||||||
|
/>
|
||||||
<title>FreeDATA</title>
|
<title>FreeDATA</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -13,30 +16,25 @@
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
// debugging code for figuring out correct folder structure in build environment
|
// debugging code for figuring out correct folder structure in build environment
|
||||||
console.log(process.env)
|
console.log(process.env);
|
||||||
|
|
||||||
|
import { readdir } from "node:fs/promises";
|
||||||
|
import { readdirSync } from "fs";
|
||||||
|
import { join } from "path";
|
||||||
|
|
||||||
import { readdir } from 'node:fs/promises';
|
function walk(dir) {
|
||||||
import { readdirSync } from 'fs'
|
return readdirSync(dir, { withFileTypes: true }).flatMap((file) =>
|
||||||
import { join } from 'path'
|
file.isDirectory() ? walk(join(dir, file.name)) : join(dir, file.name),
|
||||||
|
);
|
||||||
function walk(dir) {
|
|
||||||
return readdirSync(dir, { withFileTypes: true }).flatMap((file) => file.isDirectory() ? walk(join(dir, file.name)) : join(dir, file.name))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (process.env["NODE_ENV"] == "production"){
|
|
||||||
|
|
||||||
console.log(walk(process.env["APPDIR"]))
|
|
||||||
console.log(walk(process.env["DIST"]))
|
|
||||||
console.log(walk(process.env["DIST_ELECTRON"]))
|
|
||||||
|
|
||||||
} else {
|
|
||||||
console.log("running in " + process.env["NODE_ENV"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
if (process.env["NODE_ENV"] == "production") {
|
||||||
|
console.log(walk(process.env["APPDIR"]));
|
||||||
|
console.log(walk(process.env["DIST"]));
|
||||||
|
console.log(walk(process.env["DIST_ELECTRON"]));
|
||||||
|
} else {
|
||||||
|
console.log("running in " + process.env["NODE_ENV"]);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -7,9 +7,8 @@ https://github.com/vuejs/create-vue
|
||||||
https://vue-community.org/guide/ecosystem/desktop-apps.html#electron
|
https://vue-community.org/guide/ecosystem/desktop-apps.html#electron
|
||||||
https://blog.logrocket.com/building-app-electron-vue/
|
https://blog.logrocket.com/building-app-electron-vue/
|
||||||
|
|
||||||
|
|
||||||
Folder structure
|
Folder structure
|
||||||
dist-electron: Automatically compiled source from vite
|
dist-electron: Automatically compiled source from vite
|
||||||
electron: Source code folder for Electron stuff
|
electron: Source code folder for Electron stuff
|
||||||
public: Public data
|
public: Public data
|
||||||
src: VueJS source code
|
src: VueJS source code
|
||||||
|
|
|
@ -80,8 +80,6 @@ PouchDB.plugin(require("pouchdb-find"));
|
||||||
//PouchDB.plugin(require('pouchdb-replication'));
|
//PouchDB.plugin(require('pouchdb-replication'));
|
||||||
PouchDB.plugin(require("pouchdb-upsert"));
|
PouchDB.plugin(require("pouchdb-upsert"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var db = new PouchDB(chatDB);
|
var db = new PouchDB(chatDB);
|
||||||
var users = new PouchDB(userDB);
|
var users = new PouchDB(userDB);
|
||||||
|
|
||||||
|
@ -673,9 +671,6 @@ ipcRenderer.on("return-select-user-image", (event, arg) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ipcRenderer.on("action-update-transmission-status", (event, arg) => {
|
ipcRenderer.on("action-update-transmission-status", (event, arg) => {
|
||||||
var data = arg["data"][0];
|
var data = arg["data"][0];
|
||||||
|
|
||||||
|
@ -1056,7 +1051,6 @@ update_chat = function (obj) {
|
||||||
var attempt = obj.attempt;
|
var attempt = obj.attempt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// add percent and bytes per minute if not existing
|
// add percent and bytes per minute if not existing
|
||||||
//console.log(obj.percent)
|
//console.log(obj.percent)
|
||||||
if (typeof obj.percent == "undefined") {
|
if (typeof obj.percent == "undefined") {
|
||||||
|
@ -1385,17 +1379,16 @@ update_chat = function (obj) {
|
||||||
showOsPopUp("Message received from " + obj.dxcallsign, obj.msg);
|
showOsPopUp("Message received from " + obj.dxcallsign, obj.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if message is signed or not for adjusting icon
|
||||||
// check if message is signed or not for adjusting icon
|
if (
|
||||||
if(typeof obj.hmac_signed !== "undefined" && obj.hmac_signed !== "False"){
|
typeof obj.hmac_signed !== "undefined" &&
|
||||||
console.log(hmac_signed)
|
obj.hmac_signed !== "False"
|
||||||
var hmac_signed = '<i class="bi bi-shield-fill-check"></i>';
|
) {
|
||||||
} else {
|
console.log(hmac_signed);
|
||||||
|
var hmac_signed = '<i class="bi bi-shield-fill-check"></i>';
|
||||||
var hmac_signed = '<i class="bi bi-shield-x"></i>';
|
} else {
|
||||||
|
var hmac_signed = '<i class="bi bi-shield-x"></i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var new_message = `
|
var new_message = `
|
||||||
<div class="d-flex align-items-center" style="margin-left: auto;"> <!-- max-width: 75%; -->
|
<div class="d-flex align-items-center" style="margin-left: auto;"> <!-- max-width: 75%; -->
|
||||||
|
@ -1412,13 +1405,9 @@ update_chat = function (obj) {
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<span id="msg-${
|
<span id="msg-${obj._id}-hmac-badge" class="position-absolute top-0 start-100 translate-middle badge rounded-1 bg-secondary border border-white">
|
||||||
obj._id
|
|
||||||
}-hmac-badge" class="position-absolute top-0 start-100 translate-middle badge rounded-1 bg-secondary border border-white">
|
|
||||||
|
|
||||||
<span id="msg-${
|
<span id="msg-${obj._id}-hmac-signed" class="">${hmac_signed}</span>
|
||||||
obj._id
|
|
||||||
}-hmac-signed" class="">${hmac_signed}</span>
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -2902,8 +2891,6 @@ function clearUnreadMessages(dxcall) {
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Have the operating system show a notification popup
|
//Have the operating system show a notification popup
|
||||||
|
|
|
@ -2,14 +2,11 @@ const path = require("path");
|
||||||
const { shell, clipboard } = require("electron");
|
const { shell, clipboard } = require("electron");
|
||||||
const exec = require("child_process").spawn;
|
const exec = require("child_process").spawn;
|
||||||
|
|
||||||
|
|
||||||
//import { useIpcRenderer } from '@vueuse/electron'
|
//import { useIpcRenderer } from '@vueuse/electron'
|
||||||
//const ipcRenderer = useIpcRenderer()
|
//const ipcRenderer = useIpcRenderer()
|
||||||
|
|
||||||
|
|
||||||
//import * as bootstrap from 'bootstrap'
|
//import * as bootstrap from 'bootstrap'
|
||||||
|
|
||||||
|
|
||||||
//require("./preload-chat.js");
|
//require("./preload-chat.js");
|
||||||
//require("./preload-mesh.js");
|
//require("./preload-mesh.js");
|
||||||
//require("./preload-log.js");
|
//require("./preload-log.js");
|
||||||
|
@ -17,7 +14,6 @@ const exec = require("child_process").spawn;
|
||||||
//const daemon = require("./daemon.js");
|
//const daemon = require("./daemon.js");
|
||||||
//const sock = require("./sock.js");
|
//const sock = require("./sock.js");
|
||||||
|
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const FD = require("./freedata");
|
const FD = require("./freedata");
|
||||||
const {
|
const {
|
||||||
|
@ -1649,7 +1645,6 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// stopTNC button clicked
|
// stopTNC button clicked
|
||||||
document.getElementById("stopTNC").addEventListener("click", () => {
|
document.getElementById("stopTNC").addEventListener("click", () => {
|
||||||
if (!confirm("Stop the TNC?")) return;
|
if (!confirm("Stop the TNC?")) return;
|
||||||
|
@ -1754,8 +1749,6 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
sock.disconnectARQ();
|
sock.disconnectARQ();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.getElementById("thTime").addEventListener("click", () => {
|
document.getElementById("thTime").addEventListener("click", () => {
|
||||||
if (hslLastSort == 0 && hslLastSortDir == "asc") hslLastSortDir = "desc";
|
if (hslLastSort == 0 && hslLastSortDir == "asc") hslLastSortDir = "desc";
|
||||||
else hslLastSortDir = "asc";
|
else hslLastSortDir = "asc";
|
||||||
|
@ -2895,9 +2888,13 @@ ipcRenderer.on("action-update-unread-messages-main", (event, data) => {
|
||||||
//Do something
|
//Do something
|
||||||
if (data == true) {
|
if (data == true) {
|
||||||
document.getElementById("list-messages-list").classList.add("bg-warning");
|
document.getElementById("list-messages-list").classList.add("bg-warning");
|
||||||
document.getElementById("list-messages-list").classList.remove("bg-secondary");
|
document
|
||||||
|
.getElementById("list-messages-list")
|
||||||
|
.classList.remove("bg-secondary");
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("list-messages-list").classList.remove("bg-warning");
|
document
|
||||||
|
.getElementById("list-messages-list")
|
||||||
|
.classList.remove("bg-warning");
|
||||||
document.getElementById("list-messages-list").classList.add("bg-secondary");
|
document.getElementById("list-messages-list").classList.add("bg-secondary");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -108,10 +108,10 @@ https://stackoverflow.com/a/9622873
|
||||||
/* default dark theme mods */
|
/* default dark theme mods */
|
||||||
}
|
}
|
||||||
.modal-backdrop {
|
.modal-backdrop {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-backdrop.in {
|
.modal-backdrop.in {
|
||||||
filter: alpha(opacity=10);
|
filter: alpha(opacity=10);
|
||||||
opacity: .1
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue