web/user: add message upon source connection deletion

closes #2522

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-05-16 20:28:23 +02:00
parent 6494a0352f
commit 086a44bdbd
12 changed files with 774 additions and 805 deletions

View File

@ -2082,6 +2082,11 @@ msgstr "Richtlinienpuffer löschen fehlgeschlagen"
msgid "Failed to delete {0}: {1}"
msgstr "Löschen von {0} fehlgeschlagen: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "Aktualisieren von {0} fehlgeschlagen: {1}"
@ -5030,6 +5035,11 @@ msgstr "Nutzer erfolgreich erstellt."
msgid "Successfully deleted {0} {1}"
msgstr "{0} {1} erfolgreich gelöscht"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Zertifikat-Schlüsselpaar erfolgreich generiert."

View File

@ -2117,6 +2117,11 @@ msgstr "Failed to delete policy cache"
msgid "Failed to delete {0}: {1}"
msgstr "Failed to delete {0}: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr "Failed to disconnected source: {exc}"
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "Failed to update {0}: {1}"
@ -5136,6 +5141,11 @@ msgstr "Successfully created user."
msgid "Successfully deleted {0} {1}"
msgstr "Successfully deleted {0} {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr "Successfully disconnected source"
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Successfully generated certificate-key pair."

View File

@ -2073,6 +2073,11 @@ msgstr "No se pudo eliminar la caché de directivas"
msgid "Failed to delete {0}: {1}"
msgstr "No se pudo eliminar {0}: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "No se pudo actualizar {0}: {1}"
@ -5024,6 +5029,11 @@ msgstr "Se creó correctamente el usuario."
msgid "Successfully deleted {0} {1}"
msgstr "Se eliminó correctamente {0} {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Se ha generado correctamente el par de claves de certificado."

View File

@ -2098,6 +2098,11 @@ msgstr "Impossible de vider le cache des politiques"
msgid "Failed to delete {0}: {1}"
msgstr "Impossible de supprimer {0} : {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "Impossible de mettre à jour {0} : {1}"
@ -5085,6 +5090,11 @@ msgstr "Utilisateur créé avec succès"
msgid "Successfully deleted {0} {1}"
msgstr "{0} {1} supprimé avec succès"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Paire clé/certificat générée avec succès."

View File

@ -2070,6 +2070,11 @@ msgstr "Nie udało się usunąć pamięci podręcznej zasad"
msgid "Failed to delete {0}: {1}"
msgstr "Nie udało się usunąć {0}: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "Nie udało się zaktualizować {0}: {1}"
@ -5021,6 +5026,11 @@ msgstr "Pomyślnie utworzono użytkownika."
msgid "Successfully deleted {0} {1}"
msgstr "Pomyślnie usunięto {0} {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Pomyślnie wygenerowana para certyfikat-klucz."

View File

@ -2103,6 +2103,11 @@ msgstr ""
msgid "Failed to delete {0}: {1}"
msgstr ""
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr ""
@ -5116,6 +5121,11 @@ msgstr ""
msgid "Successfully deleted {0} {1}"
msgstr ""
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr ""

View File

@ -2073,6 +2073,11 @@ msgstr "İlke önbelleği silinemedi"
msgid "Failed to delete {0}: {1}"
msgstr "{0} silinemedi: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "{0} güncellenemedi: {1}"
@ -5026,6 +5031,11 @@ msgstr "Kullanıcı başarıyla oluşturuldu."
msgid "Successfully deleted {0} {1}"
msgstr "{0} {1} başarıyla silindi"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "Sertifika-anahtar çifti başarıyla oluşturuldu."

File diff suppressed because it is too large Load Diff

View File

@ -2064,6 +2064,11 @@ msgstr "未能删除策略缓存"
msgid "Failed to delete {0}: {1}"
msgstr "无法删除 {0}: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "更新失败 {0}{1}"
@ -4993,6 +4998,11 @@ msgstr "已成功创建用户。"
msgid "Successfully deleted {0} {1}"
msgstr "成功删除 {0} {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "成功生成证书密钥对。"

View File

@ -2064,6 +2064,11 @@ msgstr "未能删除策略缓存"
msgid "Failed to delete {0}: {1}"
msgstr "无法删除 {0}: {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Failed to disconnected source: {exc}"
msgstr ""
#: src/pages/users/UserActiveForm.ts
msgid "Failed to update {0}: {1}"
msgstr "更新失败 {0}{1}"
@ -4993,6 +4998,11 @@ msgstr "已成功创建用户。"
msgid "Successfully deleted {0} {1}"
msgstr "成功删除 {0} {1}"
#: src/user/user-settings/sources/SourceSettingsOAuth.ts
#: src/user/user-settings/sources/SourceSettingsPlex.ts
msgid "Successfully disconnected source"
msgstr ""
#: src/pages/crypto/CertificateGenerateForm.ts
msgid "Successfully generated certificate-key pair."
msgstr "成功生成证书密钥对。"

View File

@ -8,6 +8,8 @@ import { until } from "lit/directives/until.js";
import { SourcesApi } from "@goauthentik/api";
import { AndNext, DEFAULT_CONFIG } from "../../../api/Config";
import { MessageLevel } from "../../../elements/messages/Message";
import { showMessage } from "../../../elements/messages/MessageContainer";
import { BaseUserSettings } from "../BaseUserSettings";
@customElement("ak-user-settings-source-oauth")
@ -26,10 +28,21 @@ export class SourceSettingsOAuth extends BaseUserSettings {
return html` <button
class="pf-c-button pf-m-danger"
@click=${() => {
return new SourcesApi(
DEFAULT_CONFIG,
).sourcesUserConnectionsOauthDestroy({
return new SourcesApi(DEFAULT_CONFIG)
.sourcesUserConnectionsOauthDestroy({
id: connection.results[0].pk || 0,
})
.then(() => {
showMessage({
level: MessageLevel.info,
message: t`Successfully disconnected source`,
});
})
.catch((exc) => {
showMessage({
level: MessageLevel.error,
message: t`Failed to disconnected source: ${exc}`,
});
});
}}
>

View File

@ -9,6 +9,8 @@ import { SourcesApi } from "@goauthentik/api";
import { DEFAULT_CONFIG } from "../../../api/Config";
import { PlexAPIClient, popupCenterScreen } from "../../../api/Plex";
import { EVENT_REFRESH } from "../../../constants";
import { MessageLevel } from "../../../elements/messages/Message";
import { showMessage } from "../../../elements/messages/MessageContainer";
import { BaseUserSettings } from "../BaseUserSettings";
@customElement("ak-user-settings-source-plex")
@ -47,10 +49,21 @@ export class SourceSettingsPlex extends BaseUserSettings {
return html` <button
class="pf-c-button pf-m-danger"
@click=${() => {
return new SourcesApi(
DEFAULT_CONFIG,
).sourcesUserConnectionsPlexDestroy({
return new SourcesApi(DEFAULT_CONFIG)
.sourcesUserConnectionsPlexDestroy({
id: connection.results[0].pk || 0,
})
.then(() => {
showMessage({
level: MessageLevel.info,
message: t`Successfully disconnected source`,
});
})
.catch((exc) => {
showMessage({
level: MessageLevel.error,
message: t`Failed to disconnected source: ${exc}`,
});
});
}}
>