dashboard qnconfg menu

pull/14/head
Tom Early 6 years ago
parent 4830474019
commit 7cbe4fe96b

@ -1,7 +1,10 @@
##### DASHBOARD.README ##### ##### DASHBOARD.README #####
A web-based dashboard can be enabled. You can supply your own index.php file, A web-based dashboard can be enabled. The dashboard has several sections
or a functional dashboard is available. that you can disable if you want. You can also control the refresh rate and
how many rows you want in the Last Heard section. You can configure these
features with the ./qnconfig menu. Don't set the refresh time faster than about
10 seconds. If you do, it will become difficult to use the Send URCall button.
To install the dashboard system, run the following command: To install the dashboard system, run the following command:

@ -1,10 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<html>
<head>
<title>QnetGateway Dashboard</title>
<meta http-equiv="refresh" content="20">
</head>
<body>
<?php <?php
$cfg = array(); $cfg = array();
$defaults = array(); $defaults = array();
@ -120,6 +114,12 @@ ParseKVFile($cfgdir.'/qn.cfg', $cfg);
ParseKVFile($cfgdir.'/defaults', $defaults); ParseKVFile($cfgdir.'/defaults', $defaults);
?> ?>
<html>
<head>
<title>QnetGateway Dashboard</title>
<meta http-equiv="refresh" content="<?php echo GetCFGValue('dash_refresh)')?>">
</head>
<body>
<h2>QnetGateway <?php echo GetCFGValue('ircddb_login'); ?> Dashboard</h2> <h2>QnetGateway <?php echo GetCFGValue('ircddb_login'); ?> Dashboard</h2>
<?php <?php

@ -134,6 +134,47 @@ LinkMenu () {
done done
} }
DashboardMenu () {
key=''
while [[ "$key" != q* ]]; do
clear
echo
echo " Dashboard Menu"
echo
if [ -n "$em" ]; then
echo -n "n : Name of the database file = "; EvaluateVar dash_sql_filename{,_d}
fi
echo -n "r : Refresh time (sec) for page = "; EvaluateVar dash_refresh{,_d}
echo -n "c : Max number of last heard entries = "; EvaluateVar dash_lastheard_count{,_d}
echo -n "p : Show the Processes = "; EvaluateVar dash_show_ps{,_d}
echo -n "l : Show the Last Heard = "; EvaluateVar dash_show_lh{,_d}
echo -n "i : Show the IP Addresses = "; EvaluateVar dash_show_ip{,_d}
echo -n "m : Show the Modules(s) = "; EvaluateVar dash_show_mo{,_d}
echo -n "s : Show the Send URCall = "; EvaluateVar dash_show_ur{,_d}
EndMenu
if [[ "$key" == n* ]]; then dash_sql_filename="$value"
elif [[ "$key" == r* ]]; then dash_refresh="$value"
elif [[ "$key" == c* ]]; then dash_lastheard_count="$value"
elif [[ "$key" == p* ]]; then SetBooleanValue dash_show_ps "$value"
elif [[ "$key" == l* ]]; then SetBooleanValue dash_show_lh "$value"
elif [[ "$key" == i* ]]; then SetBooleanValue dash_show_ip "$value"
elif [[ "$key" == m* ]]; then SetBooleanValue dash_show_mo "$value"
elif [[ "$key" == s* ]]; then SetBooleanValue dash_show_ur "$value"
elif [[ "$key" == u* ]]; then
if [[ "$value" == n* ]]; then unset dash_sql_filename
elif [[ "$value" == r* ]]; then unset dash_refresh
elif [[ "$value" == c* ]]; then unset dash_lastheard_count
elif [[ "$value" == p* ]]; then unset dash_show_ps
elif [[ "$value" == l* ]]; then unset dash_show_lh
elif [[ "$value" == i* ]]; then unset dash_show_ip
elif [[ "$value" == m* ]]; then unset dash_show_mo
elif [[ "$value" == s* ]]; then unset dash_show_ur
fi
fi
done
}
FileMenu () { FileMenu () {
key='' key=''
while [[ "$key" != q* ]]; do while [[ "$key" != q* ]]; do
@ -652,6 +693,15 @@ WriteCFGFile () {
[ -z "${timing_timeout_local_rptr+x}" ] || echo "timing_timeout_local_rptr=${timing_timeout_local_rptr}" >> $outFile [ -z "${timing_timeout_local_rptr+x}" ] || echo "timing_timeout_local_rptr=${timing_timeout_local_rptr}" >> $outFile
[ -z "${timing_play_wait+x}" ] || echo "timing_play_wait=${timing_play_wait}" >> $outFile [ -z "${timing_play_wait+x}" ] || echo "timing_play_wait=${timing_play_wait}" >> $outFile
[ -z "${timing_play_delay+x}" ] || echo "timing_play_delay=${timing_play_delay}" >> $outFile [ -z "${timing_play_delay+x}" ] || echo "timing_play_delay=${timing_play_delay}" >> $outFile
# dash_ section
[ -z "${dash_sql_filename+x}" ] || echo "dash_sql_filename='${dash_sql_filename}'" >> $outFile
[ -z "${dash_refresh+x}" ] || echo "dash_refresh=${dash_refresh}" >> $outFile
[ -z "${dash_lastheard_count+x}" ] || echo "dash_lastheard_count=${dash_lastheard_count}" >> $outFile
[ -z "${dash_show_ip+x}" ] || echo "dash_show_ip=${dash_show_ip}" >> $outFile
[ -z "${dash_show_lh+x}" ] || echo "dash_show_lh=${dash_show_lh}" >> $outFile
[ -z "${dash_show_ip+x}" ] || echo "dash_show_ip=${dash_show_ip}" >> $outFile
[ -z "${dash_show_mo+x}" ] || echo "dash_show_mo=${dash_show_mo}" >> $outFile
[ -z "${dash_show_ur+x}" ] || echo "dash_show_ur=${dash_show_ur}" >> $outFile
clear clear
cat $outFile cat $outFile
echo echo
@ -683,7 +733,7 @@ while [[ "$ans" != q* ]]
do do
clear clear
echo echo
echo " QnConfig Main Menu V#190424" echo " QnConfig Main Menu V#200307"
echo echo
echo -n "a : Module A - "; if [ -z $module_a ]; then echo "<EMPTY>"; else echo "${module_a^^}"; fi echo -n "a : Module A - "; if [ -z $module_a ]; then echo "<EMPTY>"; else echo "${module_a^^}"; fi
echo -n "b : Module B - "; if [ -z $module_b ]; then echo "<EMPTY>"; else echo "${module_b^^}"; fi echo -n "b : Module B - "; if [ -z $module_b ]; then echo "<EMPTY>"; else echo "${module_b^^}"; fi
@ -691,6 +741,7 @@ do
echo "i : IRCDDB Menu - login = '${ircddb_login}'" echo "i : IRCDDB Menu - login = '${ircddb_login}'"
echo "g : Gateway/APRS Menu - location info and route cache" echo "g : Gateway/APRS Menu - location info and route cache"
echo "l : Link/D-Plus Menu - linking access" echo "l : Link/D-Plus Menu - linking access"
echo "D : Dashboard Menu - Dashboard customization"
if [ -n "$em" ]; then if [ -n "$em" ]; then
echo "d : Debugging/Files/Timings - miscellaneous parameters" echo "d : Debugging/Files/Timings - miscellaneous parameters"
else else
@ -706,6 +757,7 @@ do
if [[ "$ans" == a* ]]; then ModuleMenu a if [[ "$ans" == a* ]]; then ModuleMenu a
elif [[ "$ans" == b* ]]; then ModuleMenu b elif [[ "$ans" == b* ]]; then ModuleMenu b
elif [[ "$ans" == c* ]]; then ModuleMenu c elif [[ "$ans" == c* ]]; then ModuleMenu c
elif [[ "$ans" == D* ]]; then DashboardMenu
elif [[ "$ans" == i* ]]; then IrcddbMenu elif [[ "$ans" == i* ]]; then IrcddbMenu
elif [[ "$ans" == g* ]]; then GateMenu elif [[ "$ans" == g* ]]; then GateMenu
elif [[ "$ans" == l* ]]; then LinkMenu elif [[ "$ans" == l* ]]; then LinkMenu

Loading…
Cancel
Save

Powered by TurnKey Linux.