ciyidogan commited on
Commit
5f965ab
·
verified ·
1 Parent(s): ba36fe4

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

Browse files
flare-ui/src/app/components/main/main.component.ts CHANGED
@@ -117,13 +117,15 @@ import { ActivityLogComponent } from '../activity-log/activity-log.component';
117
  Chat
118
  </a>
119
 
120
- <a mat-tab-link
121
- routerLink="/spark"
122
- routerLinkActive #rla6="routerLinkActive"
123
- [active]="rla6.isActive">
124
- <mat-icon>flash_on</mat-icon>
125
- Spark Integration
126
- </a>
 
 
127
 
128
  <a mat-tab-link
129
  routerLink="/test"
@@ -230,10 +232,28 @@ import { ActivityLogComponent } from '../activity-log/activity-log.component';
230
  })
231
  export class MainComponent {
232
  private authService = inject(AuthService);
233
-
 
234
  username = this.authService.getUsername() || '';
235
  showActivityLog = false;
 
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  logout() {
238
  this.authService.logout();
239
  }
 
117
  Chat
118
  </a>
119
 
120
+ @if (!isGPTMode) {
121
+ <a mat-tab-link
122
+ routerLink="/spark"
123
+ routerLinkActive #rla6="routerLinkActive"
124
+ [active]="rla6.isActive">
125
+ <mat-icon>flash_on</mat-icon>
126
+ Spark Integration
127
+ </a>
128
+ }
129
 
130
  <a mat-tab-link
131
  routerLink="/test"
 
232
  })
233
  export class MainComponent {
234
  private authService = inject(AuthService);
235
+ private apiService = inject(ApiService);
236
+
237
  username = this.authService.getUsername() || '';
238
  showActivityLog = false;
239
+ isGPTMode = false;
240
 
241
+ ngOnInit() {
242
+ // Environment bilgisini al
243
+ this.loadEnvironment();
244
+ }
245
+
246
+ private loadEnvironment() {
247
+ this.apiService.getEnvironment().subscribe({
248
+ next: (env) => {
249
+ this.isGPTMode = env.work_mode?.startsWith('gpt4o') || false;
250
+ },
251
+ error: (err) => {
252
+ console.error('Failed to load environment:', err);
253
+ }
254
+ });
255
+ }
256
+
257
  logout() {
258
  this.authService.logout();
259
  }