Skip to content

Commit

Permalink
[ISSUE alibaba#8150] Add the namespace description item to the namesp…
Browse files Browse the repository at this point in the history
…ace list page

Close alibaba#8150
  • Loading branch information
onewe committed Apr 22, 2022
1 parent 2ee5122 commit c3f67df
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
2 changes: 2 additions & 0 deletions console-ui/src/pages/NameSpace/NameSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class NameSpace extends React.Component {
namespace,
namespaceAdd,
namespaceNames,
description,
namespaceNumber,
configuration,
namespaceOperation,
Expand Down Expand Up @@ -328,6 +329,7 @@ class NameSpace extends React.Component {
cell={this.renderName.bind(this)}
/>
<Table.Column title={namespaceNumber} dataIndex="namespace" />
<Table.Column title={description} dataIndex="namespaceDesc" />
<Table.Column title={configuration} dataIndex="configCount" />
<Table.Column
title={namespaceOperation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.alibaba.nacos.console.controller;

import com.alibaba.nacos.auth.annotation.Secured;
import com.alibaba.nacos.plugin.auth.constant.ActionTypes;
import com.alibaba.nacos.common.model.RestResult;
import com.alibaba.nacos.common.model.RestResultUtils;
import com.alibaba.nacos.common.utils.StringUtils;
Expand All @@ -26,6 +25,7 @@
import com.alibaba.nacos.console.enums.NamespaceTypeEnum;
import com.alibaba.nacos.console.model.Namespace;
import com.alibaba.nacos.console.model.NamespaceAllInfo;
import com.alibaba.nacos.plugin.auth.constant.ActionTypes;
import com.alibaba.nacos.plugin.auth.impl.constant.AuthConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down Expand Up @@ -86,8 +86,8 @@ public RestResult<List<Namespace>> getNamespaces() {
namespaces.add(namespace0);
for (TenantInfo tenantInfo : tenantInfos) {
int configCount = persistService.configInfoCount(tenantInfo.getTenantId());
Namespace namespaceTmp = new Namespace(tenantInfo.getTenantId(), tenantInfo.getTenantName(), DEFAULT_QUOTA,
configCount, NamespaceTypeEnum.CUSTOM.getType());
Namespace namespaceTmp = new Namespace(tenantInfo.getTenantId(), tenantInfo.getTenantName(),
tenantInfo.getTenantDesc(), DEFAULT_QUOTA, configCount, NamespaceTypeEnum.CUSTOM.getType());
namespaces.add(namespaceTmp);
}
return RestResultUtils.success(namespaces);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Namespace {

private String namespaceShowName;

private String namespaceDesc;

private int quota;

private int configCount;
Expand Down Expand Up @@ -68,6 +70,24 @@ public Namespace(String namespace, String namespaceShowName, int quota, int conf
this.type = type;
}

public Namespace(String namespace, String namespaceShowName, String namespaceDesc, int quota, int configCount,
int type) {
this.namespace = namespace;
this.namespaceShowName = namespaceShowName;
this.quota = quota;
this.configCount = configCount;
this.type = type;
this.namespaceDesc = namespaceDesc;
}

public String getNamespaceDesc() {
return namespaceDesc;
}

public void setNamespaceDesc(String namespaceDesc) {
this.namespaceDesc = namespaceDesc;
}

public int getQuota() {
return quota;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,9 @@
*/
public class NamespaceAllInfo extends Namespace {

private String namespaceDesc;

public String getNamespaceDesc() {
return namespaceDesc;
}

public void setNamespaceDesc(String namespaceDesc) {
this.namespaceDesc = namespaceDesc;
}

public NamespaceAllInfo() {
}

public NamespaceAllInfo(String namespace, String namespaceShowName, int quota, int configCount, int type,
String namespaceDesc) {
super(namespace, namespaceShowName, quota, configCount, type);
this.namespaceDesc = namespaceDesc;
super(namespace, namespaceShowName, namespaceDesc, quota, configCount, type);
}

}

0 comments on commit c3f67df

Please sign in to comment.