mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +02:00
fix(application): edit cluster ip services EE-4328 (#7775)
This commit is contained in:
parent
819dc4d561
commit
315c1c7e1e
10 changed files with 200 additions and 107 deletions
|
@ -18,6 +18,7 @@ interface InputOption {
|
|||
|
||||
interface PromptOptions {
|
||||
title: string;
|
||||
message?: string;
|
||||
inputType?:
|
||||
| 'text'
|
||||
| 'textarea'
|
||||
|
@ -45,9 +46,12 @@ export async function promptAsync(options: Omit<PromptOptions, 'callback'>) {
|
|||
});
|
||||
}
|
||||
|
||||
// the ts-ignore is required because the bootbox typings are not up to date
|
||||
// remove the ts-ignore when the typings are updated in
|
||||
export function prompt(options: PromptOptions) {
|
||||
const box = bootbox.prompt({
|
||||
title: options.title,
|
||||
message: options.message || '',
|
||||
inputType: options.inputType,
|
||||
inputOptions: options.inputOptions,
|
||||
buttons: options.buttons ? confirmButtons(options.buttons) : undefined,
|
||||
|
@ -84,6 +88,32 @@ export function confirmContainerDeletion(
|
|||
});
|
||||
}
|
||||
|
||||
export function confirmUpdateAppIngress(
|
||||
title: string,
|
||||
message: string,
|
||||
inputText: string,
|
||||
callback: PromptCallback
|
||||
) {
|
||||
prompt({
|
||||
title: buildTitle(title),
|
||||
inputType: 'checkbox',
|
||||
message,
|
||||
inputOptions: [
|
||||
{
|
||||
text: `${inputText}<i></i>`,
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Update',
|
||||
className: 'btn-primary',
|
||||
},
|
||||
},
|
||||
callback,
|
||||
});
|
||||
}
|
||||
|
||||
export function selectRegistry(options: PromptOptions) {
|
||||
prompt(options);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue