Skip to content

Commit

Permalink
fix config-server ui (#1669)
Browse files Browse the repository at this point in the history
* add null-check to status table

* Bump markdown-to-jsx (#1667)

Bumps [markdown-to-jsx](https://github.com/quantizor/markdown-to-jsx) from 7.3.2 to 7.5.0.
- [Release notes](https://github.com/quantizor/markdown-to-jsx/releases)
- [Changelog](https://github.com/quantizor/markdown-to-jsx/blob/main/CHANGELOG.md)
- [Commits](quantizor/markdown-to-jsx@v7.3.2...v7.5.0)

---
updated-dependencies:
- dependency-name: markdown-to-jsx
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump express in /inspectit-ocelot-documentation/website (#1666)

Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.21.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](expressjs/express@4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump next in /components/inspectit-ocelot-configurationserver-ui (#1665)

Bumps [next](https://github.com/vercel/next.js) from 14.2.5 to 14.2.10.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v14.2.5...v14.2.10)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump webpack in /components/inspectit-ocelot-configurationserver-ui (#1663)

Bumps [webpack](https://github.com/webpack/webpack) from 5.89.0 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.89.0...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump braces in /components/inspectit-ocelot-configurationserver-ui (#1657)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eduard Schander <[email protected]>

* change default values

* fix code style

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
EddeCCC and dependabot[bot] authored Nov 8, 2024
1 parent e2e8a4c commit 20a2d7d
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 258 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"jszip": "^3.10.0",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"next": "^14.2.5",
"next": "^14.2.10",
"primeflex": "^3.2.1",
"primeicons": "^5.0.0",
"primereact": "^8.5.0",
Expand All @@ -58,7 +58,7 @@
"reselect": "^4.1.6",
"strip-ansi": "^7.0.1",
"uuid": "^8.3.2",
"webpack": "^5.0.0"
"webpack": "^5.94.0"
},
"license": "Apache-2.0",
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,18 @@ class StatusTable extends React.Component {
attributes: { service },
} = rowData;

let { logAvailable, agentCommandsEnabled, serviceStatesAvailable, serviceStates } = this.resolveServiceAvailability(metaInformation);
// Set default values
let logAvailable = false;
let agentCommandsEnabled = false;
let serviceStatesAvailable = false;
let serviceStates = '{}';
let name = '-';
let agentIdElement;
let agentId = null;
if (metaInformation) {
let agentIdElement = <span></span>;
let agentId = '';

if (metaInformation && Object.entries(metaInformation).length > 0) {
({ logAvailable, agentCommandsEnabled, serviceStatesAvailable, serviceStates } = this.resolveServiceAvailability(metaInformation));

if (service) {
name = service;
}
Expand Down Expand Up @@ -292,13 +299,18 @@ class StatusTable extends React.Component {
};

agentHealthTemplate = (rowData) => {
const { onShowHealthStateDialog } = this.props;
const { onShowHealthStateDialog, onShowDownloadDialog } = this.props;
const { healthState, metaInformation } = rowData;
const { health } = healthState;
const { agentId } = metaInformation;
const { onShowDownloadDialog } = this.props;
const health = healthState?.health ?? null;
const agentId = metaInformation?.agentId ?? '';
const agentVersion = metaInformation?.agentVersion ?? '';

let { agentCommandsEnabled, supportArchiveAvailable } = this.resolveServiceAvailability(metaInformation);
// Set default values
let agentCommandsEnabled = false;
let supportArchiveAvailable = false;
if (metaInformation && Object.entries(metaInformation).length > 0) {
({ agentCommandsEnabled, supportArchiveAvailable } = this.resolveServiceAvailability(metaInformation));
}

let healthInfo;
let iconClass;
Expand All @@ -319,6 +331,11 @@ class StatusTable extends React.Component {
iconClass = 'pi-minus-circle';
iconColor = '#e8c413';
break;
default:
healthInfo = 'Unknown';
iconClass = 'pi-question-circle';
iconColor = 'gray';
break;
}

return (
Expand Down Expand Up @@ -350,7 +367,7 @@ class StatusTable extends React.Component {
<Button
className="archive-button"
icon="pi pi-cloud-download"
onClick={() => onShowDownloadDialog(metaInformation.agentId, metaInformation.agentVersion, 'archive')}
onClick={() => onShowDownloadDialog(agentId, agentVersion, 'archive')}
tooltip={
agentCommandsEnabled && supportArchiveAvailable
? 'Download Support Archive'
Expand Down
Loading

0 comments on commit 20a2d7d

Please sign in to comment.