-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5554 from GuoLiBin6/feat/glb-to-3.11/secgroup
feat(4592): secgroup reconfiguration
- Loading branch information
Showing
20 changed files
with
800 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
containers/Compute/views/secgroup-rule/mixins/singleActions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
export default { | ||
created () { | ||
this.singleActions = [ | ||
{ | ||
label: this.$t('compute.text_982'), | ||
permission: 'secgrouprules_update', | ||
action: obj => { | ||
this.createDialog('EditRulesDialog', { | ||
data: [obj], | ||
title: 'edit', | ||
columns: this.columns, | ||
onManager: this.onManager, | ||
refresh: this.refresh, | ||
type: this.type, | ||
brand: this.data.brand, | ||
}) | ||
}, | ||
meta: () => { | ||
return { | ||
validate: !this.isRead, | ||
tooltip: this.isRead ? this.$t('compute.secgroup.shared') : '', | ||
} | ||
}, | ||
}, | ||
// { | ||
// label: this.$t('compute.text_983'), | ||
// permission: 'secgrouprules_create', | ||
// action: obj => { | ||
// this.createDialog('EditRulesDialog', { | ||
// data: [obj], | ||
// title: 'clone', | ||
// columns: this.columns, | ||
// onManager: this.onManager, | ||
// refresh: this.refresh, | ||
// type: this.type, | ||
// secgroup: this.id, | ||
// }) | ||
// }, | ||
// meta: () => { | ||
// return { | ||
// validate: !this.isRead, | ||
// tooltip: this.isRead ? i18n.t('compute.secgroup.shared') : '', | ||
// } | ||
// }, | ||
// }, | ||
{ | ||
label: this.$t('compute.perform_delete'), | ||
permission: 'secgrouprules_delete', | ||
action: obj => { | ||
this.createDialog('DeleteResDialog', { | ||
vm: this, | ||
data: [obj], | ||
columns: this.columns, | ||
title: this.$t('compute.perform_delete'), | ||
name: this.$t('compute.text_984'), | ||
onManager: this.onManager, | ||
refresh: this.refresh, | ||
}) | ||
}, | ||
meta: () => { | ||
return { | ||
validate: !this.isRead, | ||
tooltip: this.isRead ? this.$t('compute.secgroup.shared') : '', | ||
} | ||
}, | ||
}, | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<base-side-page | ||
@cancel="cancelSidePage" | ||
:title="$t('dictionary.secgrouprule')" | ||
icon="res-secgroup" | ||
:res-name="name" | ||
:current-tab="params.windowData.currentTab" | ||
:tabs="detailTabs" | ||
:loaded="loaded" | ||
@tab-change="handleTabChange"> | ||
<template v-slot:actions> | ||
<actions :options="singleActions" :row="detailData" button-type="link" button-size="small" /> | ||
</template> | ||
<component | ||
:is="params.windowData.currentTab" | ||
:res-id="data.id" | ||
:data="detailData" | ||
:getParams="getParams" | ||
res-type="secgrouprule" /> | ||
</base-side-page> | ||
</template> | ||
|
||
<script> | ||
import SidePageMixin from '@/mixins/sidePage' | ||
import WindowsMixin from '@/mixins/windows' | ||
import Actions from '@/components/PageList/Actions' | ||
import SingleActionsMixin from '../mixins/singleActions' | ||
export default { | ||
name: 'SecgroupRuleSidePage', | ||
components: { Actions }, | ||
mixins: [SidePageMixin, WindowsMixin, SingleActionsMixin], | ||
data () { | ||
const detailTabs = [ | ||
{ label: this.$t('compute.text_240'), key: 'event-drawer' }, | ||
] | ||
return { | ||
detailTabs, | ||
t: null, | ||
} | ||
}, | ||
computed: { | ||
getParams () { | ||
return { | ||
t: this.t, | ||
} | ||
}, | ||
name () { | ||
return this.detailData.cidr ? `${this.detailData.cidr} (IP)` : '-' | ||
}, | ||
}, | ||
created () { | ||
if (this.params.tab) this.handleTabChange(this.params.tab) | ||
}, | ||
methods: { | ||
refresh () { | ||
this.t = new Date().getTime() | ||
if (this.isList) return this.params.list.refresh(...arguments) | ||
return this.fetchData() | ||
}, | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.