|
@@ -23,7 +23,7 @@ const app = Vue.createApp({
|
|
name: "",
|
|
name: "",
|
|
lineage: "",
|
|
lineage: "",
|
|
summary: "",
|
|
summary: "",
|
|
- config: "",
|
|
|
|
|
|
+ config: {},
|
|
creator: {
|
|
creator: {
|
|
name: "",
|
|
name: "",
|
|
url: "",
|
|
url: "",
|
|
@@ -105,7 +105,7 @@ const app = Vue.createApp({
|
|
name: "",
|
|
name: "",
|
|
icon: "",
|
|
icon: "",
|
|
summary: "",
|
|
summary: "",
|
|
- config: "",
|
|
|
|
|
|
+ config: {},
|
|
type: "",
|
|
type: "",
|
|
modules: []
|
|
modules: []
|
|
},
|
|
},
|
|
@@ -258,12 +258,18 @@ const app = Vue.createApp({
|
|
*/
|
|
*/
|
|
cloneModule(sourceModule,includeSubmodules) {
|
|
cloneModule(sourceModule,includeSubmodules) {
|
|
let output = {
|
|
let output = {
|
|
- ...this.moduleTemplate,
|
|
|
|
- ...sourceModule,
|
|
|
|
|
|
+ ...this.moduleTemplate,
|
|
|
|
+ ...sourceModule,
|
|
//TODO: implement lineage pattern, same as the rule does
|
|
//TODO: implement lineage pattern, same as the rule does
|
|
source: sourceModule, // keep track of where this module came from
|
|
source: sourceModule, // keep track of where this module came from
|
|
};
|
|
};
|
|
if (!includeSubmodules) output.modules = [];
|
|
if (!includeSubmodules) output.modules = [];
|
|
|
|
+ // clear configs
|
|
|
|
+ document.getElementById("newConfigKey").value =
|
|
|
|
+ "Configuration";
|
|
|
|
+ document.getElementById("newConfigValue").value =
|
|
|
|
+ "Value";
|
|
|
|
+ output.config = {};
|
|
// delete unnecessary properties
|
|
// delete unnecessary properties
|
|
delete output.content;
|
|
delete output.content;
|
|
delete output.readonly;
|
|
delete output.readonly;
|
|
@@ -581,7 +587,30 @@ const app = Vue.createApp({
|
|
this.addCustomModule(this.editor.module);
|
|
this.addCustomModule(this.editor.module);
|
|
this.setEditorPreviousState(this.editor.module);
|
|
this.setEditorPreviousState(this.editor.module);
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // config methods =========================================================
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Add custom config entry to the module
|
|
|
|
+ */
|
|
|
|
+ addConfig() {
|
|
|
|
+ const k = document.getElementById("newConfigKey").value;
|
|
|
|
+ const v = document.getElementById("newConfigValue").value;
|
|
|
|
+ this.editor.module.config[k] = v;
|
|
|
|
+ document.getElementById("newConfigKey").value =
|
|
|
|
+ "Configuration";
|
|
|
|
+ document.getElementById("newConfigValue").value =
|
|
|
|
+ "Value";
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Removes the config entry from the module
|
|
|
|
+ */
|
|
|
|
+ removeConfig(key) {
|
|
|
|
+ delete this.editor.module.config[key];
|
|
|
|
+ },
|
|
|
|
+
|
|
// custom module methods ==================================================
|
|
// custom module methods ==================================================
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -932,6 +961,11 @@ app.component('moduleList', {
|
|
template: `
|
|
template: `
|
|
<li class="module-list-item">
|
|
<li class="module-list-item">
|
|
<span class="module__icon" v-if="!hideIcon"><img :src="icon"> </span><strong>[[module.name]]</strong>: [[module.summary]]
|
|
<span class="module__icon" v-if="!hideIcon"><img :src="icon"> </span><strong>[[module.name]]</strong>: [[module.summary]]
|
|
|
|
+<span class="module__config">
|
|
|
|
+ <span v-for="(value, key) in module.config">
|
|
|
|
+ <br />[[key]]: [[value]]
|
|
|
|
+ </span>
|
|
|
|
+</span>
|
|
<ul class="submodules" v-if="module.modules && module.modules.length">
|
|
<ul class="submodules" v-if="module.modules && module.modules.length">
|
|
<module-list v-for="submodule in module.modules" :module="submodule" :hide-icon="hideIcon"></module-list>
|
|
<module-list v-for="submodule in module.modules" :module="submodule" :hide-icon="hideIcon"></module-list>
|
|
</ul>
|
|
</ul>
|