diff options
author | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2018-02-02 10:58:09 +0000 |
---|---|---|
committer | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2018-02-02 10:58:09 +0000 |
commit | 88fcd07560c4c19a7621e43ee00862a028423839 (patch) | |
tree | 717f2640d1ff68577b8806d8c0b4181232bcfcfc | |
parent | 8854d382910a27f66cf16afb66cd0741617168e4 (diff) |
Set the front page commands based on the documentation command entry
-rw-r--r-- | index.php | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -37,6 +37,7 @@ final class LookingGlass { $this->contact = $config['contact']; $this->misc = $config['misc']; $this->routers = $config['routers']; + $this->doc = $config['doc']; } private function render_routers() { @@ -69,11 +70,11 @@ final class LookingGlass { print('<div class="form-group">'); print('<label for="query">Command to issue</label>'); print('<select size="5" class="form-control" name="query" id="query">'); - print('<option value="bgp" selected="selected">show route IP_ADDRESS</option>'); - print('<option value="as-path-regex">show route as-path-regex AS_PATH_REGEX</option>'); - print('<option value="as">show route AS</option>'); - print('<option value="ping">ping IP_ADDRESS|HOSTNAME</option>'); - print('<option value="traceroute">traceroute IP_ADDRESS|HOSTNAME</option>'); + $selected = ' selected="selected"'; + foreach (array_keys($this->doc) as $cmd) { + print('<option value="'.$cmd.'"'.$selected.'>'.$this->doc[$cmd]['command'].'</option>'); + $selected = ''; + } print('</select>'); print('</div>'); } |