]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 6 Jul 2023 01:00:00 +0000 (03:00 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Jul 2023 01:02:15 +0000 (03:02 +0200)
- added mode=command
- added links from list.html

daemon.py
templates/views/list.html
templates/views/scoreboard.html
templates/widgets/list_links.html [new file with mode: 0644]

index a8c0eb9a04d7d0d1afad9c7a0ab2854775b1ffee..459f0fc22967d522da551677d4ccd5cc23d9b729 100755 (executable)
--- a/daemon.py
+++ b/daemon.py
@@ -113,9 +113,9 @@ def api_list(request: Request, mode: str, value: str, amount: int):
 
     domain = wildchar = punycode = reason = None
 
-    if mode in ("detection_mode", "software"):
+    if mode in ("detection_mode", "software", "command"):
         database.cursor.execute(
-            f"SELECT domain, origin, software, command, total_peers, total_blocks, first_seen, last_updated \
+            f"SELECT domain, origin, software, detection_mode, command, total_peers, total_blocks, first_seen, last_updated \
 FROM instances \
 WHERE {mode} = ? \
 ORDER BY domain \
index c6851db47e0ab65c726457f7cddd947509184173..27ece0c90304e38123f6961a2109388ea8399049 100644 (file)
@@ -24,6 +24,7 @@
             <th>Domain</th>
             <th>Origin</th>
             <th>Software</th>
+            <th>Detection mode</th>
             <th>Command</th>
             <th>First added</th>
             <th>Last seen</th>
                         {% include "widgets/links.html" %}
                         {% endwith %}
                     </td>
-                    <td>{{row['software']}}</td>
+                    <td>
+                        {% with mode='software',  amount=amount, value=row['software'] %}
+                        {% include "widgets/list_links.html" %}
+                        {% endwith %}
+                    </td>
+                    <td>
+                        {% with mode='detection_mode',  amount=amount, value=row['detection_mode'] %}
+                        {% include "widgets/list_links.html" %}
+                        {% endwith %}
+                    </td>
                     <td><code>{{row['command']}}</code></td>
                     <td>{{row['first_seen']}}</td>
                     <td>{{row['last_seen']}}</td>
index a1d9cc11ca44ff2955a5700ffccf7a1620f2d93e..bb25f1fe071aa85169df0fa8885a915eecc5337f 100644 (file)
                 <tr>
                     <td>{{loop.index}}</td>
                     <td>
-                        {% if mode in ('command', 'error_code', 'avg_peers', 'obfuscator', 'obfuscation') %}
+                        {% if mode in ('error_code', 'avg_peers', 'obfuscator', 'obfuscation') %}
                             {{entry['domain']}}
                         {% elif entry['domain'] == None %}
                             -
                         {% elif mode == 'block_level' %}
                             <a href="top?mode={{mode}}&amp;value={{entry['domain']}}&amp;amount=50">{{entry['domain']}}</a>
-                        {% elif mode in ('software', 'detection_mode') %}
+                        {% elif mode in ('software', 'detection_mode', 'command') %}
                             <a href="list?mode={{mode}}&amp;value={{entry['domain']}}&amp;amount=50">{{entry['domain']}}</a>
                         {% else %}
                             {% with domain=entry['domain'] %}
diff --git a/templates/widgets/list_links.html b/templates/widgets/list_links.html
new file mode 100644 (file)
index 0000000..00bdcf6
--- /dev/null
@@ -0,0 +1,5 @@
+{% if value != None %}
+    <a href="list?mode={{mode}}&amp;value={{value}}&amp;amount={{amount}}" title="Information on domain {{domain}}">{{value}}</a>
+{% else %}
+    None
+{% endif %}