Rename conlet.
This commit is contained in:
parent
4ceaaa9fa2
commit
e839f7b3b2
34 changed files with 42 additions and 42 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
org.jdrupes.vmoperator.vmconlet.VmConletFactory
|
||||
|
|
@ -0,0 +1 @@
|
|||
org.jdrupes.vmoperator.vmmgmt.VmMgmtFactory
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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"
|
||||
|
|
@ -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')"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
conletName = VM Infos
|
||||
conletName = VM Management
|
||||
|
||||
VMsSummary = VMs (running/total)
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
conletName = VM-Informationen
|
||||
conletName = VM-Management
|
||||
|
||||
VMsSummary = VMs (gestartet/gesamt)
|
||||
|
||||
|
|
@ -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";
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
@ -61,11 +61,11 @@ import org.jgrapes.webconsole.base.events.SetLocale;
|
|||
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);
|
||||
|
|
@ -88,7 +88,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
|
|||
* sends the event to
|
||||
*/
|
||||
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
|
||||
public VmConlet(Channel componentChannel) {
|
||||
public VmMgmt(Channel componentChannel) {
|
||||
super(componentChannel);
|
||||
setPeriodicRefresh(Duration.ofMinutes(1), () -> new Update());
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
|
|||
.addRenderMode(RenderMode.Preview)
|
||||
.addScript(new ScriptResource().setScriptType("module")
|
||||
.setScriptUri(event.renderSupport().conletResource(
|
||||
type(), "VmConlet-functions.js"))));
|
||||
type(), "VmMgmt-functions.js"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -133,7 +133,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
|
|||
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)))
|
||||
|
|
@ -150,7 +150,7 @@ public class VmConlet extends FreeMarkerConlet<VmConlet.VmsModel> {
|
|||
}
|
||||
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)))
|
||||
|
|
@ -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;
|
||||
|
|
@ -25,9 +25,9 @@ import org.jgrapes.core.ComponentType;
|
|||
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)
|
||||
|
|
@ -36,7 +36,7 @@ public class VmConletFactory implements ConletComponentFactory {
|
|||
*/
|
||||
@Override
|
||||
public Class<? extends ComponentType> componentType() {
|
||||
return VmConlet.class;
|
||||
return VmMgmt.class;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -48,7 +48,7 @@ public class VmConletFactory implements ConletComponentFactory {
|
|||
@Override
|
||||
public Optional<ComponentType> create(Channel componentChannel,
|
||||
Map<?, ?> properties) {
|
||||
return Optional.of(new VmConlet(componentChannel));
|
||||
return Optional.of(new VmMgmt(componentChannel));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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({
|
||||
|
|
@ -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) {
|
||||
|
|
@ -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) {
|
||||
|
|
@ -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
|
||||
|
|
@ -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();
|
||||
|
|
@ -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));
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
* Conlet specific styles.
|
||||
*/
|
||||
|
||||
.jdrupes-vmoperator-vmconlet-preview {
|
||||
.jdrupes-vmoperator-vmmgmt-preview {
|
||||
form {
|
||||
float: right;
|
||||
padding: 0.15em 0.3em;
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.jdrupes-vmoperator-vmconlet-view-search {
|
||||
.jdrupes-vmoperator-vmmgmt-view-search {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.jdrupes-vmoperator-vmconlet-view-table {
|
||||
.jdrupes-vmoperator-vmmgmt-view-table {
|
||||
td {
|
||||
vertical-align: top;
|
||||
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.jdrupes-vmoperator-vmconlet-view-action-list {
|
||||
.jdrupes-vmoperator-vmmgmt-view-action-list {
|
||||
white-space: nowrap;
|
||||
|
||||
[role=button] {
|
||||
|
|
@ -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;
|
||||
|
|
@ -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"]
|
||||
}
|
||||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue