Skip to content

Commit

Permalink
Merge pull request #418 from kac89/dev
Browse files Browse the repository at this point in the history
api settings fix
  • Loading branch information
kac89 authored Aug 24, 2024
2 parents 386ff7c + bd4408b commit e9a6745
Showing 1 changed file with 8 additions and 33 deletions.
41 changes: 8 additions & 33 deletions src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,8 @@ export class SettingsComponent implements OnInit {

ngOnInit() {

this.getProfiles();

this.getTemplates();

this.getVault();


}

foundvault(bool: boolean): boolean {
Expand Down Expand Up @@ -173,6 +168,7 @@ export class SettingsComponent implements OnInit {
this.ReportProfilesdataSource.paginator = this.paginator;
this.ReportProfilesdataSource.sort = this.sort;
}
this.getAPIReportProfiles();
});
}

Expand All @@ -184,6 +180,7 @@ export class SettingsComponent implements OnInit {
this.ReportTemplatesdataSource.paginator = this.paginator2;
this.ReportTemplatesdataSource.sort = this.sort2;
}
this.getAPITemplates();
});
}

Expand Down Expand Up @@ -387,8 +384,8 @@ export class SettingsComponent implements OnInit {

this.sessionsub.setSessionStorageItem('VULNREPO-API', JSON.stringify(vaultobj));

this.getReportProfiles();
this.getReportTemplates();
this.getProfiles();
this.getTemplates();
}

removeapikey() {
Expand All @@ -408,7 +405,7 @@ export class SettingsComponent implements OnInit {
this.apiconneted = false;
this.status = 'Not connected!';
this.tryconnectdb = true;
this.getReportProfiles();
this.getProfiles();
}

tryconnect() {
Expand Down Expand Up @@ -608,18 +605,6 @@ export class SettingsComponent implements OnInit {
}


getReportProfiles() {
this.indexeddbService.retrieveReportProfile().then(ret => {
if (ret) {
this.ReportProfilesdataSource = new MatTableDataSource(ret);
this.reportProfileList = this.ReportProfilesdataSource.data;
this.getAPIReportProfiles();
}

});
}


getAPIReportProfiles() {

const localkey = this.sessionsub.getSessionStorageItem('VULNREPO-API');
Expand Down Expand Up @@ -736,7 +721,7 @@ export class SettingsComponent implements OnInit {
this.ReportProfilesdataSource.data = this.reportProfileList;

this.indexeddbService.deleteProfile(item).then(ret => {
this.getReportProfiles();
this.getProfiles();
});

}
Expand Down Expand Up @@ -782,7 +767,7 @@ export class SettingsComponent implements OnInit {
};
this.ReportProfilesdataSource.data = this.reportProfileList;
this.indexeddbService.updateProfile(this.reportProfileList[index], result.original[0]._key).then(ret => { });
this.getReportProfiles();
this.getProfiles();
}
}

Expand Down Expand Up @@ -839,7 +824,7 @@ export class SettingsComponent implements OnInit {
this.indexeddbService.saveReportProfileinDB(parsed).then(ret => { });
}

this.getReportProfiles();
this.getProfiles();
}

downloadProfileItem(element) {
Expand Down Expand Up @@ -960,16 +945,6 @@ export class SettingsComponent implements OnInit {

}

getReportTemplates() {
this.indexeddbService.retrieveReportTemplates().then(ret => {
if (ret) {
this.ReportTemplatesdataSource = new MatTableDataSource(ret);
this.reportTemplateList = this.ReportTemplatesdataSource.data;
}
this.getAPITemplates();
});
}

getAPITemplates() {

const localkey = this.sessionsub.getSessionStorageItem('VULNREPO-API');
Expand Down

0 comments on commit e9a6745

Please sign in to comment.