Add Netgate Services and Support widget

This commit is contained in:
Steve Beaver 2017-08-14 13:06:02 -04:00
parent 1605d94079
commit 179991b76e
3 changed files with 42 additions and 8 deletions

View File

@ -262,7 +262,7 @@
</monitor_type>
</load_balancer>
<widgets>
<sequence>system_information:col1:show,interfaces:col2:show</sequence>
<sequence>system_information:col1:show,netgate_services_and_support:col2:show,interfaces:col2:show</sequence>
<period>10</period>
</widgets>
<openvpn/>

View File

@ -105,7 +105,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
"latest_config" => "15.8",
"latest_config" => "15.9",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",
@ -147,11 +147,11 @@ if (file_exists("/etc/platform")) {
} else {
$g['default_config_backup_count'] = 30;
}
} else {
// shouldn't happen but "just in case" no platform were detected
$g['platform'] = 'undetected';
$g['default_config_backup_count'] = 30;
}
} else {
// shouldn't happen but "just in case" no platform were detected
$g['platform'] = 'undetected';
$g['default_config_backup_count'] = 30;
}
if (file_exists("{$g['etc_path']}/default-config-flavor")) {

View File

@ -4777,7 +4777,7 @@ function upgrade_147_to_148() {
}
// if there was a space in a group name, there may be multiple
// groups with the same name in the group file. To prevent pw
// groups with the same name in the group file. To prevent pw
// from getting into a neverending loop, delete all user-defined
// groups here. local_sync_accounts will run shortly after this
// and add them back. redmine #6012
@ -5057,4 +5057,38 @@ function upgrade_157_to_158() {
}
}
/* Force the Netgate Services and Support widget to be active on upgrade.
New widget is added at the top of column 2 */
function upgrade_158_to_159() {
global $config;
if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) {
$widgets = explode(",", $config['widgets']['sequence']);
$cnt = count($widgets);
$col2 = $cnt;
$newsequence = array();
// Locate the firt column 2 widget
for ($idx=0;$idx<$cnt;$idx++) {
if (strpos($widgets[$idx], 'col2') !== false) {
$col2 = $idx;
break;
}
}
// Loop through the widgets inserting the new widget before the first col2 widget
for ($old=0,$new=0;$old<$cnt;$old++,$new++) {
$newsequence[$new] = $widgets[$old];
if ($old == ($col2 - 1)) {
$new++;
$newsequence[$new] = "netgate_services_and_support:col2:open:0";
}
}
$config['widgets']['sequence'] = implode(",", $newsequence);
}
}
?>