Spaces:
Running
Running
Update flare-ui/src/app/components/environment/environment.component.ts
Browse files
flare-ui/src/app/components/environment/environment.component.ts
CHANGED
@@ -11,7 +11,8 @@ 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 { MatSliderModule } from '@angular/material/slider';
|
14 |
-
import {
|
|
|
15 |
import { EnvironmentService } from '../../services/environment.service';
|
16 |
|
17 |
@Component({
|
@@ -29,7 +30,8 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
29 |
MatProgressSpinnerModule,
|
30 |
MatSnackBarModule,
|
31 |
MatExpansionModule,
|
32 |
-
MatSliderModule
|
|
|
33 |
],
|
34 |
templateUrl: './environment.component.html',
|
35 |
styleUrls: ['./environment.component.scss']
|
@@ -60,7 +62,7 @@ export class EnvironmentComponent implements OnInit {
|
|
60 |
use_enhanced: true,
|
61 |
enable_punctuation: true,
|
62 |
interim_results: true
|
63 |
-
};
|
64 |
|
65 |
loading = true;
|
66 |
saving = false;
|
@@ -138,9 +140,6 @@ export class EnvironmentComponent implements OnInit {
|
|
138 |
if (this.environment.stt_engine === 'no_stt') {
|
139 |
this.environment.stt_engine_api_key = '';
|
140 |
}
|
141 |
-
|
142 |
-
// Always ensure STT settings exist
|
143 |
-
this.ensureSTTSettings();
|
144 |
}
|
145 |
|
146 |
getSTTKeyLabel(): string {
|
@@ -157,7 +156,7 @@ export class EnvironmentComponent implements OnInit {
|
|
157 |
return 'STT API Key';
|
158 |
}
|
159 |
}
|
160 |
-
|
161 |
getSTTKeyPlaceholder(): string {
|
162 |
switch(this.environment.stt_engine) {
|
163 |
case 'google':
|
@@ -172,7 +171,7 @@ export class EnvironmentComponent implements OnInit {
|
|
172 |
return 'Enter STT API key';
|
173 |
}
|
174 |
}
|
175 |
-
|
176 |
getSTTKeyHint(): string {
|
177 |
switch(this.environment.stt_engine) {
|
178 |
case 'google':
|
@@ -186,13 +185,12 @@ export class EnvironmentComponent implements OnInit {
|
|
186 |
default:
|
187 |
return '';
|
188 |
}
|
189 |
-
}
|
190 |
-
|
191 |
-
// formatMilliseconds metodu eksikti, ekleyelim:
|
192 |
formatMilliseconds(value: number): string {
|
193 |
return `${value}ms`;
|
194 |
}
|
195 |
-
|
196 |
save() {
|
197 |
this.saving = true;
|
198 |
|
@@ -221,7 +219,7 @@ export class EnvironmentComponent implements OnInit {
|
|
221 |
this.saving = false;
|
222 |
}
|
223 |
});
|
224 |
-
}
|
225 |
|
226 |
testConnection() {
|
227 |
this.snackBar.open('Testing connection to Spark endpoint...', undefined, {
|
|
|
11 |
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
12 |
import { MatExpansionModule } from '@angular/material/expansion';
|
13 |
import { MatSliderModule } from '@angular/material/slider';
|
14 |
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
15 |
+
import { ApiService, Environment, STTSettings } from '../../services/api.service';
|
16 |
import { EnvironmentService } from '../../services/environment.service';
|
17 |
|
18 |
@Component({
|
|
|
30 |
MatProgressSpinnerModule,
|
31 |
MatSnackBarModule,
|
32 |
MatExpansionModule,
|
33 |
+
MatSliderModule,
|
34 |
+
MatCheckboxModule
|
35 |
],
|
36 |
templateUrl: './environment.component.html',
|
37 |
styleUrls: ['./environment.component.scss']
|
|
|
62 |
use_enhanced: true,
|
63 |
enable_punctuation: true,
|
64 |
interim_results: true
|
65 |
+
};
|
66 |
|
67 |
loading = true;
|
68 |
saving = false;
|
|
|
140 |
if (this.environment.stt_engine === 'no_stt') {
|
141 |
this.environment.stt_engine_api_key = '';
|
142 |
}
|
|
|
|
|
|
|
143 |
}
|
144 |
|
145 |
getSTTKeyLabel(): string {
|
|
|
156 |
return 'STT API Key';
|
157 |
}
|
158 |
}
|
159 |
+
|
160 |
getSTTKeyPlaceholder(): string {
|
161 |
switch(this.environment.stt_engine) {
|
162 |
case 'google':
|
|
|
171 |
return 'Enter STT API key';
|
172 |
}
|
173 |
}
|
174 |
+
|
175 |
getSTTKeyHint(): string {
|
176 |
switch(this.environment.stt_engine) {
|
177 |
case 'google':
|
|
|
185 |
default:
|
186 |
return '';
|
187 |
}
|
188 |
+
}
|
189 |
+
|
|
|
190 |
formatMilliseconds(value: number): string {
|
191 |
return `${value}ms`;
|
192 |
}
|
193 |
+
|
194 |
save() {
|
195 |
this.saving = true;
|
196 |
|
|
|
219 |
this.saving = false;
|
220 |
}
|
221 |
});
|
222 |
+
}
|
223 |
|
224 |
testConnection() {
|
225 |
this.snackBar.open('Testing connection to Spark endpoint...', undefined, {
|