@@ -578,7 +578,7 @@ export default {
578578 return this .sortStatus (a, b, key);
579579 }
580580 },
581- onTableRowAction (action , { id, name, uri }) {
581+ onTableRowAction (action , { uri }) {
582582 if (action === ' delete' ) {
583583 this .$bvModal
584584 .msgBoxConfirm (this .$tc (' pageEventLogs.modal.deleteMessage' ), {
@@ -593,27 +593,15 @@ export default {
593593 // download single log
594594 const pelJsonInfo = [];
595595 this .startLoader ();
596- if (name === ' System CE Log Entry' ) {
597- this .$store
598- .dispatch (' eventLog/downloadCELogData' , id)
599- .then ((returned ) => {
600- pelJsonInfo .push (returned);
601- })
602- .finally (() => {
603- this .downloadFile (pelJsonInfo);
604- this .endLoader ();
605- });
606- } else {
607- this .$store
608- .dispatch (' eventLog/downloadEventLogData' , id)
609- .then ((returned ) => {
610- pelJsonInfo .push (returned);
611- })
612- .finally (() => {
613- this .downloadFile (pelJsonInfo);
614- this .endLoader ();
615- });
616- }
596+ this .$store
597+ .dispatch (' eventLog/downloadLogData' , uri)
598+ .then ((returned ) => {
599+ pelJsonInfo .push (returned);
600+ })
601+ .finally (() => {
602+ this .downloadFile (pelJsonInfo);
603+ this .endLoader ();
604+ });
617605 }
618606 },
619607 onBatchAction (action ) {
@@ -697,78 +685,39 @@ export default {
697685 let counter = 1 ;
698686 while (counter <= this .allLogs .length ) {
699687 this .startLoader ();
700- if (this .allLogs [counter - 1 ].name === ' System CE Log Entry' ) {
701- await this .$store
702- .dispatch (
703- ' eventLog/downloadCELogData' ,
704- this .allLogs [counter - 1 ].id
705- )
706- .then ((returned ) => {
707- pelJsonInfo .push (returned);
708- counter = counter + 1 ;
709- })
710- .finally (() => {
711- if (pelJsonInfo .length === this .allLogs .length ) {
712- this .downloadFile (pelJsonInfo);
713- this .endLoader ();
714- }
715- });
716- } else {
717- await this .$store
718- .dispatch (
719- ' eventLog/downloadEventLogData' ,
720- this .allLogs [counter - 1 ].id
721- )
722- .then ((returned ) => {
723- pelJsonInfo .push (returned);
724- counter = counter + 1 ;
725- })
726- .finally (() => {
727- if (pelJsonInfo .length === this .allLogs .length ) {
728- this .downloadFile (pelJsonInfo);
729- this .endLoader ();
730- }
731- });
732- }
688+ await this .$store
689+ .dispatch (' eventLog/downloadLogData' , this .allLogs [counter - 1 ].uri )
690+ .then ((returned ) => {
691+ pelJsonInfo .push (returned);
692+ counter = counter + 1 ;
693+ })
694+ .finally (() => {
695+ if (pelJsonInfo .length === this .allLogs .length ) {
696+ this .downloadFile (pelJsonInfo);
697+ this .endLoader ();
698+ }
699+ });
733700 }
734701 } else {
735702 // several logs
736703 let counter = 1 ;
737704 while (counter <= this .selectedRows .length ) {
738705 this .startLoader ();
739- if (this .selectedRows [counter - 1 ].name === ' System CE Log Entry' ) {
740- await this .$store
741- .dispatch (
742- ' eventLog/downloadCELogData' ,
743- this .selectedRows [counter - 1 ].id
744- )
745- .then ((returned ) => {
746- pelJsonInfo .push (returned);
747- counter = counter + 1 ;
748- })
749- .finally (() => {
750- if (pelJsonInfo .length === this .selectedRows .length ) {
751- this .downloadFile (pelJsonInfo);
752- this .endLoader ();
753- }
754- });
755- } else {
756- await this .$store
757- .dispatch (
758- ' eventLog/downloadEventLogData' ,
759- this .selectedRows [counter - 1 ].id
760- )
761- .then ((returned ) => {
762- pelJsonInfo .push (returned);
763- counter = counter + 1 ;
764- })
765- .finally (() => {
766- if (pelJsonInfo .length === this .selectedRows .length ) {
767- this .downloadFile (pelJsonInfo);
768- this .endLoader ();
769- }
770- });
771- }
706+ await this .$store
707+ .dispatch (
708+ ' eventLog/downloadLogData' ,
709+ this .selectedRows [counter - 1 ].uri
710+ )
711+ .then ((returned ) => {
712+ pelJsonInfo .push (returned);
713+ counter = counter + 1 ;
714+ })
715+ .finally (() => {
716+ if (pelJsonInfo .length === this .selectedRows .length ) {
717+ this .downloadFile (pelJsonInfo);
718+ this .endLoader ();
719+ }
720+ });
772721 }
773722 }
774723 },
0 commit comments