feat: support network qos policy actions in console

Support qos policy actions in current project tab in console
1. Support create qos policy in console
2. Support edit qos policy in console
3. Support delete qos policy in console
4. Support create/edit/delete bandwidth in console

Change-Id: I3142f9e9386c85fd99438f7277eaebad0d2c2b6b
This commit is contained in:
Jingwei.Zhang 2022-03-25 14:47:41 +08:00
parent 36c5a63196
commit 9763ce317f
2 changed files with 25 additions and 5 deletions

View File

@ -17,6 +17,7 @@ import Base from 'containers/List';
import { QoSPolicyStore } from 'stores/neutron/qos-policy';
import { getQosPolicyColumns, getQosPolicyFilters } from 'resources/qos-policy';
import { qosEndpoint } from 'client/client/constants';
import { emptyActionConfig } from 'utils/constants';
import actionConfigs from './actions';
export class QoSPolicy extends Base {
@ -25,6 +26,14 @@ export class QoSPolicy extends Base {
this.downloadStore = new QoSPolicyStore();
}
get isProjectTab() {
const tab = this.tabKey;
if (this.isAdminPage) {
return false;
}
return !tab || tab === 'projectQoSPolicy';
}
updateFetchParamsByPage = (params) => {
switch (this.tabKey) {
case 'projectQoSPolicy':
@ -62,7 +71,10 @@ export class QoSPolicy extends Base {
if (this.isAdminPage) {
return actionConfigs.actionConfigs;
}
return actionConfigs.consoleActions;
if (this.isProjectTab) {
return actionConfigs.consoleActions;
}
return emptyActionConfig;
}
get isFilterByBackend() {

View File

@ -45,10 +45,18 @@ const actionConfigs = {
const consoleActions = {
rowActions: {
firstAction: null,
moreActions: [],
firstAction: Edit,
moreActions: [
{ action: CreateBandwidthLimitRule },
{ action: EditBandwidthEgressRule },
{ action: EditBandwidthIngressRule },
{ action: DeleteBandwidthEgressRules },
{ action: DeleteBandwidthIngressRules },
{ action: DeleteAction },
],
},
batchActions: [],
primaryActions: [],
batchActions: [DeleteAction],
primaryActions: [Create],
};
export default { actionConfigs, consoleActions };