mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 02:46:16 -08:00
feat(xtream): add clear form button and functionality
This commit is contained in:
1 parent
f6f3103794
commit
f9e25c9799
3 files changed
+30
-8
No files matched your search
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"CLEAR": "Clear",
|
||||
"CLOSE": "Close",
|
||||
"PLAYLISTS": "Playlists",
|
||||
"HOME": {
|
||||
|
||||
+17
-8
@@ -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"
|
||||
|
||||
+12
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user