Rename conlet.

This commit is contained in:
Michael Lipp 2024-11-23 14:08:45 +01:00
parent 4ceaaa9fa2
commit e839f7b3b2
34 changed files with 42 additions and 42 deletions

View file

@ -31,8 +31,8 @@ dependencies {
runtimeOnly 'org.slf4j:slf4j-jdk14:[2.0.7,3)' runtimeOnly 'org.slf4j:slf4j-jdk14:[2.0.7,3)'
runtimeOnly 'org.apache.logging.log4j:log4j-to-jul:2.20.0' 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.vmaccess')
runtimeOnly project(':org.jdrupes.vmoperator.vmconlet')
} }
application { application {

View file

@ -1 +0,0 @@
org.jdrupes.vmoperator.vmconlet.VmConletFactory

View file

@ -0,0 +1 @@
org.jdrupes.vmoperator.vmmgmt.VmMgmtFactory

View file

@ -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-conlet-grid-rows="5"
data-jgwc-on-load="orgJDrupesVmOperatorVmConlet.initPreview" data-jgwc-on-load="orgJDrupesVmOperatorVmMgmt.initPreview"
data-jgwc-on-unload="JGConsole.jgwc.unmountVueApps"> data-jgwc-on-unload="JGConsole.jgwc.unmountVueApps">
<form> <form>

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
import typescript from 'rollup-plugin-typescript2'; import typescript from 'rollup-plugin-typescript2';
import postcss from 'rollup-plugin-postcss'; import postcss from 'rollup-plugin-postcss';
let packagePath = "org/jdrupes/vmoperator/vmconlet"; let packagePath = "org/jdrupes/vmoperator/vmmgmt";
let baseName = "VmConlet" let baseName = "VmMgmt"
let module = "build/generated/resources/" + packagePath let module = "build/generated/resources/" + packagePath
+ "/" + baseName + "-functions.js"; + "/" + baseName + "-functions.js";

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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.Duration;
import java.time.Instant; import java.time.Instant;

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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.core.ParseException;
import freemarker.template.MalformedTemplateNameException; import freemarker.template.MalformedTemplateNameException;
@ -61,11 +61,11 @@ import org.jgrapes.webconsole.base.events.SetLocale;
import org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet; import org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet;
/** /**
* The Class VmConlet. * The Class {@link VmMgmt}.
*/ */
@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis", @SuppressWarnings({ "PMD.DataflowAnomalyAnalysis",
"PMD.CouplingBetweenObjects" }) "PMD.CouplingBetweenObjects" })
public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> { public class VmMgmt extends FreeMarkerConlet<VmMgmt.VmsModel> {
private static final Set<RenderMode> MODES = RenderMode.asSet( private static final Set<RenderMode> MODES = RenderMode.asSet(
RenderMode.Preview, RenderMode.View); RenderMode.Preview, RenderMode.View);
@ -88,7 +88,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
* sends the event to * sends the event to
*/ */
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod") @SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
public VmConlet(Channel componentChannel) { public VmMgmt(Channel componentChannel) {
super(componentChannel); super(componentChannel);
setPeriodicRefresh(Duration.ofMinutes(1), () -> new Update()); setPeriodicRefresh(Duration.ofMinutes(1), () -> new Update());
} }
@ -115,7 +115,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
.addRenderMode(RenderMode.Preview) .addRenderMode(RenderMode.Preview)
.addScript(new ScriptResource().setScriptType("module") .addScript(new ScriptResource().setScriptType("module")
.setScriptUri(event.renderSupport().conletResource( .setScriptUri(event.renderSupport().conletResource(
type(), "VmConlet-functions.js")))); type(), "VmMgmt-functions.js"))));
} }
@Override @Override
@ -133,7 +133,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
boolean sendVmInfos = false; boolean sendVmInfos = false;
if (event.renderAs().contains(RenderMode.Preview)) { if (event.renderAs().contains(RenderMode.Preview)) {
Template tpl Template tpl
= freemarkerConfig().getTemplate("VmConlet-preview.ftl.html"); = freemarkerConfig().getTemplate("VmMgmt-preview.ftl.html");
channel.respond(new RenderConlet(type(), conletId, channel.respond(new RenderConlet(type(), conletId,
processTemplate(event, tpl, processTemplate(event, tpl,
fmModel(event, channel, conletId, conletState))) fmModel(event, channel, conletId, conletState)))
@ -150,7 +150,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
} }
if (event.renderAs().contains(RenderMode.View)) { if (event.renderAs().contains(RenderMode.View)) {
Template tpl Template tpl
= freemarkerConfig().getTemplate("VmConlet-view.ftl.html"); = freemarkerConfig().getTemplate("VmMgmt-view.ftl.html");
channel.respond(new RenderConlet(type(), conletId, channel.respond(new RenderConlet(type(), conletId,
processTemplate(event, tpl, processTemplate(event, tpl,
fmModel(event, channel, conletId, conletState))) fmModel(event, channel, conletId, conletState)))

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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.Map;
import java.util.Optional; import java.util.Optional;
@ -25,9 +25,9 @@ import org.jgrapes.core.ComponentType;
import org.jgrapes.webconsole.base.ConletComponentFactory; 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) * (non-Javadoc)
@ -36,7 +36,7 @@ public class VmConletFactory implements ConletComponentFactory {
*/ */
@Override @Override
public Class<? extends ComponentType> componentType() { public Class<? extends ComponentType> componentType() {
return VmConlet.class; return VmMgmt.class;
} }
/* /*
@ -48,7 +48,7 @@ public class VmConletFactory implements ConletComponentFactory {
@Override @Override
public Optional<ComponentType> create(Channel componentChannel, public Optional<ComponentType> create(Channel componentChannel,
Map<?, ?> properties) { Map<?, ?> properties) {
return Optional.of(new VmConlet(componentChannel)); return Optional.of(new VmMgmt(componentChannel));
} }
} }

View file

@ -27,19 +27,19 @@ import { formatMemory, parseMemory } from "./MemorySize";
import CpuRamChart from "./CpuRamChart"; import CpuRamChart from "./CpuRamChart";
import ConditionlInputController from "./ConditionalInputController"; import ConditionlInputController from "./ConditionalInputController";
import "./VmConlet-style.scss"; import "./VmMgmt-style.scss";
// For global access // For global access
declare global { declare global {
interface Window { interface Window {
orgJDrupesVmOperatorVmConlet: { orgJDrupesVmOperatorVmMgmt: {
initPreview?: (previewDom: HTMLElement, isUpdate: boolean) => void, initPreview?: (previewDom: HTMLElement, isUpdate: boolean) => void,
initView?: (viewDom: HTMLElement, isUpdate: boolean) => void initView?: (viewDom: HTMLElement, isUpdate: boolean) => void
} }
} }
} }
window.orgJDrupesVmOperatorVmConlet = {}; window.orgJDrupesVmOperatorVmMgmt = {};
const vmInfos = reactive(new Map()); const vmInfos = reactive(new Map());
const vmSummary = reactive({ const vmSummary = reactive({
@ -64,7 +64,7 @@ const shortDateTime = (time: Date) => {
const chartData = new TimeSeries(2); const chartData = new TimeSeries(2);
const chartDateUpdate = ref<Date>(null); const chartDateUpdate = ref<Date>(null);
window.orgJDrupesVmOperatorVmConlet.initPreview = (previewDom: HTMLElement, window.orgJDrupesVmOperatorVmMgmt.initPreview = (previewDom: HTMLElement,
_isUpdate: boolean) => { _isUpdate: boolean) => {
const app = createApp({ const app = createApp({
setup(_props: object) { setup(_props: object) {
@ -98,7 +98,7 @@ window.orgJDrupesVmOperatorVmConlet.initPreview = (previewDom: HTMLElement,
app.mount(previewDom); app.mount(previewDom);
}; };
window.orgJDrupesVmOperatorVmConlet.initView = (viewDom: HTMLElement, window.orgJDrupesVmOperatorVmMgmt.initView = (viewDom: HTMLElement,
_isUpdate: boolean) => { _isUpdate: boolean) => {
const app = createApp({ const app = createApp({
setup(_props: object) { setup(_props: object) {
@ -174,7 +174,7 @@ window.orgJDrupesVmOperatorVmConlet.initView = (viewDom: HTMLElement,
app.mount(viewDom); 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any
"updateVm", function(_conletId: string, vmDefinition: any) { "updateVm", function(_conletId: string, vmDefinition: any) {
// Add some short-cuts for table controller // Add some short-cuts for table controller
@ -194,12 +194,12 @@ JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
vmInfos.set(vmDefinition.name, vmDefinition); 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) { "removeVm", function(_conletId: string, vmName: string) {
vmInfos.delete(vmName); 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any
"summarySeries", function(_conletId: string, series: any[]) { "summarySeries", function(_conletId: string, series: any[]) {
chartData.clear(); chartData.clear();
@ -210,7 +210,7 @@ JGConsole.registerConletFunction("org.jdrupes.vmoperator.vmconlet.VmConlet",
chartDateUpdate.value = new Date(); 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any
"updateSummary", function(_conletId: string, summary: any) { "updateSummary", function(_conletId: string, summary: any) {
chartData.push(new Date(), summary.usedCpus, Number(summary.usedRam)); chartData.push(new Date(), summary.usedCpus, Number(summary.usedRam));

View file

@ -20,7 +20,7 @@
* Conlet specific styles. * Conlet specific styles.
*/ */
.jdrupes-vmoperator-vmconlet-preview { .jdrupes-vmoperator-vmmgmt-preview {
form { form {
float: right; float: right;
padding: 0.15em 0.3em; padding: 0.15em 0.3em;
@ -37,7 +37,7 @@
} }
} }
.jdrupes-vmoperator-vmconlet-view-search { .jdrupes-vmoperator-vmmgmt-view-search {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
@ -46,7 +46,7 @@
} }
} }
.jdrupes-vmoperator-vmconlet-view-table { .jdrupes-vmoperator-vmmgmt-view-table {
td { td {
vertical-align: top; vertical-align: top;
@ -94,7 +94,7 @@
} }
} }
.jdrupes-vmoperator-vmconlet-view-action-list { .jdrupes-vmoperator-vmmgmt-view-action-list {
white-space: nowrap; white-space: nowrap;
[role=button] { [role=button] {

View file

@ -16,4 +16,4 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package org.jdrupes.vmoperator.vmconlet; package org.jdrupes.vmoperator.vmmgmt;

View file

@ -14,7 +14,7 @@
"aash-plugin": ["./build/unpacked/org/jgrapes/webconsole/provider/jgwcvuecomponents/aash-vue-components/lib/AashPlugin"], "aash-plugin": ["./build/unpacked/org/jgrapes/webconsole/provider/jgwcvuecomponents/aash-vue-components/lib/AashPlugin"],
"jgconsole": ["./build/unpacked/org/jgrapes/webconsole/base/JGConsole"], "jgconsole": ["./build/unpacked/org/jgrapes/webconsole/base/JGConsole"],
"jgwc": ["./build/unpacked/org/jgrapes/webconsole/provider/jgwcvuecomponents/jgwc-vue-components/jgwc-components"], "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"], "vue": ["./build/unpacked/org/jgrapes/webconsole/provider/vue/vue/vue"],
"chartjs": ["./build/unpacked/org/jgrapes/webconsole/provider/chartjs/chart.js/auto/auto"] "chartjs": ["./build/unpacked/org/jgrapes/webconsole/provider/chartjs/chart.js/auto/auto"]
} }

View file

@ -13,7 +13,7 @@ rootProject.name = 'VM-Operator'
include 'org.jdrupes.vmoperator.manager' include 'org.jdrupes.vmoperator.manager'
include 'org.jdrupes.vmoperator.manager.events' include 'org.jdrupes.vmoperator.manager.events'
include 'org.jdrupes.vmoperator.vmaccess' 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.runner.qemu'
include 'org.jdrupes.vmoperator.common' include 'org.jdrupes.vmoperator.common'
include 'org.jdrupes.vmoperator.util' include 'org.jdrupes.vmoperator.util'