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

fix(Resources/Graph): export graph image after selecting png #11491

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
dedb0d9
[SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394)
emabassi-ext Jul 29, 2022
1756cf1
removed old variable userCrypted and the use of it (#11334) (#11352)
emabassi-ext Jul 29, 2022
598c001
enh(Header/userMenu):reduce spacing user menu (#11393)
Noha-ElAbrouki Jul 29, 2022
7737c37
fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443)
jeremyjaouen Jul 29, 2022
038b6fc
fix(ci): fix debian packaging with freshly instanciated jenkins slave…
kduret Jul 29, 2022
35967db
Sanitized and bound queries (#11413) (#11445)
emabassi-ext Jul 29, 2022
ddd8d27
Snyk: Sanitize and bind media sync queries 22.04.x (#11418)
hyahiaoui-ext Jul 29, 2022
9db3d7e
Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#…
hyahiaoui-ext Jul 29, 2022
9b61eb7
Snyk: Sanitize and bind Auth class queries 22.04.x (#11448)
hyahiaoui-ext Jul 29, 2022
8d64b02
[Backport/need review] fix(UI): Fix layout for Safari and form valida…
Thebarda Jul 29, 2022
c8451ce
[SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421)
emabassi-ext Jul 29, 2022
b524e4a
[Snyk] Sanitize and bind ACL action access queries (#11385) (#11402)
emabassi-ext Jul 29, 2022
b04ce8a
feat(api): implement endpoint to update centreon web (#11391) (#11401)
kduret Jul 29, 2022
0f71be5
Clean(platform): Clean appKey method and usage 22.04.x (#11452)
hyahiaoui-ext Jul 29, 2022
726d4d2
enh(platform): Use API to select metrics in virtual metrics configura…
hyahiaoui-ext Jul 29, 2022
5dda7fc
[SNYK] Sanitize and bind ACL class queries (#11392) (#11472)
emabassi-ext Jul 31, 2022
4dabe53
fix(conf) fix broker conf name display in listing (#11372) (#11376)
a-launois Aug 1, 2022
2436e74
fix export graph image after selecting png
Noha-ElAbrouki Aug 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ try {
checkout scm
}
sh 'rm -rf *.deb'
sh 'docker run -i --entrypoint /src/centreon/ci/scripts/centreon-deb-package.sh -w "/src" -v "$PWD:/src" -e DISTRIB="bullseye" -e VERSION=$VERSION -e RELEASE=$RELEASE registry.centreon.com/centreon-debian11-dependencies:22.04'
sh 'docker run -i --entrypoint /src/centreon/ci/scripts/centreon-deb-package.sh -w "/src" -v "$PWD:/src" -e DISTRIB="bullseye" -e VERSION=$VERSION -e RELEASE=$RELEASE registry.centreon.com/mon-build-dependencies-22.04:debian11'
stash name: 'Debian11', includes: '*.deb'
archiveArtifacts artifacts: "*"
sh 'rm -rf *.deb'
Expand Down
6 changes: 6 additions & 0 deletions ci/debian/centreon-web.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@ if [ "$1" = "configure" ] ; then
fi

fi

# rebuild symfony cache on upgrade
if [ -n "$2" ]; then
su - www-data -s /bin/bash -c "/usr/share/centreon/bin/console cache:clear --no-warmup"
fi

exit 0
2 changes: 1 addition & 1 deletion ci/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ override_dh_clean:

override_dh_auto_build:
composer install --no-dev --optimize-autoloader -n
npm ci
npm ci --legacy-peer-deps
npm run build
find . -type f | \
grep -v debian/extra/centreon-web/centreon-macroreplacement.txt | \
Expand Down
5 changes: 2 additions & 3 deletions ci/scripts/centreon-deb-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ done
rm -rf lang

# Generate API documentation.
apt install -y npm && sleep 30
npm install -g redoc-cli
/usr/local/bin/redoc-cli bundle --options.hideDownloadButton=true doc/API/centreon-api-v${MAJOR_VERSION}.yaml -o ../centreon-api-v${MAJOR_VERSION}.html
npm i -g redoc-cli
redoc-cli build --options.hideDownloadButton=true doc/API/centreon-api-v${MAJOR_VERSION}.yaml -o ../centreon-api-v${MAJOR_VERSION}.html

# Make tar with original content
cd ..
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"symfony/framework-bundle": "5.4.*",
"symfony/http-client": "5.4.*",
"symfony/http-kernel": "5.4.*",
"symfony/lock": "5.4.*",
"symfony/maker-bundle": "^1.11",
"symfony/monolog-bundle": "^3.7",
"symfony/options-resolver": "5.4.*",
Expand Down
91 changes: 85 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions config/packages/Centreon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,42 @@ services:
class: Core\Infrastructure\Platform\Repository\FileReadPlatformRepository
arguments: ['%centreon_etc_path%', '%centreon_install_path%']

Core\Platform\Application\Validator\RequirementValidatorsInterface:
class: Core\Platform\Infrastructure\Validator\RequirementValidators
arguments:
$requirementValidators: !tagged_iterator 'platform.requirement.validators'

Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidator:
arguments:
$dbRequirementValidators: !tagged_iterator 'platform.requirement.database.validators'

Core\Platform\Infrastructure\Validator\RequirementValidators\PhpRequirementValidator:
arguments:
$requiredPhpVersion: '%required_php_version%'

Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidators\MariaDbRequirementValidator:
arguments:
$requiredMariaDbMinVersion: '%required_mariadb_min_version%'

Core\Platform\Application\Repository\ReadVersionRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\DbReadVersionRepository
public: true

Core\Platform\Application\Repository\ReadUpdateRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\FsReadUpdateRepository
arguments:
$installDir: '%centreon_install_path%'
public: true

Core\Platform\Application\Repository\UpdateLockerRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\SymfonyUpdateLockerRepository
public: true

Core\Platform\Application\Repository\WriteUpdateRepositoryInterface:
class: Core\Platform\Infrastructure\Repository\DbWriteUpdateRepository
arguments: ['%centreon_var_lib%', '%centreon_install_path%']
public: true

# Monitoring resources
_instanceof:
Centreon\Infrastructure\Monitoring\Resource\Provider\ProviderInterface:
Expand All @@ -238,6 +274,10 @@ services:
tags: ['authentication.provider.responses']
Core\Security\Infrastructure\Api\FindProviderConfigurations\ProviderPresenter\ProviderPresenterInterface:
tags: ['authentication.provider.presenters']
Core\Platform\Application\Validator\RequirementValidatorInterface:
tags: ['platform.requirement.validators']
Core\Platform\Infrastructure\Validator\RequirementValidators\DatabaseRequirementValidatorInterface:
tags: ['platform.requirement.database.validators']

Centreon\Domain\Monitoring\Interfaces\ResourceRepositoryInterface:
factory: ['@Centreon\Infrastructure\Monitoring\Resource\ResourceRepositoryFactory', 'createResourceRepository']
Expand Down
6 changes: 6 additions & 0 deletions config/routes/Centreon/platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ centreon_application_platform_getversion:
controller: 'Centreon\Application\Controller\PlatformController::getVersions'
condition: "request.attributes.get('version') >= 21.10"

centreon_application_platform_updateversions:
methods: PATCH
path: /platform/updates
controller: 'Core\Platform\Infrastructure\Api\UpdateVersions\UpdateVersionsController'
condition: "request.attributes.get('version') >= 22.04"

centreon_application_platformtopology_addplatformtotopology:
methods: POST
path: /platform/topology
Expand Down
5 changes: 5 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ parameters:
media_path: "img/media"
redirect_default_page: "/monitoring/resources"
session_expiration_delay: 120
required_php_version: "%env(_CENTREON_PHP_VERSION_)%"
required_mariadb_min_version: "%env(_CENTREON_MARIA_DB_MIN_VERSION_)%"

services:
# Default configuration for services in *this* file
Expand Down Expand Up @@ -66,6 +68,9 @@ services:
decorates: router
arguments: ['@.inner']

Symfony\Component\Finder\Finder:
shared: false


# Security
Security\Domain\Authentication\Interfaces\AuthenticationRepositoryInterface:
Expand Down
2 changes: 2 additions & 0 deletions doc/API/centreon-api-v22.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,8 @@ paths:
moduleName:
type: object
$ref: '#/components/schemas/Platform.Versions'
/platform/updates:
$ref: "./v22.04/Administration/updates.yaml"
/platform/installation/status:
get:
tags:
Expand Down
30 changes: 30 additions & 0 deletions doc/API/v22.04/Administration/updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
patch:
tags:
- Platform
summary: "Update Centreon web"
description: |
Update Centreon web component
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
components:
type: array
items:
type: object
properties:
name:
type: string
enum: [ centreon-web ]
responses:
204:
description: "Platform updated"
404:
description: "Updates not found"
500:
$ref: "../../centreon-api-v22.04.yaml#/components/responses/InternalServerError"
...
3 changes: 2 additions & 1 deletion features/bootstrap/VirtualMetricHandleContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public function iAddAVirtualMetric()
$this->page = new MetricsConfigurationPage($this);
$this->page->setProperties(array(
'name' => $this->vmName,
'linked-host_services' => $this->host . ' - ' . $this->hostService
'linked-host_services' => $this->host . ' - ' . $this->hostService,
'known_metrics' => $this->functionRPN,
));
$this->page->setProperties(array('function' => $this->functionRPN));
$this->page->save();
Expand Down
54 changes: 54 additions & 0 deletions lang/fr_FR.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -16914,3 +16914,57 @@ msgstr "Les attributs liés suivants sont manquants : %s"

msgid "Warning, maximum size exceeded for input '%s' (max: %d), it will be truncated upon saving"
msgstr "Attention, taille maximale dépassée pour le champ '%s' (max: %d), il sera tronqué à l'enregistrement"

msgid "Update already in progress"
msgstr "Une mise à jour est déjà en cours"

msgid "An error occurred when retrieving the current version"
msgstr "Une erreur s'est produite lors de la récupération de la version actuelle"

msgid "Cannot retrieve the current version"
msgstr "La version actuelle n'a pas pu être récupérée"

msgid "An error occurred when retrieving available updates"
msgstr "Une erreur s'est produite lors de la récupération des mises à jour disponibles"

msgid "An error occurred when applying the update %s (%s)"
msgstr "Une erreur s'est produite lors de l'application de la mise à jour %s (%s)"

msgid "Error while locking the update process"
msgstr "Erreur lors du verrouillage du processus de mise à jour"

msgid "Error while unlocking the update process"
msgstr "Erreur lors du déverrouillage du processus de mise à jour"

msgid "An error occurred when applying post update actions"
msgstr "Une erreur s'est produite lors de l'application des actions postérieures à la mise à jour"

msgid "Updates not found"
msgstr "Les mises à jour n'ont pas été trouvées"

msgid "PHP version %s required (%s installed)"
msgstr "La version %s de PHP est requise (%s installée)"

msgid "PHP extension %s not loaded"
msgstr "L'extension %s de PHP n'est pas chargée"

msgid "Error when retrieving the database version"
msgstr "Erreur lors de la récupération de la version de la base de données"

msgid "Cannot retrieve the database version information"
msgstr "Les informations de version de la base de données n'ont pas pu être récupérées"

msgid "MariaDB version %s required (%s installed)"
msgstr "La version %s de MariaDB est requise (%s installée)"

msgid "Service severity"
msgstr "Criticité du service"

msgid "Service severity level"
msgstr "Niveau de criticité du service"

msgid "Host severity"
msgstr "Criticité d'hôte"

msgid "Host severity level"
msgstr "Niveau de criticité d'hôte"
10 changes: 10 additions & 0 deletions src/Centreon/Infrastructure/DatabaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@ public function setStorageDbName(string $storageDbName)
{
$this->storageDbName = $storageDbName;
}

/**
* switch connection to another database
*
* @param string $dbName
*/
public function switchToDb(string $dbName): void
{
$this->query('use ' . $dbName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class AbstractRepositoryDRB
protected function translateDbName(string $request): string
{
return str_replace(
array(':dbstg', ':db'),
array($this->db->getStorageDbName(), $this->db->getCentreonDbName()),
[':dbstg', ':db'],
[$this->db->getStorageDbName(), $this->db->getCentreonDbName()],
$request
);
}
Expand Down
Loading