feat(xtream): add clear form button and functionality

This commit is contained in:
4gray committed 2026-03-29 13:37:08 +02:00
1 parent f6f3103794
commit f9e25c9799
3 files changed
+30 -8

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
{
"CLEAR": "Clear",
"CLOSE": "Close",
"PLAYLISTS": "Playlists",
"HOME": {
@@ -35,14 +35,23 @@
</mat-form-field>
<div class="button-row">
<button
mat-button
type="button"
[disabled]="!form.valid || isTestingConnection"
(click)="testConnection()"
>
{{ isTestingConnection ? 'Testing...' : 'Test Connection' }}
</button>
<div>
<button
mat-button
type="button"
[disabled]="!form.valid || isTestingConnection"
(click)="testConnection()"
>
{{ isTestingConnection ? 'Testing...' : 'Test Connection' }}
</button>
<button
mat-button
type="button"
(click)="clearForm()"
>
{{ 'CLEAR' | translate }}
</button>
</div>
<button
mat-button
type="submit"
@@ -127,6 +127,18 @@ export class XtreamCodeImportComponent {
return this.portalStatusService.getStatusIcon(this.connectionStatus);
}
clearForm() {
this.form.reset({
_id: uuid(),
title: '',
password: '',
username: '',
serverUrl: '',
importDate: new Date().toISOString(),
});
this.connectionStatus = null;
}
addPlaylist() {
const serverUrlAsString = this.form.value.serverUrl as string;
const url = new URL(serverUrlAsString);