| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import i18n from '@/locales'
- export default {
- created () {
- this.singleActions = [
- {
- label: i18n.t('k8s.text_201'),
- permission: 'k8s_serviceaccounts_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('serviceaccounts', 'v1').batchDelete({
- ids,
- data: {
- cluster: data[0].clusterID,
- namespace: data[0].namespace,
- },
- }).then(() => {
- this.refresh()
- return true
- }).catch(error => {
- throw error
- })
- },
- })
- },
- },
- {
- label: i18n.t('k8s.text_215'),
- permission: 'k8s_serviceaccounts_update',
- action: async obj => {
- const manager = new this.$Manager('serviceaccounts', '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,
- })
- },
- },
- ]
- },
- }
|