Spaces:
				
			
			
	
			
			
		Paused
		
	
	
	
			
			
	
	
	
	
		
		
		Paused
		
	Update flare-ui/src/app/components/spark/spark.component.ts
Browse files
    	
        flare-ui/src/app/components/spark/spark.component.ts
    CHANGED
    
    | @@ -110,90 +110,101 @@ interface SparkProject { | |
| 110 | 
             
                        </button>
         | 
| 111 | 
             
                      </div>
         | 
| 112 |  | 
| 113 | 
            -
                       | 
| 114 | 
            -
                        < | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
|  | |
|  | |
| 117 |  | 
| 118 | 
            -
                       | 
| 119 | 
             
                        <mat-divider class="section-divider"></mat-divider>
         | 
| 120 |  | 
| 121 | 
             
                        <h3>Response History</h3>
         | 
| 122 |  | 
| 123 | 
             
                        <div class="response-list">
         | 
| 124 | 
            -
                           | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
             | 
| 134 | 
            -
             | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 137 | 
            -
             | 
| 138 | 
            -
             | 
| 139 | 
            -
             | 
| 140 | 
            -
             | 
| 141 | 
            -
             | 
| 142 | 
            -
                               | 
| 143 | 
            -
             | 
| 144 | 
            -
             | 
| 145 | 
            -
                                   | 
| 146 | 
            -
             | 
| 147 | 
            -
             | 
| 148 | 
            -
             | 
| 149 | 
            -
             | 
| 150 | 
            -
             | 
| 151 | 
            -
             | 
| 152 | 
            -
             | 
| 153 | 
            -
             | 
| 154 | 
            -
             | 
| 155 | 
            -
             | 
| 156 | 
            -
             | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 161 | 
            -
             | 
| 162 | 
            -
             | 
| 163 | 
            -
             | 
| 164 | 
            -
             | 
| 165 | 
            -
             | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
             | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 183 | 
            -
             | 
| 184 | 
            -
             | 
| 185 | 
            -
             | 
| 186 | 
            -
             | 
| 187 | 
            -
             | 
| 188 | 
            -
             | 
| 189 | 
            -
             | 
| 190 | 
            -
             | 
| 191 | 
            -
             | 
| 192 | 
            -
             | 
| 193 | 
            -
             | 
| 194 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 195 | 
             
                        </div>
         | 
| 196 | 
            -
                       | 
| 197 | 
             
                    </mat-card-content>
         | 
| 198 | 
             
                  </mat-card>
         | 
| 199 | 
             
                </div>
         | 
|  | |
| 110 | 
             
                        </button>
         | 
| 111 | 
             
                      </div>
         | 
| 112 |  | 
| 113 | 
            +
                      @if (loading) {
         | 
| 114 | 
            +
                        <div class="loading-indicator">
         | 
| 115 | 
            +
                          <mat-spinner diameter="40"></mat-spinner>
         | 
| 116 | 
            +
                          <p>Processing request...</p>
         | 
| 117 | 
            +
                        </div>
         | 
| 118 | 
            +
                      }
         | 
| 119 |  | 
| 120 | 
            +
                      @if (responses.length > 0) {
         | 
| 121 | 
             
                        <mat-divider class="section-divider"></mat-divider>
         | 
| 122 |  | 
| 123 | 
             
                        <h3>Response History</h3>
         | 
| 124 |  | 
| 125 | 
             
                        <div class="response-list">
         | 
| 126 | 
            +
                          @for (response of responses; track response.timestamp) {
         | 
| 127 | 
            +
                            <mat-expansion-panel [expanded]="$index === 0">
         | 
| 128 | 
            +
                              <mat-expansion-panel-header>
         | 
| 129 | 
            +
                                <mat-panel-title>
         | 
| 130 | 
            +
                                  <mat-chip [class]="response.error ? 'error-chip' : 'success-chip'">
         | 
| 131 | 
            +
                                    {{ response.type }}
         | 
| 132 | 
            +
                                  </mat-chip>
         | 
| 133 | 
            +
                                  <span class="timestamp">{{ response.timestamp | date:'HH:mm:ss' }}</span>
         | 
| 134 | 
            +
                                </mat-panel-title>
         | 
| 135 | 
            +
                              </mat-expansion-panel-header>
         | 
| 136 | 
            +
             | 
| 137 | 
            +
                              @if (response.request) {
         | 
| 138 | 
            +
                                <div class="response-section">
         | 
| 139 | 
            +
                                  <h4>Request:</h4>
         | 
| 140 | 
            +
                                  <pre class="json-display">{{ response.request | json }}</pre>
         | 
| 141 | 
            +
                                </div>
         | 
| 142 | 
            +
                              }
         | 
| 143 | 
            +
             | 
| 144 | 
            +
                              @if (response.response) {
         | 
| 145 | 
            +
                                <div class="response-section">
         | 
| 146 | 
            +
                                  <h4>Response:</h4>
         | 
| 147 | 
            +
                                  @if (response.type === 'Get Project Status' && response.response.projects) {
         | 
| 148 | 
            +
                                    <table mat-table [dataSource]="response.response.projects" class="projects-table">
         | 
| 149 | 
            +
                                      <ng-container matColumnDef="project_name">
         | 
| 150 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Project</th>
         | 
| 151 | 
            +
                                        <td mat-cell *matCellDef="let project">{{ project.project_name }}</td>
         | 
| 152 | 
            +
                                      </ng-container>
         | 
| 153 | 
            +
             | 
| 154 | 
            +
                                      <ng-container matColumnDef="version">
         | 
| 155 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Version</th>
         | 
| 156 | 
            +
                                        <td mat-cell *matCellDef="let project">v{{ project.version }}</td>
         | 
| 157 | 
            +
                                      </ng-container>
         | 
| 158 | 
            +
             | 
| 159 | 
            +
                                      <ng-container matColumnDef="status">
         | 
| 160 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Status</th>
         | 
| 161 | 
            +
                                        <td mat-cell *matCellDef="let project">
         | 
| 162 | 
            +
                                          <mat-chip [class]="getStatusClass(project.status)">
         | 
| 163 | 
            +
                                            {{ project.status }}
         | 
| 164 | 
            +
                                          </mat-chip>
         | 
| 165 | 
            +
                                        </td>
         | 
| 166 | 
            +
                                      </ng-container>
         | 
| 167 | 
            +
             | 
| 168 | 
            +
                                      <ng-container matColumnDef="enabled">
         | 
| 169 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Enabled</th>
         | 
| 170 | 
            +
                                        <td mat-cell *matCellDef="let project">
         | 
| 171 | 
            +
                                          <mat-icon [color]="project.enabled ? 'primary' : ''">
         | 
| 172 | 
            +
                                            {{ project.enabled ? 'check_circle' : 'cancel' }}
         | 
| 173 | 
            +
                                          </mat-icon>
         | 
| 174 | 
            +
                                        </td>
         | 
| 175 | 
            +
                                      </ng-container>
         | 
| 176 | 
            +
             | 
| 177 | 
            +
                                      <ng-container matColumnDef="base_model">
         | 
| 178 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Base Model</th>
         | 
| 179 | 
            +
                                        <td mat-cell *matCellDef="let project" class="model-cell">
         | 
| 180 | 
            +
                                          {{ project.base_model }}
         | 
| 181 | 
            +
                                        </td>
         | 
| 182 | 
            +
                                      </ng-container>
         | 
| 183 | 
            +
             | 
| 184 | 
            +
                                      <ng-container matColumnDef="last_accessed">
         | 
| 185 | 
            +
                                        <th mat-header-cell *matHeaderCellDef>Last Accessed</th>
         | 
| 186 | 
            +
                                        <td mat-cell *matCellDef="let project">{{ project.last_accessed }}</td>
         | 
| 187 | 
            +
                                      </ng-container>
         | 
| 188 | 
            +
             | 
| 189 | 
            +
                                      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
         | 
| 190 | 
            +
                                      <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
         | 
| 191 | 
            +
                                    </table>
         | 
| 192 | 
            +
                                  } @else {
         | 
| 193 | 
            +
                                    <pre class="json-display">{{ response.response | json }}</pre>
         | 
| 194 | 
            +
                                  }
         | 
| 195 | 
            +
                                </div>
         | 
| 196 | 
            +
                              }
         | 
| 197 | 
            +
             | 
| 198 | 
            +
                              @if (response.error) {
         | 
| 199 | 
            +
                                <div class="response-section error">
         | 
| 200 | 
            +
                                  <h4>Error:</h4>
         | 
| 201 | 
            +
                                  <pre class="json-display error-text">{{ response.error }}</pre>
         | 
| 202 | 
            +
                                </div>
         | 
| 203 | 
            +
                              }
         | 
| 204 | 
            +
                            </mat-expansion-panel>
         | 
| 205 | 
            +
                          }
         | 
| 206 | 
             
                        </div>
         | 
| 207 | 
            +
                      }
         | 
| 208 | 
             
                    </mat-card-content>
         | 
| 209 | 
             
                  </mat-card>
         | 
| 210 | 
             
                </div>
         | 

