Add reset action to VM management.

This commit is contained in:
Michael Lipp 2025-01-29 18:42:10 +01:00
parent af41c78c07
commit 8d96307bb5
7 changed files with 126 additions and 18 deletions

View file

@ -785,6 +785,20 @@ public class VmAccess extends FreeMarkerConlet<VmAccess.ResourceModel> {
}
}
private void confirmReset(NotifyConletModel event,
ConsoleConnection channel, ResourceModel model,
ResourceBundle resourceBundle) throws TemplateNotFoundException,
MalformedTemplateNameException, ParseException, IOException {
Template tpl = freemarkerConfig()
.getTemplate("VmAccess-confirmReset.ftl.html");
channel.respond(new OpenModalDialog(type(), model.getConletId(),
processTemplate(event, tpl,
fmModel(event, channel, model.getConletId(), model)))
.addOption("cancelable", true).addOption("closeLabel", "")
.addOption("title",
resourceBundle.getString("confirmResetTitle")));
}
private void openConsole(ConsoleConnection channel, ResourceModel model,
VmChannel vmChannel, VmDefinition vmDef, Set<Permission> perms) {
var resourceBundle = resourceBundle(channel.locale());
@ -828,20 +842,6 @@ public class VmAccess extends FreeMarkerConlet<VmAccess.ResourceModel> {
}
}
private void confirmReset(NotifyConletModel event,
ConsoleConnection channel, ResourceModel model,
ResourceBundle resourceBundle) throws TemplateNotFoundException,
MalformedTemplateNameException, ParseException, IOException {
Template tpl = freemarkerConfig()
.getTemplate("VmAccess-confirmReset.ftl.html");
channel.respond(new OpenModalDialog(type(), model.getConletId(),
processTemplate(event, tpl,
fmModel(event, channel, model.getConletId(), model)))
.addOption("cancelable", true).addOption("closeLabel", "")
.addOption("title",
resourceBundle.getString("confirmResetTitle")));
}
@Override
protected boolean doSetLocale(SetLocale event, ConsoleConnection channel,
String conletId) throws Exception {