Skip to content

Commit 19bdb5b

Browse files
committed
Minor improvements and more help links
1 parent 4eef6d9 commit 19bdb5b

File tree

3 files changed

+9
-28
lines changed

3 files changed

+9
-28
lines changed

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
$permissionerr=false;
114114
$spannung=substr(exec("vcgencmd measure_volts core"),5);
115115
if( (strpos($spannung,"failed")!==false) || (strlen($spannung)<2) ){
116-
$spannung=$spannung."<div class='alert alert-danger' role='alert'>Reading of core voltage failed. Please run<br><kbd>sudo usermod -aG video www-data</kbd><br>in a terminal to solve this problem.</div>";
116+
$spannung=$spannung."<div class='alert alert-danger' role='alert'>Reading of core voltage failed. Please run<br><kbd>sudo usermod -aG video www-data</kbd><br>in a terminal to solve this problem.&nbsp;<a href='https://github.com/femto-code/Raspberry-Pi-Dashboard#core-voltage-or-other-hardware-info-output-is-not-shown-optional' target='blank'><i class='bi bi-question-circle'></i>&nbsp;Help</a></div>";
117117
$permissionerr=true;
118118
}
119119
}
@@ -274,7 +274,7 @@
274274
<div class="card-header">Model</div>
275275
<div class="card-body">
276276
<samp><?php echo exec("cat /sys/firmware/devicetree/base/model");?></samp>
277-
<?php $ot=shell_exec("vcgencmd version");if($permissionerr){echo "<div class='alert alert-danger' role='alert'>Execution of system command failed. Please run<br><kbd>sudo usermod -aG video www-data</kbd><br>in a terminal to solve this problem.</div>";}else{echo '<samp>'.$ot.'</samp>';}?>
277+
<?php $ot=shell_exec("vcgencmd version");if($permissionerr){echo "<div class='alert alert-danger' role='alert'>Execution of system command failed. Please run<br><kbd>sudo usermod -aG video www-data</kbd><br>in a terminal to solve this problem.&nbsp;<a href='https://github.com/femto-code/Raspberry-Pi-Dashboard#core-voltage-or-other-hardware-info-output-is-not-shown-optional' target='blank'><i class='bi bi-question-circle'></i>&nbsp;Help</a></div>";}else{echo '<samp>'.$ot.'</samp>';}?>
278278
<p class="card-text"><small class="text-muted">Updated <span><?php echo date("H:i:s");?> (at page load)</span></small></p>
279279
</div>
280280
</div>

js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ document.querySelector('#applyBtn').onclick = function (e) {
598598
$("#sformFeedback").html('<div class="mt-2 alert alert-info alert-dismissible fade show" role="alert"><i class="bi bi-info-circle"></i>&nbsp;All set! You did not change anything.<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>');
599599
}else{
600600
mdtoast('<i class="bi bi-x-circle"></i>&nbsp;There was an error! ('+data.responseText+')', { type: 'error'});
601-
$("#sformFeedback").html('<div class="mt-2 alert alert-danger" role="alert"><i class="bi bi-x-circle"></i>&nbsp;Config file (local.config) exists but could not be modified. Required permissions are not set correctly.<br><a class="alert-link" href="https://github.com/femto-code/Raspberry-Pi-Dashboard#valid-permissions" target="blank"><i class="bi bi-question"></i>&nbsp;Show help</a></div>');
601+
$("#sformFeedback").html('<div class="mt-2 alert alert-danger" role="alert"><i class="bi bi-x-circle"></i>&nbsp;Config file (local.config) exists but could not be modified. Required permissions are not set correctly.<br><a class="alert-link" href="https://github.com/femto-code/Raspberry-Pi-Dashboard#valid-permissions" target="blank"><i class="bi bi-question-circle"></i>&nbsp;Show help</a></div>');
602602
}
603603
}, null, "POST", false, sFormData);
604604
};

setup.php

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -554,28 +554,14 @@ function completeSetup() {
554554
return;
555555
}
556556
var value=document.getElementById("pwinput1").value;
557-
$("#submit").html("Processing...").prop("disabled", true);
558-
var vReq = new ntwReq("setup.php", function (data) {
559-
console.log(data.responseText);
560-
if(data.responseText=="1"){
561-
window.setTimeout(function(){
562-
$('#submit').html("<i class='bi bi-check-circle'></i>&nbsp;Successful");
563-
window.setTimeout(function(){
564-
location.replace("index.php");
565-
}, 1000);
566-
}, 1000);
567-
}else{
568-
if(data.responseText=="perm_error"){
569-
if (confirm(("Config file (local.config) exists but could not be modified. Required permissions are not set correctly.\nShow help?"))){
570-
window.open('https://github.com/femto-code/Raspberry-Pi-Dashboard#valid-permissions');
571-
}
572-
}
573-
574-
}
575-
}, null, "POST", true, "complete=true&pw="+value);
576557
<?php
577558
}else{
578559
?>
560+
var value="xyz"; // does not matter - server won't accept when setup done before
561+
//location.replace("index.php");
562+
<?php
563+
}
564+
?>
579565
$("#submit").html("Processing...").prop("disabled", true);
580566
var vReq = new ntwReq("setup.php", function (data) {
581567
console.log(data.responseText);
@@ -594,12 +580,7 @@ function completeSetup() {
594580
}
595581

596582
}
597-
}, null, "POST", true, "complete=true&pw=xyz");
598-
//location.replace("index.php");
599-
<?php
600-
}
601-
?>
602-
583+
}, null, "POST", true, "complete=true&pw="+value);
603584

604585
}
605586

0 commit comments

Comments
 (0)