fix: update the qos policy column in the floating ip list page
1. Update the qos policy name in the floating ip list page, if the user has the admin role, the user can fetch all the qos polices 2. Update the qos policy column title, and support qos policy id and name in the download data Change-Id: I96a18f24ef2f2e6c09d56eb5ae980202c31b98dd
This commit is contained in:
parent
824267546f
commit
47c34e1100
@ -1863,6 +1863,7 @@
|
||||
"QoS Policy": "QoS Policy",
|
||||
"QoS Policy Detail": "QoS Policy Detail",
|
||||
"QoS Policy ID": "QoS Policy ID",
|
||||
"QoS Policy ID/Name": "QoS Policy ID/Name",
|
||||
"QoS Spec": "QoS Spec",
|
||||
"QoS Spec ID": "QoS Spec ID",
|
||||
"QoS Specs": "QoS Specs",
|
||||
|
@ -1863,6 +1863,7 @@
|
||||
"QoS Policy": "QoS策略",
|
||||
"QoS Policy Detail": "QoS策略详情",
|
||||
"QoS Policy ID": "QoS策略ID",
|
||||
"QoS Policy ID/Name": "QoS策略ID/名称",
|
||||
"QoS Spec": "QoS规格",
|
||||
"QoS Spec ID": "QoS规格ID",
|
||||
"QoS Specs": "QoS规格",
|
||||
|
@ -260,7 +260,7 @@ export class FloatingIps extends Base {
|
||||
boldName: true,
|
||||
},
|
||||
{
|
||||
title: t('QoS Policy'),
|
||||
title: t('QoS Policy ID/Name'),
|
||||
dataIndex: 'qos_policy_name',
|
||||
isLink: true,
|
||||
routeName: this.getRouteName('networkQosDetail'),
|
||||
|
@ -18,7 +18,6 @@ import { action, observable } from 'mobx';
|
||||
import globalRouterStore from 'stores/neutron/router';
|
||||
import globalServerStore from 'stores/nova/instance';
|
||||
import globalLbaasStore from 'stores/octavia/loadbalancer';
|
||||
import globalQoSPolicyStore from 'stores/neutron/qos-policy';
|
||||
import { qosEndpoint } from 'client/client/constants';
|
||||
|
||||
export class FloatingIpStore extends Base {
|
||||
@ -26,6 +25,10 @@ export class FloatingIpStore extends Base {
|
||||
return client.neutron.floatingips;
|
||||
}
|
||||
|
||||
get qosClient() {
|
||||
return client.neutron.qosPolicies;
|
||||
}
|
||||
|
||||
get listFilterByProject() {
|
||||
return true;
|
||||
}
|
||||
@ -59,6 +62,19 @@ export class FloatingIpStore extends Base {
|
||||
|
||||
async listDidFetch(items, allProjects, filters) {
|
||||
const { qos_policy_id } = filters;
|
||||
const hasQos = items.find((it) => !!it.qos_policy_id);
|
||||
if (hasQos && this.enableQos) {
|
||||
const qosResult = await this.qosClient.list();
|
||||
const { policies = [] } = qosResult || {};
|
||||
items.forEach((it) => {
|
||||
if (it.qos_policy_id) {
|
||||
const qosItem = policies.find((p) => p.id === it.qos_policy_id);
|
||||
if (qosItem) {
|
||||
it.qos_policy_name = qosItem.name;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!qos_policy_id) {
|
||||
return items;
|
||||
}
|
||||
@ -75,10 +91,7 @@ export class FloatingIpStore extends Base {
|
||||
timeFilter,
|
||||
...filters
|
||||
} = {}) {
|
||||
const qosReq = this.enableQos ? globalQoSPolicyStore.fetchList() : null;
|
||||
const [qosResult, allData] = await Promise.all([
|
||||
qosReq,
|
||||
this.fetchListByPage({
|
||||
const allData = await this.fetchListByPage({
|
||||
limit,
|
||||
page,
|
||||
sortKey,
|
||||
@ -86,15 +99,9 @@ export class FloatingIpStore extends Base {
|
||||
conditions,
|
||||
timeFilter,
|
||||
...filters,
|
||||
}),
|
||||
]);
|
||||
const qosPolicies = qosResult || [];
|
||||
});
|
||||
const promises = [];
|
||||
allData.forEach((data) => {
|
||||
const qos = qosPolicies.find((it) => it.id === data.qos_policy_id);
|
||||
if (qos) {
|
||||
data.qos_policy_name = qos.name;
|
||||
}
|
||||
if (
|
||||
data.port_details &&
|
||||
data.port_details.device_owner === 'network:router_gateway'
|
||||
|
Loading…
Reference in New Issue
Block a user