Add viewer conlet (#25)
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
Michael N. Lipp 2024-05-27 12:57:01 +02:00 committed by GitHub
parent b6f0299932
commit a6525a2289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 2642 additions and 250 deletions

View file

@ -1,4 +1,4 @@
conletName = VM Viewer
conletName = VM Infos
VMsSummary = VMs (running/total)

View file

@ -1,4 +1,4 @@
conletName = VM Anzeige
conletName = VM-Informationen
VMsSummary = VMs (gestartet/gesamt)

View file

@ -86,6 +86,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
* on by default and that {@link Manager#fire(Event, Channel...)}
* sends the event to
*/
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
public VmConlet(Channel componentChannel) {
super(componentChannel);
setPeriodicRefresh(Duration.ofMinutes(1), () -> new Update());
@ -138,7 +139,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
.setRenderAs(
RenderMode.Preview.addModifiers(event.renderAs()))
.setSupportedModes(MODES));
renderedAs.add(RenderMode.View);
renderedAs.add(RenderMode.Preview);
channel.respond(new NotifyConletView(type(),
conletId, "summarySeries", summarySeries.entries()));
var summary = evaluateSummary(false);
@ -181,7 +182,8 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
*/
@Handler(namedChannels = "manager")
@SuppressWarnings({ "PMD.ConfusingTernary", "PMD.CognitiveComplexity",
"PMD.AvoidInstantiatingObjectsInLoops", "PMD.AvoidDuplicateLiterals" })
"PMD.AvoidInstantiatingObjectsInLoops", "PMD.AvoidDuplicateLiterals",
"PMD.ConfusingArgumentToVarargsMethod" })
public void onVmDefChanged(VmDefChanged event, VmChannel channel)
throws JsonDecodeException, IOException {
var vmName = event.vmDefinition().getMetadata().getName();

View file

@ -97,7 +97,11 @@
.jdrupes-vmoperator-vmconlet-view-action-list {
white-space: nowrap;
[role=button]:not(:last-child) {
margin-right: 0.5em;
[role=button] {
padding: 0.25rem;
&:not([aria-disabled]):hover {
box-shadow: var(--darkening);
}
}
}