| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- import i18n from '@/locales'
- export default {
- created () {
- this.singleActions = [
- {
- label: i18n.t('k8s.text_63'),
- permission: 'k8s_daemonsets_update',
- action: obj => {
- this.createDialog('K8SSetImageDialog', {
- data: [obj],
- columns: this.columns,
- onManager: this.onManager,
- refresh: this.refresh,
- success: () => {
- if (this.getResponseData) this.getResponseData()
- },
- })
- },
- },
- {
- label: i18n.t('k8s.text_215'),
- permission: 'k8s_daemonsets_update',
- action: async obj => {
- const manager = new this.$Manager('daemonsets', '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()
- },
- })
- },
- },
- {
- label: i18n.t('k8s.text_201'),
- permission: 'k8s_daemonsets_delete',
- action: obj => {
- const requestParams = {
- cluster: obj.clusterID,
- }
- if (obj.namespace) {
- requestParams.namespace = obj.namespace
- }
- this.createDialog('DeleteResDialog', {
- data: [obj],
- name: i18n.t('k8s.text_4'),
- columns: this.columns,
- title: i18n.t('k8s.text_201'),
- onManager: this.onManager,
- requestParams,
- success: () => {
- if (this.getResponseData) this.getResponseData()
- this.destroySidePages()
- },
- })
- },
- },
- ]
- },
- }
|