mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-10-28 02:38:55 -04:00
89 lines
3.6 KiB
HTML
89 lines
3.6 KiB
HTML
<app-page-header
|
|
[title]="displayName() + ' Settings'"
|
|
[subtitle]="'Manage your ' + displayName() + ' instances'"
|
|
/>
|
|
|
|
@if (loadError()) {
|
|
<app-empty-state
|
|
icon="tablerPlugConnectedX"
|
|
heading="Could not connect to server"
|
|
description="Failed to load settings. Please check that the server is running and try again."
|
|
>
|
|
<app-button variant="primary" size="sm" (clicked)="retry()">
|
|
Retry
|
|
</app-button>
|
|
</app-empty-state>
|
|
} @else if (loader.showSpinner()) {
|
|
<app-loading-state message="Loading settings..." />
|
|
} @else if (!loader.loading()) {
|
|
<div class="settings-form">
|
|
<app-card>
|
|
<div class="instances-header">
|
|
<h3 class="instances-header__title">Instances</h3>
|
|
<app-button variant="primary" size="sm" (clicked)="openAddModal()">
|
|
Add Instance
|
|
</app-button>
|
|
</div>
|
|
|
|
@for (instance of instances(); track instance.id) {
|
|
<div class="instance-row">
|
|
<div class="instance-row__info">
|
|
<span class="instance-row__name">{{ instance.name }}</span>
|
|
<app-badge [severity]="instance.enabled ? 'success' : 'default'" size="sm">
|
|
{{ instance.enabled ? 'Enabled' : 'Disabled' }}
|
|
</app-badge>
|
|
<span class="instance-row__url">{{ instance.url }}</span>
|
|
</div>
|
|
<div class="instance-row__actions">
|
|
<app-button variant="ghost" size="sm" (clicked)="openEditModal(instance)">Edit</app-button>
|
|
<app-button variant="destructive" size="sm" (clicked)="deleteInstance(instance)">Delete</app-button>
|
|
</div>
|
|
</div>
|
|
} @empty {
|
|
<app-empty-state
|
|
heading="No instances configured"
|
|
[description]="'Add a ' + displayName() + ' instance to get started.'"
|
|
/>
|
|
}
|
|
</app-card>
|
|
</div>
|
|
}
|
|
|
|
<!-- Add/Edit Modal -->
|
|
<app-modal
|
|
[title]="editingInstance() ? 'Edit Instance' : 'Add Instance'"
|
|
[(visible)]="modalVisible"
|
|
>
|
|
<div class="modal-form">
|
|
<app-toggle label="Enabled" [formField]="instanceForm.enabled"
|
|
hint="Enable or disable this instance"
|
|
helpKey="arr:enabled" />
|
|
<app-input label="Name" placeholder="My Instance" [formField]="instanceForm.name"
|
|
hint="A unique name to identify this instance"
|
|
[error]="instanceForm.name().errors()[0]?.message"
|
|
helpKey="arr:name" />
|
|
<app-input label="URL" placeholder="http://localhost:8989" type="url" [formField]="instanceForm.url"
|
|
hint="Full URL including protocol and port"
|
|
[error]="instanceForm.url().errors()[0]?.message"
|
|
helpKey="arr:url" />
|
|
<app-input label="External URL" placeholder="https://sonarr.example.com" type="url" [formField]="instanceForm.externalUrl"
|
|
hint="Optional URL used in notifications for clickable links (e.g., when internal Docker URLs are not reachable externally)"
|
|
helpKey="arr:externalUrl" />
|
|
<app-input label="API Key" placeholder="Enter API key" type="password" [revealable]="false" [formField]="instanceForm.apiKey"
|
|
hint="API key from your arr application's Settings > General"
|
|
[error]="instanceForm.apiKey().errors()[0]?.message"
|
|
helpKey="arr:apiKey" />
|
|
<app-select label="API Version" [options]="versionOptions()" [formField]="instanceForm.version"
|
|
hint="API version for this application"
|
|
helpKey="arr:version" />
|
|
</div>
|
|
<div modal-footer>
|
|
<app-button variant="secondary" size="sm" [loading]="testing()" (clicked)="testConnection()">
|
|
Test
|
|
</app-button>
|
|
<app-button variant="primary" size="sm" [loading]="saving()" [disabled]="hasModalErrors()" (clicked)="saveInstance()">
|
|
Save
|
|
</app-button>
|
|
</div>
|
|
</app-modal>
|