Unverified Commit e3950648 authored by hyahiaoui-ext's avatar hyahiaoui-ext Committed by GitHub
Browse files

fix(ui) : Tactical Overview it appears in black (#56)

* Fix bug style not displaying

* fix linting

* moving match statement and variable assignement in index.php

* applying requested changes
parent ccec2a7e
...@@ -81,6 +81,13 @@ $path = $centreon_path . "www/widgets/tactical-overview/src/"; ...@@ -81,6 +81,13 @@ $path = $centreon_path . "www/widgets/tactical-overview/src/";
$template = new Smarty(); $template = new Smarty();
$template = initSmartyTplForPopup($path, $template, "./", $centreon_path); $template = initSmartyTplForPopup($path, $template, "./", $centreon_path);
$template->assign(
'theme',
$variablesThemeCSS === 'Generic-theme'
? $variablesThemeCSS . '/Variables-css'
: $variablesThemeCSS
);
$kernel = \App\Kernel::createForWeb(); $kernel = \App\Kernel::createForWeb();
$resourceController = $kernel->getContainer()->get( $resourceController = $kernel->getContainer()->get(
\Centreon\Application\Controller\MonitoringResourceController::class \Centreon\Application\Controller\MonitoringResourceController::class
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<title>tactical-overview</title> <title>tactical-overview</title>
<link href="../../Themes/Generic-theme/style.css" rel="stylesheet" type="text/css"/> <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/Generic-theme/color.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/{($theme === "Generic-theme") ? ($theme|cat:"/Variables-css") : $theme}/variables.css"/> <link href="../../Themes/{$theme}/variables.css" rel="stylesheet" type="text/css"/>
</head> </head>
<body> <body>
<div id="tactical-overview"> <div id="tactical-overview">
......
...@@ -248,12 +248,7 @@ $numLine = 1; ...@@ -248,12 +248,7 @@ $numLine = 1;
$autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0) $autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0)
? (int)$preferences['refresh_interval'] ? (int)$preferences['refresh_interval']
: 30; : 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('preferences', $preferences);
$template->assign('widgetId', $widgetId); $template->assign('widgetId', $widgetId);
$template->assign('autoRefresh', $autoRefresh); $template->assign('autoRefresh', $autoRefresh);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<title>tactical-overview</title> <title>tactical-overview</title>
<link href="../../Themes/Generic-theme/style.css" rel="stylesheet" type="text/css"/> <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/Generic-theme/color.css" rel="stylesheet" type="text/css"/>
<link href="../../Themes/{($theme === "Generic-theme") ? ($theme|cat:"/Variables-css") : $theme}/variables.css"/> <link href="../../Themes/{$theme}/variables.css" rel="stylesheet" type="text/css"/>
</head> </head>
<body> <body>
<div id="tactical-overview"> <div id="tactical-overview">
......
...@@ -369,11 +369,7 @@ $numLine = 1; ...@@ -369,11 +369,7 @@ $numLine = 1;
$autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0) $autoRefresh = (isset($preferences['refresh_interval']) && (int)$preferences['refresh_interval'] > 0)
? (int)$preferences['refresh_interval'] ? (int)$preferences['refresh_interval']
: 30; : 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('widgetId', $widgetId);
$template->assign('autoRefresh', $autoRefresh); $template->assign('autoRefresh', $autoRefresh);
$template->assign('dataPEND', $dataPEND); $template->assign('dataPEND', $dataPEND);
...@@ -381,5 +377,4 @@ $template->assign('dataOK', $dataOK); ...@@ -381,5 +377,4 @@ $template->assign('dataOK', $dataOK);
$template->assign('dataWA', $dataWA); $template->assign('dataWA', $dataWA);
$template->assign('dataCRI', $dataCRI); $template->assign('dataCRI', $dataCRI);
$template->assign('dataUNK', $dataUNK); $template->assign('dataUNK', $dataUNK);
$template->assign('theme', $variablesThemeCSS);
$template->display('services_status.ihtml'); $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