frontend: add loading state handling in DevelopersComponent
This commit is contained in:
parent
e1bf07532c
commit
a3560ee845
@ -7,6 +7,23 @@
|
|||||||
<p class="subtitle">Everyting you need to embed OpenVidu Meet in your applications.</p>
|
<p class="subtitle">Everyting you need to embed OpenVidu Meet in your applications.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (isLoading()) {
|
||||||
|
<div class="ov-page-loading">
|
||||||
|
<div class="loading-content">
|
||||||
|
<div class="loading-header">
|
||||||
|
<div class="loading-title">
|
||||||
|
<mat-icon class="ov-settings-icon loading-icon">settings</mat-icon>
|
||||||
|
<h1>Loading Settings</h1>
|
||||||
|
</div>
|
||||||
|
<p class="loading-subtitle">Please wait while we fetch your settings...</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="loading-spinner-container">
|
||||||
|
<mat-spinner diameter="48"></mat-spinner>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
} @else {
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<!-- API KEY Section -->
|
<!-- API KEY Section -->
|
||||||
<mat-card class="section-card api-key-section">
|
<mat-card class="section-card api-key-section">
|
||||||
@ -120,7 +137,6 @@
|
|||||||
}
|
}
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
<!-- Event Configuration -->
|
<!-- Event Configuration -->
|
||||||
<!-- <div class="events-section">
|
<!-- <div class="events-section">
|
||||||
<h4>Event Types</h4>
|
<h4>Event Types</h4>
|
||||||
@ -171,11 +187,16 @@
|
|||||||
<mat-icon>save</mat-icon>
|
<mat-icon>save</mat-icon>
|
||||||
Save Configuration
|
Save Configuration
|
||||||
</button>
|
</button>
|
||||||
<button mat-stroked-button (click)="testWebhook()" [disabled]="!webhookForm.get('url')?.value">
|
<button
|
||||||
|
mat-stroked-button
|
||||||
|
(click)="testWebhook()"
|
||||||
|
[disabled]="webhookForm.get('url')?.disabled || webhookForm.get('url')?.invalid"
|
||||||
|
>
|
||||||
<mat-icon>send</mat-icon>
|
<mat-icon>send</mat-icon>
|
||||||
Test Webhook
|
Test Webhook
|
||||||
</button>
|
</button>
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
import { Clipboard } from '@angular/cdk/clipboard';
|
import { Clipboard } from '@angular/cdk/clipboard';
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { Component, OnInit, signal } from '@angular/core';
|
import { Component, OnInit, signal } from '@angular/core';
|
||||||
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
import { MatDividerModule } from '@angular/material/divider';
|
|
||||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatInputModule } from '@angular/material/input';
|
import { MatInputModule } from '@angular/material/input';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { AuthService, GlobalPreferencesService, NotificationService } from '@lib/services';
|
import { AuthService, GlobalPreferencesService, NotificationService } from '@lib/services';
|
||||||
import { MeetApiKey } from '@lib/typings/ce';
|
import { MeetApiKey } from '@lib/typings/ce';
|
||||||
@ -18,22 +16,22 @@ import { MeetApiKey } from '@lib/typings/ce';
|
|||||||
selector: 'ov-developers-settings',
|
selector: 'ov-developers-settings',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
MatFormFieldModule,
|
MatFormFieldModule,
|
||||||
MatSlideToggleModule,
|
MatSlideToggleModule,
|
||||||
MatSnackBarModule,
|
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatDividerModule,
|
ReactiveFormsModule,
|
||||||
ReactiveFormsModule
|
MatProgressSpinnerModule
|
||||||
],
|
],
|
||||||
templateUrl: './developers.component.html',
|
templateUrl: './developers.component.html',
|
||||||
styleUrl: './developers.component.scss'
|
styleUrl: './developers.component.scss'
|
||||||
})
|
})
|
||||||
export class DevelopersSettingsComponent implements OnInit {
|
export class DevelopersSettingsComponent implements OnInit {
|
||||||
|
isLoading = signal(true);
|
||||||
|
|
||||||
apiKeyData = signal<MeetApiKey | undefined>(undefined);
|
apiKeyData = signal<MeetApiKey | undefined>(undefined);
|
||||||
showApiKey = signal(false);
|
showApiKey = signal(false);
|
||||||
|
|
||||||
@ -66,8 +64,10 @@ export class DevelopersSettingsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
this.isLoading.set(true);
|
||||||
await this.loadApiKeyData();
|
await this.loadApiKeyData();
|
||||||
await this.loadWebhookConfig();
|
await this.loadWebhookConfig();
|
||||||
|
this.isLoading.set(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== API KEY METHODS =====
|
// ===== API KEY METHODS =====
|
||||||
|
|||||||
@ -31,7 +31,7 @@ import { AuthMode } from '@lib/typings/ce';
|
|||||||
styleUrl: './users-permissions.component.scss'
|
styleUrl: './users-permissions.component.scss'
|
||||||
})
|
})
|
||||||
export class UsersPermissionsComponent implements OnInit {
|
export class UsersPermissionsComponent implements OnInit {
|
||||||
isLoading = signal(false);
|
isLoading = signal(true);
|
||||||
|
|
||||||
adminCredentialsForm = new FormGroup({
|
adminCredentialsForm = new FormGroup({
|
||||||
adminUsername: new FormControl({ value: '', disabled: true }, [Validators.required]),
|
adminUsername: new FormControl({ value: '', disabled: true }, [Validators.required]),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user