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