mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 17:47:22 +00:00
* fix: eslint config Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: components Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: store Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: window mocks Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: components 2/x Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: components 3/x Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: rebase Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: components 5/x Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: components 6/x Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: typo Signed-off-by: Philippe Martin <phmartin@redhat.com> * fix: rebase Signed-off-by: Philippe Martin <phmartin@redhat.com>
41 lines
1.4 KiB
Svelte
41 lines
1.4 KiB
Svelte
<script lang="ts">
|
|
import { faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
import { createEventDispatcher } from 'svelte';
|
|
|
|
import { withConfirmation } from '/@/lib/dialogs/messagebox-utils';
|
|
|
|
import ListItemButtonIcon from '../ui/ListItemButtonIcon.svelte';
|
|
import { ConfigMapSecretUtils } from './configmap-secret-utils';
|
|
import type { ConfigMapSecretUI } from './ConfigMapSecretUI';
|
|
|
|
export let configMapSecret: ConfigMapSecretUI;
|
|
export let detailed = false;
|
|
|
|
const dispatch = createEventDispatcher<{ update: ConfigMapSecretUI }>();
|
|
export let onUpdate: (update: ConfigMapSecretUI) => void = update => {
|
|
dispatch('update', update);
|
|
};
|
|
|
|
const configmapSecretUtils = new ConfigMapSecretUtils();
|
|
|
|
async function deleteConfigMapSecret(): Promise<void> {
|
|
configMapSecret.status = 'DELETING';
|
|
onUpdate(configMapSecret);
|
|
|
|
if (configmapSecretUtils.isSecret(configMapSecret)) {
|
|
await window.kubernetesDeleteSecret(configMapSecret.name);
|
|
} else {
|
|
await window.kubernetesDeleteConfigMap((configMapSecret as ConfigMapSecretUI).name);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<ListItemButtonIcon
|
|
title={`Delete ${configmapSecretUtils.isSecret(configMapSecret) ? 'Secret' : 'ConfigMap'}`}
|
|
onClick={(): void =>
|
|
withConfirmation(
|
|
deleteConfigMapSecret,
|
|
`delete ${configmapSecretUtils.isSecret(configMapSecret) ? 'secret' : 'configmap'} ${configMapSecret.name}`,
|
|
)}
|
|
detailed={detailed}
|
|
icon={faTrash} />
|