Skip to content

Commit 829861e

Browse files
Birger SchachtBirger Schacht
Birger Schacht
authored and
Birger Schacht
committed
ENH: add a documentation link to the bot documentation
This commit add a link to the bot settings page on intelmq.readthedocs.org with an anchor to the specific module. Closes #257
1 parent 5bf3615 commit 829861e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CHANGELOG
1818
#### Landing page
1919

2020
#### Configuration
21+
- Add a link pointing to the module documentation to the settings overlay of every bot (PR#256)
2122

2223
#### Management
2324

intelmq_manager/static/js/configs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class VisModel {
2626
var app = new VisModel();
2727

2828
var popup = null;
29+
var documentation = null;
2930
var span = null;
3031
var table = null;
3132
var disabledKeys = ['group', 'name', 'module'];
@@ -78,6 +79,7 @@ function load_html_elements() {
7879
allowDrop(event);
7980
});
8081
popup = document.getElementById("network-popUp");
82+
documentation = document.getElementById("documentationButton");
8183
span = document.getElementById('network-popUp-title');
8284
table = document.getElementById("network-popUp-fields");
8385
}
@@ -373,6 +375,9 @@ function fill_bot(id, group, name) {
373375
insertKeyValue(key, bot.defaults[key], BORDER_TYPES.DEFAULT, false);
374376
}
375377

378+
const periodpos = bot['module'].lastIndexOf('.');
379+
modulename = bot['module'].substring(0, periodpos).replace(/\./g, "-").replace(/_/g, "-");
380+
documentation.href = "https://intelmq.readthedocs.org/en/maintenance/user/bots.html#" + modulename;
376381
popup.setAttribute('class', "with-bot");
377382
}
378383

intelmq_manager/templates/configs.mako

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
</div>
2323

2424
<div id="network-popUp" class="without-bot">
25-
<span id="network-popUp-title">node</span> <br>
25+
<span id="network-popUp-title">node</span>
26+
<a id="documentationButton" class="btn btn-default" title="open documentation" href="">
27+
<span class="glyphicon glyphicon-question-sign"></span>
28+
</a>
2629
<table id="network-popUp-fields" class="table table-striped" style="margin:auto;">
2730
<tr>
2831
<td>id</td><td><input id="node-id" value="new value"></td>

0 commit comments

Comments
 (0)