Commit 9d17024d authored by Franco Fichtner's avatar Franco Fichtner

dashboard: new defaults for dashboard (2 cols, system info left)

(cherry picked from commit 40c8dc03)
(cherry picked from commit d376cfdf)
(cherry picked from commit 5076ad19)
parent 7c4482ef
......@@ -357,6 +357,7 @@
</monitor_type>
</load_balancer>
<widgets>
<sequence>system_information-container:col1:show,gateways-container:col2:show,interface_list-container:col2:show,services_status-container:col2:show</sequence>
<sequence>system_information-container:00000000-col3:show,services_status-container:00000001-col4:show,gateways-container:00000002-col4:show,interface_list-container:00000003-col4:show</sequence>
<column_count>2</column_count>
</widgets>
</opnsense>
......@@ -51,11 +51,8 @@ if (empty($config['widgets']) || !is_array($config['widgets'])) {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = $config['widgets'];
if (empty($pconfig['sequence'])) {
// set default dashboard view
$pconfig['sequence'] = 'system_information-container:col1:show,interface_list-container:col1:show,traffic_graphs-container:col1:show';
}
// default 2 column grid layout
$pconfig['sequence'] = !empty($pconfig['sequence']) ? $pconfig['sequence'] : '';
$pconfig['column_count'] = !empty($pconfig['column_count']) ? $pconfig['column_count'] : 2;
// build list of widgets
$widgetCollection = array();
......@@ -84,12 +81,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['sequence'])) {
$config['widgets']['sequence'] = $_POST['sequence'];
} elseif (isset($config['widgets']['sequence'])) {
unset($config['widgets']['sequence']);
}
if (!empty($_POST['column_count'])) {
$config['widgets']['column_count'] = $_POST['column_count'];
} elseif(isset($config['widgets']['column_count'])) {
unset($config['widgets']['column_count']);
}
write_config(gettext("Widget configuration has been changed."));
}
header("Location: index.php");
write_config(gettext('Widget configuration has been changed.'));
header('Location: index.php');
exit;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment