ciyidogan commited on
Commit
8fef57d
·
verified ·
1 Parent(s): 59d6f69

Update flare-ui/src/app/components/environment/environment.component.ts

Browse files
flare-ui/src/app/components/environment/environment.component.ts CHANGED
@@ -9,6 +9,7 @@ import { MatButtonModule } from '@angular/material/button';
9
  import { MatIconModule } from '@angular/material/icon';
10
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
11
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
 
12
  import { ApiService, Environment } from '../../services/api.service';
13
 
14
  @Component({
@@ -24,7 +25,8 @@ import { ApiService, Environment } from '../../services/api.service';
24
  MatButtonModule,
25
  MatIconModule,
26
  MatProgressSpinnerModule,
27
- MatSnackBarModule
 
28
  ],
29
  template: `
30
  <div class="environment-container">
@@ -92,6 +94,31 @@ import { ApiService, Environment } from '../../services/api.service';
92
  </button>
93
  </mat-form-field>
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  <div class="form-actions">
96
  <button
97
  mat-raised-button
@@ -151,6 +178,22 @@ import { ApiService, Environment } from '../../services/api.service';
151
  margin-bottom: 20px;
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  .form-actions {
155
  display: flex;
156
  gap: 16px;
@@ -177,6 +220,10 @@ import { ApiService, Environment } from '../../services/api.service';
177
  .mat-mdc-progress-spinner {
178
  --mdc-circular-progress-active-indicator-color: white;
179
  }
 
 
 
 
180
  }
181
  `]
182
  })
@@ -187,7 +234,8 @@ export class EnvironmentComponent implements OnInit {
187
  environment: Environment = {
188
  work_mode: 'hfcloud',
189
  cloud_token: '',
190
- spark_endpoint: ''
 
191
  };
192
 
193
  loading = true;
 
9
  import { MatIconModule } from '@angular/material/icon';
10
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
11
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
12
+ import { MatExpansionModule } from '@angular/material/expansion';
13
  import { ApiService, Environment } from '../../services/api.service';
14
 
15
  @Component({
 
25
  MatButtonModule,
26
  MatIconModule,
27
  MatProgressSpinnerModule,
28
+ MatSnackBarModule,
29
+ MatExpansionModule
30
  ],
31
  template: `
32
  <div class="environment-container">
 
94
  </button>
95
  </mat-form-field>
96
 
97
+ <mat-expansion-panel class="prompt-panel">
98
+ <mat-expansion-panel-header>
99
+ <mat-panel-title>
100
+ <mat-icon>psychology</mat-icon>
101
+ Internal System Prompt
102
+ </mat-panel-title>
103
+ <mat-panel-description>
104
+ Advanced configuration for Spark LLM
105
+ </mat-panel-description>
106
+ </mat-expansion-panel-header>
107
+
108
+ <mat-form-field appearance="outline" class="full-width">
109
+ <mat-label>Internal Prompt</mat-label>
110
+ <textarea
111
+ matInput
112
+ name="internalPrompt"
113
+ [(ngModel)]="environment.internal_prompt"
114
+ [disabled]="loading"
115
+ rows="10"
116
+ placeholder="Enter internal system prompt for Spark..."
117
+ ></textarea>
118
+ <mat-hint>This prompt will be prepended to all project prompts</mat-hint>
119
+ </mat-form-field>
120
+ </mat-expansion-panel>
121
+
122
  <div class="form-actions">
123
  <button
124
  mat-raised-button
 
178
  margin-bottom: 20px;
179
  }
180
 
181
+ .prompt-panel {
182
+ margin-bottom: 20px;
183
+
184
+ mat-expansion-panel-header {
185
+ mat-panel-title {
186
+ display: flex;
187
+ align-items: center;
188
+ gap: 8px;
189
+
190
+ mat-icon {
191
+ color: #666;
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
  .form-actions {
198
  display: flex;
199
  gap: 16px;
 
220
  .mat-mdc-progress-spinner {
221
  --mdc-circular-progress-active-indicator-color: white;
222
  }
223
+
224
+ .mat-expansion-panel-body {
225
+ padding: 16px 0 !important;
226
+ }
227
  }
228
  `]
229
  })
 
234
  environment: Environment = {
235
  work_mode: 'hfcloud',
236
  cloud_token: '',
237
+ spark_endpoint: '',
238
+ internal_prompt: ''
239
  };
240
 
241
  loading = true;