diff --git a/cracklab/server/services/job_export.py b/cracklab/server/services/job_export.py index fcd968b..711b2a3 100644 --- a/cracklab/server/services/job_export.py +++ b/cracklab/server/services/job_export.py @@ -95,6 +95,15 @@ class JobExportService: return value + def format_local_timestamp(self, text: str) -> str: + value = self._parse_utc(text) + local_value = value.astimezone(self._timezone) + + return ( + local_value.strftime("%Y-%m-%d %H:%M:%S") + + f" {self._timezone_name}" + ) + @staticmethod def _unique_hash_content(rows) -> tuple[str, int]: unique_hashes: list[str] = [] diff --git a/cracklab/server/web/routes.py b/cracklab/server/web/routes.py index e37d431..e994b75 100644 --- a/cracklab/server/web/routes.py +++ b/cracklab/server/web/routes.py @@ -151,19 +151,26 @@ def jobs_page(): search_context_token, ) - if ( - search_context is not None - and not search_context["expired"] - and selected_method_id - and selected_version is not None - ): - search_statistics = ( - issuance_service.get_search_context_statistics( - search_context["token_hash"], - selected_method_id, - selected_version, - ) + if search_context is not None: + search_context["expires_at_local"] = ( + JobExportService(conn).format_local_timestamp( + search_context["expires_at"] ) + ) + + if ( + search_context is not None + and not search_context["expired"] + and selected_method_id + and selected_version is not None + ): + search_statistics = ( + issuance_service.get_search_context_statistics( + search_context["token_hash"], + selected_method_id, + selected_version, + ) + ) if request.method == "POST": if not selected_method_id: diff --git a/cracklab/server/web/static/cracklab.css b/cracklab/server/web/static/cracklab.css index 4b785a4..11aae5b 100644 --- a/cracklab/server/web/static/cracklab.css +++ b/cracklab/server/web/static/cracklab.css @@ -1301,7 +1301,7 @@ tbody tr:hover { } .jobs-search-stats-grid { - grid-template-columns: repeat(6, minmax(0, 1fr)); + grid-template-columns: repeat(7, minmax(0, 1fr)); } @media (max-width: 1100px) { diff --git a/cracklab/server/web/templates/jobs.html b/cracklab/server/web/templates/jobs.html index 33204e5..92be88f 100644 --- a/cracklab/server/web/templates/jobs.html +++ b/cracklab/server/web/templates/jobs.html @@ -162,6 +162,39 @@ + {% if statistics %} +
+

Selected Method Statistics

+ +
+
+
{{ statistics["total_count"] }}
+
Handshakes
+
+ +
+
{{ statistics["found_count"] }}
+
Password Found
+
+ +
+
{{ statistics["covered_count"] }}
+
Covered
+
+ +
+
{{ statistics["reserved_count"] }}
+
Reserved
+
+ +
+
{{ statistics["available_count"] }}
+
Available
+
+
+
+ {% endif %} + {% if search_context_token %}

Search Results

@@ -183,7 +216,7 @@

Источник: результаты поиска WiFi GPS Mapper. Контекст действителен до - {{ search_context["expires_at"] }} UTC. + {{ search_context["expires_at_local"] }}.

{% if search_statistics %} @@ -311,38 +344,6 @@ }); - {% if statistics %} -
-

Selected Method Statistics

- -
-
-
{{ statistics["total_count"] }}
-
Handshakes
-
- -
-
{{ statistics["found_count"] }}
-
Password Found
-
- -
-
{{ statistics["covered_count"] }}
-
Covered
-
- -
-
{{ statistics["reserved_count"] }}
-
Reserved
-
- -
-
{{ statistics["available_count"] }}
-
Available
-
-
-
- {% endif %}