Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Add API key management to the admin page

Barnabasde5e65eaf14e
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index dd907c1f..15d19ed5 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -3429,5 +3429,66 @@
}
}
},
- "encodeProgressIndeterminate": "Encoding..."
-}
\ No newline at end of file
+ "encodeProgressIndeterminate": "Encoding...",
+ "adminApiKeys": "API Keys",
+ "adminApiKeysSubtitle": "Programmatic access tokens",
+ "adminApiKeysNewTitle": "New API Key",
+ "adminApiKeysName": "Name",
+ "adminApiKeysNameHint": "e.g. Home Assistant",
+ "adminApiKeysOwner": "User",
+ "adminApiKeysExpiration": "Expiration",
+ "adminApiKeysActive": "Active",
+ "adminApiKeysActiveSub": "Key works as soon as it's created",
+ "adminApiKeysInactive": "Inactive",
+ "adminApiKeysExpired": "Expired",
+ "adminApiKeysCreate": "Create Key",
+ "adminApiKeysCreated": "API key created",
+ "adminApiKeysTokenLabel": "Your new API key",
+ "adminApiKeysCopyWarning": "Copy this key now. For security it won't be shown again.",
+ "adminApiKeysCopy": "Copy",
+ "adminApiKeysCopied": "Copied to clipboard",
+ "adminApiKeysDone": "Done",
+ "adminApiKeysDeleteTitle": "Revoke API key?",
+ "adminApiKeysDeleted": "API key revoked",
+ "adminApiKeysRevoke": "Revoke",
+ "adminApiKeysSetActive": "Set active",
+ "adminApiKeysSetInactive": "Set inactive",
+ "adminApiKeysFailedCreate": "Couldn't create API key",
+ "adminApiKeysFailedDelete": "Couldn't revoke API key",
+ "adminApiKeysFailedUpdate": "Couldn't update API key",
+ "adminApiKeysEmpty": "No API keys yet",
+ "adminApiKeysEmptySub": "Create one to let apps and scripts reach your server",
+ "adminApiKeysNeverUsed": "Never used",
+ "adminApiKeysNeverExpires": "No expiration",
+ "adminApiKeysNameRequired": "Enter a name",
+ "adminApiKeysUserRequired": "Pick a user",
+ "adminApiKeysExpNever": "Never",
+ "adminApiKeysExp7d": "7 days",
+ "adminApiKeysExp30d": "30 days",
+ "adminApiKeysExp90d": "90 days",
+ "adminApiKeysExp1y": "1 year",
+ "adminApiKeysLastUsed": "Last used {time}",
+ "@adminApiKeysLastUsed": {
+ "placeholders": {
+ "time": {
+ "type": "String"
+ }
+ }
+ },
+ "adminApiKeysExpiresOn": "Expires {date}",
+ "@adminApiKeysExpiresOn": {
+ "placeholders": {
+ "date": {
+ "type": "String"
+ }
+ }
+ },
+ "adminApiKeysDeleteContent": "Revoke \"{name}\"? Apps using this key will lose access immediately.",
+ "@adminApiKeysDeleteContent": {
+ "placeholders": {
+ "name": {
+ "type": "String"
+ }
+ }
+ }
+}
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index da82e99a..6e723620 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -9797,6 +9797,246 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Encoding...'**
String get encodeProgressIndeterminate;
+
+ /// No description provided for @adminApiKeys.
+ ///
+ /// In en, this message translates to:
+ /// **'API Keys'**
+ String get adminApiKeys;
+
+ /// No description provided for @adminApiKeysSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Programmatic access tokens'**
+ String get adminApiKeysSubtitle;
+
+ /// No description provided for @adminApiKeysNewTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'New API Key'**
+ String get adminApiKeysNewTitle;
+
+ /// No description provided for @adminApiKeysName.
+ ///
+ /// In en, this message translates to:
+ /// **'Name'**
+ String get adminApiKeysName;
+
+ /// No description provided for @adminApiKeysNameHint.
+ ///
+ /// In en, this message translates to:
+ /// **'e.g. Home Assistant'**
+ String get adminApiKeysNameHint;
+
+ /// No description provided for @adminApiKeysOwner.
+ ///
+ /// In en, this message translates to:
+ /// **'User'**
+ String get adminApiKeysOwner;
+
+ /// No description provided for @adminApiKeysExpiration.
+ ///
+ /// In en, this message translates to:
+ /// **'Expiration'**
+ String get adminApiKeysExpiration;
+
+ /// No description provided for @adminApiKeysActive.
+ ///
+ /// In en, this message translates to:
+ /// **'Active'**
+ String get adminApiKeysActive;
+
+ /// No description provided for @adminApiKeysActiveSub.
+ ///
+ /// In en, this message translates to:
+ /// **'Key works as soon as it\'s created'**
+ String get adminApiKeysActiveSub;
+
+ /// No description provided for @adminApiKeysInactive.
+ ///
+ /// In en, this message translates to:
+ /// **'Inactive'**
+ String get adminApiKeysInactive;
+
+ /// No description provided for @adminApiKeysExpired.
+ ///
+ /// In en, this message translates to:
+ /// **'Expired'**
+ String get adminApiKeysExpired;
+
+ /// No description provided for @adminApiKeysCreate.
+ ///
+ /// In en, this message translates to:
+ /// **'Create Key'**
+ String get adminApiKeysCreate;
+
+ /// No description provided for @adminApiKeysCreated.
+ ///
+ /// In en, this message translates to:
+ /// **'API key created'**
+ String get adminApiKeysCreated;
+
+ /// No description provided for @adminApiKeysTokenLabel.
+ ///
+ /// In en, this message translates to:
+ /// **'Your new API key'**
+ String get adminApiKeysTokenLabel;
+
+ /// No description provided for @adminApiKeysCopyWarning.
+ ///
+ /// In en, this message translates to:
+ /// **'Copy this key now. For security it won\'t be shown again.'**
+ String get adminApiKeysCopyWarning;
+
+ /// No description provided for @adminApiKeysCopy.
+ ///
+ /// In en, this message translates to:
+ /// **'Copy'**
+ String get adminApiKeysCopy;
+
+ /// No description provided for @adminApiKeysCopied.
+ ///
+ /// In en, this message translates to:
+ /// **'Copied to clipboard'**
+ String get adminApiKeysCopied;
+
+ /// No description provided for @adminApiKeysDone.
+ ///
+ /// In en, this message translates to:
+ /// **'Done'**
+ String get adminApiKeysDone;
+
+ /// No description provided for @adminApiKeysDeleteTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Revoke API key?'**
+ String get adminApiKeysDeleteTitle;
+
+ /// No description provided for @adminApiKeysDeleted.
+ ///
+ /// In en, this message translates to:
+ /// **'API key revoked'**
+ String get adminApiKeysDeleted;
+
+ /// No description provided for @adminApiKeysRevoke.
+ ///
+ /// In en, this message translates to:
+ /// **'Revoke'**
+ String get adminApiKeysRevoke;
+
+ /// No description provided for @adminApiKeysSetActive.
+ ///
+ /// In en, this message translates to:
+ /// **'Set active'**
+ String get adminApiKeysSetActive;
+
+ /// No description provided for @adminApiKeysSetInactive.
+ ///
+ /// In en, this message translates to:
+ /// **'Set inactive'**
+ String get adminApiKeysSetInactive;
+
+ /// No description provided for @adminApiKeysFailedCreate.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t create API key'**
+ String get adminApiKeysFailedCreate;
+
+ /// No description provided for @adminApiKeysFailedDelete.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t revoke API key'**
+ String get adminApiKeysFailedDelete;
+
+ /// No description provided for @adminApiKeysFailedUpdate.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t update API key'**
+ String get adminApiKeysFailedUpdate;
+
+ /// No description provided for @adminApiKeysEmpty.
+ ///
+ /// In en, this message translates to:
+ /// **'No API keys yet'**
+ String get adminApiKeysEmpty;
+
+ /// No description provided for @adminApiKeysEmptySub.
+ ///
+ /// In en, this message translates to:
+ /// **'Create one to let apps and scripts reach your server'**
+ String get adminApiKeysEmptySub;
+
+ /// No description provided for @adminApiKeysNeverUsed.
+ ///
+ /// In en, this message translates to:
+ /// **'Never used'**
+ String get adminApiKeysNeverUsed;
+
+ /// No description provided for @adminApiKeysNeverExpires.
+ ///
+ /// In en, this message translates to:
+ /// **'No expiration'**
+ String get adminApiKeysNeverExpires;
+
+ /// No description provided for @adminApiKeysNameRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Enter a name'**
+ String get adminApiKeysNameRequired;
+
+ /// No description provided for @adminApiKeysUserRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Pick a user'**
+ String get adminApiKeysUserRequired;
+
+ /// No description provided for @adminApiKeysExpNever.
+ ///
+ /// In en, this message translates to:
+ /// **'Never'**
+ String get adminApiKeysExpNever;
+
+ /// No description provided for @adminApiKeysExp7d.
+ ///
+ /// In en, this message translates to:
+ /// **'7 days'**
+ String get adminApiKeysExp7d;
+
+ /// No description provided for @adminApiKeysExp30d.
+ ///
+ /// In en, this message translates to:
+ /// **'30 days'**
+ String get adminApiKeysExp30d;
+
+ /// No description provided for @adminApiKeysExp90d.
+ ///
+ /// In en, this message translates to:
+ /// **'90 days'**
+ String get adminApiKeysExp90d;
+
+ /// No description provided for @adminApiKeysExp1y.
+ ///
+ /// In en, this message translates to:
+ /// **'1 year'**
+ String get adminApiKeysExp1y;
+
+ /// No description provided for @adminApiKeysLastUsed.
+ ///
+ /// In en, this message translates to:
+ /// **'Last used {time}'**
+ String adminApiKeysLastUsed(String time);
+
+ /// No description provided for @adminApiKeysExpiresOn.
+ ///
+ /// In en, this message translates to:
+ /// **'Expires {date}'**
+ String adminApiKeysExpiresOn(String date);
+
+ /// No description provided for @adminApiKeysDeleteContent.
+ ///
+ /// In en, this message translates to:
+ /// **'Revoke \"{name}\"? Apps using this key will lose access immediately.'**
+ String adminApiKeysDeleteContent(String name);
}
class _AppLocalizationsDelegate
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index 30a1309b..4582534e 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -336,7 +336,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get librarySearchAuthors => 'Autoren';
@override
- String get librarySearchTags => 'Tags';
+ String get librarySearchTags => 'Schlagwörter';
@override
String get librarySearchGenres => 'Genres';
@@ -416,7 +416,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get genre => 'Genre';
@override
- String get tag => 'Tag';
+ String get tag => 'Schlagwort';
@override
String get clearFilter => 'Filter zurücksetzen';
@@ -425,7 +425,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get noGenresFound => 'Keine Genres gefunden';
@override
- String get noTagsFound => 'No tags found';
+ String get noTagsFound => 'Keine Schlagwörter gefunden';
@override
String get asc => 'AUF';
@@ -904,7 +904,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get queueModeAuto => 'Auto';
@override
- String get queueModePlaylist => 'Playlist';
+ String get queueModePlaylist => 'Wiedergabeliste';
@override
String get queueModeInfoPlaylist => 'Playlist Queue';
@@ -917,11 +917,11 @@ class AppLocalizationsDe extends AppLocalizations {
String get queuePlaylistPickerTitle => 'Choose a playlist';
@override
- String get queuePlaylistNone => 'No playlist selected';
+ String get queuePlaylistNone => 'Keine Wiedergabeliste ausgewählt';
@override
String queuePlaylistActiveLabel(String name) {
- return 'Playlist: $name';
+ return 'Wiedergabeliste: $name';
}
@override
@@ -929,11 +929,11 @@ class AppLocalizationsDe extends AppLocalizations {
'Start a playlist queue by opening a playlist on the home page.';
@override
- String get exit => 'Exit';
+ String get exit => 'Beenden';
@override
String upNext(String label) {
- return 'Up next: $label';
+ return 'Als Nächstes: $label';
}
@override
@@ -952,7 +952,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get playlistPlayAction => 'Play playlist';
@override
- String get playlistAllFinished => 'All finished';
+ String get playlistAllFinished => 'Alle abgeschlossen';
@override
String get queueModeBooks => 'Bücher';
@@ -1800,7 +1800,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get rmabConfigBaseUrlHint => 'https://rmab.example.com';
@override
- String get rmabConfigTokenLabel => 'API token';
+ String get rmabConfigTokenLabel => 'API-Token';
@override
String get rmabConfigTokenHint => 'rmab_...';
@@ -1816,27 +1816,27 @@ class AppLocalizationsDe extends AppLocalizations {
'Paste your auto-login URL so \'Open in browser view\' lands you signed in. Leave blank to use a regular login.';
@override
- String get rmabConfigConnect => 'Connect';
+ String get rmabConfigConnect => 'Verbinden';
@override
- String get rmabConfigDisconnect => 'Disconnect';
+ String get rmabConfigDisconnect => 'Trennen';
@override
- String get rmabConfigOpenWebView => 'Open in browser view';
+ String get rmabConfigOpenWebView => 'In der Browseransicht öffnen';
@override
String rmabConfigConnectedAs(String name) {
- return 'Connected as $name';
+ return 'Verbunden als $name';
}
@override
- String get rmabConfigErrorInvalidUrl => 'Enter a valid http(s) URL';
+ String get rmabConfigErrorInvalidUrl => 'Gültige http(s)-URL eingeben';
@override
- String get rmabConfigErrorMissingToken => 'Enter your API token';
+ String get rmabConfigErrorMissingToken => 'API-Token eingeben';
@override
- String get rmabConfigErrorUnauthorized => 'Token rejected by server';
+ String get rmabConfigErrorUnauthorized => 'Token vom Server abgelehnt';
@override
String get rmabConfigErrorForbidden =>
@@ -1846,7 +1846,8 @@ class AppLocalizationsDe extends AppLocalizations {
String get rmabConfigErrorNetwork => 'Couldn\'t reach RMAB. Check the URL.';
@override
- String get rmabConfigErrorGeneric => 'Couldn\'t connect';
+ String get rmabConfigErrorGeneric =>
+ 'Verbindung konnte nicht hergestellt werden';
@override
String get rmabConfigSavedSnackbar => 'ReadMeABook connected';
@@ -1861,7 +1862,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get rmabSearchHeader => 'Request via ReadMeABook';
@override
- String get rmabSearchHint => 'Search by title or author';
+ String get rmabSearchHint => 'Nach Titel oder Autor suchen';
@override
String get rmabSearchEmpty => 'No matches on your ReadMeABook server';
@@ -1885,22 +1886,22 @@ class AppLocalizationsDe extends AppLocalizations {
'This request will be sent through your ReadMeABook server. The admin will review and process it. You can track it under My Requests on the ReadMeABook tile.';
@override
- String get rmabBookAlreadyAvailable => 'Already in your library';
+ String get rmabBookAlreadyAvailable => 'Bereits in deiner Bibliothek';
@override
- String get rmabBookAlreadyRequested => 'Already requested';
+ String get rmabBookAlreadyRequested => 'Bereits angefordert';
@override
- String get rmabRequestSubmitting => 'Submitting…';
+ String get rmabRequestSubmitting => 'Wird übermittelt…';
@override
- String get rmabRequestSent => 'Request sent';
+ String get rmabRequestSent => 'Anfrage gesendet';
@override
- String get rmabRequestErrorAlreadyAvailable => 'Already in your library';
+ String get rmabRequestErrorAlreadyAvailable => 'Bereits in deiner Bibliothek';
@override
- String get rmabRequestErrorBeingProcessed => 'Already being processed';
+ String get rmabRequestErrorBeingProcessed => 'Wird bereits bearbeitet';
@override
String get rmabRequestErrorDuplicate => 'You\'ve already requested this';
@@ -1923,10 +1924,10 @@ class AppLocalizationsDe extends AppLocalizations {
'Token rejected by server. Reconnect ReadMeABook.';
@override
- String get rmabMyRequestsTab => 'My Requests';
+ String get rmabMyRequestsTab => 'Meine Anfragen';
@override
- String get rmabSetupTab => 'Setup';
+ String get rmabSetupTab => 'Einrichtung';
@override
String get rmabMyRequestsEmpty => 'You haven\'t requested any books yet';
@@ -1935,7 +1936,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get rmabMyRequestsError => 'Couldn\'t load requests';
@override
- String get rmabMyRequestsRefresh => 'Refresh';
+ String get rmabMyRequestsRefresh => 'Aktualisieren';
@override
String get rmabRequestDetailTitle => 'Request details';
@@ -1950,31 +1951,31 @@ class AppLocalizationsDe extends AppLocalizations {
String get rmabRequestDetailCompletedOn => 'Completed on';
@override
- String get rmabRequestDetailProgress => 'Progress';
+ String get rmabRequestDetailProgress => 'Fortschritt';
@override
- String get rmabStatusActive => 'In progress';
+ String get rmabStatusActive => 'Im Gang';
@override
- String get rmabStatusWaiting => 'Waiting';
+ String get rmabStatusWaiting => 'Warten';
@override
- String get rmabStatusAvailable => 'Available';
+ String get rmabStatusAvailable => 'Verfügbar';
@override
- String get rmabStatusDownloaded => 'Downloaded';
+ String get rmabStatusDownloaded => 'Heruntergeladen';
@override
- String get rmabStatusFailed => 'Failed';
+ String get rmabStatusFailed => 'Fehlgeschlagen';
@override
- String get rmabStatusCancelled => 'Cancelled';
+ String get rmabStatusCancelled => 'Abgebrochen';
@override
- String get rmabStatusDenied => 'Denied';
+ String get rmabStatusDenied => 'Verweigert';
@override
- String get rmabStatusUnknown => 'Unknown';
+ String get rmabStatusUnknown => 'Unbekannt';
@override
String narratedBy(String narrator) {
@@ -2066,7 +2067,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get editServerDetails => 'Server-Details bearbeiten';
@override
- String get encodeTab => 'Encode';
+ String get encodeTab => 'Verschlüsseln';
@override
String get codec => 'Codec';
@@ -2075,7 +2076,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get bitrate => 'Bitrate';
@override
- String get channels => 'Channels';
+ String get channels => 'Kanäle';
@override
String get mono => 'Mono';
@@ -2087,7 +2088,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get startM4bEncode => 'Start M4B Encode';
@override
- String get encodeStarted => 'M4B encode started';
+ String get encodeStarted => 'M4B Encodierung gestartet';
@override
String get encodeFailed => 'Failed to start encode';
@@ -2096,7 +2097,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get encodeFinished => 'M4B encode finished';
@override
- String get currentlyLabel => 'Currently:';
+ String get currentlyLabel => 'Momentan:';
@override
String encodeOutputPathNote(String path) {
@@ -2418,7 +2419,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get genresLabel => 'Genres';
@override
- String get tagsLabel => 'Tags';
+ String get tagsLabel => 'Schlagwörter';
@override
String get commaSeparated => 'Komma-getrennt';
@@ -2926,45 +2927,46 @@ class AppLocalizationsDe extends AppLocalizations {
String get downloadButton => 'Herunterladen';
@override
- String get updateDownloading => 'Downloading update...';
+ String get updateDownloading => 'Update wird heruntergeladen...';
@override
String get updateInstallPermissionDenied =>
'Install permission denied. Enable \"Install unknown apps\" for Absorb in system settings.';
@override
- String get updateOpeningInBrowser => 'In-app update failed, opening browser';
+ String get updateOpeningInBrowser =>
+ 'Das In-App-Update ist fehlgeschlagen, Browser wird geöffnet';
@override
- String get sendToEreader => 'Send to E-Reader';
+ String get sendToEreader => 'An E-Reader senden';
@override
String sendingToEreader(String device) {
- return 'Sending to $device...';
+ return 'Sende an $device...';
}
@override
String sendToEreaderSuccess(String device) {
- return 'Sent to $device';
+ return 'Gesendet an $device';
}
@override
- String get sendToEreaderFailed => 'Couldn\'t send the ebook';
+ String get sendToEreaderFailed => 'Das E-Book konnte nicht gesendet werden';
@override
- String get pickEreaderDevice => 'Pick a device';
+ String get pickEreaderDevice => 'Wähle ein Gerät';
@override
- String get adminEmail => 'Email';
+ String get adminEmail => 'E-Mail';
@override
- String get adminEmailSubtitle => 'SMTP and e-reader devices';
+ String get adminEmailSubtitle => 'SMTP und E-Reader-Geräte';
@override
String get smtpSection => 'SMTP';
@override
- String get smtpSetupGuide => 'Setup guide';
+ String get smtpSetupGuide => 'Einrichtungsanleitung';
@override
String get smtpHost => 'Host';
@@ -2973,87 +2975,90 @@ class AppLocalizationsDe extends AppLocalizations {
String get smtpPort => 'Port';
@override
- String get smtpSecure => 'Secure';
+ String get smtpSecure => 'Sicher';
@override
- String get smtpRejectUnauthorized => 'Reject unauthorized TLS';
+ String get smtpRejectUnauthorized => 'Unzulässiges TLS ablehnen';
@override
- String get smtpUser => 'Username';
+ String get smtpUser => 'Benutzername';
@override
- String get smtpPass => 'Password';
+ String get smtpPass => 'Passwort';
@override
- String get smtpFromAddress => 'From address';
+ String get smtpFromAddress => 'Absenderadresse';
@override
- String get smtpTestAddress => 'Test address';
+ String get smtpTestAddress => 'Testadresse';
@override
- String get smtpSendTest => 'Send test';
+ String get smtpSendTest => 'Test senden';
@override
- String get smtpSaveSettings => 'Save';
+ String get smtpSaveSettings => 'Speichern';
@override
- String get smtpSaved => 'Email settings saved';
+ String get smtpSaved => 'E-Mail-Einstellungen gespeichert';
@override
- String get smtpSaveFailed => 'Couldn\'t save email settings';
+ String get smtpSaveFailed =>
+ 'Die E-Mail-Einstellungen konnten nicht gespeichert werden';
@override
- String get smtpTestSent => 'Test email sent';
+ String get smtpTestSent => 'Test-E-Mail gesendet';
@override
- String get smtpTestFailed => 'Test email failed';
+ String get smtpTestFailed => 'Test-E-Mail fehlgeschlagen';
@override
- String get ereaderDevicesTitle => 'E-Reader devices';
+ String get ereaderDevicesTitle => 'E-Reader-Geräte';
@override
- String get ereaderDevicesEmpty => 'No devices yet. Add one below.';
+ String get ereaderDevicesEmpty =>
+ 'Noch keine Geräte. Füge unten eines hinzu.';
@override
- String get addEreaderDevice => 'Add device';
+ String get addEreaderDevice => 'Gerät hinzufügen';
@override
- String get editEreaderDevice => 'Edit device';
+ String get editEreaderDevice => 'Gerät bearbeiten';
@override
- String get deleteEreaderDevice => 'Delete';
+ String get deleteEreaderDevice => 'Löschen';
@override
String get ereaderDeviceName => 'Name';
@override
- String get ereaderDeviceEmail => 'Email';
+ String get ereaderDeviceEmail => 'E-Mail';
@override
- String get ereaderAvailability => 'Who can use this device';
+ String get ereaderAvailability => 'Wer kann dieses Gerät verwenden';
@override
- String get ereaderAvailAdminOrUp => 'Admins only';
+ String get ereaderAvailAdminOrUp => 'Nur für Administratoren';
@override
- String get ereaderAvailUserOrUp => 'All users';
+ String get ereaderAvailUserOrUp => 'Alle Benutzer';
@override
- String get ereaderAvailGuestOrUp => 'Everyone';
+ String get ereaderAvailGuestOrUp => 'Jeder';
@override
- String get ereaderAvailSpecificUsers => 'Specific users';
+ String get ereaderAvailSpecificUsers => 'Bestimmte Benutzer';
@override
String ereaderSpecificUsersN(int count) {
- return 'Specific users ($count)';
+ return 'Bestimmte Benutzer ($count)';
}
@override
- String get ereaderDevicesSaved => 'Devices saved';
+ String get ereaderDevicesSaved => 'Geräte gespeichert';
@override
- String get ereaderDevicesSaveFailed => 'Couldn\'t save devices';
+ String get ereaderDevicesSaveFailed =>
+ 'Geräte konnten nicht gespeichert werden';
@override
String libraryCountOne(int count) {
@@ -5286,45 +5291,46 @@ class AppLocalizationsDe extends AppLocalizations {
'Geschwindigkeits-Voreinstellungen zurückgesetzt';
@override
- String get editAuthor => 'Edit author';
+ String get editAuthor => 'Autor bearbeiten';
@override
String get authorName => 'Name';
@override
- String get authorImage => 'Author image';
+ String get authorImage => 'Autorenbild';
@override
- String get authorRemoveImage => 'Remove image';
+ String get authorRemoveImage => 'Bild entfernen';
@override
- String get authorRemoveImageTitle => 'Remove author image?';
+ String get authorRemoveImageTitle => 'Autorenbild entfernen?';
@override
String get authorRemoveImageConfirm =>
- 'This deletes the image on the server.';
+ 'Dadurch wird das Bild auf dem Server gelöscht.';
@override
- String get authorImageRemoved => 'Image removed';
+ String get authorImageRemoved => 'Bild entfernt';
@override
- String get authorImageFailed => 'Couldn\'t update author image';
+ String get authorImageFailed =>
+ 'Das Autorenbild konnte nicht aktualisiert werden';
@override
- String get authorUpdated => 'Author updated';
+ String get authorUpdated => 'Autor aktualisiert';
@override
- String get authorUpdateFailed => 'Couldn\'t update author';
+ String get authorUpdateFailed => 'Der Autor konnte nicht aktualisiert werden';
@override
String get authorMatched => 'Author updated from match';
@override
- String get authorNoMatchFound => 'No match found';
+ String get authorNoMatchFound => 'Kein Treffer gefunden';
@override
String authorMergedInto(String name) {
- return 'Merged into $name';
+ return 'Zusammengeführt in $name';
}
@override
@@ -5451,16 +5457,16 @@ class AppLocalizationsDe extends AppLocalizations {
String get chapterSaveButton => 'Save chapters';
@override
- String get chapterAddHint => 'Add chapter (e.g. \"Chapter 01\")';
+ String get chapterAddHint => 'Kapitel hinzufügen (z.B. \"Kapitel 01\")';
@override
String get chapterAddTooltip => 'Add chapter(s)';
@override
- String get chapterRemoveAll => 'Remove All';
+ String get chapterRemoveAll => 'Alle entfernen';
@override
- String get chapterShiftTimes => 'Shift Times';
+ String get chapterShiftTimes => 'Zeiten verschieben';
@override
String get chapterFromTracks => 'From Tracks';
@@ -5469,10 +5475,10 @@ class AppLocalizationsDe extends AppLocalizations {
String get chapterLookup => 'Lookup';
@override
- String get chapterShowSeconds => 'Show seconds';
+ String get chapterShowSeconds => 'Sekunden anzeigen';
@override
- String get chapterShiftBySeconds => 'Shift by (seconds)';
+ String get chapterShiftBySeconds => 'Verschieben um (Sekunden)';
@override
String get chapterShiftHint =>
@@ -5560,7 +5566,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get chapterApplyChapters => 'Apply chapters';
@override
- String get coverSearchTitle => 'Search for a cover';
+ String get coverSearchTitle => 'Nach einem Cover suchen';
@override
String get coverSearchRefineHint =>
@@ -5570,7 +5576,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get coverNoneFound => 'No covers found';
@override
- String get coverEnterTitleFirst => 'Enter a title first';
+ String get coverEnterTitleFirst => 'Gebe zuerst einen Titel ein';
@override
String get coverUpdated => 'Cover updated';
@@ -5680,4 +5686,132 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index 7c07cb0d..39f48b02 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index 8cd2b6cb..e7df4550 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index 5c86f915..897f0521 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index f95f30c0..77765d27 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -5623,4 +5623,132 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index c72ba429..9d2f07ba 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index 9bae3d9d..58d51c40 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index 0bb02e9a..558866f0 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index d8716358..8cb40205 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index bdbaa998..821dec77 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -5621,4 +5621,132 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index 69f36c4f..bbc4ed71 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -5624,4 +5624,132 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index b84ea19a..3f641297 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -5542,4 +5542,132 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get encodeProgressIndeterminate => 'Encoding...';
+
+ @override
+ String get adminApiKeys => 'API Keys';
+
+ @override
+ String get adminApiKeysSubtitle => 'Programmatic access tokens';
+
+ @override
+ String get adminApiKeysNewTitle => 'New API Key';
+
+ @override
+ String get adminApiKeysName => 'Name';
+
+ @override
+ String get adminApiKeysNameHint => 'e.g. Home Assistant';
+
+ @override
+ String get adminApiKeysOwner => 'User';
+
+ @override
+ String get adminApiKeysExpiration => 'Expiration';
+
+ @override
+ String get adminApiKeysActive => 'Active';
+
+ @override
+ String get adminApiKeysActiveSub => 'Key works as soon as it\'s created';
+
+ @override
+ String get adminApiKeysInactive => 'Inactive';
+
+ @override
+ String get adminApiKeysExpired => 'Expired';
+
+ @override
+ String get adminApiKeysCreate => 'Create Key';
+
+ @override
+ String get adminApiKeysCreated => 'API key created';
+
+ @override
+ String get adminApiKeysTokenLabel => 'Your new API key';
+
+ @override
+ String get adminApiKeysCopyWarning =>
+ 'Copy this key now. For security it won\'t be shown again.';
+
+ @override
+ String get adminApiKeysCopy => 'Copy';
+
+ @override
+ String get adminApiKeysCopied => 'Copied to clipboard';
+
+ @override
+ String get adminApiKeysDone => 'Done';
+
+ @override
+ String get adminApiKeysDeleteTitle => 'Revoke API key?';
+
+ @override
+ String get adminApiKeysDeleted => 'API key revoked';
+
+ @override
+ String get adminApiKeysRevoke => 'Revoke';
+
+ @override
+ String get adminApiKeysSetActive => 'Set active';
+
+ @override
+ String get adminApiKeysSetInactive => 'Set inactive';
+
+ @override
+ String get adminApiKeysFailedCreate => 'Couldn\'t create API key';
+
+ @override
+ String get adminApiKeysFailedDelete => 'Couldn\'t revoke API key';
+
+ @override
+ String get adminApiKeysFailedUpdate => 'Couldn\'t update API key';
+
+ @override
+ String get adminApiKeysEmpty => 'No API keys yet';
+
+ @override
+ String get adminApiKeysEmptySub =>
+ 'Create one to let apps and scripts reach your server';
+
+ @override
+ String get adminApiKeysNeverUsed => 'Never used';
+
+ @override
+ String get adminApiKeysNeverExpires => 'No expiration';
+
+ @override
+ String get adminApiKeysNameRequired => 'Enter a name';
+
+ @override
+ String get adminApiKeysUserRequired => 'Pick a user';
+
+ @override
+ String get adminApiKeysExpNever => 'Never';
+
+ @override
+ String get adminApiKeysExp7d => '7 days';
+
+ @override
+ String get adminApiKeysExp30d => '30 days';
+
+ @override
+ String get adminApiKeysExp90d => '90 days';
+
+ @override
+ String get adminApiKeysExp1y => '1 year';
+
+ @override
+ String adminApiKeysLastUsed(String time) {
+ return 'Last used $time';
+ }
+
+ @override
+ String adminApiKeysExpiresOn(String date) {
+ return 'Expires $date';
+ }
+
+ @override
+ String adminApiKeysDeleteContent(String name) {
+ return 'Revoke \"$name\"? Apps using this key will lose access immediately.';
+ }
}
diff --git a/lib/screens/admin_api_keys_screen.dart b/lib/screens/admin_api_keys_screen.dart
new file mode 100644
index 00000000..bd189233
--- /dev/null
+++ b/lib/screens/admin_api_keys_screen.dart
@@ -0,0 +1,424 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:provider/provider.dart';
+
+import '../l10n/app_localizations.dart';
+import '../providers/auth_provider.dart';
+import '../widgets/absorb_page_header.dart';
+import '../widgets/overlay_toast.dart';
+
+class AdminApiKeysScreen extends StatefulWidget {
+ final List<dynamic> users;
+ const AdminApiKeysScreen({super.key, required this.users});
+ @override State<AdminApiKeysScreen> createState() => _AdminApiKeysScreenState();
+}
+
+class _AdminApiKeysScreenState extends State<AdminApiKeysScreen> {
+ bool _loading = true;
+ List<dynamic> _keys = [];
+
+ @override
+ void initState() { super.initState(); _load(); }
+
+ Future<void> _load() async {
+ final api = context.read<AuthProvider>().apiService; if (api == null) return;
+ final keys = await api.getApiKeys();
+ if (mounted) setState(() { _keys = keys; _loading = false; });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final l = AppLocalizations.of(context)!;
+
+ return Scaffold(
+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,
+ floatingActionButton: FloatingActionButton.small(
+ backgroundColor: cs.primary,
+ onPressed: _showEditor,
+ child: Icon(Icons.add_rounded, color: cs.onPrimary),
+ ),
+ body: SafeArea(
+ child: Column(children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(20, 12, 8, 0),
+ child: Row(children: [
+ Expanded(child: AbsorbPageHeader(title: l.adminApiKeys, padding: EdgeInsets.zero)),
+ IconButton(icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant), onPressed: () => Navigator.pop(context)),
+ ]),
+ ),
+ const SizedBox(height: 16),
+ Expanded(
+ child: _loading
+ ? const Center(child: CircularProgressIndicator(strokeWidth: 2))
+ : RefreshIndicator(
+ onRefresh: _load,
+ child: _keys.isEmpty
+ ? ListView(physics: const AlwaysScrollableScrollPhysics(), children: [
+ const SizedBox(height: 100),
+ Center(child: Icon(Icons.vpn_key_rounded, size: 48, color: cs.onSurface.withValues(alpha: 0.08))),
+ const SizedBox(height: 14),
+ Center(child: Text(l.adminApiKeysEmpty, style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.3), fontWeight: FontWeight.w600))),
+ const SizedBox(height: 4),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 48),
+ child: Text(l.adminApiKeysEmptySub, textAlign: TextAlign.center,
+ style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24))),
+ ),
+ ])
+ : ListView.builder(
+ physics: const AlwaysScrollableScrollPhysics(),
+ padding: const EdgeInsets.only(bottom: 80),
+ itemCount: _keys.length,
+ itemBuilder: (_, i) => _keyCard(cs, tt, _keys[i] as Map<String, dynamic>),
+ ),
+ ),
+ ),
+ ]),
+ ),
+ );
+ }
+
+ Widget _keyCard(ColorScheme cs, TextTheme tt, Map<String, dynamic> key) {
+ final l = AppLocalizations.of(context)!;
+ final name = key['name'] as String? ?? l.unknown;
+ final owner = (key['user'] as Map?)?['username'] as String? ?? '';
+ final isActive = key['isActive'] as bool? ?? false;
+ final expiresAt = DateTime.tryParse(key['expiresAt'] as String? ?? '');
+ final lastUsedAt = DateTime.tryParse(key['lastUsedAt'] as String? ?? '');
+ final isExpired = expiresAt != null && expiresAt.isBefore(DateTime.now());
+
+ final (statusColor, statusLabel) = isExpired
+ ? (Colors.orange, l.adminApiKeysExpired)
+ : !isActive
+ ? (cs.onSurfaceVariant, l.adminApiKeysInactive)
+ : (const Color(0xFF4CAF50), l.adminApiKeysActive);
+
+ final lastUsedStr = lastUsedAt != null ? l.adminApiKeysLastUsed(_timeAgo(lastUsedAt)) : l.adminApiKeysNeverUsed;
+ final expiryStr = expiresAt != null ? l.adminApiKeysExpiresOn(_fmtDate(expiresAt)) : l.adminApiKeysNeverExpires;
+
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
+ child: Container(
+ padding: const EdgeInsets.fromLTRB(14, 12, 6, 12),
+ decoration: BoxDecoration(color: cs.surfaceContainerHigh, borderRadius: BorderRadius.circular(16)),
+ child: Row(children: [
+ Container(
+ width: 38, height: 38,
+ decoration: BoxDecoration(color: statusColor.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(10)),
+ child: Icon(Icons.vpn_key_rounded, size: 18, color: statusColor.withValues(alpha: 0.9)),
+ ),
+ const SizedBox(width: 12),
+ Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Row(children: [
+ Flexible(child: Text(name, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface), overflow: TextOverflow.ellipsis)),
+ const SizedBox(width: 8),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
+ decoration: BoxDecoration(color: statusColor.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(4)),
+ child: Text(statusLabel, style: tt.labelSmall?.copyWith(color: statusColor, fontSize: 9, fontWeight: FontWeight.w600)),
+ ),
+ ]),
+ const SizedBox(height: 3),
+ Text(
+ [if (owner.isNotEmpty) owner, lastUsedStr].join(' · '),
+ style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.4), fontSize: 11),
+ maxLines: 1, overflow: TextOverflow.ellipsis,
+ ),
+ const SizedBox(height: 1),
+ Text(expiryStr, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.28), fontSize: 10)),
+ ])),
+ PopupMenuButton<String>(
+ icon: Icon(Icons.more_vert_rounded, size: 20, color: cs.onSurface.withValues(alpha: 0.4)),
+ color: cs.surfaceContainerHigh,
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
+ onSelected: (v) {
+ if (v == 'toggle') _toggleActive(key);
+ else if (v == 'revoke') _revoke(key);
+ },
+ itemBuilder: (_) => [
+ PopupMenuItem(value: 'toggle', child: Row(children: [
+ Icon(isActive ? Icons.pause_circle_outline_rounded : Icons.play_circle_outline_rounded, size: 18, color: cs.onSurfaceVariant),
+ const SizedBox(width: 10),
+ Text(isActive ? l.adminApiKeysSetInactive : l.adminApiKeysSetActive, style: TextStyle(color: cs.onSurface)),
+ ])),
+ PopupMenuItem(value: 'revoke', child: Row(children: [
+ Icon(Icons.delete_outline_rounded, size: 18, color: Colors.red.shade300),
+ const SizedBox(width: 10),
+ Text(l.adminApiKeysRevoke, style: TextStyle(color: Colors.red.shade300)),
+ ])),
+ ],
+ ),
+ ]),
+ ),
+ );
+ }
+
+ Future<void> _toggleActive(Map<String, dynamic> key) async {
+ final api = context.read<AuthProvider>().apiService; if (api == null) return;
+ final id = key['id'] as String? ?? '';
+ final ok = await api.updateApiKey(id, isActive: !(key['isActive'] as bool? ?? false));
+ if (!mounted) return;
+ if (ok) { _load(); } else { showOverlayToast(context, AppLocalizations.of(context)!.adminApiKeysFailedUpdate, icon: Icons.error_outline_rounded); }
+ }
+
+ Future<void> _revoke(Map<String, dynamic> key) async {
+ final l = AppLocalizations.of(context)!;
+ final name = key['name'] as String? ?? l.unknown;
+ final yes = await showDialog<bool>(context: context, builder: (ctx) => AlertDialog(
+ title: Text(l.adminApiKeysDeleteTitle),
+ content: Text(l.adminApiKeysDeleteContent(name)),
+ actions: [
+ TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(l.cancel)),
+ TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text(l.adminApiKeysRevoke, style: TextStyle(color: Colors.red.shade300))),
+ ],
+ ));
+ if (yes != true) return;
+ final api = context.read<AuthProvider>().apiService; if (api == null) return;
+ final ok = await api.deleteApiKey(key['id'] as String? ?? '');
+ if (!mounted) return;
+ final l2 = AppLocalizations.of(context)!;
+ if (ok) { _load(); showOverlayToast(context, l2.adminApiKeysDeleted, icon: Icons.check_circle_outline_rounded); }
+ else { showOverlayToast(context, l2.adminApiKeysFailedDelete, icon: Icons.error_outline_rounded); }
+ }
+
+ void _showEditor() {
+ showModalBottomSheet(context: context, isScrollControlled: true, useSafeArea: true, backgroundColor: Colors.transparent,
+ builder: (_) => _ApiKeyEditorSheet(users: widget.users, onCreated: _load));
+ }
+
+ String _timeAgo(DateTime dt) {
+ final l = AppLocalizations.of(context)!;
+ final d = DateTime.now().difference(dt);
+ if (d.inSeconds < 60) return l.justNow;
+ if (d.inMinutes < 60) return l.minutesAgo(d.inMinutes);
+ if (d.inHours < 24) return l.hoursAgo(d.inHours);
+ if (d.inDays < 30) return l.daysAgo(d.inDays);
+ return l.adminUsersMonthsAgo((d.inDays / 30).floor());
+ }
+
+ static const _months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
+ String _fmtDate(DateTime d) => '${_months[d.month - 1]} ${d.day}, ${d.year}';
+}
+
+// ═══════════════════════════════════════════════════════════════
+// API Key Editor Sheet
+// ═══════════════════════════════════════════════════════════════
+
+class _ApiKeyEditorSheet extends StatefulWidget {
+ final List<dynamic> users;
+ final VoidCallback onCreated;
+ const _ApiKeyEditorSheet({required this.users, required this.onCreated});
+ @override State<_ApiKeyEditorSheet> createState() => _ApiKeyEditorSheetState();
+}
+
+class _ApiKeyEditorSheetState extends State<_ApiKeyEditorSheet> {
+ final _nameCtrl = TextEditingController();
+ String? _userId;
+ int _expiryIndex = 0; // index into _expiryOptions
+ bool _isActive = true;
+ bool _saving = false;
+
+ // (labelKey resolver, seconds or null)
+ static const _expirySeconds = <int?>[null, 604800, 2592000, 7776000, 31536000];
+
+ @override
+ void initState() {
+ super.initState();
+ _userId = context.read<AuthProvider>().userId;
+ // Fall back to the first user if the current id isn't in the list.
+ final ids = widget.users.map((u) => u['id'] as String?).toSet();
+ if (!ids.contains(_userId)) {
+ _userId = widget.users.isNotEmpty ? widget.users.first['id'] as String? : null;
+ }
+ }
+
+ @override
+ void dispose() { _nameCtrl.dispose(); super.dispose(); }
+
+ @override
+ Widget build(BuildContext context) {
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final l = AppLocalizations.of(context)!;
+ final expiryLabels = [l.adminApiKeysExpNever, l.adminApiKeysExp7d, l.adminApiKeysExp30d, l.adminApiKeysExp90d, l.adminApiKeysExp1y];
+
+ return Container(
+ decoration: BoxDecoration(color: Theme.of(context).bottomSheetTheme.backgroundColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(24))),
+ child: Column(mainAxisSize: MainAxisSize.min, children: [
+ Center(child: Container(margin: const EdgeInsets.only(top: 12), width: 36, height: 4,
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(2)))),
+ Padding(padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
+ child: Row(children: [Expanded(child: Text(l.adminApiKeysNewTitle, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface)))])),
+ Flexible(child: SingleChildScrollView(
+ padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ _lbl(cs, tt, l.adminApiKeysName), const SizedBox(height: 6),
+ TextField(controller: _nameCtrl, style: TextStyle(color: cs.onSurface), decoration: _deco(cs, l.adminApiKeysNameHint)),
+ const SizedBox(height: 20),
+ _lbl(cs, tt, l.adminApiKeysOwner), const SizedBox(height: 8),
+ Wrap(spacing: 8, runSpacing: 8, children: widget.users.map((u) {
+ final id = u['id'] as String? ?? '';
+ final uname = u['username'] as String? ?? l.unknown;
+ final on = id == _userId;
+ return GestureDetector(
+ onTap: () => setState(() => _userId = id),
+ child: AnimatedContainer(duration: const Duration(milliseconds: 150),
+ padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
+ decoration: BoxDecoration(
+ color: on ? cs.primary.withValues(alpha: 0.15) : cs.onSurface.withValues(alpha: 0.03),
+ borderRadius: BorderRadius.circular(20),
+ border: Border.all(color: on ? cs.primary.withValues(alpha: 0.4) : cs.onSurface.withValues(alpha: 0.06))),
+ child: Text(uname, style: tt.labelMedium?.copyWith(
+ color: on ? cs.primary : cs.onSurfaceVariant.withValues(alpha: 0.7), fontWeight: on ? FontWeight.w700 : FontWeight.w500)),
+ ),
+ );
+ }).toList()),
+ const SizedBox(height: 20),
+ _lbl(cs, tt, l.adminApiKeysExpiration), const SizedBox(height: 8),
+ Wrap(spacing: 8, runSpacing: 8, children: List.generate(expiryLabels.length, (i) {
+ final on = i == _expiryIndex;
+ return GestureDetector(
+ onTap: () => setState(() => _expiryIndex = i),
+ child: AnimatedContainer(duration: const Duration(milliseconds: 150),
+ padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
+ decoration: BoxDecoration(
+ color: on ? cs.primary.withValues(alpha: 0.15) : cs.onSurface.withValues(alpha: 0.03),
+ borderRadius: BorderRadius.circular(20),
+ border: Border.all(color: on ? cs.primary.withValues(alpha: 0.4) : cs.onSurface.withValues(alpha: 0.06))),
+ child: Text(expiryLabels[i], style: tt.labelMedium?.copyWith(
+ color: on ? cs.primary : cs.onSurfaceVariant.withValues(alpha: 0.7), fontWeight: on ? FontWeight.w700 : FontWeight.w500)),
+ ),
+ );
+ })),
+ const SizedBox(height: 8),
+ SwitchListTile(dense: true, contentPadding: EdgeInsets.zero,
+ title: Text(l.adminApiKeysActive, style: TextStyle(color: cs.onSurface, fontSize: 14)),
+ subtitle: Text(l.adminApiKeysActiveSub, style: TextStyle(color: cs.onSurface.withValues(alpha: 0.3), fontSize: 11)),
+ value: _isActive, onChanged: (v) => setState(() => _isActive = v)),
+ ]))),
+ Padding(padding: EdgeInsets.fromLTRB(20, 8, 20, MediaQuery.of(context).padding.bottom + 12),
+ child: SizedBox(width: double.infinity, height: 48, child: FilledButton(
+ onPressed: _saving ? null : _create,
+ style: FilledButton.styleFrom(backgroundColor: cs.primary, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14))),
+ child: _saving
+ ? SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2, color: cs.onPrimary))
+ : Text(l.adminApiKeysCreate, style: TextStyle(fontWeight: FontWeight.w700, color: cs.onPrimary)),
+ ))),
+ ]));
+ }
+
+ Widget _lbl(ColorScheme cs, TextTheme tt, String t) => Text(t, style: tt.labelMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600));
+
+ InputDecoration _deco(ColorScheme cs, String hint) => InputDecoration(
+ hintText: hint, hintStyle: TextStyle(color: cs.onSurface.withValues(alpha: 0.2)),
+ filled: true, fillColor: cs.onSurface.withValues(alpha: 0.04),
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.onSurface.withValues(alpha: 0.08))),
+ enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.onSurface.withValues(alpha: 0.08))),
+ focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.primary.withValues(alpha: 0.5))),
+ contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12));
+
+ Future<void> _create() async {
+ final api = context.read<AuthProvider>().apiService; if (api == null) return;
+ final l = AppLocalizations.of(context)!;
+ final name = _nameCtrl.text.trim();
+ if (name.isEmpty) { showOverlayToast(context, l.adminApiKeysNameRequired, icon: Icons.error_outline_rounded); return; }
+ if (_userId == null) { showOverlayToast(context, l.adminApiKeysUserRequired, icon: Icons.error_outline_rounded); return; }
+ setState(() => _saving = true);
+ final created = await api.createApiKey(
+ name: name, userId: _userId!, expiresIn: _expirySeconds[_expiryIndex], isActive: _isActive);
+ if (!mounted) return;
+ setState(() => _saving = false);
+ final token = created?['apiKey'] as String?;
+ if (created != null && token != null) {
+ widget.onCreated();
+ Navigator.pop(context);
+ showModalBottomSheet(context: context, isScrollControlled: true, useSafeArea: true, backgroundColor: Colors.transparent,
+ builder: (_) => _ApiKeyCreatedSheet(name: name, token: token));
+ } else {
+ showOverlayToast(context, l.adminApiKeysFailedCreate, icon: Icons.error_outline_rounded);
+ }
+ }
+}
+
+// ═══════════════════════════════════════════════════════════════
+// API Key Created Sheet (token shown once)
+// ═══════════════════════════════════════════════════════════════
+
+class _ApiKeyCreatedSheet extends StatelessWidget {
+ final String name;
+ final String token;
+ const _ApiKeyCreatedSheet({required this.name, required this.token});
+
+ @override
+ Widget build(BuildContext context) {
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final l = AppLocalizations.of(context)!;
+
+ return Container(
+ decoration: BoxDecoration(color: Theme.of(context).bottomSheetTheme.backgroundColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(24))),
+ child: Column(mainAxisSize: MainAxisSize.min, children: [
+ Center(child: Container(margin: const EdgeInsets.only(top: 12), width: 36, height: 4,
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(2)))),
+ Padding(
+ padding: EdgeInsets.fromLTRB(20, 20, 20, MediaQuery.of(context).padding.bottom + 16),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
+ Row(children: [
+ Container(width: 38, height: 38,
+ decoration: BoxDecoration(color: const Color(0xFF4CAF50).withValues(alpha: 0.12), borderRadius: BorderRadius.circular(10)),
+ child: const Icon(Icons.check_rounded, size: 20, color: Color(0xFF4CAF50))),
+ const SizedBox(width: 12),
+ Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Text(l.adminApiKeysCreated, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface)),
+ Text(name, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.5))),
+ ])),
+ ]),
+ const SizedBox(height: 16),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
+ decoration: BoxDecoration(color: Colors.orange.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(12)),
+ child: Row(children: [
+ Icon(Icons.warning_amber_rounded, size: 18, color: Colors.orange.withValues(alpha: 0.9)),
+ const SizedBox(width: 10),
+ Expanded(child: Text(l.adminApiKeysCopyWarning, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.7)))),
+ ]),
+ ),
+ const SizedBox(height: 16),
+ _lbl(cs, tt, l.adminApiKeysTokenLabel), const SizedBox(height: 6),
+ Container(
+ width: double.infinity,
+ padding: const EdgeInsets.all(14),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.04), borderRadius: BorderRadius.circular(12),
+ border: Border.all(color: cs.onSurface.withValues(alpha: 0.08))),
+ child: SelectableText(token, style: TextStyle(color: cs.onSurface, fontFamily: 'monospace', fontSize: 12, height: 1.4)),
+ ),
+ const SizedBox(height: 16),
+ Row(children: [
+ Expanded(child: SizedBox(height: 48, child: OutlinedButton.icon(
+ onPressed: () {
+ Clipboard.setData(ClipboardData(text: token));
+ showOverlayToast(context, l.adminApiKeysCopied, icon: Icons.check_circle_outline_rounded);
+ },
+ style: OutlinedButton.styleFrom(
+ foregroundColor: cs.primary,
+ side: BorderSide(color: cs.primary.withValues(alpha: 0.4)),
+ shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14))),
+ icon: const Icon(Icons.copy_rounded, size: 18),
+ label: Text(l.adminApiKeysCopy, style: const TextStyle(fontWeight: FontWeight.w700)),
+ ))),
+ const SizedBox(width: 12),
+ Expanded(child: SizedBox(height: 48, child: FilledButton(
+ onPressed: () => Navigator.pop(context),
+ style: FilledButton.styleFrom(backgroundColor: cs.primary, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14))),
+ child: Text(l.adminApiKeysDone, style: TextStyle(fontWeight: FontWeight.w700, color: cs.onPrimary)),
+ ))),
+ ]),
+ ]),
+ ),
+ ]));
+ }
+
+ Widget _lbl(ColorScheme cs, TextTheme tt, String t) => Text(t, style: tt.labelMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600));
+}
diff --git a/lib/screens/admin_screen.dart b/lib/screens/admin_screen.dart
index f6f7607b..23c914dd 100644
--- a/lib/screens/admin_screen.dart
+++ b/lib/screens/admin_screen.dart
@@ -8,6 +8,7 @@ import '../l10n/app_localizations.dart';
import 'admin_users_screen.dart';
import 'admin_podcasts_screen.dart';
import 'admin_email_screen.dart';
+import 'admin_api_keys_screen.dart';
class AdminScreen extends StatefulWidget {
const AdminScreen({super.key});
@@ -164,6 +165,16 @@ class _AdminScreenState extends State<AdminScreen> {
},
),
const SizedBox(height: 10),
+ _navButton(cs, tt,
+ icon: Icons.vpn_key_rounded,
+ label: l.adminApiKeys,
+ subtitle: l.adminApiKeysSubtitle,
+ onTap: () {
+ Navigator.push(context, MaterialPageRoute(
+ builder: (_) => AdminApiKeysScreen(users: _users)));
+ },
+ ),
+ const SizedBox(height: 10),
if (_hasRmab) _rmabTile(cs, tt) else _rmabAddRow(cs, tt),
]),
),
diff --git a/lib/services/api_service.dart b/lib/services/api_service.dart
index 55827d22..083dda7e 100644
--- a/lib/services/api_service.dart
+++ b/lib/services/api_service.dart
@@ -1932,6 +1932,70 @@ class ApiService {
return false;
}
+ /// List all API keys (admin only). Each entry includes the expanded `user`
+ /// ({id, username, type}) plus name, isActive, expiresAt, lastUsedAt, createdAt.
+ /// The actual key string is never returned here, only on creation.
+ Future<List<dynamic>> getApiKeys() async {
+ try {
+ final r = await _authGet(Uri.parse('$_cleanBaseUrl/api/api-keys'));
+ if (r.statusCode == 200) {
+ final data = jsonDecode(r.body);
+ if (data is Map && data['apiKeys'] is List) return data['apiKeys'] as List<dynamic>;
+ if (data is List) return data;
+ }
+ } catch (e) { debugPrint('getApiKeys error: $e'); }
+ return [];
+ }
+
+ /// Create an API key (admin only). [expiresIn] is in seconds; pass null for
+ /// no expiration. Returns the created key map which — only on creation —
+ /// includes the actual token under `apiKey`.
+ Future<Map<String, dynamic>?> createApiKey({
+ required String name,
+ required String userId,
+ int? expiresIn,
+ bool isActive = true,
+ }) async {
+ try {
+ final body = <String, dynamic>{'name': name, 'userId': userId, 'isActive': isActive};
+ if (expiresIn != null) body['expiresIn'] = expiresIn;
+ final r = await _authPost(
+ Uri.parse('$_cleanBaseUrl/api/api-keys'),
+ body: jsonEncode(body),
+ );
+ if (r.statusCode == 200) {
+ final data = jsonDecode(r.body);
+ if (data is Map && data['apiKey'] is Map) return Map<String, dynamic>.from(data['apiKey'] as Map);
+ }
+ } catch (e) { debugPrint('createApiKey error: $e'); }
+ return null;
+ }
+
+ /// Update an API key (admin only). Only `isActive` and `userId` are mutable
+ /// server-side (name and expiry are baked into the JWT).
+ Future<bool> updateApiKey(String keyId, {bool? isActive, String? userId}) async {
+ try {
+ final body = <String, dynamic>{};
+ if (isActive != null) body['isActive'] = isActive;
+ if (userId != null) body['userId'] = userId;
+ final r = await _authPatch(
+ Uri.parse('$_cleanBaseUrl/api/api-keys/$keyId'),
+ body: jsonEncode(body),
+ );
+ return r.statusCode == 200;
+ } catch (e) { debugPrint('updateApiKey error: $e'); }
+ return false;
+ }
+
+ /// Delete (revoke) an API key (admin only).
+ Future<bool> deleteApiKey(String keyId) async {
+ try {
+ final r = await _authDelete(Uri.parse('$_cleanBaseUrl/api/api-keys/$keyId'));
+ return r.statusCode == 200;
+ } catch (e) { debugPrint('deleteApiKey error: $e'); }
+ return false;
+ }
+
/// Update a library item's media metadata (admin/root only).
/// PATCH /api/items/:id/media. Tags live on `media`, not `metadata`, so
/// pass them via the [tags] arg to be included at the top level of the