1
0
Fork 0

Making default tab on page load configurable in config.js

closed https://github.com/dg9vh/MMDVMHost-Websocketboard/issues/8
main
Kim - DG9VH 4 years ago
parent 937be46503
commit 1d4954542c

@ -35,7 +35,7 @@ Actually known:
* change ownership to your user for example with `sudo chown -R pi /opt/MMDVMDash` * change ownership to your user for example with `sudo chown -R pi /opt/MMDVMDash`
* copy all files from repository into this folder * copy all files from repository into this folder
* modify *logtailer.ini* to fit your needs * modify *logtailer.ini* to fit your needs
* modify */html/js/config.js* to fit your needs, here you can switch on/off tabs showing or enable debug for getting some output in javascript console * modify */html/js/config.js* to fit your needs, here you can switch on/off tabs showing or enable debug for getting some output in javascript console. You should take a look into this file - here are different options you can configure.
* copy files in */opt/MMDVMDash/systemd* to */etc/systemd/system* or similar corresponding to your system * copy files in */opt/MMDVMDash/systemd* to */etc/systemd/system* or similar corresponding to your system
* modify both scripts to fit your needs * modify both scripts to fit your needs
* enable services with following commmands, this results in starting both automatically after reboot: * enable services with following commmands, this results in starting both automatically after reboot:

@ -38,7 +38,7 @@
<ul class="nav nav-tabs" id="myTab" role="tablist"> <ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" id="currtx-tab" data-toggle="tab" href="#currtx" role="tab" aria-controls="currtx" aria-selected="true">Currently TXing</a> <a class="nav-link" id="currtx-tab" data-toggle="tab" href="#currtx" role="tab" aria-controls="currtx" aria-selected="true">Currently TXing</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="lastheard-tab" data-toggle="tab" href="#lastheard" role="tab" aria-controls="lastheard" aria-selected="false">Last Heard</a> <a class="nav-link" id="lastheard-tab" data-toggle="tab" href="#lastheard" role="tab" aria-controls="lastheard" aria-selected="false">Last Heard</a>
@ -57,7 +57,7 @@
</li> </li>
</ul> </ul>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="currtx" role="tabpanel" aria-labelledby="currtx-tab"> <div class="tab-pane fade" id="currtx" role="tabpanel" aria-labelledby="currtx-tab">
<div class="panel panel-default"> <div class="panel panel-default">
<!-- Standard-Panel-Inhalt --> <!-- Standard-Panel-Inhalt -->
<div class="panel-heading">Currently TXing<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span></div> <div class="panel-heading">Currently TXing<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span></div>

@ -2,7 +2,7 @@
var qrz = 1; var qrz = 1;
// 1 = enable debug in javascript-console, 0 = 0ff // 1 = enable debug in javascript-console, 0 = 0ff
var debug = 0; var debug = 1;
// Set messagecounters for different badge-colors // Set messagecounters for different badge-colors
var warnlevel = 200; var warnlevel = 200;
@ -16,3 +16,7 @@ var showLocalHeadTab = 1;
var showInQSOTab = 1; var showInQSOTab = 1;
var showDAPNETMessagesTab = 1; var showDAPNETMessagesTab = 1;
var showAboutTab = 1; var showAboutTab = 1;
// default-tab to show
// chose from following list: CurrTXTab, LastHeardTab, LocalHeadTab, InQSOTab, DAPNETMessagesTab, AboutTab
var defaultTab = "LastHeardTab";

@ -475,4 +475,61 @@ $(document).ready(function() {
document.getElementById("myTab").children[5].style.display="none"; document.getElementById("myTab").children[5].style.display="none";
document.getElementById("about").style.display="none"; document.getElementById("about").style.display="none";
} }
switch (defaultTab) {
case "CurrTXTab":
var element = document.getElementById("currtx-tab");
element.classList.add("active");
element = document.getElementById("currtx");
element.classList.add("show");
element.classList.add("active");
break;
case "LastHeardTab":
var element = document.getElementById("lastheard-tab");
element.classList.add("active");
var element = document.getElementById("lastheard");
element.classList.add("show");
element.classList.add("active");
break;
case "LocalHeadTab":
var element = document.getElementById("localheard-tab");
element.classList.add("active");
var element = document.getElementById("localheard");
element.classList.add("show");
element.classList.add("active");
break;
case "InQSOTab":
var element = document.getElementById("qso-tab");
element.classList.add("active");
var element = document.getElementById("qso");
element.classList.add("show");
element.classList.add("active");
break;
case "DAPNETMessagesTab":
var element = document.getElementById("dapnet-tab");
element.classList.add("active");
var element = document.getElementById("dapnet");
element.classList.add("show");
element.classList.add("active");
break;
case "AboutTab":
var element = document.getElementById("about-tab");
element.classList.add("active");
var element = document.getElementById("about");
element.classList.add("show");
element.classList.add("active");
break;
default:
var element = document.getElementById("currtx-tab");
element.classList.add("active");
element = document.getElementById("currtx");
element.classList.add("show");
element.classList.add("active");
break;
}
}); });

Loading…
Cancel
Save