diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-08-13 18:31:08 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-08-15 15:02:00 +0000 |
commit | b082a6fb211ef19d75c4c81414be9aa1b9248b45 (patch) | |
tree | 85ee394234198a669c4be22cc97f1e2f3ab5050b /interface-definitions | |
parent | 8efb8ba1efa9d51ec376bac0bfcb48cf200447a9 (diff) | |
download | vyos-1x-b082a6fb211ef19d75c4c81414be9aa1b9248b45.tar.gz vyos-1x-b082a6fb211ef19d75c4c81414be9aa1b9248b45.zip |
lcd: T2564: flatten CLI interface
* set system lcd device <device>
* set system lcd model <modeml>
Both device and model have completion helpers for supported interfaces and LCD
displays.
Diffstat (limited to 'interface-definitions')
-rw-r--r-- | interface-definitions/system-display.xml.in | 235 | ||||
-rw-r--r-- | interface-definitions/system-lcd.xml.in | 62 |
2 files changed, 62 insertions, 235 deletions
diff --git a/interface-definitions/system-display.xml.in b/interface-definitions/system-display.xml.in deleted file mode 100644 index fbd897996..000000000 --- a/interface-definitions/system-display.xml.in +++ /dev/null @@ -1,235 +0,0 @@ -<?xml version="1.0"?> -<interfaceDefinition> - <!-- - system display model (sdec|ezio|test) - system display show host (cpu|cpu-all|cpu-hist|disk|load-hist|memory|proc|uptime) - network interface <intName> alias <alias> - units (bps|Bps|pps) - clock (big|mini|date-time) - title <name> - - system display time <s> - system display hello <string> - system display bye <string> - system display disabled - --> - <node name="system"> - <children> - <node name="display" owner="${vyos_conf_scripts_dir}/system-display.py"> - <properties> - <help>System display LCD/VFD/LED</help> - <priority>400</priority> - </properties> - <children> - <!-- system display model (sdec|ezio) --> - <leafNode name="model"> - <properties> - <help>Model of the display attached to this system [REQUIRED]</help> - <completionHelp> - <list>sdec ezio test</list> - </completionHelp> - <constraint> - <regex>(sdec|ezio|test)</regex> - </constraint> - <constraintErrorMessage>Invalid system display model</constraintErrorMessage> - <valueHelp> - <format>sdec</format> - <description>Display model for Lanner, Watchguard, Nexcom NSA, Sophos UTM appliances with built-in SDEC LCD</description> - </valueHelp> - <valueHelp> - <format>ezio</format> - <description>Display model for Portwell, Caswell appliances with built-in EZIO-100 or EZIO-300 LCD</description> - </valueHelp> - <valueHelp> - <format>test</format> - <description>Test model for USB CrystalFonz CF533</description> - </valueHelp> - </properties> - </leafNode><!--system display model--> - <!-- system display disabled --> - <leafNode name="disabled"> - <properties> - <help>Disable sytem display</help> - <valueless/> - </properties> - </leafNode><!--system display disabled--> - <node name="show"> - <properties> - <help>Select the screens for the system display [REQUIRED]</help> - </properties> - <children> - <!-- system display show host (cpu|cpu-all|cpu-hist|disk|load-hist|memory|proc|uptime) --> - <leafNode name="host"> - <properties> - <multi/> - <help>Select host screens for the system display</help> - <completionHelp> - <list>cpu cpu-all cpu-hist disk load-hist memory proc uptime</list> - </completionHelp> - <constraint> - <regex>(cpu|cpu-all|cpu-hist|disk|load-hist|memory|proc|uptime)</regex> - </constraint> - <constraintErrorMessage>Invalid host screen</constraintErrorMessage> - <valueHelp> - <format>cpu</format> - <description>Detailed CPU usage</description> - </valueHelp> - <valueHelp> - <format>cpu-all</format> - <description>CPU usage overview (one line per CPU)</description> - </valueHelp> - <valueHelp> - <format>cpu-hist</format> - <description>CPU usage histogram</description> - </valueHelp> - <valueHelp> - <format>disk</format> - <description>File systems fill level</description> - </valueHelp> - <valueHelp> - <format>load-hist</format> - <description>Load histogram</description> - </valueHelp> - <valueHelp> - <format>memory</format> - <description>Memory and swap usage</description> - </valueHelp> - <valueHelp> - <format>proc</format> - <description>Top processes by size</description> - </valueHelp> - <valueHelp> - <format>uptime</format> - <description>System uptime</description> - </valueHelp> - </properties> - </leafNode><!--system display show host--> - <!-- system display show network --> - <node name="network"> - <properties> - <help>Network settings for system display</help> - </properties> - <children> - <!-- system display show network interface <interface name> --> - <tagNode name="interface"> - <properties> - <help>Show network traffic on the system display [Max 3 interfaces]</help> - <completionHelp> - <script>${vyos_completion_dir}/list_interfaces.py -b</script> - </completionHelp> - </properties> - <children> - <leafNode name="alias"> - <properties> - <help>Interface alias</help> - <constraint> - <regex>[A-Za-z0-9]{1,10}</regex> - </constraint> - <constraintErrorMessage>Invalid alias, must be 1 to 10 char or digit</constraintErrorMessage> - </properties> - </leafNode> - </children> - </tagNode><!--system display show network interface--> - <!-- system display show network units --> - <leafNode name="units"> - <properties> - <help>Unit for network details</help> - <completionHelp> - <list>bps Bps pps</list> - </completionHelp> - <constraint> - <regex>(bps|Bps|pps)</regex> - </constraint> - <constraintErrorMessage>Invalid network detail unit</constraintErrorMessage> - <valueHelp> - <format>bps</format> - <description>Bit(s) per second</description> - </valueHelp> - <valueHelp> - <format>Bps</format> - <description>Byte(s) per second</description> - </valueHelp> - <valueHelp> - <format>pps</format> - <description>Packet(s) per second</description> - </valueHelp> - </properties> - </leafNode><!--system display show network units--> - </children> - </node><!--system display show network--> - <!-- system display show clock (Big|Mini|Date-Time) --> - <leafNode name="clock"> - <properties> - <!--multi--> - <help>Show a clock on the system display</help> - <completionHelp> - <list>big mini date-time</list> - </completionHelp> - <constraint> - <regex>(big|mini|date-time)</regex> - </constraint> - <constraintErrorMessage>Invalid clock format</constraintErrorMessage> - <valueHelp> - <format>big</format> - <description>Multi-line clock</description> - </valueHelp> - <valueHelp> - <format>mini</format> - <description>Minimal clock</description> - </valueHelp> - <valueHelp> - <format>date-time</format> - <description>Clock with Date and Time </description> - </valueHelp> - </properties> - </leafNode><!--system display show clock--> - <!-- system display show title --> - <leafNode name="title"> - <properties> - <help>Screen title to show on the system display</help> - <constraint> - <regex>[A-Za-z0-9]{1,16}</regex> - </constraint> - <constraintErrorMessage>Invalid title, must be 1 to 16 char or digit</constraintErrorMessage> - </properties> - </leafNode><!--system display show title--> - </children> - </node><!--system display show--> - <!-- system display time --> - <leafNode name="time"> - <properties> - <help>Time in sec to show each screen on the system display</help> - <valueHelp> - <format>1-30</format> - <description>Numer of seconds</description> - </valueHelp> - <constraint> - <validator name="numeric" argument="--range 1-30"/> - </constraint> - </properties> - </leafNode><!--system display time--> - <!-- system display hello --> - <leafNode name="hello"> - <properties> - <help>Message to show when system display first starts</help> - <constraint> - <regex>.{1,16}</regex> - </constraint> - <constraintErrorMessage>Hello message must be 1 to 16 char</constraintErrorMessage> - </properties> - </leafNode><!--system display hello--> - <!-- system display bye --> - <leafNode name="bye"> - <properties> - <help>Message to show when system display stops</help> - <constraint> - <regex>.{1,16}</regex> - </constraint> - <constraintErrorMessage>Bye message must be 1 to 16 char</constraintErrorMessage> - </properties> - </leafNode><!--system display bye--> - </children> - </node><!--system display--> - </children> - </node><!--system--> -</interfaceDefinition> diff --git a/interface-definitions/system-lcd.xml.in b/interface-definitions/system-lcd.xml.in new file mode 100644 index 000000000..ad59acb6b --- /dev/null +++ b/interface-definitions/system-lcd.xml.in @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="system"> + <children> + <node name="lcd" owner="${vyos_conf_scripts_dir}/system_lcd.py"> + <properties> + <help>System LCD display</help> + <priority>100</priority> + </properties> + <children> + <leafNode name="model"> + <properties> + <help>Model of the display attached to this system [REQUIRED]</help> + <completionHelp> + <list>CFA-533 CFA-631 CFA-633 CFA-635</list> + </completionHelp> + <valueHelp> + <format>CFA-533</format> + <description>Crystalfontz CFA-533</description> + </valueHelp> + <valueHelp> + <format>CFA-631</format> + <description>Crystalfontz CFA-631</description> + </valueHelp> + <valueHelp> + <format>CFA-633</format> + <description>Crystalfontz CFA-633</description> + </valueHelp> + <valueHelp> + <format>CFA-635</format> + <description>Crystalfontz CFA-635</description> + </valueHelp> + <constraint> + <regex>^(CFA-533|CFA-631|CFA-633|CFA-635)$</regex> + </constraint> + </properties> + </leafNode> + <leafNode name="device"> + <properties> + <help>Physical device used by LCD display</help> + <completionHelp> + <script>ls -1 /dev | grep ttyS</script> + <script>if [ -d /dev/serial/by-bus ]; then ls -1 /dev/serial/by-bus; fi</script> + </completionHelp> + <valueHelp> + <format>ttySXX</format> + <description>TTY device name, regular serial port</description> + </valueHelp> + <valueHelp> + <format>usbNbXpY</format> + <description>TTY device name, USB based</description> + </valueHelp> + <constraint> + <regex>^(ttyS[0-9]+|usb[0-9]+b.*)$</regex> + </constraint> + </properties> + </leafNode> + </children> + </node> + </children> + </node> +</interfaceDefinition> |