Unverified Commit ccec2a7e authored by ataghzout's avatar ataghzout Committed by GitHub
Browse files

feat(ui): Adapting the widget tactical overview to dark mode (#55)

parent f3243730
/vendor
/build
\ No newline at end of file
/build
.idea/
\ No newline at end of file
......@@ -10,7 +10,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.6"
},
"config": {
"secure-http": false,
......
This diff is collapsed.
......@@ -67,6 +67,11 @@ try {
$autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0)
? (int)$preferences['refresh_interval']
: 30;
$variablesThemeCSS = match ($centreon->user->theme) {
'light' => "Generic-theme",
'dark' => "Centreon-Dark",
default => throw new \Exception('Unknown user theme : ' . $centreon->user->theme),
};
} catch (Exception $e) {
echo $e->getMessage() . "<br/>";
exit;
......
<html>
<head>
<title>tactical-overview</title>
<link href="../../Themes/Centreon-2/style.css" type="text/css"/>
<link href="../../Themes/Centreon-2/Color/blue_css.php" rel="stylesheet" text="text/css"/>
{literal}
<style type="text/css">
.ListTable {font-size:11px;border-color: #BFD0E2;}
</style>
<style>
@import url('../../Themes/Centreon-2/style.css');
</style>
{/literal}
<link href="../../Themes/Generic-theme/style.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/Generic-theme/color.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/{($theme === "Generic-theme") ? ($theme|cat:"/Variables-css") : $theme}/variables.css"/>
</head>
<body>
<div id="tactical-overview">
......
......@@ -248,7 +248,12 @@ $numLine = 1;
$autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0)
? (int)$preferences['refresh_interval']
: 30;
$variablesThemeCSS = match ($centreon->user->theme) {
'light' => "Generic-theme",
'dark' => "Centreon-Dark",
default => throw new \Exception('Unknown user theme : ' . $centreon->user->theme),
};
$template->assign('theme', $variablesThemeCSS);
$template->assign('preferences', $preferences);
$template->assign('widgetId', $widgetId);
$template->assign('autoRefresh', $autoRefresh);
......
<html>
<head>
<title>tactical-overview</title>
<link href="../../Themes/Centreon-2/style.css" type="text/css"/>
<link href="../../Themes/Centreon-2/Color/blue_css.php" rel="stylesheet" text="text/css"/>
{literal}
<style type="text/css">
.ListTable {font-size:11px;border-color: #BFD0E2;}
</style>
<style>
@import url('../../Themes/Centreon-2/style.css');
</style>
{/literal}
<link href="../../Themes/Generic-theme/style.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/Generic-theme/color.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/{($theme === "Generic-theme") ? ($theme|cat:"/Variables-css") : $theme}/variables.css"/>
</head>
<body>
<div id="tactical-overview">
......
......@@ -369,7 +369,11 @@ $numLine = 1;
$autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0)
? (int)$preferences['refresh_interval']
: 30;
$variablesThemeCSS = match ($centreon->user->theme) {
'light' => "Generic-theme",
'dark' => "Centreon-Dark",
default => throw new \Exception('Unknown user theme : ' . $centreon->user->theme),
};
$template->assign('widgetId', $widgetId);
$template->assign('autoRefresh', $autoRefresh);
$template->assign('dataPEND', $dataPEND);
......@@ -377,5 +381,5 @@ $template->assign('dataOK', $dataOK);
$template->assign('dataWA', $dataWA);
$template->assign('dataCRI', $dataCRI);
$template->assign('dataUNK', $dataUNK);
$template->assign('theme', $variablesThemeCSS);
$template->display('services_status.ihtml');
Supports Markdown
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