Dash System Info section

pull/14/head
Tom Early 6 years ago
parent 98adbcb0e6
commit 5fc37e31e6

@ -219,6 +219,7 @@ timing_play_delay_d=19 # milliseconds between frames playback, if echo so
dash_sql_filename_d='qn.db' # name for the sqlite database in the $CFGDIR directory dash_sql_filename_d='qn.db' # name for the sqlite database in the $CFGDIR directory
dash_refresh_d=20 # seconds for the webpage to reload dash_refresh_d=20 # seconds for the webpage to reload
dash_lastheard_count_d=20 # maximum number of last heard entries to display dash_lastheard_count_d=20 # maximum number of last heard entries to display
dash_show_sy_d=true # set to false if for no System Info section
dash_show_lh_d=true # set to false if for no Last Heard section dash_show_lh_d=true # set to false if for no Last Heard section
dash_show_ps_d=true # set to false if for no Processes section dash_show_ps_d=true # set to false if for no Processes section
dash_show_ip_d=true # set to false if for no IP Addresses section dash_show_ip_d=true # set to false if for no IP Addresses section

@ -133,6 +133,27 @@ if ('true' == GetCFGValue('dash_show_ps') && `ps -aux | grep -e qn -e MMDVMHost
echo '</code>', "\n"; echo '</code>', "\n";
} }
if ('true' == GetCFGValue('dash_show_sy')) {
echo 'System Info:<br>', "\n";
$hn = trim(`uname -n`);
$kn = trim(`uname -rmo`);
$oslist = explode(':', `lsb_release -d`);
$os = trim($oslist[1]);
$cu = trim(`cat /proc/cpuinfo | grep Model`);
if (0 == strlen($cu))
$cu = trim(`cat /proc/cpuinfo | grep "model name"`);
$culist = explode("\n", $cu);
$mnlist = explode(':', $culist[0]);
$cu = trim($mnlist[1]);
if (count($culist) > 1)
$cu .= ' ' . count($culist) . ' Threads';
if (file_exists('/opt/vc/bin/vcgencmd'))
$cu .= ' ' . `/opt/vc/bin/vcgencmd measure_temp`;
echo '<table cellpadding="1" border="1" style="font-family: monospace">', "\n";
echo '<tr><td style="text-align:center">Hostname</td><td style="text-align:center">Kernel</td><td style="text-align:center">OS</td><td style="text-align:center">CPU</td></tr>', "\n";
echo '<tr><td style="text-align:center">', $hn, '</td><td style="text-align:center">', $kn, '</td><td style="text-align:center">', $os, '</td><td style="text-align:center">', $cu, '</td></tr>', "\n";
}
if ('true' == GetCFGValue('dash_show_lh')) { if ('true' == GetCFGValue('dash_show_lh')) {
echo 'Last Heard:<br><code>', "\n"; echo 'Last Heard:<br><code>', "\n";
$rstr = 'MyCall/Sfx Source Last Time<br>'; $rstr = 'MyCall/Sfx Source Last Time<br>';

@ -147,6 +147,7 @@ DashboardMenu () {
echo -n "r : Refresh time (sec) for page = "; EvaluateVar dash_refresh{,_d} 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 "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 "p : Show the Processes = "; EvaluateVar dash_show_ps{,_d}
echo -n "y : Show the System = "; EvaluateVar dash_show_sy{,_d}
echo -n "l : Show the Last Heard = "; EvaluateVar dash_show_lh{,_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 "i : Show the IP Addresses = "; EvaluateVar dash_show_ip{,_d}
echo -n "m : Show the Modules(s) = "; EvaluateVar dash_show_mo{,_d} echo -n "m : Show the Modules(s) = "; EvaluateVar dash_show_mo{,_d}
@ -157,6 +158,7 @@ DashboardMenu () {
elif [[ "$key" == r* ]]; then dash_refresh="$value" elif [[ "$key" == r* ]]; then dash_refresh="$value"
elif [[ "$key" == c* ]]; then dash_lastheard_count="$value" elif [[ "$key" == c* ]]; then dash_lastheard_count="$value"
elif [[ "$key" == p* ]]; then SetBooleanValue dash_show_ps "$value" elif [[ "$key" == p* ]]; then SetBooleanValue dash_show_ps "$value"
elif [[ "$key" == y* ]]; then SetBooleanValue dash_show_sy "$value"
elif [[ "$key" == l* ]]; then SetBooleanValue dash_show_lh "$value" elif [[ "$key" == l* ]]; then SetBooleanValue dash_show_lh "$value"
elif [[ "$key" == i* ]]; then SetBooleanValue dash_show_ip "$value" elif [[ "$key" == i* ]]; then SetBooleanValue dash_show_ip "$value"
elif [[ "$key" == m* ]]; then SetBooleanValue dash_show_mo "$value" elif [[ "$key" == m* ]]; then SetBooleanValue dash_show_mo "$value"
@ -166,6 +168,7 @@ DashboardMenu () {
elif [[ "$value" == r* ]]; then unset dash_refresh elif [[ "$value" == r* ]]; then unset dash_refresh
elif [[ "$value" == c* ]]; then unset dash_lastheard_count elif [[ "$value" == c* ]]; then unset dash_lastheard_count
elif [[ "$value" == p* ]]; then unset dash_show_ps elif [[ "$value" == p* ]]; then unset dash_show_ps
elif [[ "$value" == y* ]]; then unset dash_show_sy
elif [[ "$value" == l* ]]; then unset dash_show_lh elif [[ "$value" == l* ]]; then unset dash_show_lh
elif [[ "$value" == i* ]]; then unset dash_show_ip elif [[ "$value" == i* ]]; then unset dash_show_ip
elif [[ "$value" == m* ]]; then unset dash_show_mo elif [[ "$value" == m* ]]; then unset dash_show_mo
@ -700,6 +703,7 @@ WriteCFGFile () {
[ -z "${dash_show_ip+x}" ] || echo "dash_show_ip=${dash_show_ip}" >> $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_lh+x}" ] || echo "dash_show_lh=${dash_show_lh}" >> $outFile
[ -z "${dash_show_ps+x}" ] || echo "dash_show_ps=${dash_show_ps}" >> $outFile [ -z "${dash_show_ps+x}" ] || echo "dash_show_ps=${dash_show_ps}" >> $outFile
[ -z "${dash_show_sy+x}" ] || echo "dash_show_sy=${dash_show_sy}" >> $outFile
[ -z "${dash_show_mo+x}" ] || echo "dash_show_mo=${dash_show_mo}" >> $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 [ -z "${dash_show_ur+x}" ] || echo "dash_show_ur=${dash_show_ur}" >> $outFile
clear clear
@ -733,7 +737,7 @@ while [[ "$ans" != q* ]]
do do
clear clear
echo echo
echo " QnConfig Main Menu V#200312" echo " QnConfig Main Menu V#200326"
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

Loading…
Cancel
Save

Powered by TurnKey Linux.