Merge pull request #239 from adityachandelgit/develop

Merge Develop into Master for Release
This commit is contained in:
Aditya Chandel
2025-04-28 18:09:02 -06:00
committed by GitHub
2 changed files with 53 additions and 23 deletions
@@ -20,6 +20,25 @@
</p-toggleButton>
</div>
<div *ngIf="opdsEnabled" class="flex flex-col gap-2 mt-4 rounded-lg">
<p class="text-lg py-1">OPDS Endpoint:</p>
<div class="flex items-center gap-4">
<input
class="min-w-[500px] max-w-[800px]"
type="text"
pInputText
[value]="opdsEndpoint"
readonly/>
<p-button
icon="pi pi-copy"
severity="info"
(onClick)="copyOpdsEndpoint()"
label="Copy"
outlined="true">
</p-button>
</div>
</div>
<div *ngIf="opdsEnabled" class="mt-6">
<p-button
label="Create New User"
@@ -44,7 +63,7 @@
<td>{{ user.username }}</td>
<td class="flex items-center gap-2">
<p-password
[(ngModel)]="user.password"
[(ngModel)]="dummyPassword"
[disabled]="true">
</p-password>
<i
@@ -14,6 +14,7 @@ import { OpdsUser, OpdsUserService } from '../opds-user.service';
import {AppSettingsService} from '../core/service/app-settings.service';
import {AppSettings} from '../core/model/app-settings.model';
import {Password} from 'primeng/password';
import {API_CONFIG} from '../config/api-config';
@Component({
selector: 'app-opds-settings',
@@ -40,6 +41,8 @@ export class OpdsSettingsComponent implements OnInit {
resetPasswordDialogVisible = false;
newUser = {username: '', password: ''};
newPassword = '';
opdsEndpoint: string = `${API_CONFIG.BASE_URL}/api/v1/opds/catalog`;
dummyPassword: string = '********************************';
private readonly appSettings$ = inject(AppSettingsService).appSettings$;
private readonly opdsUserService = inject(OpdsUserService);
@@ -117,6 +120,14 @@ export class OpdsSettingsComponent implements OnInit {
this.newPassword = '';
}
copyOpdsEndpoint() {
navigator.clipboard.writeText(this.opdsEndpoint)
.then(() => {
})
.catch(err => {
});
}
confirmResetPassword(): void {
if (this.selectedUser && this.newPassword.trim()) {
this.opdsUserService.resetPassword(this.selectedUser.id, this.newPassword).subscribe({