feat: update qos policy info
For the qos policy info in the port detail page: 1. add qos policy name 2. update qos policy link for console and administrator Change-Id: Ib17f3c84aade6ce44610f379e577e676c30facb7
This commit is contained in:
parent
84d1e7af72
commit
34a41dd38d
@ -12,8 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import Base from 'containers/BaseDetail';
|
||||
import { qosEndpoint } from 'client/client/constants';
|
||||
@ -63,12 +61,17 @@ export class BaseDetail extends Base {
|
||||
label: t('QoS Policy'),
|
||||
dataIndex: 'qos_policy_id',
|
||||
copyable: false,
|
||||
render: (data) =>
|
||||
data ? (
|
||||
<Link to={`/network/qos-policy/detail/${data}`}>{data}</Link>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
render: (data) => {
|
||||
if (!data) {
|
||||
return '-';
|
||||
}
|
||||
const { qosPolicy } = this.detailData;
|
||||
const { name } = qosPolicy || {};
|
||||
const displayName = name ? `${data}(${name})` : data;
|
||||
return this.getLinkRender('networkQosDetail', displayName, {
|
||||
id: data,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
return {
|
||||
|
@ -166,6 +166,16 @@ export class PortStore extends Base {
|
||||
});
|
||||
}
|
||||
item.itemInList = itemContrib;
|
||||
const { qos_policy_id } = item;
|
||||
if (qos_policy_id) {
|
||||
try {
|
||||
const { policy } = await client.neutron.qosPolicies.show(qos_policy_id);
|
||||
item.qosPolicy = policy;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('fetch qos error', e);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user