@@ -688,16 +688,15 @@ class Monitor {
688
688
nodeRow = document . createElement ( 'tr' ) ;
689
689
nodeRow . id = `node-${ data . uid } ` ;
690
690
691
- // Create cells
691
+ // Create cells matching the HTML template structure
692
692
const cells = [
693
- { class : 'text-center' , content : '' } , // IDX
694
- { class : 'text-center' , content : '' } , // IP
695
- { class : 'text-center' , content : '' } , // Role
696
- { class : 'text-center' , content : '' } , // Round
697
- { class : 'text-center' , content : '' } , // Behavior
698
- { class : 'text-center' , content : '' } , // Status
699
- { class : 'text-center' , content : '' } , // Federation
700
- { class : 'text-center' , content : '' } // Timestamp
693
+ { class : 'py-3' , content : '' } , // IDX
694
+ { class : 'py-3' , content : '' } , // IP
695
+ { class : 'py-3' , content : '' } , // Role
696
+ { class : 'py-3' , content : '' } , // Round
697
+ { class : 'py-3' , content : '' } , // Behaviour
698
+ { class : 'py-3' , content : '' } , // Status
699
+ { class : 'py-3' , content : '' } // Actions
701
700
] ;
702
701
703
702
// Add cells to row
@@ -750,7 +749,7 @@ class Monitor {
750
749
// Update IDX
751
750
const idxCell = nodeRow . querySelector ( 'td:nth-child(1)' ) ;
752
751
if ( idxCell ) {
753
- idxCell . textContent = data . idx || '' ;
752
+ idxCell . textContent = data . idx || '0 ' ;
754
753
}
755
754
756
755
// Update IP
@@ -775,7 +774,7 @@ class Monitor {
775
774
roundCell . textContent = data . round || '0' ;
776
775
}
777
776
778
- // Update Behavior
777
+ // Update Behaviour
779
778
const behaviorCell = nodeRow . querySelector ( 'td:nth-child(5)' ) ;
780
779
if ( behaviorCell ) {
781
780
behaviorCell . innerHTML = data . malicious === "True"
@@ -788,20 +787,46 @@ class Monitor {
788
787
if ( statusCell ) {
789
788
statusCell . innerHTML = data . status
790
789
? '<span class="badge bg-success"><i class="fa fa-circle me-1"></i>Online</span>'
791
- : '<span class="badge bg-danger"><i class="fa fa-circle me-1"></i>Offline</span>' ;
790
+ : '<span class="badge bg-danger-subtle text-danger "><i class="fa fa-circle me-1"></i>Offline</span>' ;
792
791
}
793
792
794
- // Update Federation if present
795
- const federationCell = nodeRow . querySelector ( 'td:nth-child(7)' ) ;
796
- if ( federationCell && data . federation ) {
797
- federationCell . textContent = data . federation ;
798
- }
799
-
800
- // Update Timestamp if present
801
- const timestampCell = nodeRow . querySelector ( 'td:nth-child(8)' ) ;
802
- if ( timestampCell && data . timestamp ) {
803
- const date = new Date ( data . timestamp ) ;
804
- timestampCell . textContent = date . toLocaleString ( ) ;
793
+ // Update Actions
794
+ const actionsCell = nodeRow . querySelector ( 'td:nth-child(7)' ) ;
795
+ if ( actionsCell ) {
796
+ const metricsLink = data . hash ? `
797
+ <li>
798
+ <a class="dropdown-item" href="/platform/dashboard/${ this . scenarioName } /node/${ data . hash } /metrics">
799
+ <i class="fa fa-chart-bar me-2"></i>Real-time metrics
800
+ </a>
801
+ </li>
802
+ ` : '' ;
803
+
804
+ actionsCell . innerHTML = `
805
+ <div class="dropdown d-flex justify-content-center">
806
+ <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button"
807
+ data-bs-toggle="dropdown" aria-expanded="false">
808
+ <i class="fa fa-ellipsis-v"></i>
809
+ </button>
810
+ <ul class="dropdown-menu dropdown-menu-end">
811
+ ${ metricsLink }
812
+ <li>
813
+ <a class="dropdown-item download" href="/platform/dashboard/${ this . scenarioName } /node/${ data . idx } /infolog">
814
+ <i class="fa fa-file-alt me-2"></i>Download INFO logs
815
+ </a>
816
+ </li>
817
+ <li>
818
+ <a class="dropdown-item download" href="/platform/dashboard/${ this . scenarioName } /node/${ data . idx } /debuglog">
819
+ <i class="fa fa-bug me-2"></i>Download DEBUG logs
820
+ </a>
821
+ </li>
822
+ <li>
823
+ <a class="dropdown-item download" href="/platform/dashboard/${ this . scenarioName } /node/${ data . idx } /errorlog">
824
+ <i class="fa fa-exclamation-triangle me-2"></i>Download ERROR logs
825
+ </a>
826
+ </li>
827
+ </ul>
828
+ </div>
829
+ ` ;
805
830
}
806
831
807
832
console . log ( 'Table updated for node:' , data . uid ) ;
0 commit comments