Spaces:
Building
Building
Update flare-ui/src/app/components/environment/environment.component.ts
Browse files
flare-ui/src/app/components/environment/environment.component.ts
CHANGED
@@ -11,6 +11,7 @@ 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({
|
16 |
selector: 'app-environment',
|
@@ -269,6 +270,7 @@ import { ApiService, Environment } from '../../services/api.service';
|
|
269 |
export class EnvironmentComponent implements OnInit {
|
270 |
private apiService = inject(ApiService);
|
271 |
private snackBar = inject(MatSnackBar);
|
|
|
272 |
|
273 |
environment: Environment = {
|
274 |
work_mode: 'hfcloud',
|
@@ -339,9 +341,12 @@ export class EnvironmentComponent implements OnInit {
|
|
339 |
|
340 |
save() {
|
341 |
this.saving = true;
|
342 |
-
|
343 |
this.apiService.updateEnvironment(this.environment).subscribe({
|
344 |
next: () => {
|
|
|
|
|
|
|
345 |
this.snackBar.open('Environment configuration saved successfully', 'Close', {
|
346 |
duration: 3000
|
347 |
});
|
|
|
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 |
+
import { EnvironmentService } from '../../services/environment.service';
|
15 |
|
16 |
@Component({
|
17 |
selector: 'app-environment',
|
|
|
270 |
export class EnvironmentComponent implements OnInit {
|
271 |
private apiService = inject(ApiService);
|
272 |
private snackBar = inject(MatSnackBar);
|
273 |
+
private environmentService = inject(EnvironmentService);
|
274 |
|
275 |
environment: Environment = {
|
276 |
work_mode: 'hfcloud',
|
|
|
341 |
|
342 |
save() {
|
343 |
this.saving = true;
|
344 |
+
|
345 |
this.apiService.updateEnvironment(this.environment).subscribe({
|
346 |
next: () => {
|
347 |
+
// Environment service'i güncelle
|
348 |
+
this.environmentService.updateEnvironment(this.environment);
|
349 |
+
|
350 |
this.snackBar.open('Environment configuration saved successfully', 'Close', {
|
351 |
duration: 3000
|
352 |
});
|