]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 8 Dec 2023 03:40:46 +0000 (04:40 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 8 Dec 2023 03:40:46 +0000 (04:40 +0100)
- added column original_software, it contains the original software name, but
  without any version number or " powered by " in it

blocks_empty.db
fba/http/federation.py
fba/models/instances.py
templates/views/infos.html

index e6c495ffffe5b885d56acc638368c8192f5cc274..dec6ada3e62839974aaa9f105364a7ed5bf80a1e 100644 (file)
Binary files a/blocks_empty.db and b/blocks_empty.db differ
index eab7df3159d4f42fbfed915cdb6004573cdd6c61..2cb50f497744ea88b682a3630fc63753427a1f4b 100644 (file)
@@ -451,6 +451,9 @@ def determine_software(domain: str, path: str = None) -> str:
         logger.debug("Returning None - EXIT!")
         return None
 
+    logger.debug("Setting original software='%s' ...", software)
+    instances.set_original_software(domain, software)
+
     logger.debug("software='%s'- BEFORE!", software)
     software = software_helper.alias(software)
     logger.debug("software['%s']='%s' - AFTER!", type(software), software)
index 67a5c16a8d2a576a9a1db02fe1a2f17c723dd149..619d05b2968f32052284d6f2a8b9611ec0298a6f 100644 (file)
@@ -70,7 +70,9 @@ _pending = {
     "last_error_details" : {},
     # Wether obfuscation has been used
     "has_obfuscation"    : {},
-    # Determined software
+    # Original software
+    "original_software"  : {},
+    # Aliased software
     "software"           : {},
 }
 
@@ -510,6 +512,20 @@ def set_has_obfuscation(domain: str, status: bool):
     _set_data("has_obfuscation", domain, status)
     logger.debug("EXIT!")
 
+def set_original_software(domain: str, software: str):
+    logger.debug("domain='%s',software='%s' - CALLED!", domain, software)
+    domain_helper.raise_on(domain)
+
+    if not isinstance(software, str) and software is not None:
+        raise ValueError(f"Parameter software[]='{type(software)}' is not of type 'str'")
+    elif software == "":
+        raise ValueError("Parameter 'software' is empty")
+
+    # Set original software
+    _set_data("original_software", domain, software)
+    logger.debug("EXIT!")
+
+
 def set_software(domain: str, software: str):
     logger.debug("domain='%s',software='%s' - CALLED!", domain, software)
     domain_helper.raise_on(domain)
@@ -519,7 +535,7 @@ def set_software(domain: str, software: str):
     elif software == "":
         raise ValueError("Parameter 'software' is empty")
 
-    # Set timestamp
+    # Set software (maybe aliased to generic name)
     _set_data("software", domain, software)
     logger.debug("EXIT!")
 
index 274360f988f87fe070d97c19adcea46f4394f0a4..776c6f50904166bd68701dd26eda4ab4752eda59 100644 (file)
     </tr>
 
     <tr>
-        <td>Software:</td>
+        <td>Original software:</td>
+        <td>
+            {% if instance['original_software'] != None %}
+                <a href="list?mode=original_software&amp;value={{instance['original_software']}}&amp;amount=50">{{instance['original_software']}}</a>
+            {% else %}
+                -
+            {% endif %}
+        </td>
+    </tr>
+
+    <tr>
+        <td>Aliased software:</td>
         <td>
             {% if instance['software'] != None %}
                 <a href="list?mode=software&amp;value={{instance['software']}}&amp;amount=50">{{instance['software']}}</a>