@@ -43,12 +43,13 @@ import { DialogEditorFullscreenComponent } from '../dialog-editor-fullscreen/dia
43
43
import { DialogAttachPreviewComponent } from '../dialog-attach-preview/dialog-attach-preview.component' ;
44
44
import { AlignmentType , Document , Footer , Header , Packer , PageBreak , HeadingLevel , ImageRun , PageNumber , NumberFormat , Paragraph , TextRun , TableOfContents , Table , TableCell , TableRow , WidthType } from "docx" ;
45
45
import { UtilsService } from '../utils.service' ;
46
- import { OllamaServiceService } from '../ollama-service.service' ;
47
- import { DialogOllamaSettingsComponent } from '../dialog-ollama-settings/dialog-ollama-settings.component' ;
46
+ import { OllamaServiceService } from '../ollama-service.service' ;
47
+ import { DialogOllamaSettingsComponent } from '../dialog-ollama-settings/dialog-ollama-settings.component' ;
48
48
import { DialogOllamaComponent } from '../dialog-ollama/dialog-ollama.component' ;
49
49
import { CurrentdateService } from '../currentdate.service' ;
50
50
import { DialogMergeIssuesComponent } from '../dialog-merge-issues/dialog-merge-issues.component' ;
51
51
import { DialogReportHistoryComponent } from '../dialog-report-history/dialog-report-history.component' ;
52
+ import { DialogSpinnerComponent } from '../dialog-spinner/dialog-spinner.component' ;
52
53
53
54
export interface Tags {
54
55
name : string ;
@@ -122,6 +123,7 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
122
123
pok = 0 ;
123
124
prev_height = 190 ;
124
125
timerCounter = 0 ;
126
+ spinner :any ;
125
127
savemsg = '' ;
126
128
report_decryption_in_progress : boolean ;
127
129
report_encryption_in_progress : boolean ;
@@ -182,7 +184,7 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
182
184
183
185
aiprogress = false ;
184
186
aiconnected = false ;
185
- models :any ;
187
+ models : any ;
186
188
187
189
@HostListener ( 'window:keydown.control.shift.l' , [ '$event' ] )
188
190
GoToNewReport ( event : KeyboardEvent ) {
@@ -343,16 +345,16 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
343
345
344
346
345
347
this . indexeddbService . getkeybyAiintegration ( ) . then ( ret => {
346
-
347
- if ( ret [ 0 ] ) {
348
+
349
+ if ( ret [ 0 ] ) {
348
350
this . aiconnected = true ;
349
351
this . models = ret [ 0 ] ;
350
352
}
351
- } ) ;
353
+ } ) ;
352
354
}
353
355
354
356
355
- ngAfterViewInit ( ) { }
357
+ ngAfterViewInit ( ) { }
356
358
357
359
calendarDateChanged ( ) {
358
360
this . selectedRangeValue = new DateRange < Date > ( new Date ( this . decryptedReportDataChanged . report_metadata . starttest ) , new Date ( this . decryptedReportDataChanged . report_metadata . endtest ) ) ;
@@ -705,14 +707,14 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
705
707
const ret = this . selectedResult [ event ] ;
706
708
const index : number = this . decryptedReportDataChanged . report_vulns . indexOf ( ret ) ;
707
709
if ( index !== - 1 ) {
708
- if ( checked === true ) {
709
- this . selectedIssues . push ( { "index" : index , "data" : ret } ) ;
710
+ if ( checked === true ) {
711
+ this . selectedIssues . push ( { "index" : index , "data" : ret } ) ;
710
712
711
- } else if ( checked === false ) {
712
- const index2 : number = this . selectedIssues . findIndex ( i => i . data === ret )
713
- if ( index2 !== - 1 ) {
714
- this . selectedIssues . splice ( index2 , 1 ) ;
715
- }
713
+ } else if ( checked === false ) {
714
+ const index2 : number = this . selectedIssues . findIndex ( i => i . data === ret )
715
+ if ( index2 !== - 1 ) {
716
+ this . selectedIssues . splice ( index2 , 1 ) ;
717
+ }
716
718
}
717
719
718
720
}
@@ -729,13 +731,13 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
729
731
730
732
checkcheckbox ( i ) {
731
733
732
- let returnVal = false ;
733
- const ret = this . selectedResult [ i ] ;
734
+ let returnVal = false ;
735
+ const ret = this . selectedResult [ i ] ;
734
736
735
- const index2 : number = this . selectedIssues . findIndex ( i => i . data === ret )
736
- if ( index2 !== - 1 ) {
737
- returnVal = true ;
738
- }
737
+ const index2 : number = this . selectedIssues . findIndex ( i => i . data === ret )
738
+ if ( index2 !== - 1 ) {
739
+ returnVal = true ;
740
+ }
739
741
740
742
return returnVal
741
743
}
@@ -791,7 +793,7 @@ export class ReportComponent implements OnInit, OnDestroy, AfterViewInit {
791
793
792
794
this . decryptedReportDataChanged . report_vulns . forEach ( ( element , ind ) => {
793
795
794
- this . selectedIssues . push ( { "index" : ind , "data" : element } ) ;
796
+ this . selectedIssues . push ( { "index" : ind , "data" : element } ) ;
795
797
796
798
} ) ;
797
799
@@ -947,7 +949,7 @@ Sample code here\n\
947
949
948
950
if ( this . decryptedReportDataChanged . report_vulns . length > 0 ) {
949
951
setTimeout ( ( ) => {
950
- if ( this . calendar ) {
952
+ if ( this . calendar ) {
951
953
this . calendar . updateTodaysDate ( ) ;
952
954
}
953
955
} ) ;
@@ -962,14 +964,14 @@ Sample code here\n\
962
964
963
965
getData ( event ?: PageEvent ) {
964
966
965
- if ( event ) {
967
+ if ( event ) {
966
968
this . pageSize = event . pageSize ;
967
969
this . pageIndex = event . pageIndex ;
968
970
}
969
971
970
972
this . selectedResult = this . decryptedReportDataChanged . report_vulns . slice ( this . pageIndex * this . pageSize , this . pageIndex * this . pageSize + this . pageSize ) ;
971
973
return event ;
972
-
974
+
973
975
}
974
976
975
977
renderdateformat ( inputdate ) {
@@ -1368,7 +1370,7 @@ Sample code here\n\
1368
1370
1369
1371
for ( const [ key , value ] of Object . entries ( this . decryptedReportDataChanged . report_vulns ) ) {
1370
1372
1371
- if ( value ) {
1373
+ if ( value ) {
1372
1374
if ( value [ "severity" ] === "Critical" ) {
1373
1375
critical . push ( value ) ;
1374
1376
} else if ( value [ "severity" ] === "High" ) {
@@ -3051,6 +3053,7 @@ Date | Description
3051
3053
link . setAttribute ( 'download' , report_info . report_name + ' ' + report_info . report_id + encryptedtext + ' (vulnrepo.com).html' ) ;
3052
3054
link . style . visibility = 'hidden' ;
3053
3055
document . body . appendChild ( link ) ;
3056
+ this . hidespinner ( ) ;
3054
3057
link . click ( ) ;
3055
3058
document . body . removeChild ( link ) ;
3056
3059
}
@@ -3075,6 +3078,7 @@ Date | Description
3075
3078
3076
3079
3077
3080
DownloadHTMLv2 ( report_info , encrypted , type_dep , encpass ) : void {
3081
+ this . showspinner ( ) ;
3078
3082
const json = {
3079
3083
"report_name" : report_info . report_name ,
3080
3084
"report_id" : report_info . report_id ,
@@ -3423,8 +3427,8 @@ Date | Description
3423
3427
3424
3428
fastsearchBB ( poc , showsnack ) {
3425
3429
this . BBmsg = 'Please wait, searching...' ;
3426
- let scope = [ ] ;
3427
- this . bugbountylist . forEach ( function ( item :any ) {
3430
+ let scope = [ ] ;
3431
+ this . bugbountylist . forEach ( function ( item : any ) {
3428
3432
scope = scope . concat ( item . domains ) ;
3429
3433
} ) ;
3430
3434
@@ -3441,7 +3445,7 @@ Date | Description
3441
3445
// get only scope & search
3442
3446
const findedbounty = scope . find ( x => x == match ) ;
3443
3447
if ( findedbounty ) {
3444
- this . bugbountylist . forEach ( function ( item :any ) {
3448
+ this . bugbountylist . forEach ( function ( item : any ) {
3445
3449
const findedbounty2 = item . domains . find ( x => x == findedbounty ) ;
3446
3450
if ( findedbounty2 ) {
3447
3451
arr . push ( item ) ;
@@ -3602,7 +3606,7 @@ Date | Description
3602
3606
}
3603
3607
3604
3608
3605
- aiasist ( ) {
3609
+ aiasist ( ) {
3606
3610
console . log ( 'AI start chat' ) ;
3607
3611
this . aiprogress = true ;
3608
3612
@@ -3625,17 +3629,17 @@ Date | Description
3625
3629
3626
3630
<ATTACHMENT_FILE>
3627
3631
<FILE_INDEX>File 1</FILE_INDEX>
3628
- <FILE_NAME>` + this . report_info . report_name + `</FILE_NAME>
3632
+ <FILE_NAME>` + this . report_info . report_name + `</FILE_NAME>
3629
3633
<FILE_CONTENT>
3630
- ` + JSON . stringify ( json ) + `
3634
+ ` + JSON . stringify ( json ) + `
3631
3635
</FILE_CONTENT>
3632
3636
</ATTACHMENT_FILE>
3633
3637
` ;
3634
3638
3635
3639
this . decryptedReportDataChanged . report_summary = "" ;
3636
3640
3637
3641
let tempx = "" ;
3638
- this . ollamaService . chatStream ( this . models . ollama_url , msgin , this . models . model , [ ] , [ ] , this . models . defaultprompt ) . subscribe ( {
3642
+ this . ollamaService . chatStream ( this . models . ollama_url , msgin , this . models . model , [ ] , [ ] , this . models . defaultprompt ) . subscribe ( {
3639
3643
next : ( text ) => {
3640
3644
this . decryptedReportDataChanged . report_summary += text ;
3641
3645
tempx += text ;
@@ -3653,7 +3657,7 @@ Date | Description
3653
3657
this . aiprogress = false ;
3654
3658
} ,
3655
3659
error : ( ) => {
3656
-
3660
+
3657
3661
}
3658
3662
} ) ;
3659
3663
@@ -3667,17 +3671,17 @@ Date | Description
3667
3671
disableClose : false ,
3668
3672
data : [ ]
3669
3673
} ) ;
3670
-
3674
+
3671
3675
dialogRef . afterClosed ( ) . subscribe ( result => {
3672
3676
console . log ( 'The AI-Settings dialog was closed' ) ;
3673
3677
if ( result ) {
3674
3678
3675
3679
this . indexeddbService . getkeybyAiintegration ( ) . then ( ret => {
3676
-
3677
- if ( ret [ 0 ] ) {
3680
+
3681
+ if ( ret [ 0 ] ) {
3678
3682
this . models = ret [ 0 ] ;
3679
3683
}
3680
- } ) ;
3684
+ } ) ;
3681
3685
3682
3686
}
3683
3687
} ) ;
@@ -3706,7 +3710,7 @@ Date | Description
3706
3710
const dialogRef = this . dialog . open ( DialogOllamaComponent , {
3707
3711
width : '800px' ,
3708
3712
disableClose : true ,
3709
- data : [ { "prompt" : `` , "files" : [ { "filename" : this . report_info . report_name + ".json" , "date" : String ( this . currentdateService . getcurrentDate ( ) ) , "filetype" : "json" , "file" : btoa ( unescape ( encodeURIComponent ( xxx ) ) ) } ] , "images" : [ ] } ]
3713
+ data : [ { "prompt" : `` , "files" : [ { "filename" : this . report_info . report_name + ".json" , "date" : String ( this . currentdateService . getcurrentDate ( ) ) , "filetype" : "json" , "file" : btoa ( unescape ( encodeURIComponent ( xxx ) ) ) } ] , "images" : [ ] } ]
3710
3714
} ) ;
3711
3715
3712
3716
dialogRef . afterClosed ( ) . subscribe ( result => {
@@ -3715,6 +3719,23 @@ Date | Description
3715
3719
3716
3720
}
3717
3721
3722
+ hidespinner ( ) : void {
3723
+ this . spinner . close ( ) ;
3724
+ }
3725
+ showspinner ( ) : void {
3726
+
3727
+ this . spinner = this . dialog . open ( DialogSpinnerComponent , {
3728
+ maxWidth : '250px' ,
3729
+ maxHeight : '250px' ,
3730
+ height : '250px' ,
3731
+ width : '250px' ,
3732
+ disableClose : false ,
3733
+ panelClass : 'my-css-class-spinner' ,
3734
+ data : ''
3735
+ } ) ;
3736
+
3737
+ }
3738
+
3718
3739
3719
3740
showHistory ( report_id ) : void {
3720
3741
0 commit comments