Skip to content

Commit

Permalink
fix: fix bugs
Browse files Browse the repository at this point in the history
1. container registry display
2. enable reset cluster when status is Updating
3. disable backup for rancher cluster

Signed-off-by: moweiwei <mo.weiwei@99cloud.net>
  • Loading branch information
moweiwei committed Nov 16, 2022
1 parent a6dbbe9 commit 2674dbb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import React from 'react';
import Base from 'containers/BaseDetail';
import { get } from 'lodash';
import { get, uniq } from 'lodash';
import { useRootStore } from 'stores';
import { observer } from 'mobx-react';

Expand All @@ -36,7 +36,11 @@ function BaseDetail() {
{
label: t('Container Registry'),
dataIndex: 'containerRuntime',
render: (data) => data.insecureRegistry,
render: (_, record) => {
const registry = get(record, '_originData.status.Registries', []);
if (registry.length === 0) return '-';
return uniq(registry.map((it) => it.host));
},
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/pages/cluster/containers/Cluster/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StatusTitle = () => (
function ClusterDetail() {
const { clusterStore: store } = useRootStore();

const allowedCheckProviderType = (item) => item?.provider?.name !== 'rancher';
const allowedCheckProviderType = (item) => item.providerType !== 'rancher';
const allowedCheckComponents = (item, key) => !isEmpty(item[key]);

const currentProps = {
Expand Down
7 changes: 6 additions & 1 deletion src/pages/cluster/containers/Cluster/actions/Reset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ export default class Index extends ConfirmAction {
return failedStatus.includes(item.status);
}

isUpdating(item) {
return item.status === 'Updating';
}

allowedCheckFunc = (item) =>
this.isFailed(item) && !isDisableByProviderType(item);
(this.isFailed(item) || this.isUpdating(item)) &&
!isDisableByProviderType(item);

confirmContext = (data) => {
const name = this.getName(data);
Expand Down

0 comments on commit 2674dbb

Please sign in to comment.