| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import i18n from '@/locales'
- export default {
- created () {
- this.singleActions = [
- {
- label: i18n.t('k8s.text_201'),
- permission: 'k8s_rbacrolebindings_delete',
- action: (obj) => {
- this.createDialog('DeleteResDialog', {
- vm: this,
- data: [obj],
- columns: this.columns,
- title: i18n.t('k8s.text_328'),
- name: i18n.t('k8s.text_24'),
- onManager: this.onManager,
- ok: (ids, data) => {
- return new this.$Manager('rbacrolebindings', 'v1').batchDelete({
- ids,
- data: {
- cluster: data[0].clusterID,
- namespace: data[0].namespace,
- },
- }).then(() => {
- if (this.getResponseData) {
- this.getResponseData()
- } else {
- this.destroySidePages()
- this.refresh()
- }
- return true
- }).catch(error => {
- throw error
- })
- },
- })
- },
- },
- {
- label: i18n.t('k8s.text_215'),
- permission: 'k8s_rbacrolebindings_update',
- action: async obj => {
- const manager = new this.$Manager('rbacrolebindings', 'v1')
- async function fetchData () {
- const { data } = await manager.getSpecific({ id: obj.id, spec: 'rawdata' })
- return data
- }
- const configText = await fetchData()
- this.createDialog('K8SEditYamlDialog', {
- data: [obj],
- manager,
- refresh: this.refresh,
- configText,
- success: () => {
- if (this.getResponseData) this.getResponseData()
- },
- })
- },
- },
- ]
- },
- }
|