summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Mazoyer <respawneral@gmail.com>2014-08-06 00:09:50 +0200
committerGuillaume Mazoyer <respawneral@gmail.com>2014-08-06 00:09:50 +0200
commit62026ca49b5bff063a06e3b49864947e65cea426 (patch)
tree8f6dc5e7ee86958c1be496ac70603e0956605122
parent730bc651dba3c47f75bb41970629736642d54c03 (diff)
Reminder of the command in the help modal.
-rw-r--r--css/style.css2
-rw-r--r--includes/config.defaults.php15
-rw-r--r--index.php4
-rw-r--r--js/looking-glass.js3
4 files changed, 15 insertions, 9 deletions
diff --git a/css/style.css b/css/style.css
index 2cc53ba..1bae099 100644
--- a/css/style.css
+++ b/css/style.css
@@ -62,7 +62,7 @@ body {
margin-left: auto;
margin-right: auto;
}
-#command-help, #parameter-help {
+#description-help, #parameter-help {
font-size: 1.3em;
}
pre {
diff --git a/includes/config.defaults.php b/includes/config.defaults.php
index 4821da8..1c703eb 100644
--- a/includes/config.defaults.php
+++ b/includes/config.defaults.php
@@ -31,27 +31,32 @@ $config = array (
'doc' => array (
// Documentation for the 'show route' query
'bgp' => array(
- 'query' => 'Show the best routes to a given destination.',
+ 'command' => 'show route IP_ADDRESS',
+ 'description' => 'Show the best routes to a given destination.',
'parameter' => 'The parameter must be a valid destination. Destination means an IPv4/IPv6 address or a subnet. Masks are also accepted as part of a valid IPv4/IPv6 address.<br />Please note that some routers always need a mask to be given when looking for an IPv6 address.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>172.16.0.0/12</li><li>2001:db8:1337::42</li><li>2001:db8::/32</li>'
),
// Documentation for the 'as-path-regex' query
'as-path-regex' => array(
- 'query' => 'Show the routes matching the given AS path regular expression.',
+ 'command' => 'show route as-path-regex AS_PATH_REGEX',
+ 'description' => 'Show the routes matching the given AS path regular expression.',
'parameter' => 'The parameter must be a valid AS path regular expression.<br />Please note that these expression can change depending on the router and its software.<br /><br />Here are some examples:<ul><li><strong>Juniper</strong> - ^AS1 AS2 .*$</li><li><strong>Cisco</strong> - ^AS1_</li><li><strong>BIRD</strong> - AS1 AS2 AS3 &hellip; ASZ</li></ul><br />You may find some help with the following link:<br /><ul><li><a href="http://www.juniper.net/techpubs/en_US/junos13.3/topics/reference/command-summary/show-route-aspath-regex.html" title="Juniper Documentation">Juniper Documentation</a></li><li><a href="http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#asregexp" title="Cisco Documentation">Cisco Documentation</a></li><li><a href="http://bird.network.cz/?get_doc&f=bird-5.html" title="BIRD Documentation">BIRD Documentation</a> (search for bgpmask)</li></ul>'
),
// Documentation for the 'as' query
'as' => array(
- 'query' => 'Show the routes received from a given AS number.',
+ 'command' => 'show route AS',
+ 'description' => 'Show the routes received from a given AS number.',
'parameter' => 'The parameter must be a valid 16-bit or 32-bit autonomous system number.<br />Be careful, 32-bit ASN are not handled by old routers or old router softwares.<br />Unless specified, private ASN will be considered as invalid.<br /><br />Example of valid argument:<br /><ul><li>15169</li><li>29467</li></ul>'
),
// Documentation for the 'ping' query
'ping' => array(
- 'query' => 'Send 10 pings to the given destination.',
+ 'command' => 'ping IP_ADDRESS',
+ 'description' => 'Send 10 pings to the given destination.',
'parameter' => 'The parameter must be an IPv4/IPv6 address (without mask) or a fully qualified domain name.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>2001:db8:1337::42</li><li>example.com</li></ul>'
),
// Documentation for the 'traceroute' query
'traceroute' => array(
- 'query' => 'Display the path to a given destination.',
+ 'command' =>'traceroute IP_ADDRESS',
+ 'description' => 'Display the path to a given destination.',
'parameter' => 'The parameter must be an IPv4/IPv6 address (without mask) or a fully qualified domain name.<br /><br />Example of valid arguments:<br /><ul><li>10.1.1.1</li><li>2001:db8:1337::42</li><li>example.com</li></ul>'
)
)
diff --git a/index.php b/index.php
index c29a148..1cfbda6 100644
--- a/index.php
+++ b/index.php
@@ -198,8 +198,8 @@ final class LookingGlass {
print '<h4 class="modal-title">Help</h4>';
print '</div>';
print '<div class="modal-body">';
- print '<h4>Command</h4>';
- print '<p id="command-help"></p>';
+ print '<h4>Command <small id="command-reminder"></small></h4>';
+ print '<p id="description-help"></p>';
print '<h4>Parameter</h4>';
print '<p id="parameter-help"></p>';
print '</div>';
diff --git a/js/looking-glass.js b/js/looking-glass.js
index ec26416..4cbc47a 100644
--- a/js/looking-glass.js
+++ b/js/looking-glass.js
@@ -6,7 +6,8 @@ function request_doc(query) {
}).done(function(response) {
var response = $.parseJSON(response);
- $('#command-help').html(response.query);
+ $('#command-reminder').text(response.command);
+ $('#description-help').html(response.description);
$('#parameter-help').html(response.parameter);
}).fail(function(xhr) {
$('#help-content').text('Cannot load documentation...');