Merge "fix: show qos_policy name in floating ip list"

This commit is contained in:
Zuul 2022-07-14 09:58:22 +00:00 committed by Gerrit Code Review
commit a0d2ed54a7
2 changed files with 20 additions and 12 deletions

View File

@ -220,7 +220,7 @@ export class FloatingIps extends Base {
},
{
title: t('QoS Policy'),
dataIndex: 'qos_policy_id',
dataIndex: 'qos_policy_name',
isLink: true,
routeName: this.getRouteName('networkQosDetail'),
idKey: 'qos_policy_id',

View File

@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import client from 'client';
import Base from 'stores/base';
import { action, observable } from 'mobx';
import globalRouterStore from 'stores/neutron/router';
import globalServerStore from 'stores/nova/instance';
import globalLbaasStore from 'stores/octavia/loadbalancer';
import client from 'client';
import Base from 'stores/base';
import globalQoSPolicyStore from 'stores/neutron/qos-policy';
export class FloatingIpStore extends Base {
get client() {
@ -69,7 +70,9 @@ export class FloatingIpStore extends Base {
timeFilter,
...filters
} = {}) {
const allData = await this.fetchListByPage({
const [qosPolicies, allData] = await Promise.all([
globalQoSPolicyStore.fetchList(),
this.fetchListByPage({
limit,
page,
sortKey,
@ -77,9 +80,14 @@ export class FloatingIpStore extends Base {
conditions,
timeFilter,
...filters,
});
}),
]);
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'