From e741fc6341bcfac03bb66fcd74e6618185a883f9 Mon Sep 17 00:00:00 2001 From: spoony Date: Tue, 5 May 2020 00:08:40 +0800 Subject: [PATCH] v1.1 --- README.md | 4 ++-- assets/dashboard.js | 2 +- assets/dashboard.min.js | 5 +++-- assets/logo.png | Bin 0 -> 4305 bytes device.php | 25 +++++++++++++++---------- favicon.ico | Bin 0 -> 5430 bytes index.php | 19 ++++++++----------- 7 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 assets/logo.png create mode 100644 favicon.ico diff --git a/README.md b/README.md index 557d413..8ea594f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Pi Dashboard A WebUI dashboard for IoT devices likes raspberry pi. -Project details: (http://maker.quwj.com/project/10) +Project details: (http://make.quwj.com/project/10) -Copyright 2017 NXEZ.com. +Copyright 2017-2020 NXEZ.com. Licensed under the GPL v3.0 license. \ No newline at end of file diff --git a/assets/dashboard.js b/assets/dashboard.js index 67bd48e..5b28351 100644 --- a/assets/dashboard.js +++ b/assets/dashboard.js @@ -398,7 +398,7 @@ $(document).ready(function() { point.update(Math.round((1.0 - (idle_diff / used_total)) * 100 * Math.pow(10,1))/Math.pow(10,1)); } - + $("#cpu-freq").text(window.dashboard.cpu.freq / 1000); $("#cpu-stat-idl").text(Math.round(((parseInt(window.dashboard.cpu.stat.idle) - parseInt(window.dashboard_old.cpu.stat.idle)) / used_total) * 100 * Math.pow(10,1))/Math.pow(10,1)); $("#cpu-stat-use").text(Math.round(((parseInt(window.dashboard.cpu.stat.user) - parseInt(window.dashboard_old.cpu.stat.user)) / used_total) * 100 * Math.pow(10,1))/Math.pow(10,1)); $("#cpu-stat-sys").text(Math.round(((parseInt(window.dashboard.cpu.stat.sys) - parseInt(window.dashboard_old.cpu.stat.sys)) / used_total) * 100 * Math.pow(10,1))/Math.pow(10,1)); diff --git a/assets/dashboard.min.js b/assets/dashboard.min.js index a10b406..502286a 100644 --- a/assets/dashboard.min.js +++ b/assets/dashboard.min.js @@ -3,5 +3,6 @@ * Copyright 2017 NXEZ.com. * Licensed under the GPL v3.0 license. */ -$(document).ready(function(){Highcharts.setOptions({global:{useUTC:false},credits:{enabled:false},navigation:{buttonOptions:{enabled:false}}});var j={chart:{type:"solidgauge"},title:null,pane:{center:["50%","85%"],size:"140%",startAngle:-90,endAngle:90,background:{backgroundColor:(Highcharts.theme&&Highcharts.theme.background2)||"#FFFFFF",innerRadius:"60%",outerRadius:"100%",shape:"arc"}},tooltip:{enabled:false},yAxis:{stops:[[0.1,"#55BF3B"],[0.5,"#DDDF0D"],[0.9,"#DF5353"]],lineWidth:0,minorTickInterval:null,tickAmount:2,title:{y:-70},labels:{y:16}},plotOptions:{solidgauge:{dataLabels:{y:5,borderWidth:0,useHTML:true}}}};var f=Highcharts.chart("container-cpu",Highcharts.merge(j,{yAxis:{min:0,max:100,title:{text:""}},series:[{name:"CPU",data:[0],dataLabels:{format:'
{y}'+'%
'},tooltip:{valueSuffix:" %"}}]}));var c=Highcharts.chart("container-mem",Highcharts.merge(j,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"MEMORY",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var g=Highcharts.chart("container-cache",Highcharts.merge(j,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"CACHE",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var a=Highcharts.chart("container-mem-real",Highcharts.merge(j,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"REAL MEMORY",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var h=Highcharts.chart("container-swap",Highcharts.merge(j,{yAxis:{min:0,max:init_vals.mem.swap.total,title:{text:""}},series:[{name:"SWAP",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var b=Highcharts.chart("container-disk",Highcharts.merge(j,{yAxis:{min:0,max:init_vals.disk.total,title:{text:""}},series:[{name:"DISK",data:[0],dataLabels:{format:'
{y:.1f}
'+'GB
'},tooltip:{valueSuffix:" GB"}}]}));var k=new Array();var e=new Array();var d=new Array();for(i=0;i0){for(i=0;i=30){k[i].series[0].addPoint(parseInt(window.dashboard.net.interfaces[i].total_in)-parseInt(window.dashboard_old.net.interfaces[i].total_in),true,true)}else{k[i].series[0].addPoint(parseInt(window.dashboard.net.interfaces[i].total_in)-parseInt(window.dashboard_old.net.interfaces[i].total_in))}if(k[i].series[1].data.length>=30){k[i].series[1].addPoint(parseInt(window.dashboard.net.interfaces[i].total_out)-parseInt(window.dashboard_old.net.interfaces[i].total_out),true,true)}else{k[i].series[1].addPoint(parseInt(window.dashboard.net.interfaces[i].total_out)-parseInt(window.dashboard_old.net.interfaces[i].total_out))}}}idle_diff=parseInt(window.dashboard.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.idle);used_total=parseInt(window.dashboard.cpu.stat.idle)+parseInt(window.dashboard.cpu.stat.user)+parseInt(window.dashboard.cpu.stat.sys)+parseInt(window.dashboard.cpu.stat.nice)+parseInt(window.dashboard.cpu.stat.iowait)+parseInt(window.dashboard.cpu.stat.irq)+parseInt(window.dashboard.cpu.stat.softirq)-parseInt(window.dashboard_old.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.user)-parseInt(window.dashboard_old.cpu.stat.sys)-parseInt(window.dashboard_old.cpu.stat.nice)-parseInt(window.dashboard_old.cpu.stat.iowait)-parseInt(window.dashboard_old.cpu.stat.irq)-parseInt(window.dashboard_old.cpu.stat.softirq);if(f){m=f.series[0].points[0];m.update(Math.round((1-(idle_diff/used_total))*100*Math.pow(10,1))/Math.pow(10,1))}$("#cpu-stat-idl").text(Math.round(((parseInt(window.dashboard.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.idle))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-use").text(Math.round(((parseInt(window.dashboard.cpu.stat.user)-parseInt(window.dashboard_old.cpu.stat.user))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-sys").text(Math.round(((parseInt(window.dashboard.cpu.stat.sys)-parseInt(window.dashboard_old.cpu.stat.sys))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-nic").text(Math.round(((parseInt(window.dashboard.cpu.stat.nice)-parseInt(window.dashboard_old.cpu.stat.nice))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-iow").text(Math.round(((parseInt(window.dashboard.cpu.stat.iowait)-parseInt(window.dashboard_old.cpu.stat.iowait))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-irq").text(Math.round(((parseInt(window.dashboard.cpu.stat.irq)-parseInt(window.dashboard_old.cpu.stat.irq))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-sirq").text(Math.round(((parseInt(window.dashboard.cpu.stat.softirq)-parseInt(window.dashboard_old.cpu.stat.softirq))/used_total)*100*Math.pow(10,1))/Math.pow(10,1))}}},1000)});function bytesRound(c,a){if(c<0){var b=0+"B"}else{if(c<1024){var b=c+"B"}else{if(c<1048576){c=c/1024;var b=Math.round(c*Math.pow(10,a))/Math.pow(10,a)+"K"}else{if(c<1048576000){c=c/1048576;var b=Math.round(c*Math.pow(10,a))/Math.pow(10,a)+"M"}else{c=c/1048576000;var b=Math.round(c*Math.pow(10,a))/Math.pow(10,a)+"G"}}}}return b}Date.prototype.format=function(c){var b={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};if(/(y+)/i.test(c)){c=c.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))}for(var a in b){if(new RegExp("("+a+")").test(c)){c=c.replace(RegExp.$1,RegExp.$1.length==1?b[a]:("00"+b[a]).substr((""+b[a]).length))}}return c};function uptimeFormat(d){var c="";var b=parseInt(d)/60;var a=b/60;var e=Math.floor(a/24);var a=Math.floor(a-(e*24));b=Math.floor(b-(e*60*24)-(a*60));if(e!==0){if(e==1){c=e+" day "}else{c=e+" days "}}if(a!==0){c=c+a+":"}return c=c+b}; \ No newline at end of file +$(document).ready(function(){Highcharts.setOptions({global:{useUTC:false},credits:{enabled:false},navigation:{buttonOptions:{enabled:false}}});var gaugeOptions={chart:{type:"solidgauge"},title:null,pane:{center:["50%","85%"],size:"140%",startAngle:-90,endAngle:90,background:{backgroundColor:(Highcharts.theme&&Highcharts.theme.background2)||"#FFFFFF",innerRadius:"60%",outerRadius:"100%",shape:"arc"}},tooltip:{enabled:false},yAxis:{stops:[[0.1,"#55BF3B"],[0.5,"#DDDF0D"],[0.9,"#DF5353"]],lineWidth:0,minorTickInterval:null,tickAmount:2,title:{y:-70},labels:{y:16}},plotOptions:{solidgauge:{dataLabels:{y:5,borderWidth:0,useHTML:true}}}};var chartCPU=Highcharts.chart("container-cpu",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:100,title:{text:""}},series:[{name:"CPU",data:[0],dataLabels:{format:'
{y}'+'%
'},tooltip:{valueSuffix:" %"}}]}));var chartRAM=Highcharts.chart("container-mem",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"MEMORY",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var chartCache=Highcharts.chart("container-cache",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"CACHE",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var chartRAM_real=Highcharts.chart("container-mem-real",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:init_vals.mem.total,title:{text:""}},series:[{name:"REAL MEMORY",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var chartSWAP=Highcharts.chart("container-swap",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:init_vals.mem.swap.total,title:{text:""}},series:[{name:"SWAP",data:[0],dataLabels:{format:'
{y:.1f}
'+'MB
'},tooltip:{valueSuffix:" MB"}}]}));var chartDisk=Highcharts.chart("container-disk",Highcharts.merge(gaugeOptions,{yAxis:{min:0,max:init_vals.disk.total,title:{text:""}},series:[{name:"DISK",data:[0],dataLabels:{format:'
{y:.1f}
'+'GB
'},tooltip:{valueSuffix:" GB"}}]}));var chartNetInterfaces=new Array();var net_In=new Array();var net_Out=new Array();for(i=0;i0){for(i=0;i=30){chartNetInterfaces[i].series[0].addPoint(parseInt(window.dashboard.net.interfaces[i].total_in)-parseInt(window.dashboard_old.net.interfaces[i].total_in),true,true)}else{chartNetInterfaces[i].series[0].addPoint(parseInt(window.dashboard.net.interfaces[i].total_in)-parseInt(window.dashboard_old.net.interfaces[i].total_in))}if(chartNetInterfaces[i].series[1].data.length>=30){chartNetInterfaces[i].series[1].addPoint(parseInt(window.dashboard.net.interfaces[i].total_out)-parseInt(window.dashboard_old.net.interfaces[i].total_out),true,true)}else{chartNetInterfaces[i].series[1].addPoint(parseInt(window.dashboard.net.interfaces[i].total_out)-parseInt(window.dashboard_old.net.interfaces[i].total_out))}}}idle_diff=parseInt(window.dashboard.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.idle);used_total=parseInt(window.dashboard.cpu.stat.idle)+parseInt(window.dashboard.cpu.stat.user)+parseInt(window.dashboard.cpu.stat.sys)+parseInt(window.dashboard.cpu.stat.nice)+parseInt(window.dashboard.cpu.stat.iowait)+parseInt(window.dashboard.cpu.stat.irq)+parseInt(window.dashboard.cpu.stat.softirq)-parseInt(window.dashboard_old.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.user)-parseInt(window.dashboard_old.cpu.stat.sys)-parseInt(window.dashboard_old.cpu.stat.nice)-parseInt(window.dashboard_old.cpu.stat.iowait)-parseInt(window.dashboard_old.cpu.stat.irq)-parseInt(window.dashboard_old.cpu.stat.softirq);if(chartCPU){point=chartCPU.series[0].points[0];point.update(Math.round((1-(idle_diff/used_total))*100*Math.pow(10,1))/Math.pow(10,1))}$("#cpu-freq").text(window.dashboard.cpu.freq/1000);$("#cpu-stat-idl").text(Math.round(((parseInt(window.dashboard.cpu.stat.idle)-parseInt(window.dashboard_old.cpu.stat.idle))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-use").text(Math.round(((parseInt(window.dashboard.cpu.stat.user)-parseInt(window.dashboard_old.cpu.stat.user))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-sys").text(Math.round(((parseInt(window.dashboard.cpu.stat.sys)-parseInt(window.dashboard_old.cpu.stat.sys))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-nic").text(Math.round(((parseInt(window.dashboard.cpu.stat.nice)-parseInt(window.dashboard_old.cpu.stat.nice))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-iow").text(Math.round(((parseInt(window.dashboard.cpu.stat.iowait)-parseInt(window.dashboard_old.cpu.stat.iowait))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-irq").text(Math.round(((parseInt(window.dashboard.cpu.stat.irq)-parseInt(window.dashboard_old.cpu.stat.irq))/used_total)*100*Math.pow(10,1))/Math.pow(10,1));$("#cpu-stat-sirq").text(Math.round(((parseInt(window.dashboard.cpu.stat.softirq)-parseInt(window.dashboard_old.cpu.stat.softirq))/used_total)*100*Math.pow(10,1))/Math.pow(10,1))}}},1000)});function bytesRound(number,round){if(number<0){var last=0+"B"}else{if(number<1024){var last=number+"B"}else{if(number<1048576){number=number/1024;var last=Math.round(number*Math.pow(10,round))/Math.pow(10,round)+"K"}else{if(number<1048576000){number=number/1048576;var last=Math.round(number*Math.pow(10,round))/Math.pow(10,round)+"M"}else{number=number/1048576000;var last=Math.round(number*Math.pow(10,round))/Math.pow(10,round)+"G"}}}}return last}Date.prototype.format=function(format){var date={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};if(/(y+)/i.test(format)){format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))}for(var k in date){if(new RegExp("("+k+")").test(format)){format=format.replace(RegExp.$1,RegExp.$1.length==1?date[k]:("00"+date[k]).substr((""+date[k]).length))}}return format};function uptimeFormat(str){var uptime="";var min=parseInt(str)/60;var hours=min/60;var days=Math.floor(hours/24);var hours=Math.floor(hours-(days*24));min=Math.floor(min-(days*60*24)-(hours*60));if(days!==0){if(days==1){uptime=days+" day " +}else{uptime=days+" days "}}if(hours!==0){uptime=uptime+hours+":"}return uptime=uptime+min}; \ No newline at end of file diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2fd237fe0753dcb563487ad166844cd861168452 GIT binary patch literal 4305 zcmaJ_c|4Ts+kXrb$(k7?%b3c}m?6wy?E8|;5L%cROqLllV~ZI32_=#!L^xzCQI;%Y zsVozx=$w))$+VD>ITcxY$N8Pk@BQOF@AG+{=f3ajbA7+pb=}wZe*SpQySdtl3d;!t z03hmMZ|%+-89R^AF5bHzOBmq|`{*`abR0R59!;PU0gC|gX(G%aj1WY0ClUf;BZi13 z0Kk8cg!iI*xj19|$zeK#9Uq;TFbWS1048QJ6oP*Ukq$de3?hY_!Z{Cm;4o5vDg4-B z7hM;M6)~7(f0jzbopr_gpAGRx2f)p+Fq0Szk06XlC%|IDLc?j87*qIPycphm$Bcl( z{&Jy*n8N>)l$VPe%!*7U!Vc@`Y5VIUkuU=T9i;wY0|TTM45f=iA#{1Sfi_YfbJzfb zGKBqo!FkcB0f88IYumqL@m8krU^<r);k3WEiML^h7y<=>)Y083 z>8GQM%m42h7WR)fjqXnTZ@&L0F%2I}AtKy~G;$=>pVzp+13R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n=eg=uL5HvWeL8 zn|eIZm^(BVs=3I&B1kQWl6kmZ;ZQ7sX$wj^_3OE zhV-FmSu1zuD%#*__Yq}7`rUc}3`6aDYBxVPQx5fhIL=xein!!+*;BfbH@-VkK_?{JAC!m;Ri3#9%Gavc%xW9JW_}B;+A6x2 o-B@O##;^h7Uup~*ZmTkZ%}{fUpocqr=O=@MjjMH|rC;*@0M!zDI{*Lx literal 0 HcmV?d00001 diff --git a/device.php b/device.php index 85a561a..3c7180d 100644 --- a/device.php +++ b/device.php @@ -18,7 +18,7 @@ if (isset($_GET['ajax']) && $_GET['ajax'] == "true"){ exit; } -$D['version'] = '1.0.0'; +$D['version'] = '1.1.0'; $D['model'] = get_device_model(); $D['user'] = @get_current_user(); $D['hostname'] = gethostname(); @@ -27,18 +27,11 @@ $D['yourip'] = $_SERVER['REMOTE_ADDR']; $D['uname'] = @php_uname(); $D['os'] = explode(" ", php_uname()); -if (($str = @file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) !== false){ - $D['cpu']['freq'] = $str[0]; -} -else{ - $D['cpu']['freq'] = 0; -} - - if (($str = @file("/proc/cpuinfo")) !== false){ $str = implode("", $str); @preg_match_all("/model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model); @preg_match_all("/BogoMIPS\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips); + @preg_match_all("/Model\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $pimodel); if (false !== is_array($model[1])){ $D['cpu']['count'] = sizeof($model[1]); @@ -50,10 +43,15 @@ if (($str = @file("/proc/cpuinfo")) !== false){ $D['cpu']['model'] = $model[1][0].$bogomips[1][0].' ×'.$D['cpu']['count']; } } + + if (false !== is_array($pimodel[1])){ + $D['model']['pimodel'] = $pimodel[1][0]; + } } else{ $D['cpu']['count'] = 1; $D['cpu']['model'] = ''; + $D['model']['pimodel'] = ''; } function get_device_model(){ @@ -73,6 +71,13 @@ function get_info(){ $D['uptime'] = 0; } + if (($str = @file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) !== false){ + $D['cpu']['freq'] = $str[0]; + } + else{ + $D['cpu']['freq'] = 0; + } + // CPU Core if (($str = @file("/proc/stat")) !== false){ $str = str_replace(" ", " ", $str); @@ -175,4 +180,4 @@ function get_info(){ $D['net']['count'] = 0; } } -?> +?> \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..852bf7c54fab0fda4c7e8542bdd48c179b077608 GIT binary patch literal 5430 zcmbtY3vg7`89w*!`+4uapUG}E*`Vc2zelH2oPTg#kN`*ZPkvE>WHYV z<8!Lw3$?9}s@PVC`e>(GwN*Sn#SUF=%#mxV2Ff#Tso-=rdEvy}bzvsUpy#G4CxO0&ladd?x z=D0>?>VBCi2MtVp2mkN(S(~#-WsUrG_)kXbu{20Q`y9z^@V80K`Cic0uFZ(tG1{5< zwLUX`pB8uaYK)mbwi;rqV$MD(U~88q2<+t$Zjkl@TZt_AyxZ^s4;XS)d#PmGIb+4O%-I8{Z!+>lxhQ8^{{;&>|yyBw%eHT zopaoFNGYdC#qOnXV85U7o;%trY&-%T_fn1$iv@p zxfYcEkyJ|!@CU^I!?7_!xxmGv@Wp<}Yd%)&@wg4y=b2>Y`a9x!v=Cq123!u0rIFf; z9v+t|k26eseSYd$Qq4`!9eah%^6wXvy`-BYuO6^<&L~mVP8kbf#H?beohdPk)|Glj z&-3B>kI=N>Wn`6$5odoE7zON!y5d|?U1%HD`Pn#pKD?GDEokdnek}cqTuZrp*Ft}N zPU3OFgWI<;d>u*53?DmaLD`Gr`W=ZgLO#oM$e5sxG1}hr9@y$toQtdupI)2xd}B)e zBaZGU&f5DSd#CO;XAsMmiCE{jIDf!*QMLd3!p8+03m>J2>BOQ3v2G^=3m_ho)EK#m z7MA^qnj_nZpCQn{gBb8kWdrQFA!wVe@fb$#8PnMXehI|+3K8oLW0GnD7lZ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_pSUJVoOemZ)_UHHzCn~V>> zaaa`d2~RggZq#%BA<=8&o=Qpg0J%(A-UsUy-fw@7zWG~U#=~cAJGCu-FM7P!P#>>H zy}Vgq^FAK>G5FCVDvF{beG3%0Fmwo2nnfJx{L>{}8mCei(P9#nckJOX$t< z`JD&%r%%G}uAYhX{5j~KGY`Ft&hPRG_i}NkFI7(ybG83M=srjt$;U}C*FJGHE&rd) zt+07*Gu}WSs8&Y5(DMG55$?szPl-ebh}Q%5_K6yQUYNVyg^1;qFNN(={vk zF7oER;lait|B~uXYo-4gWlritj)C`gdwa8u1^Pp?7(1Xa_8SX^AwPyNPaI+m>jx(6 HDeV0pv>(Yi literal 0 HcmV?d00001 diff --git a/index.php b/index.php index f1d3824..d587d3b 100644 --- a/index.php +++ b/index.php @@ -7,12 +7,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'device.php'); Pi Dashboard - + @@ -40,16 +35,17 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'device.php'); - Pi Dashboard + Pi Dashboard