Skip to content

Commit

Permalink
Rename conlet.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlipp committed Nov 23, 2024
1 parent 4ceaaa9 commit e839f7b
Show file tree
Hide file tree
Showing 34 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion org.jdrupes.vmoperator.manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ dependencies {
runtimeOnly 'org.slf4j:slf4j-jdk14:[2.0.7,3)'
runtimeOnly 'org.apache.logging.log4j:log4j-to-jul:2.20.0'

runtimeOnly project(':org.jdrupes.vmoperator.vmmgmt')
runtimeOnly project(':org.jdrupes.vmoperator.vmaccess')
runtimeOnly project(':org.jdrupes.vmoperator.vmconlet')
}

application {
Expand Down

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.jdrupes.vmoperator.vmmgmt.VmMgmtFactory
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="jdrupes-vmoperator-vmconlet jdrupes-vmoperator-vmconlet-preview"
<div class="jdrupes-vmoperator-vmmgmt jdrupes-vmoperator-vmmgmt-preview"
data-conlet-grid-rows="5"
data-jgwc-on-load="orgJDrupesVmOperatorVmConlet.initPreview"
data-jgwc-on-load="orgJDrupesVmOperatorVmMgmt.initPreview"
data-jgwc-on-unload="JGConsole.jgwc.unmountVueApps">

<form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="jdrupes-vmoperator-vmconlet jdrupes-vmoperator-vmconlet-view"
data-jgwc-on-load="orgJDrupesVmOperatorVmConlet.initView"
<div class="jdrupes-vmoperator-vmmgmt jdrupes-vmoperator-vmmgmt-view"
data-jgwc-on-load="orgJDrupesVmOperatorVmMgmt.initView"
data-jgwc-on-unload="JGConsole.jgwc.unmountVueApps">
<div class="jdrupes-vmoperator-vmconlet-view-search">
<div class="jdrupes-vmoperator-vmmgmt-view-search">
<form>
<label class="form__label--horizontal">
<span>{{ localize("Filter") }}</span>
Expand All @@ -13,7 +13,7 @@
</form>
</div>
<table
class="table--basic--striped jdrupes-vmoperator-vmconlet-view-table">
class="table--basic--striped jdrupes-vmoperator-vmmgmt-view-table">
<thead>
<tr>
<th v-for="key in controller.keys"
Expand Down Expand Up @@ -51,7 +51,7 @@
<span v-else
v-html="controller.breakBeforeDots(entry[key])"></span>
</td>
<td class="jdrupes-vmoperator-vmconlet-view-action-list">
<td class="jdrupes-vmoperator-vmmgmt-view-action-list">
<span role="button"
v-if="entry.spec.vm.state != 'Running' && !entry['running']"
tabindex="0" class="fa fa-play" :title="localize('Start VM')"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
conletName = VM Infos
conletName = VM Management

VMsSummary = VMs (running/total)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
conletName = VM-Informationen
conletName = VM-Management

VMsSummary = VMs (gestartet/gesamt)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import typescript from 'rollup-plugin-typescript2';
import postcss from 'rollup-plugin-postcss';

let packagePath = "org/jdrupes/vmoperator/vmconlet";
let baseName = "VmConlet"
let packagePath = "org/jdrupes/vmoperator/vmmgmt";
let baseName = "VmMgmt"
let module = "build/generated/resources/" + packagePath
+ "/" + baseName + "-functions.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.jdrupes.vmoperator.vmconlet;
package org.jdrupes.vmoperator.vmmgmt;

import java.time.Duration;
import java.time.Instant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.jdrupes.vmoperator.vmconlet;
package org.jdrupes.vmoperator.vmmgmt;

import freemarker.core.ParseException;
import freemarker.template.MalformedTemplateNameException;
Expand Down Expand Up @@ -61,11 +61,11 @@
import org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet;

/**
* The Class VmConlet.
* The Class {@link VmMgmt}.
*/
@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis",
"PMD.CouplingBetweenObjects" })
public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
public class VmMgmt extends FreeMarkerConlet<VmMgmt.VmsModel> {

private static final Set<RenderMode> MODES = RenderMode.asSet(
RenderMode.Preview, RenderMode.View);
Expand All @@ -88,7 +88,7 @@ public static class Update extends Event<Void> {
* sends the event to
*/
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
public VmConlet(Channel componentChannel) {
public VmMgmt(Channel componentChannel) {
super(componentChannel);
setPeriodicRefresh(Duration.ofMinutes(1), () -> new Update());
}
Expand All @@ -115,7 +115,7 @@ public void onConsoleReady(ConsoleReady event, ConsoleConnection channel)
.addRenderMode(RenderMode.Preview)
.addScript(new ScriptResource().setScriptType("module")
.setScriptUri(event.renderSupport().conletResource(
type(), "VmConlet-functions.js"))));
type(), "VmMgmt-functions.js"))));
}

@Override
Expand All @@ -133,7 +133,7 @@ protected Set<RenderMode> doRenderConlet(RenderConletRequestBase<?> event,
boolean sendVmInfos = false;
if (event.renderAs().contains(RenderMode.Preview)) {
Template tpl
= freemarkerConfig().getTemplate("VmConlet-preview.ftl.html");
= freemarkerConfig().getTemplate("VmMgmt-preview.ftl.html");
channel.respond(new RenderConlet(type(), conletId,
processTemplate(event, tpl,
fmModel(event, channel, conletId, conletState)))
Expand All @@ -150,7 +150,7 @@ protected Set<RenderMode> doRenderConlet(RenderConletRequestBase<?> event,
}
if (event.renderAs().contains(RenderMode.View)) {
Template tpl
= freemarkerConfig().getTemplate("VmConlet-view.ftl.html");
= freemarkerConfig().getTemplate("VmMgmt-view.ftl.html");
channel.respond(new RenderConlet(type(), conletId,
processTemplate(event, tpl,
fmModel(event, channel, conletId, conletState)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.jdrupes.vmoperator.vmconlet;
package org.jdrupes.vmoperator.vmmgmt;

import java.util.Map;
import java.util.Optional;
Expand All @@ -25,9 +25,9 @@
import org.jgrapes.webconsole.base.ConletComponentFactory;

/**
* The factory service for {@link VmConlet}s.
* The factory service for {@link VmMgmt}s.
*/
public class VmConletFactory implements ConletComponentFactory {
public class VmMgmtFactory implements ConletComponentFactory {

/*
* (non-Javadoc)
Expand All @@ -36,7 +36,7 @@ public class VmConletFactory implements ConletComponentFactory {
*/
@Override
public Class<? extends ComponentType> componentType() {
return VmConlet.class;
return VmMgmt.class;
}

/*
Expand All @@ -48,7 +48,7 @@ public Class<? extends ComponentType> componentType() {
@Override
public Optional<ComponentType> create(Channel componentChannel,
Map<?, ?> properties) {
return Optional.of(new VmConlet(componentChannel));
return Optional.of(new VmMgmt(componentChannel));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ import { formatMemory, parseMemory } from "./MemorySize";
import CpuRamChart from "./CpuRamChart";
import ConditionlInputController from "./ConditionalInputController";

import "./VmConlet-style.scss";
import "./VmMgmt-style.scss";

// For global access
declare global {
interface Window {
orgJDrupesVmOperatorVmConlet: {
orgJDrupesVmOperatorVmMgmt: {
initPreview?: (previewDom: HTMLElement, isUpdate: boolean) => void,
initView?: (viewDom: HTMLElement, isUpdate: boolean) => void
}
}
}

window.orgJDrupesVmOperatorVmConlet = {};
window.orgJDrupesVmOperatorVmMgmt = {};

const vmInfos = reactive(new Map());
const vmSummary = reactive({
Expand All @@ -64,7 +64,7 @@ const shortDateTime = (time: Date) => {
const chartData = new TimeSeries(2);
const chartDateUpdate = ref<Date>(null);

window.orgJDrupesVmOperatorVmConlet.initPreview = (previewDom: HTMLElement,
window.orgJDrupesVmOperatorVmMgmt.initPreview = (previewDom: HTMLElement,
_isUpdate: boolean) => {
const app = createApp({
setup(_props: object) {
Expand Down Expand Up @@ -98,7 +98,7 @@ window.orgJDrupesVmOperatorVmConlet.initPreview = (previewDom: HTMLElement,
app.mount(previewDom);
};

window.orgJDrupesVmOperatorVmConlet.initView = (viewDom: HTMLElement,
window.orgJDrupesVmOperatorVmMgmt.initView = (viewDom: HTMLElement,
_isUpdate: boolean) => {
const app = createApp({
setup(_props: object) {
Expand Down Expand Up @@ -174,7 +174,7 @@ window.orgJDrupesVmOperatorVmConlet.initView = (viewDom: HTMLElement,
app.mount(viewDom);
};

JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmmgmt.VmMgmt",
// eslint-disable-next-line @typescript-eslint/no-explicit-any
"updateVm", function(_conletId: string, vmDefinition: any) {
// Add some short-cuts for table controller
Expand All @@ -194,12 +194,12 @@ JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
vmInfos.set(vmDefinition.name, vmDefinition);
});

JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmmgmt.VmMgmt",
"removeVm", function(_conletId: string, vmName: string) {
vmInfos.delete(vmName);
});

JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmmgmt.VmMgmt",
// eslint-disable-next-line @typescript-eslint/no-explicit-any
"summarySeries", function(_conletId: string, series: any[]) {
chartData.clear();
Expand All @@ -210,7 +210,7 @@ JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
chartDateUpdate.value = new Date();
});

JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmmgmt.VmMgmt",
// eslint-disable-next-line @typescript-eslint/no-explicit-any
"updateSummary", function(_conletId: string, summary: any) {
chartData.push(new Date(), summary.usedCpus, Number(summary.usedRam));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Conlet specific styles.
*/

.jdrupes-vmoperator-vmconlet-preview {
.jdrupes-vmoperator-vmmgmt-preview {
form {
float: right;
padding: 0.15em 0.3em;
Expand All @@ -37,7 +37,7 @@
}
}

.jdrupes-vmoperator-vmconlet-view-search {
.jdrupes-vmoperator-vmmgmt-view-search {
display: flex;
justify-content: flex-end;

Expand All @@ -46,7 +46,7 @@
}
}

.jdrupes-vmoperator-vmconlet-view-table {
.jdrupes-vmoperator-vmmgmt-view-table {
td {
vertical-align: top;

Expand Down Expand Up @@ -94,7 +94,7 @@
}
}

.jdrupes-vmoperator-vmconlet-view-action-list {
.jdrupes-vmoperator-vmmgmt-view-action-list {
white-space: nowrap;

[role=button] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.jdrupes.vmoperator.vmconlet;
package org.jdrupes.vmoperator.vmmgmt;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"aash-plugin": ["./build/unpacked/org/jgrapes/webconsole/provider/jgwcvuecomponents/aash-vue-components/lib/AashPlugin"],
"jgconsole": ["./build/unpacked/org/jgrapes/webconsole/base/JGConsole"],
"jgwc": ["./build/unpacked/org/jgrapes/webconsole/provider/jgwcvuecomponents/jgwc-vue-components/jgwc-components"],
"l10nBundles": ["./src/org/jdrupes/vmoperator/vmconlet/browser/l10nBundles-stub"],
"l10nBundles": ["./src/org/jdrupes/vmoperator/vmmgmt/browser/l10nBundles-stub"],
"vue": ["./build/unpacked/org/jgrapes/webconsole/provider/vue/vue/vue"],
"chartjs": ["./build/unpacked/org/jgrapes/webconsole/provider/chartjs/chart.js/auto/auto"]
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rootProject.name = 'VM-Operator'
include 'org.jdrupes.vmoperator.manager'
include 'org.jdrupes.vmoperator.manager.events'
include 'org.jdrupes.vmoperator.vmaccess'
include 'org.jdrupes.vmoperator.vmconlet'
include 'org.jdrupes.vmoperator.vmmgmt'
include 'org.jdrupes.vmoperator.runner.qemu'
include 'org.jdrupes.vmoperator.common'
include 'org.jdrupes.vmoperator.util'
Expand Down

0 comments on commit e839f7b

Please sign in to comment.