mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
add css form VC
This commit is contained in:
parent
cd5fd4782c
commit
8258e1f446
@ -561,10 +561,18 @@ function createVisualConsole(
|
|||||||
var id = props.id;
|
var id = props.id;
|
||||||
var data = e.data;
|
var data = e.data;
|
||||||
|
|
||||||
// Content tiny.
|
if (
|
||||||
var content = tinymce.get("tinyMCE_editor").getContent();
|
props.type != 20 &&
|
||||||
// Pass the content.
|
props.type != 3 &&
|
||||||
data.label = content;
|
props.type != 9 &&
|
||||||
|
props.type != 15 &&
|
||||||
|
props.type != 16
|
||||||
|
) {
|
||||||
|
// Content tiny.
|
||||||
|
var content = tinymce.get("tinyMCE_editor").getContent();
|
||||||
|
// Pass content to array data.
|
||||||
|
data.label = content;
|
||||||
|
}
|
||||||
|
|
||||||
var taskId = "visual-console-item-update-" + id;
|
var taskId = "visual-console-item-update-" + id;
|
||||||
|
|
||||||
@ -636,10 +644,10 @@ function createVisualConsole(
|
|||||||
$formElement.dialog({
|
$formElement.dialog({
|
||||||
title: formContainer.title,
|
title: formContainer.title,
|
||||||
modal: true,
|
modal: true,
|
||||||
resizable: true,
|
resizable: false,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
height: 300,
|
height: 600,
|
||||||
width: 500,
|
width: 700,
|
||||||
open: function() {
|
open: function() {
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
selector: "#tinyMCE_editor",
|
selector: "#tinyMCE_editor",
|
||||||
@ -672,9 +680,7 @@ function createVisualConsole(
|
|||||||
"bold,italic, |, justifyleft, justifycenter, justifyright, |, undo, redo, |, image, link, |, fontselect, forecolor, fontsizeselect, |,code",
|
"bold,italic, |, justifyleft, justifycenter, justifyright, |, undo, redo, |, image, link, |, fontselect, forecolor, fontsizeselect, |,code",
|
||||||
theme_advanced_buttons2: "",
|
theme_advanced_buttons2: "",
|
||||||
theme_advanced_buttons3: "",
|
theme_advanced_buttons3: "",
|
||||||
theme_advanced_statusbar_location: "none",
|
theme_advanced_statusbar_location: "none"
|
||||||
width: "400",
|
|
||||||
height: "200"
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
beforeClose: function() {
|
beforeClose: function() {
|
||||||
@ -687,14 +693,19 @@ function createVisualConsole(
|
|||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: "Cancel",
|
text: "Cancel",
|
||||||
|
class:
|
||||||
|
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel",
|
||||||
click: function() {
|
click: function() {
|
||||||
$formElement.dialog("close");
|
$formElement.dialog("close");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "Update",
|
text: "Update",
|
||||||
|
class:
|
||||||
|
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
||||||
click: function() {
|
click: function() {
|
||||||
console.log(formContainer);
|
// Trigered simulate button submit.
|
||||||
|
this.dispatchEvent(new Event("submit"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -74,31 +74,39 @@ final class ColorCloud extends Item
|
|||||||
{
|
{
|
||||||
$return = parent::encode($data);
|
$return = parent::encode($data);
|
||||||
$colorRanges = null;
|
$colorRanges = null;
|
||||||
|
|
||||||
|
$defaultColor = null;
|
||||||
|
|
||||||
|
if (isset($data['defaultColor']) === true) {
|
||||||
|
$defaultColor = static::extractDefaultColor($data);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['colorRanges']) === true) {
|
if (isset($data['colorRanges']) === true) {
|
||||||
$defaultColor = null;
|
|
||||||
if (isset($data['defaultColor']) === true) {
|
|
||||||
$defaultColor = static::extractDefaultColor($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
$colorRanges = static::encodeColorRanges($data);
|
$colorRanges = static::encodeColorRanges($data);
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($data['id']) === true) {
|
if (empty($data['id']) === true) {
|
||||||
$return['label'] = json_encode(
|
$return['label'] = json_encode(
|
||||||
[
|
[
|
||||||
'default_color' => $defaultColor,
|
'default_color' => $defaultColor,
|
||||||
'color_ranges' => $colorRanges,
|
'color_ranges' => $colorRanges,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$prevData = $this->toArray();
|
$prevData = $this->toArray();
|
||||||
|
$prevDataDefaultColor = static::extractDefaultColor(
|
||||||
|
['defaultColor' => $prevData['defaultColor']]
|
||||||
|
);
|
||||||
|
$prevDataColorRanges = static::encodeColorRanges(
|
||||||
|
['colorRanges' => $prevData['colorRanges']]
|
||||||
|
);
|
||||||
|
|
||||||
$return['label'] = json_encode(
|
$return['label'] = json_encode(
|
||||||
[
|
[
|
||||||
'default_color' => ($defaultColor !== null) ? $defaultColor : $prevData['defaultColor'],
|
'default_color' => ($defaultColor !== null) ? $defaultColor : $prevDataDefaultColor,
|
||||||
'color_ranges' => ($colorRanges !== null && (count($colorRanges) > 0)) ? $colorRanges : $prevData['colorRanges'],
|
'color_ranges' => ($colorRanges !== null && (count($colorRanges) > 0)) ? $colorRanges : $prevDataColorRanges,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -128,16 +128,6 @@
|
|||||||
background: rgb(212, 215, 218);
|
background: rgb(212, 215, 218);
|
||||||
}
|
}
|
||||||
|
|
||||||
form.visual-console-item-edition > .input-groups {
|
|
||||||
margin-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.visual-console-item-edition > input[type="submit"] {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 5px;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.show-elements {
|
.show-elements {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -146,6 +136,160 @@ form.visual-console-item-edition > input[type="submit"] {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Forms*/
|
||||||
|
.div-input-group label {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: horizontal;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12pt;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #343434;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.div-input-group label img {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group input[type="text"],
|
||||||
|
.div-input-group input[type="number"] {
|
||||||
|
height: 25px;
|
||||||
|
font-size: 10pt;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: lighter;
|
||||||
|
padding: 0px 0px 2px 0px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group input[type="radio"] {
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group select {
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: lighter;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-groups {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-ranges-input-group {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
-webkit-box-align: start;
|
||||||
|
-ms-flex-align: start;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-ranges-input-group > div {
|
||||||
|
padding-left: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group,
|
||||||
|
.div-input-group div div {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: horizontal;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group h3 {
|
||||||
|
text-transform: initial;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
font-style: italic;
|
||||||
|
text-decoration: underline;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group div div a {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group-autocomplete-agent {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
-webkit-box-align: start;
|
||||||
|
-ms-flex-align: start;
|
||||||
|
align-items: start;
|
||||||
|
-webkit-box-pack: justify;
|
||||||
|
-ms-flex-pack: justify;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group-inside {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group-link-console {
|
||||||
|
height: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-elements > div.div-input-group-autocomplete-agent {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-vc-elements {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Styles for the solid icons */
|
/* Styles for the solid icons */
|
||||||
|
|
||||||
.fa {
|
.fa {
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -219,16 +219,7 @@ export class FormContainer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
// Add buttons.
|
|
||||||
const submitBtn = document.createElement("input");
|
|
||||||
submitBtn.className = "sub upd";
|
|
||||||
submitBtn.type = "submit";
|
|
||||||
submitBtn.value = type === "creation" ? t("Create") : t("Update");
|
|
||||||
*/
|
|
||||||
|
|
||||||
form.appendChild(formContent);
|
form.appendChild(formContent);
|
||||||
//form.appendChild(submitBtn);
|
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
|
@ -102,12 +102,19 @@ export interface ItemSelectionChangedEvent {
|
|||||||
// TODO: Document
|
// TODO: Document
|
||||||
class LinkInputGroup extends InputGroup<Partial<ItemProps>> {
|
class LinkInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const linkLabel = document.createElement("label");
|
const linkLabel = document.createElement("label");
|
||||||
linkLabel.textContent = t("Link enabled");
|
linkLabel.textContent = t("Link enabled");
|
||||||
|
|
||||||
|
const linkInputLabel = document.createElement("label");
|
||||||
|
linkInputLabel.className = "p-switch";
|
||||||
|
linkInputLabel.htmlFor = "checkbox-link";
|
||||||
|
|
||||||
const linkInputChkbx = document.createElement("input");
|
const linkInputChkbx = document.createElement("input");
|
||||||
linkInputChkbx.id = "checkbox-switch";
|
linkInputChkbx.id = "checkbox-link";
|
||||||
linkInputChkbx.className = "checkbox-switch";
|
linkInputChkbx.className = "checkbox-link";
|
||||||
linkInputChkbx.type = "checkbox";
|
linkInputChkbx.type = "checkbox";
|
||||||
linkInputChkbx.name = "checkbox-enable-link";
|
linkInputChkbx.name = "checkbox-enable-link";
|
||||||
linkInputChkbx.value = "1";
|
linkInputChkbx.value = "1";
|
||||||
@ -119,26 +126,54 @@ class LinkInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const linkInputLabel = document.createElement("label");
|
const spanInputLabel = document.createElement("span");
|
||||||
linkInputLabel.className = "label-switch";
|
spanInputLabel.className = "p-slider";
|
||||||
linkInputLabel.htmlFor = "checkbox-switch";
|
|
||||||
|
|
||||||
linkLabel.appendChild(linkInputChkbx);
|
linkInputLabel.appendChild(linkInputChkbx);
|
||||||
linkLabel.appendChild(linkInputLabel);
|
linkInputLabel.appendChild(spanInputLabel);
|
||||||
|
|
||||||
return linkLabel;
|
generalDiv.appendChild(linkLabel);
|
||||||
|
generalDiv.appendChild(linkInputLabel);
|
||||||
|
|
||||||
|
return generalDiv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Document
|
||||||
|
class AdvancedOptionsInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
|
const h3 = document.createElement("h3");
|
||||||
|
h3.textContent = t("Advanced Options");
|
||||||
|
|
||||||
|
generalDiv.appendChild(h3);
|
||||||
|
|
||||||
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class OnTopInputGroup extends InputGroup<Partial<ItemProps>> {
|
class OnTopInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const onTopLabel = document.createElement("label");
|
const onTopLabel = document.createElement("label");
|
||||||
onTopLabel.textContent = t("Show on top");
|
onTopLabel.textContent = t("Show on top");
|
||||||
|
|
||||||
|
onTopLabel.appendChild(
|
||||||
|
helpTip(
|
||||||
|
t(
|
||||||
|
"It allows the element to be superimposed to the rest of items of the visual console"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const onTopInputChkbx = document.createElement("input");
|
const onTopInputChkbx = document.createElement("input");
|
||||||
onTopInputChkbx.id = "checkbox-switch";
|
onTopInputChkbx.id = "checkbox-on-top";
|
||||||
onTopInputChkbx.className = "checkbox-switch";
|
onTopInputChkbx.className = "checkbox-on-top";
|
||||||
onTopInputChkbx.type = "checkbox";
|
onTopInputChkbx.type = "checkbox";
|
||||||
onTopInputChkbx.name = "checkbox-show-on-top";
|
onTopInputChkbx.name = "checkbox-show-on-top";
|
||||||
onTopInputChkbx.value = "1";
|
onTopInputChkbx.value = "1";
|
||||||
@ -151,26 +186,27 @@ class OnTopInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onTopInputLabel = document.createElement("label");
|
const onTopInputLabel = document.createElement("label");
|
||||||
onTopInputLabel.className = "label-switch";
|
onTopInputLabel.className = "p-switch";
|
||||||
onTopInputLabel.htmlFor = "checkbox-switch";
|
onTopInputLabel.htmlFor = "checkbox-on-top";
|
||||||
|
|
||||||
onTopLabel.appendChild(
|
const spanInputLabel = document.createElement("span");
|
||||||
helpTip(
|
spanInputLabel.className = "p-slider";
|
||||||
t(
|
|
||||||
"It allows the element to be superimposed to the rest of items of the visual console"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
onTopLabel.appendChild(onTopInputChkbx);
|
|
||||||
onTopLabel.appendChild(onTopInputLabel);
|
|
||||||
|
|
||||||
return onTopLabel;
|
onTopInputLabel.appendChild(onTopInputChkbx);
|
||||||
|
onTopInputLabel.appendChild(spanInputLabel);
|
||||||
|
|
||||||
|
generalDiv.appendChild(onTopLabel);
|
||||||
|
generalDiv.appendChild(onTopInputLabel);
|
||||||
|
|
||||||
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class PositionInputGroup extends InputGroup<Partial<ItemProps>> {
|
class PositionInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
const positionLabel = document.createElement("label");
|
const positionLabel = document.createElement("label");
|
||||||
positionLabel.textContent = t("Position");
|
positionLabel.textContent = t("Position");
|
||||||
|
|
||||||
@ -196,16 +232,19 @@ class PositionInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
positionLabel.appendChild(positionInputX);
|
generalDiv.appendChild(positionLabel);
|
||||||
positionLabel.appendChild(positionInputY);
|
generalDiv.appendChild(positionInputX);
|
||||||
|
generalDiv.appendChild(positionInputY);
|
||||||
|
|
||||||
return positionLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class SizeInputGroup extends InputGroup<Partial<ItemProps>> {
|
class SizeInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
const sizeLabel = document.createElement("label");
|
const sizeLabel = document.createElement("label");
|
||||||
sizeLabel.textContent = t("Size");
|
sizeLabel.textContent = t("Size");
|
||||||
|
|
||||||
@ -242,16 +281,20 @@ class SizeInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
sizeLabel.appendChild(sizeInputWidth);
|
|
||||||
sizeLabel.appendChild(sizeInputHeight);
|
|
||||||
|
|
||||||
return sizeLabel;
|
generalDiv.appendChild(sizeLabel);
|
||||||
|
generalDiv.appendChild(sizeInputWidth);
|
||||||
|
generalDiv.appendChild(sizeInputHeight);
|
||||||
|
|
||||||
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class LabelInputGroup extends InputGroup<Partial<ItemProps>> {
|
class LabelInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
const label = document.createElement("label");
|
const label = document.createElement("label");
|
||||||
label.textContent = t("Label");
|
label.textContent = t("Label");
|
||||||
|
|
||||||
@ -265,9 +308,10 @@ class LabelInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
this.initialData.label ||
|
this.initialData.label ||
|
||||||
""}`;
|
""}`;
|
||||||
|
|
||||||
label.appendChild(labelInput);
|
generalDiv.appendChild(label);
|
||||||
|
generalDiv.appendChild(labelInput);
|
||||||
|
|
||||||
return label;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,6 +322,9 @@ class LabelInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
*/
|
*/
|
||||||
class ParentInputGroup extends InputGroup<Partial<ItemProps>> {
|
class ParentInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const parentLabel = document.createElement("label");
|
const parentLabel = document.createElement("label");
|
||||||
parentLabel.textContent = t("Parent");
|
parentLabel.textContent = t("Parent");
|
||||||
|
|
||||||
@ -310,9 +357,10 @@ class ParentInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
0}`;
|
0}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
parentLabel.appendChild(parentSelect);
|
generalDiv.appendChild(parentLabel);
|
||||||
|
generalDiv.appendChild(parentSelect);
|
||||||
|
|
||||||
return parentLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,9 +371,14 @@ class ParentInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
*/
|
*/
|
||||||
class AclGroupInputGroup extends InputGroup<Partial<ItemProps>> {
|
class AclGroupInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const aclGroupLabel = document.createElement("label");
|
const aclGroupLabel = document.createElement("label");
|
||||||
aclGroupLabel.textContent = t("Restrict access to group");
|
aclGroupLabel.textContent = t("Restrict access to group");
|
||||||
|
|
||||||
|
generalDiv.appendChild(aclGroupLabel);
|
||||||
|
|
||||||
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
||||||
size: "small",
|
size: "small",
|
||||||
spin: true
|
spin: true
|
||||||
@ -369,20 +422,25 @@ class AclGroupInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
this.initialData.aclGroupId ||
|
this.initialData.aclGroupId ||
|
||||||
0}`;
|
0}`;
|
||||||
|
|
||||||
aclGroupLabel.appendChild(aclGroupSelect);
|
generalDiv.appendChild(aclGroupSelect);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return aclGroupLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class CacheExpirationInputGroup extends InputGroup<Partial<ItemProps>> {
|
class CacheExpirationInputGroup extends InputGroup<Partial<ItemProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const periodLabel = document.createElement("label");
|
const periodLabel = document.createElement("label");
|
||||||
periodLabel.textContent = t("Cache expiration");
|
periodLabel.textContent = t("Cache expiration");
|
||||||
|
|
||||||
|
generalDiv.appendChild(periodLabel);
|
||||||
|
|
||||||
const periodControl = periodSelector(
|
const periodControl = periodSelector(
|
||||||
this.currentData.cacheExpiration || this.initialData.cacheExpiration || 0,
|
this.currentData.cacheExpiration || this.initialData.cacheExpiration || 0,
|
||||||
{ text: t("No cache"), value: 0 },
|
{ text: t("No cache"), value: 0 },
|
||||||
@ -398,9 +456,9 @@ class CacheExpirationInputGroup extends InputGroup<Partial<ItemProps>> {
|
|||||||
value => this.updateData({ cacheExpiration: value })
|
value => this.updateData({ cacheExpiration: value })
|
||||||
);
|
);
|
||||||
|
|
||||||
periodLabel.appendChild(periodControl);
|
generalDiv.appendChild(periodControl);
|
||||||
|
|
||||||
return periodLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,7 +473,9 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
// Create div container.
|
// Create div container.
|
||||||
const container = document.createElement("div");
|
const container = document.createElement("div");
|
||||||
|
container.className = "div-input-group ";
|
||||||
const lvcTypeContainer = document.createElement("div");
|
const lvcTypeContainer = document.createElement("div");
|
||||||
|
lvcTypeContainer.className = "div-input-group-inside";
|
||||||
|
|
||||||
// Create Principal element label - select.
|
// Create Principal element label - select.
|
||||||
const linkConsoleLabel = document.createElement("label");
|
const linkConsoleLabel = document.createElement("label");
|
||||||
@ -527,12 +587,12 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add principal select to label.
|
|
||||||
linkConsoleLabel.appendChild(linkConsoleSelect);
|
|
||||||
|
|
||||||
// Add weight warning field.
|
// Add weight warning field.
|
||||||
container.appendChild(linkConsoleLabel);
|
container.appendChild(linkConsoleLabel);
|
||||||
|
|
||||||
|
// Add principal select to label.
|
||||||
|
container.appendChild(linkConsoleSelect);
|
||||||
|
|
||||||
// Add containerType to container.
|
// Add containerType to container.
|
||||||
lvcTypeContainer.appendChild(
|
lvcTypeContainer.appendChild(
|
||||||
this.getLinkedVisualConsoleTypeSelector(
|
this.getLinkedVisualConsoleTypeSelector(
|
||||||
@ -542,8 +602,8 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
container.appendChild(lvcTypeContainer);
|
container.appendChild(lvcTypeContainer);
|
||||||
} else {
|
} else {
|
||||||
// Add principal select to label.
|
// Add principal select to label.
|
||||||
linkConsoleLabel.appendChild(linkConsoleSelect);
|
|
||||||
container.appendChild(linkConsoleLabel);
|
container.appendChild(linkConsoleLabel);
|
||||||
|
container.appendChild(linkConsoleSelect);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -599,12 +659,12 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
|
|
||||||
typeLinkConsoleSelect.value = value;
|
typeLinkConsoleSelect.value = value;
|
||||||
|
|
||||||
// Add select type link.
|
|
||||||
typeLinkConsoleLabel.appendChild(typeLinkConsoleSelect);
|
|
||||||
|
|
||||||
// Add type link.
|
// Add type link.
|
||||||
containerType.appendChild(typeLinkConsoleLabel);
|
containerType.appendChild(typeLinkConsoleLabel);
|
||||||
|
|
||||||
|
// Add select type link.
|
||||||
|
containerType.appendChild(typeLinkConsoleSelect);
|
||||||
|
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "weight":
|
case "weight":
|
||||||
// Add Chil container with weight.
|
// Add Chil container with weight.
|
||||||
@ -709,12 +769,11 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add input weight.
|
|
||||||
weightLabel.appendChild(weightInput);
|
|
||||||
|
|
||||||
// Add label weight.
|
// Add label weight.
|
||||||
containerChildType.appendChild(weightLabel);
|
containerChildType.appendChild(weightLabel);
|
||||||
|
|
||||||
|
// Add input weight.
|
||||||
|
containerChildType.appendChild(weightInput);
|
||||||
return containerChildType;
|
return containerChildType;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -796,18 +855,18 @@ export class LinkConsoleInputGroup extends InputGroup<
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add input weight warning.
|
|
||||||
warningWeightLabel.appendChild(warningWeightInput);
|
|
||||||
|
|
||||||
// Add label warning field.
|
// Add label warning field.
|
||||||
containerChildType.appendChild(warningWeightLabel);
|
containerChildType.appendChild(warningWeightLabel);
|
||||||
|
|
||||||
// Add input crital weight.
|
// Add input weight warning.
|
||||||
criticalWeightLabel.appendChild(criticalWeightInput);
|
containerChildType.appendChild(warningWeightInput);
|
||||||
|
|
||||||
// Add label weight critical.
|
// Add label weight critical.
|
||||||
containerChildType.appendChild(criticalWeightLabel);
|
containerChildType.appendChild(criticalWeightLabel);
|
||||||
|
|
||||||
|
// Add input crital weight.
|
||||||
|
containerChildType.appendChild(criticalWeightInput);
|
||||||
|
|
||||||
return containerChildType;
|
return containerChildType;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -829,10 +888,15 @@ export class ImageInputGroup extends InputGroup<
|
|||||||
}
|
}
|
||||||
> {
|
> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const imageKey = this.initialData.imageKey;
|
const imageKey = this.initialData.imageKey;
|
||||||
const imageLabel = document.createElement("label");
|
const imageLabel = document.createElement("label");
|
||||||
imageLabel.textContent = t("Image");
|
imageLabel.textContent = t("Image");
|
||||||
|
|
||||||
|
generalDiv.appendChild(imageLabel);
|
||||||
|
|
||||||
const divImage = document.createElement("div");
|
const divImage = document.createElement("div");
|
||||||
|
|
||||||
// Create element Spinner.
|
// Create element Spinner.
|
||||||
@ -840,7 +904,7 @@ export class ImageInputGroup extends InputGroup<
|
|||||||
size: "small",
|
size: "small",
|
||||||
spin: true
|
spin: true
|
||||||
});
|
});
|
||||||
imageLabel.appendChild(spinner);
|
generalDiv.appendChild(spinner);
|
||||||
|
|
||||||
// Init request
|
// Init request
|
||||||
this.requestData("image-console", {}, (error, data) => {
|
this.requestData("image-console", {}, (error, data) => {
|
||||||
@ -850,7 +914,7 @@ export class ImageInputGroup extends InputGroup<
|
|||||||
// Check errors.
|
// Check errors.
|
||||||
if (error) {
|
if (error) {
|
||||||
// Add img error.
|
// Add img error.
|
||||||
imageLabel.appendChild(
|
generalDiv.appendChild(
|
||||||
fontAwesomeIcon(faExclamationCircle, t("Error"), {
|
fontAwesomeIcon(faExclamationCircle, t("Error"), {
|
||||||
size: "small",
|
size: "small",
|
||||||
color: "#e63c52"
|
color: "#e63c52"
|
||||||
@ -885,16 +949,16 @@ export class ImageInputGroup extends InputGroup<
|
|||||||
|
|
||||||
labelSelect.value = valueImage;
|
labelSelect.value = valueImage;
|
||||||
|
|
||||||
imageLabel.appendChild(labelSelect);
|
generalDiv.appendChild(labelSelect);
|
||||||
|
|
||||||
if (valueImage != null) {
|
if (valueImage != null) {
|
||||||
const imageItem = data.find(item => item.name === valueImage);
|
const imageItem = data.find(item => item.name === valueImage);
|
||||||
imageLabel.appendChild(this.getImage(imageItem, divImage));
|
generalDiv.appendChild(this.getImage(imageItem, divImage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return imageLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getImage(
|
private getImage(
|
||||||
@ -952,9 +1016,17 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
Partial<ItemProps & WithModuleProps>
|
Partial<ItemProps & WithModuleProps>
|
||||||
> {
|
> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDivAutocomplete = document.createElement("div");
|
||||||
|
generalDivAutocomplete.className = "div-input-group-autocomplete-agent";
|
||||||
|
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const agentLabel = document.createElement("label");
|
const agentLabel = document.createElement("label");
|
||||||
agentLabel.textContent = t("Agent");
|
agentLabel.textContent = t("Agent");
|
||||||
|
|
||||||
|
generalDiv.appendChild(agentLabel);
|
||||||
|
|
||||||
const agentInput = document.createElement("input");
|
const agentInput = document.createElement("input");
|
||||||
agentInput.type = "text";
|
agentInput.type = "text";
|
||||||
agentInput.required = true;
|
agentInput.required = true;
|
||||||
@ -1026,7 +1098,7 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
? `${item.agentAlias} - ${item.agentAddress}`
|
? `${item.agentAlias} - ${item.agentAddress}`
|
||||||
: item.agentAlias;
|
: item.agentAlias;
|
||||||
|
|
||||||
agentLabel.appendChild(this.agentModuleInput(item));
|
generalDivAutocomplete.appendChild(this.agentModuleInput(item));
|
||||||
|
|
||||||
return `${selectedItem || ""}`;
|
return `${selectedItem || ""}`;
|
||||||
};
|
};
|
||||||
@ -1035,7 +1107,7 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
? `${this.initialData.agentAlias} - ${this.initialData.agentAddress}`
|
? `${this.initialData.agentAlias} - ${this.initialData.agentAddress}`
|
||||||
: this.initialData.agentAlias;
|
: this.initialData.agentAlias;
|
||||||
|
|
||||||
agentLabel.appendChild(
|
generalDiv.appendChild(
|
||||||
autocompleteInput(
|
autocompleteInput(
|
||||||
notEmptyStringOr(initialAutocompleteInput, null),
|
notEmptyStringOr(initialAutocompleteInput, null),
|
||||||
handleDataRequested,
|
handleDataRequested,
|
||||||
@ -1044,9 +1116,11 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
generalDivAutocomplete.appendChild(generalDiv);
|
||||||
|
|
||||||
const initialAgentId = parseIntOr(this.initialData.agentId, null);
|
const initialAgentId = parseIntOr(this.initialData.agentId, null);
|
||||||
if (initialAgentId !== null) {
|
if (initialAgentId !== null) {
|
||||||
agentLabel.appendChild(
|
generalDivAutocomplete.appendChild(
|
||||||
this.agentModuleInput({
|
this.agentModuleInput({
|
||||||
agentId: initialAgentId,
|
agentId: initialAgentId,
|
||||||
agentName: notEmptyStringOr(this.initialData.agentName, null),
|
agentName: notEmptyStringOr(this.initialData.agentName, null),
|
||||||
@ -1062,7 +1136,7 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return agentLabel;
|
return generalDivAutocomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
private agentModuleInput(item: AgentAutocompleteData): HTMLElement {
|
private agentModuleInput(item: AgentAutocompleteData): HTMLElement {
|
||||||
@ -1074,10 +1148,15 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
deleteAgentModuleItem.remove();
|
deleteAgentModuleItem.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.id = "select-autocomplete-agent-module";
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const agentModuleLabel = document.createElement("label");
|
const agentModuleLabel = document.createElement("label");
|
||||||
agentModuleLabel.id = "select-autocomplete-agent-module";
|
|
||||||
agentModuleLabel.textContent = t("Module");
|
agentModuleLabel.textContent = t("Module");
|
||||||
|
|
||||||
|
generalDiv.appendChild(agentModuleLabel);
|
||||||
|
|
||||||
// Create element Spinner.
|
// Create element Spinner.
|
||||||
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
||||||
size: "small",
|
size: "small",
|
||||||
@ -1122,11 +1201,11 @@ export class AgentModuleInputGroup extends InputGroup<
|
|||||||
this.initialData.moduleId ||
|
this.initialData.moduleId ||
|
||||||
0}`;
|
0}`;
|
||||||
|
|
||||||
agentModuleLabel.appendChild(agentModuleSelect);
|
generalDiv.appendChild(agentModuleSelect);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return agentModuleLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2178,21 +2257,23 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||||||
return new FormContainer(
|
return new FormContainer(
|
||||||
this.titleItem(this.props.type),
|
this.titleItem(this.props.type),
|
||||||
[
|
[
|
||||||
new LabelInputGroup("label", this.props),
|
|
||||||
new PositionInputGroup("position", this.props),
|
|
||||||
new SizeInputGroup("size", this.props),
|
new SizeInputGroup("size", this.props),
|
||||||
|
new LabelInputGroup("label", this.props),
|
||||||
new LinkInputGroup("link", this.props),
|
new LinkInputGroup("link", this.props),
|
||||||
new OnTopInputGroup("show-on-top", this.props),
|
new OnTopInputGroup("show-on-top", this.props),
|
||||||
|
new AdvancedOptionsInputGroup("advanced-options", this.props),
|
||||||
|
new PositionInputGroup("position", this.props),
|
||||||
new ParentInputGroup("parent", this.props),
|
new ParentInputGroup("parent", this.props),
|
||||||
new AclGroupInputGroup("acl-group", this.props),
|
new AclGroupInputGroup("acl-group", this.props),
|
||||||
new CacheExpirationInputGroup("cache-expiration", this.props)
|
new CacheExpirationInputGroup("cache-expiration", this.props)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"label",
|
|
||||||
"position",
|
|
||||||
"size",
|
"size",
|
||||||
|
"label",
|
||||||
"link",
|
"link",
|
||||||
"show-on-top",
|
"show-on-top",
|
||||||
|
"advanced-options",
|
||||||
|
"position",
|
||||||
"parent",
|
"parent",
|
||||||
"acl-group",
|
"acl-group",
|
||||||
"cache-expiration"
|
"cache-expiration"
|
||||||
@ -2207,21 +2288,23 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||||||
return new FormContainer(
|
return new FormContainer(
|
||||||
t("Item"),
|
t("Item"),
|
||||||
[
|
[
|
||||||
new LabelInputGroup("label", props),
|
|
||||||
new PositionInputGroup("position", props),
|
|
||||||
new SizeInputGroup("size", props),
|
new SizeInputGroup("size", props),
|
||||||
|
new LabelInputGroup("label", props),
|
||||||
new LinkInputGroup("link", props),
|
new LinkInputGroup("link", props),
|
||||||
new OnTopInputGroup("show-on-top", props),
|
new OnTopInputGroup("show-on-top", props),
|
||||||
|
new AdvancedOptionsInputGroup("advanced-options", props),
|
||||||
|
new PositionInputGroup("position", props),
|
||||||
new ParentInputGroup("parent", props),
|
new ParentInputGroup("parent", props),
|
||||||
new AclGroupInputGroup("acl-group", props),
|
new AclGroupInputGroup("acl-group", props),
|
||||||
new CacheExpirationInputGroup("cache-expiration", props)
|
new CacheExpirationInputGroup("cache-expiration", props)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"label",
|
|
||||||
"position",
|
|
||||||
"size",
|
"size",
|
||||||
|
"label",
|
||||||
"link",
|
"link",
|
||||||
"show-on-top",
|
"show-on-top",
|
||||||
|
"advanced-options",
|
||||||
|
"position",
|
||||||
"parent",
|
"parent",
|
||||||
"acl-group",
|
"acl-group",
|
||||||
"cache-expiration"
|
"cache-expiration"
|
||||||
|
@ -66,8 +66,13 @@ export function colorCloudPropsDecoder(
|
|||||||
*/
|
*/
|
||||||
class ColorInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
class ColorInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
const ColorLabel = document.createElement("label");
|
const generalDiv = document.createElement("div");
|
||||||
ColorLabel.textContent = t("Default color");
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
|
const colorLabel = document.createElement("label");
|
||||||
|
colorLabel.textContent = t("Default color");
|
||||||
|
|
||||||
|
generalDiv.appendChild(colorLabel);
|
||||||
|
|
||||||
const ColorInput = document.createElement("input");
|
const ColorInput = document.createElement("input");
|
||||||
ColorInput.type = "color";
|
ColorInput.type = "color";
|
||||||
@ -83,9 +88,9 @@ class ColorInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
ColorLabel.appendChild(ColorInput);
|
generalDiv.appendChild(ColorInput);
|
||||||
|
|
||||||
return ColorLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,12 +99,18 @@ type ColorRange = ColorRanges[0];
|
|||||||
|
|
||||||
class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group div-ranges-input-group";
|
||||||
|
|
||||||
const rangesLabel = this.createLabel("Ranges");
|
const rangesLabel = this.createLabel("Ranges");
|
||||||
|
|
||||||
|
generalDiv.appendChild(rangesLabel);
|
||||||
|
|
||||||
const rangesControlsContainer = document.createElement("div");
|
const rangesControlsContainer = document.createElement("div");
|
||||||
const createdRangesContainer = document.createElement("div");
|
const createdRangesContainer = document.createElement("div");
|
||||||
|
|
||||||
rangesControlsContainer.appendChild(createdRangesContainer);
|
generalDiv.appendChild(createdRangesContainer);
|
||||||
rangesLabel.appendChild(rangesControlsContainer);
|
generalDiv.appendChild(rangesControlsContainer);
|
||||||
|
|
||||||
const colorRanges =
|
const colorRanges =
|
||||||
this.currentData.colorRanges || this.initialData.colorRanges || [];
|
this.currentData.colorRanges || this.initialData.colorRanges || [];
|
||||||
@ -159,7 +170,7 @@ class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
|||||||
this.initialRangeContainer(handleCreate)
|
this.initialRangeContainer(handleCreate)
|
||||||
);
|
);
|
||||||
|
|
||||||
return rangesLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
private initialRangeContainer(onCreate: (range: ColorRange) => void) {
|
private initialRangeContainer(onCreate: (range: ColorRange) => void) {
|
||||||
@ -217,7 +228,10 @@ class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
|||||||
// Button delete.
|
// Button delete.
|
||||||
const createBtn = document.createElement("a");
|
const createBtn = document.createElement("a");
|
||||||
createBtn.appendChild(
|
createBtn.appendChild(
|
||||||
fontAwesomeIcon(faPlusCircle, t("Create color range"))
|
fontAwesomeIcon(faPlusCircle, t("Create color range"), {
|
||||||
|
size: "small",
|
||||||
|
color: "#565656"
|
||||||
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
@ -294,7 +308,12 @@ class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
|||||||
|
|
||||||
// Button delete.
|
// Button delete.
|
||||||
const deleteBtn = document.createElement("a");
|
const deleteBtn = document.createElement("a");
|
||||||
deleteBtn.appendChild(fontAwesomeIcon(faTrashAlt, t("Delete color range")));
|
deleteBtn.appendChild(
|
||||||
|
fontAwesomeIcon(faTrashAlt, t("Delete color range"), {
|
||||||
|
size: "small",
|
||||||
|
color: "#565656"
|
||||||
|
})
|
||||||
|
);
|
||||||
deleteBtn.addEventListener("click", onDelete);
|
deleteBtn.addEventListener("click", onDelete);
|
||||||
|
|
||||||
rangesContainer.appendChild(deleteBtn);
|
rangesContainer.appendChild(deleteBtn);
|
||||||
@ -409,15 +428,19 @@ export default class ColorCloud extends Item<ColorCloudProps> {
|
|||||||
*/
|
*/
|
||||||
public getFormContainer(): FormContainer {
|
public getFormContainer(): FormContainer {
|
||||||
const formContainer = super.getFormContainer();
|
const formContainer = super.getFormContainer();
|
||||||
|
formContainer.removeInputGroup("label");
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new AgentModuleInputGroup("agent-autocomplete", this.props)
|
new AgentModuleInputGroup("agent-autocomplete", this.props),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new ColorInputGroup("color-cloud", this.props),
|
||||||
|
3
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new LinkConsoleInputGroup("link-console", this.props)
|
new RangesInputGroup("ranges-cloud", this.props),
|
||||||
);
|
4
|
||||||
formContainer.addInputGroup(new ColorInputGroup("color-cloud", this.props));
|
|
||||||
formContainer.addInputGroup(
|
|
||||||
new RangesInputGroup("ranges-cloud", this.props)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return formContainer;
|
return formContainer;
|
||||||
|
@ -106,9 +106,14 @@ export function moduleGraphPropsDecoder(
|
|||||||
*/
|
*/
|
||||||
class BackgroundTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
class BackgroundTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const backgroundTypeLabel = document.createElement("label");
|
const backgroundTypeLabel = document.createElement("label");
|
||||||
backgroundTypeLabel.textContent = t("Background color");
|
backgroundTypeLabel.textContent = t("Background color");
|
||||||
|
|
||||||
|
generalDiv.appendChild(backgroundTypeLabel);
|
||||||
|
|
||||||
const options: {
|
const options: {
|
||||||
value: ModuleGraphProps["backgroundType"];
|
value: ModuleGraphProps["backgroundType"];
|
||||||
text: string;
|
text: string;
|
||||||
@ -141,9 +146,9 @@ class BackgroundTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
backgroundTypeLabel.appendChild(backgroundTypeSelect);
|
generalDiv.appendChild(backgroundTypeSelect);
|
||||||
|
|
||||||
return backgroundTypeLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +159,7 @@ class BackgroundTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
class ChooseTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
class ChooseTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
const divContainer = document.createElement("div");
|
const divContainer = document.createElement("div");
|
||||||
|
divContainer.className = "div-input-group";
|
||||||
const radioButtonModuleLabel = document.createElement("label");
|
const radioButtonModuleLabel = document.createElement("label");
|
||||||
radioButtonModuleLabel.textContent = t("Module Graph");
|
radioButtonModuleLabel.textContent = t("Module Graph");
|
||||||
|
|
||||||
@ -222,9 +228,17 @@ class ChooseTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
*/
|
*/
|
||||||
class CustomGraphInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
class CustomGraphInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const containerGeneralDiv = document.createElement("div");
|
||||||
|
containerGeneralDiv.className = "div-input-group-autocomplete-agent";
|
||||||
|
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const customGraphLabel = document.createElement("label");
|
const customGraphLabel = document.createElement("label");
|
||||||
customGraphLabel.textContent = t("Custom graph");
|
customGraphLabel.textContent = t("Custom graph");
|
||||||
|
|
||||||
|
generalDiv.appendChild(customGraphLabel);
|
||||||
|
|
||||||
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
const spinner = fontAwesomeIcon(faCircleNotch, t("Spinner"), {
|
||||||
size: "small",
|
size: "small",
|
||||||
spin: true
|
spin: true
|
||||||
@ -278,11 +292,13 @@ class CustomGraphInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
customGraphLabel.appendChild(customGraphSelect);
|
generalDiv.appendChild(customGraphSelect);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return customGraphLabel;
|
containerGeneralDiv.appendChild(generalDiv);
|
||||||
|
|
||||||
|
return containerGeneralDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,9 +309,14 @@ class CustomGraphInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
*/
|
*/
|
||||||
class GraphTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
class GraphTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const graphTypeLabel = document.createElement("label");
|
const graphTypeLabel = document.createElement("label");
|
||||||
graphTypeLabel.textContent = t("Graph Type");
|
graphTypeLabel.textContent = t("Graph Type");
|
||||||
|
|
||||||
|
generalDiv.appendChild(graphTypeLabel);
|
||||||
|
|
||||||
const options: {
|
const options: {
|
||||||
value: ModuleGraphProps["graphType"];
|
value: ModuleGraphProps["graphType"];
|
||||||
text: string;
|
text: string;
|
||||||
@ -323,18 +344,23 @@ class GraphTypeInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
graphTypeLabel.appendChild(graphTypeSelect);
|
generalDiv.appendChild(graphTypeSelect);
|
||||||
|
|
||||||
return graphTypeLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Document
|
// TODO: Document
|
||||||
class PeriodInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
class PeriodInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const periodLabel = document.createElement("label");
|
const periodLabel = document.createElement("label");
|
||||||
periodLabel.textContent = t("Period");
|
periodLabel.textContent = t("Period");
|
||||||
|
|
||||||
|
generalDiv.appendChild(periodLabel);
|
||||||
|
|
||||||
const periodControl = periodSelector(
|
const periodControl = periodSelector(
|
||||||
this.currentData.period || this.initialData.period || 300,
|
this.currentData.period || this.initialData.period || 300,
|
||||||
null,
|
null,
|
||||||
@ -355,9 +381,9 @@ class PeriodInputGroup extends InputGroup<Partial<ModuleGraphProps>> {
|
|||||||
value => this.updateData({ period: value })
|
value => this.updateData({ period: value })
|
||||||
);
|
);
|
||||||
|
|
||||||
periodLabel.appendChild(periodControl);
|
generalDiv.appendChild(periodControl);
|
||||||
|
|
||||||
return periodLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,19 +458,12 @@ export default class ModuleGraph extends Item<ModuleGraphProps> {
|
|||||||
public getFormContainer(): FormContainer {
|
public getFormContainer(): FormContainer {
|
||||||
const formContainer = super.getFormContainer();
|
const formContainer = super.getFormContainer();
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new BackgroundTypeInputGroup("background-type", this.props)
|
new BackgroundTypeInputGroup("background-type", this.props),
|
||||||
|
3
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new GraphTypeInputGroup("graph-type", this.props)
|
new ChooseTypeInputGroup("show-type-graph", this.props),
|
||||||
);
|
4
|
||||||
formContainer.addInputGroup(
|
|
||||||
new PeriodInputGroup("period-graph", this.props)
|
|
||||||
);
|
|
||||||
formContainer.addInputGroup(
|
|
||||||
new LinkConsoleInputGroup("link-console", this.props)
|
|
||||||
);
|
|
||||||
formContainer.addInputGroup(
|
|
||||||
new ChooseTypeInputGroup("show-type-graph", this.props)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const displayAgent = this.props.customGraphId
|
const displayAgent = this.props.customGraphId
|
||||||
@ -458,13 +477,27 @@ export default class ModuleGraph extends Item<ModuleGraphProps> {
|
|||||||
new AgentModuleInputGroup(
|
new AgentModuleInputGroup(
|
||||||
`agent-autocomplete ${displayAgent}`,
|
`agent-autocomplete ${displayAgent}`,
|
||||||
this.props
|
this.props
|
||||||
)
|
),
|
||||||
|
5
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new CustomGraphInputGroup(
|
new CustomGraphInputGroup(
|
||||||
`custom-graph-list ${displayCustom}`,
|
`custom-graph-list ${displayCustom}`,
|
||||||
this.props
|
this.props
|
||||||
)
|
),
|
||||||
|
6
|
||||||
|
);
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new GraphTypeInputGroup("graph-type", this.props),
|
||||||
|
7
|
||||||
|
);
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new PeriodInputGroup("period-graph", this.props),
|
||||||
|
8
|
||||||
|
);
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new LinkConsoleInputGroup("link-console", this.props),
|
||||||
|
16
|
||||||
);
|
);
|
||||||
return formContainer;
|
return formContainer;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,8 @@ import Item, {
|
|||||||
ItemType,
|
ItemType,
|
||||||
ItemProps,
|
ItemProps,
|
||||||
itemBasePropsDecoder,
|
itemBasePropsDecoder,
|
||||||
LinkConsoleInputGroup
|
LinkConsoleInputGroup,
|
||||||
|
AgentModuleInputGroup
|
||||||
} from "../Item";
|
} from "../Item";
|
||||||
import { InputGroup, FormContainer } from "../Form";
|
import { InputGroup, FormContainer } from "../Form";
|
||||||
|
|
||||||
@ -113,9 +114,14 @@ export function percentilePropsDecoder(
|
|||||||
*/
|
*/
|
||||||
class DiameterInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class DiameterInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const diameterLabel = document.createElement("label");
|
const diameterLabel = document.createElement("label");
|
||||||
diameterLabel.textContent = t("Diameter");
|
diameterLabel.textContent = t("Diameter");
|
||||||
|
|
||||||
|
generalDiv.appendChild(diameterLabel);
|
||||||
|
|
||||||
const diameterInput = document.createElement("input");
|
const diameterInput = document.createElement("input");
|
||||||
diameterInput.type = "number";
|
diameterInput.type = "number";
|
||||||
diameterInput.required = true;
|
diameterInput.required = true;
|
||||||
@ -128,9 +134,9 @@ class DiameterInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
diameterLabel.appendChild(diameterInput);
|
generalDiv.appendChild(diameterInput);
|
||||||
|
|
||||||
return diameterLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +147,14 @@ class DiameterInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class MinValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class MinValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const minValueLabel = document.createElement("label");
|
const minValueLabel = document.createElement("label");
|
||||||
minValueLabel.textContent = t("Min Value");
|
minValueLabel.textContent = t("Min Value");
|
||||||
|
|
||||||
|
generalDiv.appendChild(minValueLabel);
|
||||||
|
|
||||||
const minValueInput = document.createElement("input");
|
const minValueInput = document.createElement("input");
|
||||||
minValueInput.type = "number";
|
minValueInput.type = "number";
|
||||||
minValueInput.required = true;
|
minValueInput.required = true;
|
||||||
@ -158,9 +169,9 @@ class MinValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
minValueLabel.appendChild(minValueInput);
|
generalDiv.appendChild(minValueInput);
|
||||||
|
|
||||||
return minValueLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,9 +182,14 @@ class MinValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class MaxValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class MaxValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const maxValueLabel = document.createElement("label");
|
const maxValueLabel = document.createElement("label");
|
||||||
maxValueLabel.textContent = t("Max Value");
|
maxValueLabel.textContent = t("Max Value");
|
||||||
|
|
||||||
|
generalDiv.appendChild(maxValueLabel);
|
||||||
|
|
||||||
const maxValueInput = document.createElement("input");
|
const maxValueInput = document.createElement("input");
|
||||||
maxValueInput.type = "number";
|
maxValueInput.type = "number";
|
||||||
maxValueInput.required = true;
|
maxValueInput.required = true;
|
||||||
@ -188,9 +204,9 @@ class MaxValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
maxValueLabel.appendChild(maxValueInput);
|
generalDiv.appendChild(maxValueInput);
|
||||||
|
|
||||||
return maxValueLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,9 +219,14 @@ class MaxValueInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class TypePercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class TypePercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const typeLabel = document.createElement("label");
|
const typeLabel = document.createElement("label");
|
||||||
typeLabel.textContent = t("Type");
|
typeLabel.textContent = t("Type");
|
||||||
|
|
||||||
|
generalDiv.appendChild(typeLabel);
|
||||||
|
|
||||||
const options: {
|
const options: {
|
||||||
value: PercentileProps["percentileType"];
|
value: PercentileProps["percentileType"];
|
||||||
text: string;
|
text: string;
|
||||||
@ -245,9 +266,9 @@ class TypePercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
typeLabel.appendChild(typeSelect);
|
generalDiv.appendChild(typeSelect);
|
||||||
|
|
||||||
return typeLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,9 +280,14 @@ class TypePercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class ValueToShowInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class ValueToShowInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const valueToShowLabel = document.createElement("label");
|
const valueToShowLabel = document.createElement("label");
|
||||||
valueToShowLabel.textContent = t("Value to show");
|
valueToShowLabel.textContent = t("Value to show");
|
||||||
|
|
||||||
|
generalDiv.appendChild(valueToShowLabel);
|
||||||
|
|
||||||
const options: { value: PercentileProps["valueType"]; text: string }[] = [
|
const options: { value: PercentileProps["valueType"]; text: string }[] = [
|
||||||
{ value: "percent", text: t("Percent") },
|
{ value: "percent", text: t("Percent") },
|
||||||
{ value: "value", text: t("Value") }
|
{ value: "value", text: t("Value") }
|
||||||
@ -285,9 +311,9 @@ class ValueToShowInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
valueToShowLabel.appendChild(valueToShowInput);
|
generalDiv.appendChild(valueToShowInput);
|
||||||
|
|
||||||
return valueToShowLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,9 +324,14 @@ class ValueToShowInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class ElementColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class ElementColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const elementColorLabel = document.createElement("label");
|
const elementColorLabel = document.createElement("label");
|
||||||
elementColorLabel.textContent = t("Element color");
|
elementColorLabel.textContent = t("Element color");
|
||||||
|
|
||||||
|
generalDiv.appendChild(elementColorLabel);
|
||||||
|
|
||||||
const elementColorInput = document.createElement("input");
|
const elementColorInput = document.createElement("input");
|
||||||
elementColorInput.type = "color";
|
elementColorInput.type = "color";
|
||||||
elementColorInput.required = true;
|
elementColorInput.required = true;
|
||||||
@ -314,9 +345,9 @@ class ElementColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
elementColorLabel.appendChild(elementColorInput);
|
generalDiv.appendChild(elementColorInput);
|
||||||
|
|
||||||
return elementColorLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,9 +358,14 @@ class ElementColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class ValueColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class ValueColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const valueColorLabel = document.createElement("label");
|
const valueColorLabel = document.createElement("label");
|
||||||
valueColorLabel.textContent = t("Value color");
|
valueColorLabel.textContent = t("Value color");
|
||||||
|
|
||||||
|
generalDiv.appendChild(valueColorLabel);
|
||||||
|
|
||||||
const valueColorInput = document.createElement("input");
|
const valueColorInput = document.createElement("input");
|
||||||
valueColorInput.type = "color";
|
valueColorInput.type = "color";
|
||||||
valueColorInput.required = true;
|
valueColorInput.required = true;
|
||||||
@ -343,9 +379,9 @@ class ValueColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
valueColorLabel.appendChild(valueColorInput);
|
generalDiv.appendChild(valueColorInput);
|
||||||
|
|
||||||
return valueColorLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,9 +392,14 @@ class ValueColorInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
*/
|
*/
|
||||||
class LabelPercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
class LabelPercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const labelPercentileLabel = document.createElement("label");
|
const labelPercentileLabel = document.createElement("label");
|
||||||
labelPercentileLabel.textContent = t("Label");
|
labelPercentileLabel.textContent = t("Label");
|
||||||
|
|
||||||
|
generalDiv.appendChild(labelPercentileLabel);
|
||||||
|
|
||||||
const labelPercentileInput = document.createElement("input");
|
const labelPercentileInput = document.createElement("input");
|
||||||
labelPercentileInput.type = "text";
|
labelPercentileInput.type = "text";
|
||||||
labelPercentileInput.required = true;
|
labelPercentileInput.required = true;
|
||||||
@ -373,9 +414,9 @@ class LabelPercentileInputGroup extends InputGroup<Partial<PercentileProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
labelPercentileLabel.appendChild(labelPercentileInput);
|
generalDiv.appendChild(labelPercentileInput);
|
||||||
|
|
||||||
return labelPercentileLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,34 +613,48 @@ export default class Percentile extends Item<PercentileProps> {
|
|||||||
const formContainer = super.getFormContainer();
|
const formContainer = super.getFormContainer();
|
||||||
// Delete items groups.
|
// Delete items groups.
|
||||||
formContainer.removeInputGroup("size");
|
formContainer.removeInputGroup("size");
|
||||||
// TODO: Remove inputGroup label this item.
|
formContainer.removeInputGroup("label");
|
||||||
//formContainer.removeInputGroup("label");
|
|
||||||
|
|
||||||
// Add new items gropus.
|
// Add new items gropus.
|
||||||
formContainer.addInputGroup(new DiameterInputGroup("diameter", this.props));
|
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new MinValueInputGroup("min-value", this.props)
|
new AgentModuleInputGroup("agent-autocomplete", this.props),
|
||||||
|
1
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new MaxValueInputGroup("max-value", this.props)
|
new DiameterInputGroup("diameter", this.props),
|
||||||
|
2
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new TypePercentileInputGroup("type", this.props)
|
new MinValueInputGroup("min-value", this.props),
|
||||||
|
3
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new ValueToShowInputGroup("value-to-show", this.props)
|
new MaxValueInputGroup("max-value", this.props),
|
||||||
|
4
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new ElementColorInputGroup("element-color", this.props)
|
new TypePercentileInputGroup("type-percentil", this.props),
|
||||||
|
5
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new ValueColorInputGroup("value-color", this.props)
|
new ValueToShowInputGroup("value-to-show", this.props),
|
||||||
|
6
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new LabelPercentileInputGroup("label-percentile", this.props)
|
new ElementColorInputGroup("element-color", this.props),
|
||||||
|
7
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new LinkConsoleInputGroup("link-console", this.props)
|
new ValueColorInputGroup("value-color", this.props),
|
||||||
|
8
|
||||||
|
);
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new LabelPercentileInputGroup("label-percentile", this.props),
|
||||||
|
9
|
||||||
|
);
|
||||||
|
formContainer.addInputGroup(
|
||||||
|
new LinkConsoleInputGroup("link-console", this.props),
|
||||||
|
16
|
||||||
);
|
);
|
||||||
return formContainer;
|
return formContainer;
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,14 @@ export function staticGraphPropsDecoder(
|
|||||||
*/
|
*/
|
||||||
class ShowLastValueInputGroup extends InputGroup<Partial<StaticGraphProps>> {
|
class ShowLastValueInputGroup extends InputGroup<Partial<StaticGraphProps>> {
|
||||||
protected createContent(): HTMLElement | HTMLElement[] {
|
protected createContent(): HTMLElement | HTMLElement[] {
|
||||||
|
const generalDiv = document.createElement("div");
|
||||||
|
generalDiv.className = "div-input-group";
|
||||||
|
|
||||||
const showLastValueLabel = document.createElement("label");
|
const showLastValueLabel = document.createElement("label");
|
||||||
showLastValueLabel.textContent = t("Show Last Value");
|
showLastValueLabel.textContent = t("Show Last Value");
|
||||||
|
|
||||||
|
generalDiv.appendChild(showLastValueLabel);
|
||||||
|
|
||||||
const options: {
|
const options: {
|
||||||
value: StaticGraphProps["showLastValueTooltip"];
|
value: StaticGraphProps["showLastValueTooltip"];
|
||||||
text: string;
|
text: string;
|
||||||
@ -120,9 +125,9 @@ class ShowLastValueInputGroup extends InputGroup<Partial<StaticGraphProps>> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
showLastValueLabel.appendChild(showLastValueSelect);
|
generalDiv.appendChild(showLastValueSelect);
|
||||||
|
|
||||||
return showLastValueLabel;
|
return generalDiv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,16 +178,20 @@ export default class StaticGraph extends Item<StaticGraphProps> {
|
|||||||
...this.props,
|
...this.props,
|
||||||
imageKey: "imageSrc",
|
imageKey: "imageSrc",
|
||||||
showStatusImg: true
|
showStatusImg: true
|
||||||
})
|
}),
|
||||||
|
3
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new LinkConsoleInputGroup("link-console", this.props)
|
new AgentModuleInputGroup("agent-autocomplete", this.props),
|
||||||
|
4
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new ShowLastValueInputGroup("show-last-value", this.props)
|
new ShowLastValueInputGroup("show-last-value", this.props),
|
||||||
|
5
|
||||||
);
|
);
|
||||||
formContainer.addInputGroup(
|
formContainer.addInputGroup(
|
||||||
new AgentModuleInputGroup("agent-autocomplete", this.props)
|
new LinkConsoleInputGroup("link-console", this.props),
|
||||||
|
13
|
||||||
);
|
);
|
||||||
return formContainer;
|
return formContainer;
|
||||||
}
|
}
|
||||||
|
@ -92,16 +92,6 @@
|
|||||||
background: rgb(212, 215, 218);
|
background: rgb(212, 215, 218);
|
||||||
}
|
}
|
||||||
|
|
||||||
form.visual-console-item-edition > .input-groups {
|
|
||||||
margin-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.visual-console-item-edition > input[type="submit"] {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 5px;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.show-elements {
|
.show-elements {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -109,3 +99,116 @@ form.visual-console-item-edition > input[type="submit"] {
|
|||||||
.hide-elements {
|
.hide-elements {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Forms*/
|
||||||
|
.div-input-group label {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12pt;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #343434;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.div-input-group label img {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group input[type="text"],
|
||||||
|
.div-input-group input[type="number"] {
|
||||||
|
height: 25px;
|
||||||
|
font-size: 10pt;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: lighter;
|
||||||
|
padding: 0px 0px 2px 0px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group input[type="radio"] {
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group select {
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
font-weight: lighter;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-groups {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-ranges-input-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-ranges-input-group > div {
|
||||||
|
padding-left: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group,
|
||||||
|
.div-input-group div div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group h3 {
|
||||||
|
text-transform: initial;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
font-style: italic;
|
||||||
|
text-decoration: underline;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group div div a {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group-autocomplete-agent {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: start;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-input-group-inside {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group-link-console {
|
||||||
|
height: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-elements > div.div-input-group-autocomplete-agent {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-vc-elements {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user