mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-01-01 05:50:12 +00:00
Compare commits
9 Commits
9799665951
...
bd227842d2
Author | SHA1 | Date | |
---|---|---|---|
|
bd227842d2 | ||
|
f47bf762ac | ||
|
1342208980 | ||
|
c8a9b15b4e | ||
|
b0bd6973d1 | ||
|
d10eb6d6bf | ||
|
0c5a332fa2 | ||
|
5a07e103c0 | ||
40fc5e9604 |
2
Makefile
2
Makefile
@ -63,7 +63,7 @@ compile-debug:
|
||||
$(GOBINARY) mod download
|
||||
$(info Building)
|
||||
mkdir -p build
|
||||
cd build && CGO_ENABLED=0 $(GOBINARY) build -o ./jfa-go ../*.go -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)"
|
||||
cd build && CGO_ENABLED=0 $(GOBINARY) build -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)" -o ./jfa-go ../*.go
|
||||
|
||||
compress:
|
||||
upx --lzma build/jfa-go
|
||||
|
2
api.go
2
api.go
@ -1514,7 +1514,7 @@ func (app *appContext) GetEmail(gc *gin.Context) {
|
||||
respondBool(500, false, gc)
|
||||
return
|
||||
}
|
||||
gc.JSON(200, customEmailDTO{Content: content, Variables: variables, Values: values, HTML: email.HTML})
|
||||
gc.JSON(200, customEmailDTO{Content: content, Variables: variables, Values: values, HTML: email.HTML, Plaintext: email.Text})
|
||||
}
|
||||
|
||||
// @Summary Logout by deleting refresh token from cookies.
|
||||
|
@ -33,7 +33,6 @@ func (app *appContext) loadConfig() error {
|
||||
|
||||
for _, key := range app.config.Section("files").Keys() {
|
||||
if name := key.Name(); name != "html_templates" && name != "lang_files" {
|
||||
fmt.Println(name)
|
||||
key.SetValue(key.MustString(filepath.Join(app.dataPath, (key.Name() + ".json"))))
|
||||
}
|
||||
}
|
||||
|
@ -409,3 +409,11 @@ p.top {
|
||||
padding-bottom: 0.5rem;
|
||||
margin-bottom: -0.5rem;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
1
email.go
1
email.go
@ -571,6 +571,5 @@ func (emailer *Emailer) constructWelcome(username string, app *appContext, noSub
|
||||
|
||||
// calls the send method in the underlying emailClient.
|
||||
func (emailer *Emailer) send(email *Email, address ...string) error {
|
||||
fmt.Printf("%+v\n", email)
|
||||
return emailer.sender.send(emailer.fromName, emailer.fromAddr, email, address...)
|
||||
}
|
||||
|
3
go.mod
3
go.mod
@ -12,6 +12,7 @@ replace github.com/hrfee/jfa-go/ombi => ./ombi
|
||||
|
||||
require (
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
||||
github.com/evanw/esbuild v0.8.50 // indirect
|
||||
github.com/fatih/color v1.10.0
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/gin-contrib/pprof v1.3.0
|
||||
@ -40,7 +41,7 @@ require (
|
||||
github.com/ugorji/go v1.2.0 // indirect
|
||||
github.com/writeas/go-strip-markdown v2.0.1+incompatible
|
||||
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 // indirect
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect
|
||||
golang.org/x/tools v0.1.0 // indirect
|
||||
google.golang.org/protobuf v1.25.0 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0
|
||||
|
5
go.sum
5
go.sum
@ -30,6 +30,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473 h1:4
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/evanw/esbuild v0.8.50 h1:97YxSC9Ni9zu82601vI93cSUS0C+WUcPPNIARuGcQtI=
|
||||
github.com/evanw/esbuild v0.8.50/go.mod h1:y2AFBAGVelPqPodpdtxWWqe6n2jYf5FrsJbligmRmuw=
|
||||
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ=
|
||||
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64=
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
|
||||
@ -283,11 +285,14 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 h1:SgQ6LNaYJU0JIuEHv9+s6EbhSCwYeAf5Yvj6lpYlqAE=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
@ -65,7 +65,17 @@
|
||||
"notifyUserCreation": "Bei Benutzererstellung",
|
||||
"label": "Label",
|
||||
"settingsRestarting": "Neustart…",
|
||||
"settingsRestart": "Neustart"
|
||||
"settingsRestart": "Neustart",
|
||||
"variables": "Variablen",
|
||||
"preview": "Vorschau",
|
||||
"reset": "Zurücksetzen",
|
||||
"edit": "Bearbeiten",
|
||||
"customizeEmails": "E-Mails anpassen",
|
||||
"customizeEmailsDescription": "Wenn du jfa-go's E-Mail-Vorlagen nicht benutzen willst, kannst du deinen eigenen unter Verwendung von Markdown erstellen.",
|
||||
"announce": "Ankündigen",
|
||||
"subject": "E-Mail-Betreff",
|
||||
"message": "Nachricht",
|
||||
"markdownSupported": "Markdown wird unterstützt."
|
||||
},
|
||||
"notifications": {
|
||||
"changedEmailAddress": "E-Mail-Adresse von {n} geändert.",
|
||||
@ -94,7 +104,10 @@
|
||||
"errorFailureCheckLogs": "Fehlgeschlagen (überprüfe die Konsole/Logs)",
|
||||
"errorPartialFailureCheckLogs": "Teilweiser Fehlschlag (überprüfe die Konsole/Logs)",
|
||||
"errorUserCreated": "Fehler beim Erstellen des Benutzers {n}.",
|
||||
"errorSendWelcomeEmail": "Fehler beim Senden der Willkommens-E-Mail (überprüfe die Konsole/Logs)"
|
||||
"errorSendWelcomeEmail": "Fehler beim Senden der Willkommens-E-Mail (überprüfe die Konsole/Logs)",
|
||||
"saveEmail": "E-Mail gespeichert.",
|
||||
"errorSaveEmail": "Fehler beim Speichern der E-Mail.",
|
||||
"sentAnnouncement": "Ankündigung gesendet."
|
||||
},
|
||||
"quantityStrings": {
|
||||
"modifySettingsFor": {
|
||||
@ -120,6 +133,10 @@
|
||||
"appliedSettings": {
|
||||
"singular": "Einstellungen auf {n} Benutzer angewendet.",
|
||||
"plural": "Einstellungen auf {n} Benutzer angewendet."
|
||||
},
|
||||
"announceTo": {
|
||||
"singular": "{n} Benutzer mitteilen",
|
||||
"plural": "{n} Benutzern mitteilen"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,13 @@
|
||||
"announce": "Annoncer",
|
||||
"subject": "Sujet du courriel",
|
||||
"message": "Message",
|
||||
"markdownSupported": "Markdown est pris en charge."
|
||||
"markdownSupported": "Markdown est pris en charge.",
|
||||
"customizeEmailsDescription": "Si vous ne souhaitez pas utiliser les modèles d'e-mails de jfa-go, vous pouvez créer les vôtres à l'aide de Markdown.",
|
||||
"variables": "Variables",
|
||||
"preview": "Aperçu",
|
||||
"reset": "Réinitialiser",
|
||||
"edit": "Éditer",
|
||||
"customizeEmails": "Personnaliser les e-mails"
|
||||
},
|
||||
"notifications": {
|
||||
"changedEmailAddress": "Adresse e-mail modifiée de {n}.",
|
||||
@ -100,7 +106,9 @@
|
||||
"errorPartialFailureCheckLogs": "Panne partielle (vérifier la console / les journaux)",
|
||||
"errorUserCreated": "Echec lors de la création de l'utilisateur {n}.",
|
||||
"errorSendWelcomeEmail": "Echec lors de l'envoi du mail de bienvenue (vérifier la console/les journaux)",
|
||||
"sentAnnouncement": "Annonce envoyée."
|
||||
"sentAnnouncement": "Annonce envoyée.",
|
||||
"saveEmail": "Email enregistré.",
|
||||
"errorSaveEmail": "Échec de l'enregistrement de l'e-mail."
|
||||
},
|
||||
"quantityStrings": {
|
||||
"modifySettingsFor": {
|
||||
|
@ -13,7 +13,7 @@
|
||||
"warning": "Peringatan",
|
||||
"inviteInfiniteUsesWarning": "Undangan dalam jumlah tak terbatas dapat disalahgunakan",
|
||||
"inviteSendToEmail": "Dikirim kepada",
|
||||
"login": "Gabung",
|
||||
"login": "Masuk",
|
||||
"logout": "Keluar",
|
||||
"create": "Buat",
|
||||
"apply": "Terapkan",
|
||||
@ -35,15 +35,15 @@
|
||||
"applyHomescreenLayout": "Terapkan tata letak layar beranda",
|
||||
"sendDeleteNotificationEmail": "Kirim email notifikasi",
|
||||
"sendDeleteNotifiationExample": "Akun anda telah dihapus.",
|
||||
"settingsRestart": "Restart",
|
||||
"settingsRestart": "Mulai ulang",
|
||||
"settingsRestarting": "Mengulang kembali…",
|
||||
"settingsRestartRequired": "Perlu restart",
|
||||
"settingsRestartRequiredDescription": "Restart diperlukan untuk menerapkan beberapa pengaturan yang Anda ubah. Mulai ulang sekarang atau nanti?",
|
||||
"settingsRestartRequired": "Mulai ulang diperlukan",
|
||||
"settingsRestartRequiredDescription": "Mulai ulang diperlukan untuk menerapkan beberapa pengaturan yang Anda ubah. Mulai ulang sekarang atau nanti?",
|
||||
"settingsApplyRestartLater": "Terapkan, mulai ulang nanti",
|
||||
"settingsApplyRestartNow": "Terapkan dan mulai ulang kembali",
|
||||
"settingsApplyRestartNow": "Terapkan & mulai ulang",
|
||||
"settingsApplied": "Pengaturan diterapkan.",
|
||||
"settingsRefreshPage": "Segarkan halaman dalam beberapa detik.",
|
||||
"settingsRequiredOrRestartMessage": "Catatan: {n} harus diisi, {n} mengindikasikan perubahan memerlukan restart.",
|
||||
"settingsRequiredOrRestartMessage": "Catatan: {n} harus diisi, {n} mengindikasikan perubahan memerlukan mulai ulang.",
|
||||
"settingsSave": "Simpan",
|
||||
"ombiUserDefaults": "Default pengguna Ombi",
|
||||
"ombiUserDefaultsDescription": "Buat pengguna Ombi dan konfigurasikan, lalu pilih di bawah. Pengaturan / izinnya akan disimpan dan diterapkan ke pengguna Ombi baru yang dibuat oleh jfa-go",
|
||||
@ -65,7 +65,17 @@
|
||||
"inviteExpiresInTime": "Kadaluarsa dalam {n}",
|
||||
"notifyEvent": "Beritahu pada:",
|
||||
"notifyInviteExpiry": "Saat kadaluarsa",
|
||||
"notifyUserCreation": "Saat pembuatan pengguna"
|
||||
"notifyUserCreation": "Saat pembuatan pengguna",
|
||||
"variables": "Variabel",
|
||||
"preview": "Pratinjau",
|
||||
"reset": "Setel ulang",
|
||||
"edit": "Edit",
|
||||
"customizeEmails": "Sesuaikan Email",
|
||||
"customizeEmailsDescription": "Jika Anda tidak ingin menggunakan templat email jfa-go, Anda dapat membuatnya sendiri menggunakan Markdown.",
|
||||
"announce": "Mengumumkan",
|
||||
"subject": "Subjek Email",
|
||||
"message": "Pesan",
|
||||
"markdownSupported": "Markdown didukung."
|
||||
},
|
||||
"notifications": {
|
||||
"changedEmailAddress": "Alamat email {n} diubah.",
|
||||
@ -94,7 +104,10 @@
|
||||
"errorFailureCheckLogs": "Gagal (periksa konsol / log)",
|
||||
"errorPartialFailureCheckLogs": "Kegagalan sebagian (periksa konsol / log)",
|
||||
"errorUserCreated": "Gagal membuat pengguna {n}.",
|
||||
"errorSendWelcomeEmail": "Gagal mengirim email selamat datang (periksa konsol / log)"
|
||||
"errorSendWelcomeEmail": "Gagal mengirim email selamat datang (periksa konsol / log)",
|
||||
"saveEmail": "Email disimpan.",
|
||||
"sentAnnouncement": "Pengumuman dikirim.",
|
||||
"errorSaveEmail": "Gagal menyimpan email."
|
||||
},
|
||||
"quantityStrings": {
|
||||
"modifySettingsFor": {
|
||||
@ -120,6 +133,10 @@
|
||||
"appliedSettings": {
|
||||
"singular": "Pengaturan diterapkan pada {n} pengguna.",
|
||||
"plural": "Pengaturan diterapkan pada {n} pengguna."
|
||||
},
|
||||
"announceTo": {
|
||||
"singular": "Umumkan kepada {n} pengguna",
|
||||
"plural": "Umumkan kepada {n} pengguna"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,13 @@
|
||||
"announce": "Aankondiging",
|
||||
"markdownSupported": "Markdown wordt ondersteund.",
|
||||
"subject": "E-mailonderwerp",
|
||||
"message": "Bericht"
|
||||
"message": "Bericht",
|
||||
"variables": "Variabelen",
|
||||
"customizeEmailsDescription": "Als je de e-mailsjablonen van jfa-go niet wilt gebruiken, kun je met gebruik van Markdown je eigen aanmaken.",
|
||||
"preview": "Voorbeeld",
|
||||
"reset": "Resetten",
|
||||
"edit": "Bewerken",
|
||||
"customizeEmails": "E-mails aanpassen"
|
||||
},
|
||||
"notifications": {
|
||||
"changedEmailAddress": "E-mailadres van {n} gewijzigd.",
|
||||
@ -99,7 +105,9 @@
|
||||
"errorPartialFailureCheckLogs": "Gedeeltelijke fout (controleer console/logbestanden)",
|
||||
"errorSendWelcomeEmail": "Versturen van welkomste-mail is mislukt (zie console/logs)",
|
||||
"errorUserCreated": "Aanmaken van gebruiker {n} is mislukt.",
|
||||
"sentAnnouncement": "Aankondiging verzonden."
|
||||
"sentAnnouncement": "Aankondiging verzonden.",
|
||||
"saveEmail": "E-mail opgeslagen.",
|
||||
"errorSaveEmail": "Opslaan van e-mail mislukt."
|
||||
},
|
||||
"quantityStrings": {
|
||||
"modifySettingsFor": {
|
||||
|
@ -69,7 +69,13 @@
|
||||
"announce": "Anunciar",
|
||||
"subject": "Assunto do email",
|
||||
"message": "Mensagem",
|
||||
"markdownSupported": "Suporte a Markdown."
|
||||
"markdownSupported": "Suporte a Markdown.",
|
||||
"customizeEmailsDescription": "Se não quiser usar os modelos de email do jfa-go, você pode criar o seu próprio usando o Markdown.",
|
||||
"variables": "Variáveis",
|
||||
"preview": "Pre-visualizar",
|
||||
"reset": "Reiniciar",
|
||||
"edit": "Editar",
|
||||
"customizeEmails": "Customizar Emails"
|
||||
},
|
||||
"notifications": {
|
||||
"changedEmailAddress": "Endereço de e-mail alterado de {n}.",
|
||||
@ -99,7 +105,9 @@
|
||||
"errorPartialFailureCheckLogs": "Falha parcial (verificar console/logs)",
|
||||
"errorUserCreated": "Falha ao criar o usuário {n}.",
|
||||
"errorSendWelcomeEmail": "Falha ao enviar e-mail de boas-vindas (verifique console/logs)",
|
||||
"sentAnnouncement": "Comunicado enviado."
|
||||
"sentAnnouncement": "Comunicado enviado.",
|
||||
"saveEmail": "Email salvo.",
|
||||
"errorSaveEmail": "Falha ao salvar o email."
|
||||
},
|
||||
"quantityStrings": {
|
||||
"modifySettingsFor": {
|
||||
|
@ -10,25 +10,29 @@
|
||||
"title": "Mitteilung: Benutzer erstellt",
|
||||
"aUserWasCreated": "Ein Benutzer wurde unter Verwendung des Codes {code} erstellt.",
|
||||
"time": "Zeit",
|
||||
"notificationNotice": "Hinweis: Benachrichtigungs-E-Mails können auf dem Administrator-Dashboard umgeschalten werden."
|
||||
"notificationNotice": "Hinweis: Benachrichtigungs-E-Mails können auf dem Administrator-Dashboard umgeschalten werden.",
|
||||
"name": "Benutzererstellung"
|
||||
},
|
||||
"inviteExpiry": {
|
||||
"title": "Mitteilung: Invite abgelaufen",
|
||||
"inviteExpired": "Invite abgelaufen.",
|
||||
"expiredAt": "Code {code} lief um {time} ab.",
|
||||
"notificationNotice": "Hinweis: Benachrichtigungs-E-Mails können auf dem Administrator-Dashboard umgeschalten werden."
|
||||
"notificationNotice": "Hinweis: Benachrichtigungs-E-Mails können auf dem Administrator-Dashboard umgeschalten werden.",
|
||||
"name": "Invite Ablaufdatum"
|
||||
},
|
||||
"passwordReset": {
|
||||
"title": "Passwortzurücksetzung angefordert - Jellyfin",
|
||||
"someoneHasRequestedReset": "Jemand hat vor kurzem eine Passwortzurücksetzung auf Jellyfin angefordert.",
|
||||
"ifItWasYou": "Wenn du das warst, gib die PIN unten in die Eingabeaufforderung ein.",
|
||||
"codeExpiry": "Der Code wird am {date}, um {time} UTC ablaufen, was in {expiresInMinutes} ist.",
|
||||
"pin": "PIN"
|
||||
"pin": "PIN",
|
||||
"name": "Passwortzurücksetzung"
|
||||
},
|
||||
"userDeleted": {
|
||||
"title": "Dein Konto wurde gelöscht - Jellyfin",
|
||||
"yourAccountWasDeleted": "Dein Jellyfin-Konto wurde gelöscht.",
|
||||
"reason": "Grund"
|
||||
"reason": "Grund",
|
||||
"name": "Benutzerlöschung"
|
||||
},
|
||||
"inviteEmail": {
|
||||
"title": "Invite - Jellyfin",
|
||||
@ -36,17 +40,20 @@
|
||||
"youHaveBeenInvited": "Du wurdest zu Jellyfin eingeladen.",
|
||||
"toJoin": "Um beizutreten, folge dem untenstehenden Link.",
|
||||
"inviteExpiry": "Dieser Invite wird am {date}; um {time} ablaufen, was in {expiresInMinutes} ist, also handle schnell.",
|
||||
"linkButton": "Richte dein Konto ein"
|
||||
"linkButton": "Richte dein Konto ein",
|
||||
"name": "Einladungs-E-Mail"
|
||||
},
|
||||
"welcomeEmail": {
|
||||
"title": "Wilkommen bei Jellyfin",
|
||||
"welcome": "Willkommen bei Jellyfin!",
|
||||
"youCanLoginWith": "Du kannst dich mit den mit den untenstehenden Zugangsdaten anmelden",
|
||||
"jellyfinURL": "URL"
|
||||
"jellyfinURL": "URL",
|
||||
"name": "Willkommens-E-Mail"
|
||||
},
|
||||
"emailConfirmation": {
|
||||
"title": "Bestätige deine E-Mail - Jellyfin",
|
||||
"clickBelow": "Klicke den untenstehenden Link, um deine E-Mail-Adresse zu bestätigen, und fange an, Jellyfin zu benutzen.",
|
||||
"confirmEmail": "E-Mail bestätigen"
|
||||
"confirmEmail": "E-Mail bestätigen",
|
||||
"name": "Bestätigungs-E-Mail"
|
||||
}
|
||||
}
|
||||
|
@ -11,25 +11,29 @@
|
||||
"title": "Notification : Utilisateur créé",
|
||||
"aUserWasCreated": "Un utilisateur a été créé avec ce code {code}.",
|
||||
"time": "Date",
|
||||
"notificationNotice": "Note : Les emails de notification peuvent être activés sur le tableau de bord administrateur."
|
||||
"notificationNotice": "Note : Les emails de notification peuvent être activés sur le tableau de bord administrateur.",
|
||||
"name": "Création d'utilisateur"
|
||||
},
|
||||
"inviteExpiry": {
|
||||
"title": "Notification : Invitation expirée",
|
||||
"inviteExpired": "Invitation expirée.",
|
||||
"expiredAt": "Le code {code} a expiré à {time}.",
|
||||
"notificationNotice": "Note : Les emails de notification peuvent être activés sur le tableau de bord administrateur."
|
||||
"notificationNotice": "Note : Les emails de notification peuvent être activés sur le tableau de bord administrateur.",
|
||||
"name": "Expiration de l'invitation"
|
||||
},
|
||||
"passwordReset": {
|
||||
"title": "Réinitialisation de mot du passe demandée - Jellyfin",
|
||||
"someoneHasRequestedReset": "Quelqu'un vient de demander une réinitialisation du mot de passe via Jellyfin.",
|
||||
"ifItWasYou": "Si c'était bien toi, renseigne le code PIN en dessous.",
|
||||
"codeExpiry": "Ce code expirera le {date}, à {time} UTC, soit dans {expiresInMinutes}.",
|
||||
"pin": "PIN"
|
||||
"pin": "PIN",
|
||||
"name": "Réinitialisation du mot de passe"
|
||||
},
|
||||
"userDeleted": {
|
||||
"title": "Ton compte a été désactivé - Jellyfin",
|
||||
"yourAccountWasDeleted": "Ton compte Jellyfin a été supprimé.",
|
||||
"reason": "Motif"
|
||||
"reason": "Motif",
|
||||
"name": "Suppression de l'utilisateur"
|
||||
},
|
||||
"inviteEmail": {
|
||||
"title": "Invitation - Jellyfin",
|
||||
@ -37,17 +41,20 @@
|
||||
"youHaveBeenInvited": "Tu as été invité à rejoindre Jellyfin.",
|
||||
"toJoin": "Pour continuer, suis le lien en dessous.",
|
||||
"inviteExpiry": "L'invitation expirera le {date}, à {time}, soit dans {expiresInMinutes}, alors fais vite !",
|
||||
"linkButton": "Lien"
|
||||
"linkButton": "Lien",
|
||||
"name": "Courriel d'invitation"
|
||||
},
|
||||
"welcomeEmail": {
|
||||
"youCanLoginWith": "Tu peux te connecter avec les informations ci-dessous",
|
||||
"title": "Bienvenue sur Jellyfin",
|
||||
"welcome": "Bienvenue sur Jellyfin !",
|
||||
"jellyfinURL": "URL"
|
||||
"jellyfinURL": "URL",
|
||||
"name": "Courriel de bienvenue"
|
||||
},
|
||||
"emailConfirmation": {
|
||||
"title": "Confirmez votre adresse e-mail - Jellyfin",
|
||||
"clickBelow": "Clique sur le lien ci-dessous pour confirmer ton adresse e-mail et commencer à utiliser Jellyfin.",
|
||||
"confirmEmail": "Confirmer l'adresse e-mail"
|
||||
"confirmEmail": "Confirmer l'adresse e-mail",
|
||||
"name": "Email de confirmation"
|
||||
}
|
||||
}
|
||||
|
@ -10,25 +10,29 @@
|
||||
"title": "Perhatian: User telah dibuat",
|
||||
"aUserWasCreated": "User telah dibuat menggunakan kode {code}.",
|
||||
"time": "Waktu",
|
||||
"notificationNotice": "Catatan: Email notifikasi dapat diganti pada dasbor admin."
|
||||
"notificationNotice": "Catatan: Email notifikasi dapat diganti pada dasbor admin.",
|
||||
"name": "Pembuatan pengguna"
|
||||
},
|
||||
"inviteExpiry": {
|
||||
"title": "Perhatian: Undangan telah kadaluarsa",
|
||||
"inviteExpired": "Undangan telah kadaluarsa.",
|
||||
"expiredAt": "Kode {code} kadaluarsa pada {time}.",
|
||||
"notificationNotice": "Catatan: Email notifikasi dapat diganti pada dasbor admin."
|
||||
"notificationNotice": "Catatan: Email notifikasi dapat diganti pada dasbor admin.",
|
||||
"name": "Waktu kedaluwarsa undangan"
|
||||
},
|
||||
"passwordReset": {
|
||||
"title": "Reset password telah di-request - Jellyfin",
|
||||
"someoneHasRequestedReset": "Seseorang baru saja me-request reset password pada Jellyfin.",
|
||||
"ifItWasYou": "Jika ini adalah benar anda, masukkan pin dibawah ke dalam tempat yang sudah disediakan.",
|
||||
"codeExpiry": "Kode akan kadaluarsa pada {date}, pada waktu {time} UTC, yaitu dalam {expiresInMinutes}.",
|
||||
"pin": "PIN"
|
||||
"pin": "PIN",
|
||||
"name": "Atur ulang kata sandi"
|
||||
},
|
||||
"userDeleted": {
|
||||
"title": "Akun anda telah dihapus - Jellyfin",
|
||||
"yourAccountWasDeleted": "Akun Jellyfin anda telah dihapus.",
|
||||
"reason": "Alasan"
|
||||
"reason": "Alasan",
|
||||
"name": "Penghapusan pengguna"
|
||||
},
|
||||
"inviteEmail": {
|
||||
"title": "Undangan - Jellyfin",
|
||||
@ -36,17 +40,20 @@
|
||||
"youHaveBeenInvited": "Anda telah diundang ke Jellyfin.",
|
||||
"toJoin": "Untuk masuk, silahkan ikuti link dibawah ini.",
|
||||
"inviteExpiry": "Undangan ini akan berakhir dalam {date} pada {time}, yaitu dalam {expiresInMinutes}, jadi bergegaslah.",
|
||||
"linkButton": "Persiapkan akunmu"
|
||||
"linkButton": "Persiapkan akunmu",
|
||||
"name": "Email Undangan"
|
||||
},
|
||||
"welcomeEmail": {
|
||||
"title": "Selamat datang di Jellyfin",
|
||||
"welcome": "Selamat datang di Jellyfin!",
|
||||
"youCanLoginWith": "Anda dapat masuk dengan menggunakan data dibawah ini",
|
||||
"jellyfinURL": "URL"
|
||||
"jellyfinURL": "URL",
|
||||
"name": "Email selamat datang"
|
||||
},
|
||||
"emailConfirmation": {
|
||||
"title": "Konfirmasi emailmu - Jellyfin",
|
||||
"clickBelow": "Klik link dibawah ini untuk mengkonfirmasikan alamat emailmu untuk mulai menggunakan Jellyfin.",
|
||||
"confirmEmail": "Konfirmasi Email"
|
||||
"confirmEmail": "Konfirmasi Email",
|
||||
"name": "Email konfirmasi"
|
||||
}
|
||||
}
|
||||
|
@ -195,4 +195,5 @@ type customEmailDTO struct {
|
||||
Variables []string `json:"variables"`
|
||||
Values map[string]interface{} `json:"values"`
|
||||
HTML string `json:"html"`
|
||||
Plaintext string `json:"plaintext"`
|
||||
}
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -1438,6 +1438,11 @@
|
||||
"resolved": "https://registry.npm.taobao.org/remixicon/download/remixicon-2.5.0.tgz",
|
||||
"integrity": "sha1-teJFiUoVUKojeT+V2s6tv5atGkE="
|
||||
},
|
||||
"remove-markdown": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npm.taobao.org/remove-markdown/download/remove-markdown-0.3.0.tgz",
|
||||
"integrity": "sha1-XktmdJOpNXlyjz1S7MHbnKUF3Jg="
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
|
@ -23,6 +23,7 @@
|
||||
"lodash": "^4.17.19",
|
||||
"mjml": "^4.8.0",
|
||||
"remixicon": "^2.5.0",
|
||||
"remove-markdown": "^0.3.0",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"devDependencies": {}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { _get, _post, toggleLoader } from "../modules/common.js";
|
||||
import { Marked } from "@ts-stack/markdown";
|
||||
import { stripMarkdown } from "../modules/stripmd.js";
|
||||
|
||||
interface settingsBoolEvent extends Event {
|
||||
detail: boolean;
|
||||
@ -672,17 +673,12 @@ class ombiDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
interface Email {
|
||||
subject: string;
|
||||
html: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface templateEmail {
|
||||
content: string;
|
||||
variables: string[];
|
||||
values: { [key: string]: string };
|
||||
html: string;
|
||||
plaintext: string;
|
||||
}
|
||||
|
||||
interface emailListEl {
|
||||
@ -700,6 +696,7 @@ class EmailEditor {
|
||||
private _variables = document.getElementById("editor-variables") as HTMLDivElement;
|
||||
private _textArea = document.getElementById("textarea-editor") as HTMLTextAreaElement;
|
||||
private _preview = document.getElementById("editor-preview") as HTMLDivElement;
|
||||
private _previewContent: HTMLElement;
|
||||
// private _timeout: number;
|
||||
// private _finishInterval = 200;
|
||||
|
||||
@ -734,7 +731,12 @@ class EmailEditor {
|
||||
}
|
||||
this._templ = req.response as templateEmail;
|
||||
this._textArea.value = this._templ.content;
|
||||
this._preview.innerHTML = this._templ.html;
|
||||
if (this._templ.html == "") {
|
||||
this._preview.innerHTML = `<pre id="preview-content" class="monospace"></pre>`;
|
||||
} else {
|
||||
this._preview.innerHTML = this._templ.html;
|
||||
}
|
||||
this._previewContent = document.getElementById("preview-content");
|
||||
this.loadPreview();
|
||||
this._content = this._templ.content;
|
||||
const colors = ["info", "urge", "positive", "neutral"];
|
||||
@ -764,8 +766,13 @@ class EmailEditor {
|
||||
if (value === undefined) { value = variable; }
|
||||
content = content.replace(new RegExp(variable, "g"), value);
|
||||
}
|
||||
content = Marked.parse(content)
|
||||
document.getElementById("preview-content").innerHTML = content;
|
||||
if (this._templ.html == "") {
|
||||
content = stripMarkdown(content);
|
||||
this._previewContent.textContent = content;
|
||||
} else {
|
||||
content = Marked.parse(content);
|
||||
this._previewContent.innerHTML = content;
|
||||
}
|
||||
// _post("/config/emails/" + this._currentID + "/test", { "content": this._textArea.value }, (req: XMLHttpRequest) => {
|
||||
// if (req.readyState == 4) {
|
||||
// if (req.status != 200) {
|
||||
|
49
ts/modules/stripmd.ts
Normal file
49
ts/modules/stripmd.ts
Normal file
@ -0,0 +1,49 @@
|
||||
const removeMd = require("remove-markdown");
|
||||
|
||||
export function stripMarkdown(md: string): string {
|
||||
let foundOpenSquare = false;
|
||||
let openSquare = -1;
|
||||
let openBracket = -1;
|
||||
let closeBracket = -1;
|
||||
let openSquares: number[] = [];
|
||||
let closeBrackets: number[] = [];
|
||||
let links: string[] = [];
|
||||
let foundOpen = false;
|
||||
for (let i = 0; i < md.length; i++) {
|
||||
const c = md.charAt(i);
|
||||
if (!foundOpenSquare && !foundOpen && c != '[' && c != ']') {
|
||||
continue;
|
||||
}
|
||||
if (c == '[' && md.charAt(i-1) != '!') {
|
||||
foundOpenSquare = true;
|
||||
openSquare = i;
|
||||
} else if (c == ']') {
|
||||
if (md.charAt(i+1) == '(') {
|
||||
foundOpenSquare = false;
|
||||
foundOpen = true;
|
||||
openBracket = i + 1;
|
||||
continue;
|
||||
}
|
||||
} else if (c == ')') {
|
||||
closeBracket = i;
|
||||
openSquares.push(openSquare);
|
||||
closeBrackets.push(closeBracket);
|
||||
links.push(md.slice(openBracket+1, closeBracket))
|
||||
openBracket = -1;
|
||||
closeBracket = -1;
|
||||
openSquare = -1;
|
||||
foundOpenSquare = false;
|
||||
foundOpen = false;
|
||||
}
|
||||
}
|
||||
let fullLinks: string[] = new Array(openSquares.length);
|
||||
for (let i = 0; i < openSquares.length; i++) {
|
||||
if (openSquares[i] != -1 && closeBrackets[i] != -1) {
|
||||
fullLinks[i] = md.slice(openSquares[i], closeBrackets[i]+1)
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < openSquares.length; i++) {
|
||||
md = md.replace(fullLinks[i], links[i]);
|
||||
}
|
||||
return removeMd(md);
|
||||
}
|
Loading…
Reference in New Issue
Block a user