Merge branch 'visual-console-refactor' of https://brutus.artica.lan:8081/artica/pandorafms into visual-console-refactor

Former-commit-id: 1d0a9a172afd06cb0c641b53d02371bd85355721
This commit is contained in:
Daniel Maya 2019-04-15 18:14:55 +02:00
commit b0b1db5746
15 changed files with 17 additions and 17 deletions

View File

@ -133,7 +133,7 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
* To create a new element which will be inside the item box.
* @return Item.
*/
abstract createDomElement(): HTMLElement;
protected abstract createDomElement(): HTMLElement;
public constructor(props: Props) {
this.itemProps = props;

View File

@ -35,7 +35,7 @@ export function barsGraphPropsDecoder(
}
export default class BarsGraph extends Item<BarsGraphProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.innerHTML = this.props.html;

View File

@ -40,7 +40,7 @@ export function boxPropsDecoder(data: UnknownObject): BoxProps | never {
}
export default class Box extends Item<BoxProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const box: HTMLDivElement = document.createElement("div");
box.className = "box";
// To prevent this item to expand beyond its parent.

View File

@ -149,7 +149,7 @@ export default class Clock extends Item<ClockProps> {
* @return DOM Element.
* @override
*/
public createDomElement(): HTMLElement | never {
protected createDomElement(): HTMLElement | never {
return this.createClock();
}
@ -450,7 +450,7 @@ export default class Clock extends Item<ClockProps> {
to {
${prefixedCssRules(
"transform",
`translate(50px, 50px) rotate(${minuteAngle + 360}deg)`
`translate(50px, 50px) rotate(${secAngle + 360}deg)`
).join("\n")}
}
}

View File

@ -43,7 +43,7 @@ export function colorCloudPropsDecoder(
const svgNS = "http://www.w3.org/2000/svg";
export default class ColorCloud extends Item<ColorCloudProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const container: HTMLDivElement = document.createElement("div");
container.className = "color-cloud";

View File

@ -46,7 +46,7 @@ export function donutGraphPropsDecoder(
}
export default class DonutGraph extends Item<DonutGraphProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.innerHTML = this.props.html;

View File

@ -42,7 +42,7 @@ export function eventsHistoryPropsDecoder(
}
export default class EventsHistory extends Item<EventsHistoryProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.innerHTML = this.props.html;

View File

@ -38,7 +38,7 @@ export function groupPropsDecoder(data: UnknownObject): GroupProps | never {
}
export default class Group extends Item<GroupProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const img: HTMLImageElement = document.createElement("img");
img.className = "group";
if (this.props.statusImageSrc != null) {

View File

@ -31,7 +31,7 @@ export function iconPropsDecoder(data: UnknownObject): IconProps | never {
}
export default class Icon extends Item<IconProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const img: HTMLImageElement = document.createElement("img");
img.className = "icon";
img.src = this.props.imageSrc;

View File

@ -25,7 +25,7 @@ export function labelPropsDecoder(data: UnknownObject): LabelProps | never {
}
export default class Label extends Item<LabelProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.className = "label";
element.innerHTML = this.props.label || "";

View File

@ -74,7 +74,7 @@ export default class Line extends Item<LineProps> {
* To create the item's DOM representation.
* @return Item.
*/
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element: HTMLDivElement = document.createElement("div");
element.className = "line";

View File

@ -46,7 +46,7 @@ export function moduleGraphPropsDecoder(
}
export default class ModuleGraph extends Item<ModuleGraphProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.innerHTML = this.props.html;

View File

@ -100,7 +100,7 @@ export function percentilePropsDecoder(
const svgNS = "http://www.w3.org/2000/svg";
export default class Percentile extends Item<PercentileProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
// Progress.
const progress = this.getProgress();
// Main element.

View File

@ -88,7 +88,7 @@ export function simpleValuePropsDecoder(
}
export default class SimpleValue extends Item<SimpleValueProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const element = document.createElement("div");
element.className = "simple-value";
@ -114,7 +114,7 @@ export default class SimpleValue extends Item<SimpleValueProps> {
* Create a new label for the visual console item.
* @return Item label.
*/
public createLabelDomElement(): HTMLElement {
protected createLabelDomElement(): HTMLElement {
const element = document.createElement("div");
element.className = "visual-console-item-label";
// Always return an empty label.

View File

@ -66,7 +66,7 @@ export function staticGraphPropsDecoder(
}
export default class StaticGraph extends Item<StaticGraphProps> {
public createDomElement(): HTMLElement {
protected createDomElement(): HTMLElement {
const img: HTMLImageElement = document.createElement("img");
img.className = "static-graph";
img.src = this.props.statusImageSrc || this.props.imageSrc;