Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
[fix]MON-13067-install-remove-default-value-for-colors-in-options-tab…
Browse files Browse the repository at this point in the history
…le-for-develop (#11479)

* update insertBaseConf , remove colors

* disable database colors import in serviceDetail file

* remove unused line in serviceDatail.php

* relpace generalOpt color importing with hard coded value

* restore deleted lines in sql script

* color values  deleted from database in upgrade script to 22.10.0-beta.1

* Update www/install/php/Update-22.10.0-beta.1.php

Co-authored-by: Kevin Duret <kduret@centreon.com>

* Update www/install/php/Update-22.10.0-beta.1.php

Co-authored-by: Kevin Duret <kduret@centreon.com>

Co-authored-by: Kevin Duret <kduret@centreon.com>
  • Loading branch information
emabassi-ext and kduret authored Sep 5, 2022
1 parent 0784363 commit 81d11cb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
6 changes: 2 additions & 4 deletions www/class/centreonGraph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ public function initCurveList()
) {
$this->metrics[$metric["metric_id"]]["warn"] = $metric["warn"];
if (!isset($ds_data["ds_color_area_warn"]) || empty($ds_data["ds_color_area_warn"])) {
$this->metrics[$metric["metric_id"]]["ds_color_area_warn"] =
$this->generalOpt["color_warning"];
$this->metrics[$metric["metric_id"]]["ds_color_area_warn"] = "#ff9a13";
}
}
if (
Expand All @@ -677,8 +676,7 @@ public function initCurveList()
) {
$this->metrics[$metric["metric_id"]]["crit"] = $metric["crit"];
if (!isset($ds_data["ds_color_area_crit"]) || empty($ds_data["ds_color_area_crit"])) {
$this->metrics[$metric["metric_id"]]["ds_color_area_crit"] =
$this->generalOpt["color_critical"];
$this->metrics[$metric["metric_id"]]["ds_color_area_crit"] = "#e00b3d";
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions www/class/centreonGraphNg.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ private function addRealMetric($metric, $hidden = null)
$this->metrics[$metric["metric_id"]]["crit"] = $metric["crit"];
$this->metrics[$metric["metric_id"]]["crit_low"] = $metric["crit_low"];
if (!isset($dsData["ds_color_area_warn"]) || empty($dsData["ds_color_area_warn"])) {
$this->metrics[$metric["metric_id"]]["ds_color_area_warn"] = $this->generalOpt["color_warning"]['value'];
$this->metrics[$metric["metric_id"]]["ds_color_area_warn"] = "#ff9a13";
}
if (!isset($dsData["ds_color_area_crit"]) || empty($dsData["ds_color_area_crit"])) {
$this->metrics[$metric["metric_id"]]["ds_color_area_crit"] = $this->generalOpt["color_critical"]['value'];
$this->metrics[$metric["metric_id"]]["ds_color_area_crit"] = "#e00b3d";
}

$this->metrics[$metric["metric_id"]]["ds_order"] =
Expand Down
2 changes: 0 additions & 2 deletions www/include/monitoring/objectDetails/serviceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@
str_replace(' \'', "\n'", $service_status['performance_data'])
);
if ($service_status['current_state'] !== "") {
$service_status["status_color"] =
$centreon->optGen["color_" . strtolower($service_status["current_state"])];
$service_status["status_class"] = $tab_class_service[strtolower($service_status["current_state"])];
}
!$service_status["check_latency"]
Expand Down
13 changes: 0 additions & 13 deletions www/install/insertBaseConf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,6 @@ INSERT INTO `options` (`key`, `value`) VALUES
('maxViewConfiguration','30'),
('AjaxTimeReloadMonitoring','15'),
('AjaxTimeReloadStatistic','15'),
('color_up','#88b917'),
('color_down','#e00b3d'),
('color_unreachable','#818285'),
('color_ok','#88b917'),
('color_warning','#ff9a13'),
('color_critical','#e00b3d'),
('color_pending','#2AD1D4'),
('color_unknown','#bcbdc0'),
('color_ack','#FAED60'),
('color_host_down','#'),
('color_host_unreachable','#9CD9F1'),
('color_line_critical','#F96461'),
('color_downtime','#FBC5E8'),
('global_sort_type','host_name'),
('global_sort_order','ASC'),
('problem_sort_type','last_state_change'),
Expand Down
4 changes: 2 additions & 2 deletions www/install/php/Update-22.10.0-beta.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

$pearDB->beginTransaction();

$errorMessage = "Unable to delete 'oreon_web_path' option from database";
$pearDB->query("DELETE FROM `options` WHERE `key` = 'oreon_web_path'");
$errorMessage = "Unable to delete 'oreon_web_path' and color options from database";
$pearDB->query("DELETE FROM `options` WHERE `key` = 'oreon_web_path' OR `key` LIKE 'color_%'");

$errorMessage = "Unable to delete 'appKey' information from database";
$pearDB->query("DELETE FROM `informations` WHERE `key` = 'appKey'");
Expand Down

0 comments on commit 81d11cb

Please sign in to comment.