From 0bd74cf3010de984d36eed04b6318b7b30e25373 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sun, 6 Jan 2019 15:40:16 +0100 Subject: Extenstive frontend work on box/type/switch editing Still not very visible, but the nmsModSwitch() class is starting to look very interesting. This introduces a big thing: A type system. So far it is "only" used to provide generic validation-services for all fields that will be edited, but the scope can extend further into other uses. The implementation as it is does shallow validation for IP addresses, JSON-input (tags,placement), durations/intervals (poll frequency), sysname references (checks that distro_name is a valid system), and networks (verifying that mgmt_vlan / traffic_vlan exists). This is expected to improve over time, and should eventually lead to things like "if it doesn't exist, then please make it." As the big comment in nms-ui-switch.js now suggests: This is still just a proof of concept and while the fundamental concepts of nmsBox seems to work well, I still feel like I have a lot to iron out in nmsModSwitch, which really should be generic for networks and switches at the very least. But we're getting there. --- web/js/nms-ui-boxes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/js/nms-ui-boxes.js') diff --git a/web/js/nms-ui-boxes.js b/web/js/nms-ui-boxes.js index 3ed65cd..ac4445e 100644 --- a/web/js/nms-ui-boxes.js +++ b/web/js/nms-ui-boxes.js @@ -166,7 +166,7 @@ class nmsPanel extends nmsBox{ /* Mainly just to make the constructor more readable. */ makeHeading(title) { var titleObject = new nmsBox("div",{html:{classList: ["panel-heading"]}}); - this._titleText = new nmsBox("p",{html:{textContent: title}}); + this._titleText = new nmsBox("h4",{html:{textContent: title}}); var closeButton = new nmsBox("button"); closeButton.html.className = "close"; closeButton.panel = this; -- cgit v1.2.3