Add info modal, redesign header

This commit is contained in:
Mashintime 2023-02-06 21:18:36 -05:00
parent 9b17a680e5
commit f74cb06491
2 changed files with 143 additions and 53 deletions

View file

@ -21,7 +21,7 @@ var appDataFolder = process.env.APPDATA || (process.platform == 'darwin' ? proce
var configFolder = path.join(appDataFolder, "FreeDATA");
var configPath = path.join(configFolder, 'config.json');
const config = require(configPath);
const contrib = ["DK5SM","DL4IAZ","DB1UJ","EI3HIB","VK5DGR","EI7IG","N2KIQ?","KT4WO","DF7MH","G0HWW","N1QM"]
// SET dbfs LEVEL GLOBAL
// this is an attempt of reducing CPU LOAD
@ -426,10 +426,12 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', ()
document.getElementById("local-remote-switch1").checked = false;
document.getElementById("local-remote-switch2").checked = true;
document.getElementById("remote-tnc-field").style.visibility = 'visible';
toggleClass("remote-tnc-field",'d-none',false);
} else {
document.getElementById("local-remote-switch1").checked = true;
document.getElementById("local-remote-switch2").checked = false;
document.getElementById("remote-tnc-field").style.visibility = 'hidden';
toggleClass("remote-tnc-field",'d-none',true);
}
// Create spectrum object on canvas with ID "waterfall"
@ -443,6 +445,22 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', ()
document.getElementById("wftheme_selector").value = config.wftheme;
spectrum.setColorMap(config.wftheme);
document.getElementById("btnAbout").addEventListener("click", () => {
document.getElementById('aboutVersion').innerText=appVer;
let shuffled = contrib
.map(value => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort)
.map(({ value }) => value)
let list ="<h6>Special thanks to</h6><hr \><ul><li>DJ2LS</li>";
shuffled.forEach(element => {
list +="<li>" +element+"</li>"
});
list+="</ul>";
divContrib.innerHTML=list;
console.log(shuffled)
});
// on click radio control toggle view
// disabled
document.getElementById("radio-control-switch-disabled").addEventListener("click", () => {
@ -894,6 +912,7 @@ document.getElementById('hamlib_rigctld_stop').addEventListener('click', () => {
document.getElementById("local-remote-switch2").checked = false;
document.getElementById("remote-tnc-field").style.visibility = 'hidden';
config.tnclocation = 'localhost';
toggleClass("remote-tnc-field",'d-none',true);
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
});
document.getElementById("local-remote-switch2").addEventListener("click", () => {
@ -901,6 +920,7 @@ document.getElementById('hamlib_rigctld_stop').addEventListener('click', () => {
document.getElementById("local-remote-switch2").checked = true;
document.getElementById("remote-tnc-field").style.visibility = 'visible';
config.tnclocation = 'remote';
toggleClass("remote-tnc-field",'d-none',false);
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
});
@ -1224,6 +1244,14 @@ document.getElementById('hamlib_rigctld_stop').addEventListener('click', () => {
shell.openExternal('https://explorer.freedata.app/?myCall=' + document.getElementById("myCall").value);
});
// GH Link clicked
document.getElementById("ghUrl").addEventListener("click", () => {
shell.openExternal('https://github.com/DJ2LS/FreeDATA');
});
// Wiki Link clicked
document.getElementById("wikiUrl").addEventListener("click", () => {
shell.openExternal('https://wiki.freedata.app');
});
// startTNC button clicked
document.getElementById("startTNC").addEventListener("click", () => {

View file

@ -18,8 +18,10 @@
<body>
<!-- SECONDARY NAVBAR -->
<nav class="navbar bg-light fixed-top mt-0 mb-1 pb-1 pt-1 shadow-sm">
<div class="container-fluid mt-0">
<nav class="navbar fixed-top bg-light shadow-sm mt-0 mb-1 pb-1 pt-1">
<div style="margin-left: 5px;">
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group btn-group-sm me-2" role="group"
aria-label="local-remote-switch toggle button group" data-bs-placement="bottom"
@ -45,58 +47,79 @@
<button class="btn btn-sm btn-danger" id="daemon_connection_state" type="button" disabled> <i
class="bi bi-diagram-3" style="font-size: 1rem; color: white;"></i> </button>
</div>
<div class="input-group input-group-sm" data-bs-placement="bottom" data-bs-toggle="tooltip"
data-bs-html="true"
title="Start or stop the TNC process. Please set your audio and radio settings first!">
<button type="button" id="startTNC" class="btn btn-sm btn-success"> <i class="bi bi-play-fill"
style="font-size: 1rem; color: white;"></i> </button>
<!-- TNC LOG BUTTON -->
<button class="btn btn-sm btn-secondary" id="tncLog" type="button"> <i class="bi bi-activity"
style="font-size: 1rem; color: white;"></i> </button>
<!-- <span class="input-group-text" id="tnc_running_state" style="width: 5rem">---</span>-->
<button type="button" data-bs-toggle="collapse" data-bs-target=".multi-collapse" id="stopTNC"
class="btn btn-sm btn-danger"> <i class="bi bi-x-octagon-fill"
style="font-size: 1rem; color: white;"></i> </button>
</div>
</div>
<div class="btn-toolbar" role="toolbar">
<button class="btn btn-sm btn-danger" id="stop_transmission_connection" type="button"> <i
class="bi bi-x-octagon-fill" style="font-size: 1rem; color: white;"></i> STOP </button>
</div>
<div class="btn-toolbar" role="toolbar">
<button class="btn btn-sm btn-primary me-4 position-relative" id="openExplorer" type="button"
data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false" title="View explorer map">
<strong>Explorer</strong> <i class="bi bi-pin-map-fill"
style="font-size: 1rem; color: white;"></i></button>
<button class="btn btn-sm btn-primary me-4 position-relative" id="openRFChat" type="button"
data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false"
title="Open the HF chat module. This is currently just a test and not finished, yet!"> <strong>RF
Chat</strong> <i class="bi bi-chat-left-text-fill" style="font-size: 1rem; color: white;"></i>
<span
class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">.</span>
</button> <span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false"
title="View the received files. This is currently under development!">
<!--
<button class="btn btn-sm btn-primary me-2" data-bs-toggle="offcanvas" data-bs-target="#receivedFilesSidebar" id="openReceivedFiles" type="button" > <strong>Files </strong>
<i class="bi bi-file-earmark-arrow-up-fill" style="font-size: 1rem; color: white;"></i>
<i class="bi bi-file-earmark-arrow-down-fill" style="font-size: 1rem; color: white;"></i>
</button>
</span> <span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false" title="Send files through HF. This is currently under development!">
<button class="btn btn-sm btn-primary me-2" id="openDataModule" data-bs-toggle="offcanvas" data-bs-target="#transmitFileSidebar" type="button" style="display: None;"> <strong>TX File </strong>
<i class="bi bi-file-earmark-arrow-up-fill" style="font-size: 1rem; color: white;"></i>
</button>
-->
</span> <span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="true"
title="Settings and Info">
<button type="button" id="infoModalButton" data-bs-toggle="modal" data-bs-target="#infoModal"
class="btn btn-sm btn-secondary"><strong>Settings </strong>
<i class="bi bi-sliders" style="font-size: 1rem; color: white;"></i>
</button>
</span>
</div>
</div>
</nav>
<div>
<button class="btn btn-sm btn-danger" id="stop_transmission_connection" type="button" data-bs-toggle="tooltip" data-bs-html="false" title="Abort session and stop transmissions"> <i
class="bi bi-x-octagon-fill" style="font-size: 1rem; color: white;"></i> STOP <i
class="bi bi-x-octagon-fill" style="font-size: 1rem; color: white;"></i></button>
</div>
<div style="margin-right: 10px;">
<button type="button" id="startTNC" class="btn btn-sm btn-success" data-bs-toggle="tooltip" data-bs-html="false" title="Start the TNC. Please set your audio and radio settings first!"> <i class="bi bi-play-fill"
style="font-size: 1rem; color: white;"></i></button>
<!-- Split Button -->
<div class="btn-group" >
<button class="btn btn-sm btn-primary" id="openRFChat" type="button"
data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false"
title="Open the HF chat module. This is currently just a test and not finished, yet!"> <strong>RF
Chat</strong> <i class="bi bi-chat-left-text-fill" style="font-size: 1rem; color: white;"></i>
<span
class="position-absolute top-0 start-55 translate-middle badge rounded-pill bg-danger">.</span>
</button>
<button type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-toggle-split dropdown-menu-start" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li><button type="button" id="infoModalButton" data-bs-toggle="modal" data-bs-target="#infoModal" class="dropdown-item">Settings</button>
</li>
<li><button class="dropdown-item" id="openExplorer" type="button" data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false" title="View explorer map">Explorer</button></li>
<li><hr class="dropdown-divider"></li>
<!-- TNC STUFF -->
<li><h6 class="dropdown-header">TNC</h6></li>
<li>
<button type="button" id="stopTNC" class="dropdown-item">Stop</button></li>
<button class="dropdown-item" id="tncLog" type="button">Logs</button>
<li><hr class="dropdown-divider"></li>
<li>
<!-- Button trigger About modal -->
<button type="button" id="btnAbout" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#aboutModal">About</button>
</li>
</ul>
</div>
</div>
<!--
<div class="btn-toolbar" role="toolbar">
<span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false"
title="View the received files. This is currently under development!">
<button class="btn btn-sm btn-primary me-2" data-bs-toggle="offcanvas" data-bs-target="#receivedFilesSidebar" id="openReceivedFiles" type="button" > <strong>Files </strong>
<i class="bi bi-file-earmark-arrow-up-fill" style="font-size: 1rem; color: white;"></i>
<i class="bi bi-file-earmark-arrow-down-fill" style="font-size: 1rem; color: white;"></i>
</button>
</span> <span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="false" title="Send files through HF. This is currently under development!">
<button class="btn btn-sm btn-primary me-2" id="openDataModule" data-bs-toggle="offcanvas" data-bs-target="#transmitFileSidebar" type="button" style="display: None;"> <strong>TX File </strong>
<i class="bi bi-file-earmark-arrow-up-fill" style="font-size: 1rem; color: white;"></i>
</button>
</span> <span data-bs-placement="bottom" data-bs-toggle="tooltip" data-bs-html="true"
title="Settings and Info">
</span>
</div>
-->
</nav>
<div id="blurdiv" style="-webkit-Filter: blur(0px)">
<!--beginn of blur div -->
<!-------------------------------- MAIN AREA ---------------->
@ -355,7 +378,7 @@
</div>
</div>
<!------------------------------------------------------------------------------------------>
<div class="container mt-5 p-0">
<div class="container p-0" style="margin-top:55px">
<div class="row collapse multi-collapse show" id="collapseFirstRow">
<div class="col">
<div class="card text-dark mb-0">
@ -1668,6 +1691,45 @@
</div>
</div>
</div>
<!-- info modal -->
<!-- Modal -->
<div class="modal fade" id="aboutModal" tabindex="-1" aria-labelledby="aboutModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="aboutModalLabel">FreeDATA</h1>-<div class="small" id="aboutVersion">v123</div>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-6" id="divContrib">
<h6>Special thanks to</h6>
<hr \>
<ul>
<li>DJ2LS</li>
</ul>
</div>
<div class="col-6">
<h6>Resources</h6>
<hr \>
<ul>
<li><a id="ghUrl" href="#">Github</a></li>
<li><a id="wikiUrl"href="#">Wiki</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>