import * as plugins from '../plugins.js'; import { DeesElement, customElement, html, state, css, cssManager, } from '@design.estate/dees-element'; import * as appstate from '../appstate.js'; @customElement('cloudly-view-services') export class CloudlyViewServices extends DeesElement { @state() private data: appstate.IDataState = { secretGroups: [], secretBundles: [], }; constructor() { super(); const subecription = appstate.dataState .select((stateArg) => stateArg) .subscribe((dataArg) => { this.data = dataArg; }); this.rxSubscriptions.push(subecription); } public static styles = [ cssManager.defaultStyles, css` :host { display: block; margin: auto; max-width: 1280px; padding: 16px 16px; } `, ]; public render() { return html` Services { return { id: itemArg.id, serverAmount: itemArg.data.servers.length, }; }} .dataActions=${[ { name: 'add configBundle', iconName: 'plus', type: ['header', 'footer'], actionFunc: async (dataActionArg) => { const modal = await plugins.deesCatalog.DeesModal.createAndShow({ heading: 'Add ConfigBundle', content: html` `, menuOptions: [ { name: 'create', action: async (modalArg) => {} }, { name: 'cancel', action: async (modalArg) => { modalArg.destroy(); }, }, ], }); }, }, { name: 'delete', iconName: 'trash', type: ['contextmenu', 'inRow'], actionFunc: async (actionDataArg) => { plugins.deesCatalog.DeesModal.createAndShow({ heading: `Delete ConfigBundle ${actionDataArg.item.id}`, content: html`
Do you really want to delete the ConfigBundle?
${actionDataArg.item.id}
`, menuOptions: [ { name: 'cancel', action: async (modalArg) => { await modalArg.destroy(); }, }, { name: 'delete', action: async (modalArg) => { appstate.dataState.dispatchAction(appstate.deleteSecretBundleAction, { configBundleId: actionDataArg.item.id, }); await modalArg.destroy(); }, }, ], }); }, }, ] as plugins.deesCatalog.ITableAction[]} >
`; } }