Enable supportpages switch.

This commit is contained in:
SimonFair
2023-07-09 12:58:09 +01:00
parent bc736825db
commit cbfe0f47b0
2 changed files with 10 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ table.t1{margin-top:0;background:transparent; border-collapse: collapse; border-
//table.t1 td:first-child{width:144px}
table tr td{padding:0 0 3px 0;margin:0}
table tr td.thin{line-height:8px;height:8px}
table.t1 tr>td{width: 1%; white-space: nowrap;}
table.t1 tr>td{width: 1%; ; text-align:centre ;white-space: nowrap;}
table.t1 tr>td+td{width: 1%; white-space: nowrap; }
table.t1 tr>td+td+td{width:auto ; text-align:left;}
table.t1 tr>td+td+td+td{text-align:left;}
@@ -84,11 +84,13 @@ function textsave(module) {
$('#text'+module).val(data.modprobe) ;
$('#status'+module).html(data.state) ;
if (data.modprobe == "") $('#text'+module).attr('hidden', true); else $('#text'+module).attr('rows', 3)
if (data.support == true) {
document.getElementById("link" + module).innerHTML = "<a href='" + data.supporturl + "'target='_blank'><i title='" + _("Support page")_ + "' class='fa fa-phone-square'></i></a>" ;
} else {
document.getElementById("link" + module).innerHTML = "<i title='" + _("No support page avaialable")_ + "' class='fa fa-phone-square' ></i>" ;
}
if (data.supportpage == true) {
if (data.support == true) {
document.getElementById("link" + module).innerHTML = "<a href='" + data.supporturl + "'target='_blank'><i title='" + _("Support page")_ + "' class='fa fa-phone-square'></i></a>" ;
} else {
document.getElementById("link" + module).innerHTML = "<i title='" + _("No support page avaialable")_ + "' class='fa fa-phone-square' ></i>" ;
}
}
}
var message = "_(System Drivers)_: _(A reboot is required to apply changes)_";
addRebootNotice(message);

View File

@@ -21,6 +21,7 @@ require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"
$kernel = shell_exec("uname -r") ;
$kernel = trim($kernel,"\n") ;
$lsmod = shell_exec("lsmod") ;
$supportpage = true;
function getplugin($in) {
@@ -226,7 +227,6 @@ case 't1pre':
}
echo "<tr><td><span><a class='info' href=\"#\"><i title='"._("Edit Modprobe config")."' onclick=\"textedit('".$modname."')\" id=\"icon'.$modname.'\" class='fa fa-edit'></i></a><span>" ;
$supportpage = true ;
if ($supportpage) {
if ($module['support'] == false) {
$supporthtml = "<span id='link$modname'><i title='"._("No support page avaialable")."' class='fa fa-phone-square'></i></span>" ;
@@ -255,6 +255,7 @@ case "update":
else $error = file_put_contents("/boot/config/modprobe.d/$module.conf",$conf) ;
getmodules($module) ;
$return = $arrModules[$module] ;
$return['supportpage'] = $supportpage ;
if (is_array($return["modprobe"]))$return["modprobe"] = implode("\n",$return["modprobe"]) ;
if ($error !== false) $return["error"] = false ; else $return["error"] = true ;
echo json_encode($return) ;