]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[WebUI] Add `Delete hash` button 5454/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 2 May 2025 15:38:30 +0000 (18:38 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 2 May 2025 15:38:30 +0000 (18:38 +0300)
- Add `Delete hash` button
- Rename `Upload FUZZY` button to `Add hash`

interface/index.html
interface/js/app/upload.js

index a759ac48f9f286394e3eede6a11fa14e0a407943..8329a74ddd1502337c8d486e27587c2f605c855c 100644 (file)
                                                        </div>
                                                        <div class="col-lg-6">
                                                                <div class="card bg-light shadow card-body card p-2">
-                                                                       <p>Learn Fuzzy storage:</p>
+                                                                       <p>Fuzzy hash storage management:</p>
                                                                        <form class="d-flex">
                                                                                <div class="d-flex align-items-center">
                                                                                        <label for="fuzzyFlagText">Flag:</label>
                                                                                        <label for="fuzzyWeightText">Weight:</label>
                                                                                        <input name="fuzzyWeightText" id="fuzzyWeightText" class="form-control ms-1" type="number" value="1"/>
                                                                                </div>
-                                                                               <button class="btn btn-warning ms-2 d-flex align-items-center" data-upload="fuzzy" disabled><i class="fas fa-upload me-2"></i>Upload FUZZY</button>
+                                                                               <button class="btn btn-warning ms-2 d-flex align-items-center" data-upload="fuzzyadd" disabled><i class="fas fa-circle-plus me-2"></i>Add hash</button>
+                                                                               <button class="btn btn-danger ms-2 d-flex align-items-center" data-upload="fuzzydel" disabled><i class="fas fa-trash-can me-2"></i>Delete hash</button>
                                                                        </form>
                                                                </div>
                                                        </div>
index a484a41aaced5e3ab6c270b2c43de73038a2fc69..d8519629649f7fb058948a1b814fcffebaac05cd 100644 (file)
@@ -42,8 +42,10 @@ define(["jquery", "app/common", "app/libft"],
                 url = "learnspam";
             } else if (source === "ham") {
                 url = "learnham";
-            } else if (source === "fuzzy") {
+            } else if (source === "fuzzyadd") {
                 url = "fuzzyadd";
+            } else if (source === "fuzzydel") {
+                url = "fuzzydel";
             } else if (source === "scan") {
                 url = "checkv2";
             }
@@ -245,11 +247,15 @@ define(["jquery", "app/common", "app/libft"],
                     getFuzzyHashes(data);
                 } else {
                     let headers = {};
-                    if (source === "fuzzy") {
+                    if (source === "fuzzyadd") {
                         headers = {
                             flag: $("#fuzzyFlagText").val(),
                             weight: $("#fuzzyWeightText").val()
                         };
+                    } else if (source === "fuzzydel") {
+                        headers = {
+                            flag: $("#fuzzyFlagText").val(),
+                        };
                     }
                     uploadText(data, source, headers);
                 }