aboutsummaryrefslogtreecommitdiff
path: root/internal/ui
diff options
context:
space:
mode:
authorGravatar Shaolong Chen <shaolong.chen@outlook.it> 2024-10-18 13:18:17 +0800
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-10-18 18:06:09 -0700
commit366928b35de36b6ac37b8058faf7ea783afef7e6 (patch)
treee1fb1ab77852bb28af4b8bf8038172d157e48b45 /internal/ui
parent3b654fefa73908063842fd143b76f1089d0d11ed (diff)
downloadv2-366928b35de36b6ac37b8058faf7ea783afef7e6.tar.gz
v2-366928b35de36b6ac37b8058faf7ea783afef7e6.tar.zst
v2-366928b35de36b6ac37b8058faf7ea783afef7e6.zip
feat(integration): add cubox integration
Signed-off-by: Shaolong Chen <shaolong.chen@outlook.it>
Diffstat (limited to 'internal/ui')
-rw-r--r--internal/ui/form/integration.go6
-rw-r--r--internal/ui/integration_show.go2
2 files changed, 8 insertions, 0 deletions
diff --git a/internal/ui/form/integration.go b/internal/ui/form/integration.go
index a60e9100..0852123b 100644
--- a/internal/ui/form/integration.go
+++ b/internal/ui/form/integration.go
@@ -110,6 +110,8 @@ type IntegrationForm struct {
NtfyUsername string
NtfyPassword string
NtfyIconURL string
+ CuboxEnabled bool
+ CuboxAPILink string
}
// Merge copy form values to the model.
@@ -209,6 +211,8 @@ func (i IntegrationForm) Merge(integration *model.Integration) {
integration.NtfyUsername = i.NtfyUsername
integration.NtfyPassword = i.NtfyPassword
integration.NtfyIconURL = i.NtfyIconURL
+ integration.CuboxEnabled = i.CuboxEnabled
+ integration.CuboxAPILink = i.CuboxAPILink
}
// NewIntegrationForm returns a new IntegrationForm.
@@ -311,6 +315,8 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm {
NtfyUsername: r.FormValue("ntfy_username"),
NtfyPassword: r.FormValue("ntfy_password"),
NtfyIconURL: r.FormValue("ntfy_icon_url"),
+ CuboxEnabled: r.FormValue("cubox_enabled") == "1",
+ CuboxAPILink: r.FormValue("cubox_api_link"),
}
}
diff --git a/internal/ui/integration_show.go b/internal/ui/integration_show.go
index 8cc3bfe6..1395fab2 100644
--- a/internal/ui/integration_show.go
+++ b/internal/ui/integration_show.go
@@ -124,6 +124,8 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) {
NtfyUsername: integration.NtfyUsername,
NtfyPassword: integration.NtfyPassword,
NtfyIconURL: integration.NtfyIconURL,
+ CuboxEnabled: integration.CuboxEnabled,
+ CuboxAPILink: integration.CuboxAPILink,
}
sess := session.New(h.store, request.SessionID(r))