From 3bd8cd335bdbf0e9627ffd6b75a577d597896979 Mon Sep 17 00:00:00 2001 From: cv5ch <176032962+cv5ch@users.noreply.github.com> Date: Mon, 7 Jul 2025 12:48:27 +0200 Subject: [PATCH] Show checkmark icon after hashlist name in task table, if all hashes of this hashlist are cracked --- .../tables/ht-table/ht-table.component.html | 14 ++++++------- .../tasks-table/tasks-table.component.ts | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/app/core/_components/tables/ht-table/ht-table.component.html b/src/app/core/_components/tables/ht-table/ht-table.component.html index a5c2d903..4bd919b1 100644 --- a/src/app/core/_components/tables/ht-table/ht-table.component.html +++ b/src/app/core/_components/tables/ht-table/ht-table.component.html @@ -235,16 +235,16 @@ - + {{ tableColumn.icon(element).name }}{{ icon.name }} - {{ - tableColumn.icon(element).name + {{ + icon.name }} diff --git a/src/app/core/_components/tables/tasks-table/tasks-table.component.ts b/src/app/core/_components/tables/tasks-table/tasks-table.component.ts index 6a1ec8fb..41fce492 100644 --- a/src/app/core/_components/tables/tasks-table/tasks-table.component.ts +++ b/src/app/core/_components/tables/tasks-table/tasks-table.component.ts @@ -4,6 +4,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { SafeHtml } from '@angular/platform-browser'; import { ChunkData } from '@models/chunk.model'; +import { JHashlist } from '@models/hashlist.model'; import { JTaskWrapper } from '@models/task-wrapper.model'; import { JTask } from '@models/task.model'; @@ -31,6 +32,7 @@ import { import { TasksDataSource } from '@datasources/tasks.datasource'; +import { TaskWrapper } from '@src/app/core/_constants/userpermissions.config'; import { convertCrackingSpeed, convertToLocale } from '@src/app/shared/utils/util'; import { ModalSubtasksComponent } from '@src/app/tasks/show-tasks/modal-subtasks/modal-subtasks.component'; @@ -198,6 +200,7 @@ export class TasksTableComponent extends BaseTableComponent implements OnInit, O id: TaskTableCol.HASHLISTS, dataKey: 'hashlistId', routerLink: (wrapper: JTaskWrapper) => this.renderHashlistLinkFromWrapper(wrapper), + icon: (wrapper: JTaskWrapper) => this.renderHashlistIcon(wrapper.hashlist), isSortable: false, isSearchable: true, export: async (wrapper: JTaskWrapper) => wrapper.hashlist.name + '' @@ -788,4 +791,21 @@ export class TasksTableComponent extends BaseTableComponent implements OnInit, O } return of(links); } + + /** + * Renders checkmark icon, if all hashes of hashlist are cracked + * @param hashlist Hashlist object + * @private + */ + private renderHashlistIcon(hashlist: JHashlist): HTTableIcon | undefined { + const allHashesCracked = hashlist.hashCount === hashlist.cracked; + + if (allHashesCracked) { + return { + name: 'check', + tooltip: 'All hashes cracked' + }; + } + return undefined; + } }