Skip to content

Commit

Permalink
Merge branch 'eclipse-xpanse:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
WangLiNaruto authored May 31, 2024
2 parents 876bca0 + cbd8c67 commit b1f467b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
#
FROM nginx:1.26.0-alpine
FROM nginx:1.27.0-alpine
WORKDIR /usr/share/nginx/html
RUN apk add --no-cache bash envsubst
COPY docker/nginx-entrypoint.sh /
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xpanse-ui",
"version": "1.0.11",
"version": "1.0.12",
"private": true,
"type": "module",
"dependencies": {
Expand Down
17 changes: 1 addition & 16 deletions src/components/content/monitor/Monitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ApiError, DeployedService, Response } from '../../../xpanse-api/generat
import { MetricAutoRefreshSwitch } from './MetricAutoRefreshSwitch';
import { MetricChartsPerRowDropDown } from './MetricChartsPerRowDropDown';
import { MetricTimePeriodRadioButton } from './MetricTimePeriodRadioButton';
import { MonitorTip } from './MonitorTip';
import { chartsPerRowWithTwo, lastMinuteRadioButtonKeyId } from './metricProps';
import { useDeployedServicesByUserQuery } from './useDeployedServicesByUserQuery';

Expand Down Expand Up @@ -177,15 +176,6 @@ function Monitor(): React.JSX.Element {
setServiceId('');
};

const onRemove = () => {
setServiceId('');
form.resetFields();
tipType.current = undefined;
tipMessage.current = '';
tipDescription.current = '';
void deployedServiceQuery.refetch();
};

return (
<div className={tablesStyle.genericTableContainer}>
<div className={monitorStyles.monitorServiceSelectTitle}>
Expand All @@ -194,12 +184,6 @@ function Monitor(): React.JSX.Element {
&nbsp; Operating System Monitor
</h3>
</div>
<MonitorTip
type={tipType.current}
msg={tipMessage.current}
description={tipDescription.current}
onRemove={onRemove}
/>
<Form
name='basic'
form={form}
Expand Down Expand Up @@ -287,6 +271,7 @@ function Monitor(): React.JSX.Element {
isAutoRefresh={isAutoRefresh}
chartsPerRow={chartsPerRow}
setNumberOfChartsAvailable={setNumberOfChartsAvailable}
onReset={onReset}
/>
</Suspense>
</div>
Expand Down
14 changes: 13 additions & 1 deletion src/components/content/monitor/MonitorChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export default function MonitorChart({
isAutoRefresh,
chartsPerRow,
setNumberOfChartsAvailable,
onReset,
}: {
serviceId: string;
timePeriod: number;
isAutoRefresh: boolean;
chartsPerRow: string;
setNumberOfChartsAvailable: (chartCount: number) => void;
onReset: () => void;
}): React.JSX.Element {
let tipType: 'error' | 'success' | undefined = undefined;
let tipMessage: string = '';
Expand Down Expand Up @@ -235,6 +237,10 @@ export default function MonitorChart({
tipType = undefined;
tipMessage = '';
tipDescription = '';
onReset();
};

const retryRequest = () => {
if (timePeriod === lastMinuteRadioButtonKeyId) {
void useGetLastKnownMetric.refetch();
} else {
Expand All @@ -244,7 +250,13 @@ export default function MonitorChart({

return (
<>
<MonitorTip type={tipType} msg={tipMessage} description={tipDescription} onRemove={onRemove} />
<MonitorTip
type={tipType}
msg={tipMessage}
description={tipDescription}
onRemove={onRemove}
retryRequest={retryRequest}
/>
{useGetMetricForSpecificTimePeriod.isLoading || useGetLastKnownMetric.isLoading ? (
<div className={monitorStyles.monitorSearchLoadingClass}>
<Spin
Expand Down
16 changes: 15 additions & 1 deletion src/components/content/monitor/MonitorTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
* SPDX-FileCopyrightText: Huawei Inc.
*/

import { Alert } from 'antd';
import { Alert, Button } from 'antd';
import React from 'react';
import errorAlertStyles from '../../../styles/error-alert.module.css';
import monitorStyles from '../../../styles/monitor.module.css';

export const MonitorTip = ({
type,
msg,
description,
onRemove,
retryRequest,
}: {
type: 'error' | 'success' | undefined;
msg: string;
description: string;
onRemove: () => void;
retryRequest: () => void;
}): React.JSX.Element => {
if (!type) {
return <></>;
Expand All @@ -32,6 +35,17 @@ export const MonitorTip = ({
type={type}
onClose={onRemove}
closable={true}
action={
<Button
className={errorAlertStyles.tryAgainBtnInAlertClass}
size='small'
type='primary'
onClick={retryRequest}
danger={true}
>
Retry Request
</Button>
}
/>{' '}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const MigrateServiceSubmitBillingMode = ({ selectBillMode }: { selectBill
required={true}
>
<Flex vertical gap='middle'>
<Radio.Group disabled={true} buttonStyle='solid' value={selectBillMode}>
<Radio.Group disabled={true} buttonStyle='solid'>
<Radio.Button key={selectBillMode} value={selectBillMode}>
{selectBillMode}
</Radio.Button>
Expand Down

0 comments on commit b1f467b

Please sign in to comment.