Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix ui-bug #1669

Merged
merged 8 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading