From 6ed12151d2d7979bf19561010156030d8a7b1cb3 Mon Sep 17 00:00:00 2001 From: Christian Frommert Date: Sun, 28 Sep 2025 20:37:05 +0200 Subject: [PATCH] feat(integration): add tags option for karakeep integration fix missing comma Move tags attachment to own function --- internal/database/migrations.go | 7 ++ internal/integration/integration.go | 8 +- internal/integration/karakeep/karakeep.go | 99 +++++++++++++++++-- internal/locale/translations/de_DE.json | 1 + internal/locale/translations/el_EL.json | 1 + internal/locale/translations/en_US.json | 1 + internal/locale/translations/es_ES.json | 1 + internal/locale/translations/fi_FI.json | 1 + internal/locale/translations/fr_FR.json | 1 + internal/locale/translations/hi_IN.json | 1 + internal/locale/translations/id_ID.json | 1 + internal/locale/translations/it_IT.json | 1 + internal/locale/translations/ja_JP.json | 1 + .../locale/translations/nan_Latn_pehoeji.json | 1 + internal/locale/translations/nl_NL.json | 1 + internal/locale/translations/pl_PL.json | 1 + internal/locale/translations/pt_BR.json | 1 + internal/locale/translations/ro_RO.json | 1 + internal/locale/translations/ru_RU.json | 1 + internal/locale/translations/tr_TR.json | 1 + internal/locale/translations/uk_UA.json | 1 + internal/locale/translations/zh_CN.json | 1 + internal/locale/translations/zh_TW.json | 1 + internal/model/integration.go | 1 + internal/storage/integration.go | 18 ++-- .../templates/views/integrations.html | 3 + internal/ui/form/integration.go | 3 + internal/ui/integration_show.go | 1 + 28 files changed, 143 insertions(+), 17 deletions(-) diff --git a/internal/database/migrations.go b/internal/database/migrations.go index e9c2a4a1..a0416881 100644 --- a/internal/database/migrations.go +++ b/internal/database/migrations.go @@ -1348,4 +1348,11 @@ var migrations = [...]func(tx *sql.Tx) error{ _, err = tx.Exec(sql) return err }, + func(tx *sql.Tx) (err error) { + sql := ` + ALTER TABLE integrations ADD COLUMN karakeep_tags text default ''; + ` + _, err = tx.Exec(sql) + return err + }, } diff --git a/internal/integration/integration.go b/internal/integration/integration.go index 1f24ba3d..76be9e5b 100644 --- a/internal/integration/integration.go +++ b/internal/integration/integration.go @@ -457,14 +457,20 @@ func SendEntry(entry *model.Entry, userIntegrations *model.Integration) { if userIntegrations.KarakeepEnabled { slog.Debug("Sending entry to Karakeep", slog.Int64("user_id", userIntegrations.UserID), + slog.String("user_tags", userIntegrations.KarakeepTags), slog.Int64("entry_id", entry.ID), slog.String("entry_url", entry.URL), ) - client := karakeep.NewClient(userIntegrations.KarakeepAPIKey, userIntegrations.KarakeepURL) + client := karakeep.NewClient( + userIntegrations.KarakeepAPIKey, + userIntegrations.KarakeepURL, + userIntegrations.KarakeepTags, + ) if err := client.SaveURL(entry.URL); err != nil { slog.Error("Unable to send entry to Karakeep", slog.Int64("user_id", userIntegrations.UserID), + slog.String("user_tags", userIntegrations.KarakeepTags), slog.Int64("entry_id", entry.ID), slog.String("entry_url", entry.URL), slog.Any("error", err), diff --git a/internal/integration/karakeep/karakeep.go b/internal/integration/karakeep/karakeep.go index 7410f374..b8dd8706 100644 --- a/internal/integration/karakeep/karakeep.go +++ b/internal/integration/karakeep/karakeep.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "net/http" + "strings" "time" "miniflux.app/v2/internal/version" @@ -16,9 +17,15 @@ import ( const defaultClientTimeout = 10 * time.Second -type errorResponse struct { - Code string `json:"code"` - Error string `json:"error"` +type Client struct { + wrapped *http.Client + apiEndpoint string + apiToken string + tags string +} + +type tagItem struct { + TagName string `json:"tagName"` } type saveURLPayload struct { @@ -26,14 +33,75 @@ type saveURLPayload struct { URL string `json:"url"` } -type Client struct { - wrapped *http.Client - apiEndpoint string - apiToken string +type saveURLResponse struct { + ID string `json:"id"` } -func NewClient(apiToken string, apiEndpoint string) *Client { - return &Client{wrapped: &http.Client{Timeout: defaultClientTimeout}, apiEndpoint: apiEndpoint, apiToken: apiToken} +type attachTagsPayload struct { + Tags []tagItem `json:"tags"` +} + +type errorResponse struct { + Code string `json:"code"` + Error string `json:"error"` +} + +func NewClient(apiToken string, apiEndpoint string, tags string) *Client { + return &Client{wrapped: &http.Client{Timeout: defaultClientTimeout}, apiEndpoint: apiEndpoint, apiToken: apiToken, tags: tags} +} + +func (c *Client) attachTags(entryID string) error { + if c.tags == "" { + return nil + } + + tagItems := make([]tagItem, 0) + for tag := range strings.SplitSeq(c.tags, ",") { + if trimmedTag := strings.TrimSpace(tag); trimmedTag != "" { + tagItems = append(tagItems, tagItem{TagName: trimmedTag}) + } + } + + if len(tagItems) == 0 { + return nil + } + + tagRequestBody, err := json.Marshal(&attachTagsPayload{ + Tags: tagItems, + }) + if err != nil { + return fmt.Errorf("karakeep: unable to encode tag request body: %v", err) + } + + tagRequest, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/%s/tags", c.apiEndpoint, entryID), bytes.NewReader(tagRequestBody)) + if err != nil { + return fmt.Errorf("karakeep: unable to create tag request: %v", err) + } + + tagRequest.Header.Set("Authorization", "Bearer "+c.apiToken) + tagRequest.Header.Set("Content-Type", "application/json") + tagRequest.Header.Set("User-Agent", "Miniflux/"+version.Version) + + tagResponse, err := c.wrapped.Do(tagRequest) + if err != nil { + return fmt.Errorf("karakeep: unable to send tag request: %v", err) + } + defer tagResponse.Body.Close() + + if tagResponse.StatusCode != http.StatusOK && tagResponse.StatusCode != http.StatusCreated { + tagResponseBody, err := io.ReadAll(tagResponse.Body) + if err != nil { + return fmt.Errorf("karakeep: failed to parse tag response: %s", err) + } + + var errResponse errorResponse + if err := json.Unmarshal(tagResponseBody, &errResponse); err != nil { + return fmt.Errorf("karakeep: unable to parse tag error response: status=%d body=%s", tagResponse.StatusCode, string(tagResponseBody)) + } + return fmt.Errorf("karakeep: failed to attach tags: status=%d errorcode=%s %s", tagResponse.StatusCode, errResponse.Code, errResponse.Error) + } + + return nil } func (c *Client) SaveURL(entryURL string) error { @@ -77,5 +145,18 @@ func (c *Client) SaveURL(entryURL string) error { return fmt.Errorf("karakeep: failed to save URL: status=%d errorcode=%s %s", resp.StatusCode, errResponse.Code, errResponse.Error) } + var response saveURLResponse + if err := json.Unmarshal(responseBody, &response); err != nil { + return fmt.Errorf("karakeep: unable to parse response: %v", err) + } + + if response.ID == "" { + return fmt.Errorf("karakeep: unable to get ID from response") + } + + if err := c.attachTags(response.ID); err != nil { + return fmt.Errorf("karakeep: unable to attach tags: %v", err) + } + return nil } diff --git a/internal/locale/translations/de_DE.json b/internal/locale/translations/de_DE.json index 3ea1a76d..aaf8c48a 100644 --- a/internal/locale/translations/de_DE.json +++ b/internal/locale/translations/de_DE.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Artikel in Karakeep speichern", "form.integration.karakeep_api_key": "Karakeep-API-Schlüssel", "form.integration.karakeep_url": "Karakeep-API-Endpunkt", + "form.integration.karakeep_tags": "Karakeep-Tags", "form.integration.linkace_activate": "Artikel in LinkAce speichern", "form.integration.linkace_api_key": "LinkAce-API-Schlüssel", "form.integration.linkace_check_disabled": "Linkprüfung deaktivieren", diff --git a/internal/locale/translations/el_EL.json b/internal/locale/translations/el_EL.json index 03d0cc9f..dc4d7da7 100644 --- a/internal/locale/translations/el_EL.json +++ b/internal/locale/translations/el_EL.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Αποθήκευση άρθρων στο Karakeep", "form.integration.karakeep_api_key": "Κλειδί API Karakeep", "form.integration.karakeep_url": "Τελικό σημείο Karakeep API", + "form.integration.karakeep_tags": "Ετικέτες Karakeep", "form.integration.linkace_activate": "Αποθήκευση καταχωρήσεων στο LinkAce", "form.integration.linkace_api_key": "Κλειδί API LinkAce", "form.integration.linkace_check_disabled": "Απενεργοποίηση ελέγχου συνδέσμου", diff --git a/internal/locale/translations/en_US.json b/internal/locale/translations/en_US.json index c6b87dcb..192fee0d 100644 --- a/internal/locale/translations/en_US.json +++ b/internal/locale/translations/en_US.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Save entries to Karakeep", "form.integration.karakeep_api_key": "Karakeep API key", "form.integration.karakeep_url": "Karakeep API Endpoint", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Save entries to LinkAce", "form.integration.linkace_api_key": "LinkAce API key", "form.integration.linkace_check_disabled": "Disable link check", diff --git a/internal/locale/translations/es_ES.json b/internal/locale/translations/es_ES.json index b15c5c71..720edfe7 100644 --- a/internal/locale/translations/es_ES.json +++ b/internal/locale/translations/es_ES.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Enviar artículos a Karakeep", "form.integration.karakeep_api_key": "Clave de API de Karakeep", "form.integration.karakeep_url": "Acceso API de Karakeep", + "form.integration.karakeep_tags": "Etiquetas de Karakeep", "form.integration.linkace_activate": "Guardar artículos en LinkAce", "form.integration.linkace_api_key": "Clave API de LinkAce", "form.integration.linkace_check_disabled": "Deshabilitar la comprobación de enlace", diff --git a/internal/locale/translations/fi_FI.json b/internal/locale/translations/fi_FI.json index 7fe44fce..2cefea7a 100644 --- a/internal/locale/translations/fi_FI.json +++ b/internal/locale/translations/fi_FI.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Tallenna artikkelit Karakeepiin", "form.integration.karakeep_api_key": "Karakeep API-avain", "form.integration.karakeep_url": "Karakeep API-päätepiste", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Save entries to LinkAce", "form.integration.linkace_api_key": "LinkAce API key", "form.integration.linkace_check_disabled": "Disable link check", diff --git a/internal/locale/translations/fr_FR.json b/internal/locale/translations/fr_FR.json index 9f6bccbf..06c77beb 100644 --- a/internal/locale/translations/fr_FR.json +++ b/internal/locale/translations/fr_FR.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Sauvegarder les articles vers Karakeep", "form.integration.karakeep_api_key": "Clé d'API de Karakeep", "form.integration.karakeep_url": "URL de l'API de Karakeep", + "form.integration.karakeep_tags": "Libellés Karakeep", "form.integration.linkace_activate": "Enregistrer les entrées vers LinkAce", "form.integration.linkace_api_key": "Clé d'API LinkAce", "form.integration.linkace_check_disabled": "Désactiver la vérification des liens", diff --git a/internal/locale/translations/hi_IN.json b/internal/locale/translations/hi_IN.json index d331b70f..96143ef4 100644 --- a/internal/locale/translations/hi_IN.json +++ b/internal/locale/translations/hi_IN.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Save entries to Karakeep", "form.integration.karakeep_api_key": "Karakeep API key", "form.integration.karakeep_url": "Karakeep API Endpoint", + "form.integration.karakeep_tags": "Karakeep Labels", "form.integration.linkace_activate": "Save entries to LinkAce", "form.integration.linkace_api_key": "LinkAce API key", "form.integration.linkace_check_disabled": "Disable link check", diff --git a/internal/locale/translations/id_ID.json b/internal/locale/translations/id_ID.json index 8e18c4b1..b4af4bbc 100644 --- a/internal/locale/translations/id_ID.json +++ b/internal/locale/translations/id_ID.json @@ -238,6 +238,7 @@ "form.integration.karakeep_activate": "Simpan artikel ke Karakeep", "form.integration.karakeep_api_key": "Kunci API Karakeep", "form.integration.karakeep_url": "Titik URL API Karakeep", + "form.integration.karakeep_tags": "Tanda di Karakeep", "form.integration.linkace_activate": "Simpan artikel ke LinkAce", "form.integration.linkace_api_key": "Kunci API LinkAce", "form.integration.linkace_check_disabled": "Matikan pemeriksaan tautan", diff --git a/internal/locale/translations/it_IT.json b/internal/locale/translations/it_IT.json index 005bb400..5ba305fc 100644 --- a/internal/locale/translations/it_IT.json +++ b/internal/locale/translations/it_IT.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Salva gli articoli su Karakeep", "form.integration.karakeep_api_key": "API key dell'account Karakeep", "form.integration.karakeep_url": "Endpoint dell'API di Karakeep", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Salva gli articoli su LinkAce", "form.integration.linkace_api_key": "API key dell'account LinkAce", "form.integration.linkace_check_disabled": "Disabilita i controlli", diff --git a/internal/locale/translations/ja_JP.json b/internal/locale/translations/ja_JP.json index 3f6f0349..cb951369 100644 --- a/internal/locale/translations/ja_JP.json +++ b/internal/locale/translations/ja_JP.json @@ -238,6 +238,7 @@ "form.integration.karakeep_activate": "Karakeep に記事を保存する", "form.integration.karakeep_api_key": "Karakeep の API key", "form.integration.karakeep_url": "Karakeep の API Endpoint", + "form.integration.karakeep_tags": "Karakeep の Tags", "form.integration.linkace_activate": "Save entries to LinkAce", "form.integration.linkace_api_key": "LinkAce API key", "form.integration.linkace_check_disabled": "Disable link check", diff --git a/internal/locale/translations/nan_Latn_pehoeji.json b/internal/locale/translations/nan_Latn_pehoeji.json index 79384c2a..473b04fa 100644 --- a/internal/locale/translations/nan_Latn_pehoeji.json +++ b/internal/locale/translations/nan_Latn_pehoeji.json @@ -238,6 +238,7 @@ "form.integration.karakeep_activate": "Pó-chûn siau-sit kàu Karakeep", "form.integration.karakeep_api_key": "Karakeep API só-sî", "form.integration.karakeep_url": "Karakeep API thâu", + "form.integration.karakeep_tags": "Karakeep khan-á", "form.integration.linkace_activate": "Pó-chûn siau-sit kàu LinkAce", "form.integration.linkace_api_key": "LinkAce API só-sî", "form.integration.linkace_check_disabled": "Thêng iōng liân-kiat kiám-cha", diff --git a/internal/locale/translations/nl_NL.json b/internal/locale/translations/nl_NL.json index 9cbddcd4..5a12151d 100644 --- a/internal/locale/translations/nl_NL.json +++ b/internal/locale/translations/nl_NL.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Artikelen opslaan in Karakeep", "form.integration.karakeep_api_key": "Karakeep API-sleutel", "form.integration.karakeep_url": "Karakeep URL", + "form.integration.karakeep_tags": "Karakeep tags", "form.integration.linkace_activate": "Artikelen opslaan in LinkAce", "form.integration.linkace_api_key": "LinkAce API-sleutel", "form.integration.linkace_check_disabled": "Koppelingcontrole uitschakelen", diff --git a/internal/locale/translations/pl_PL.json b/internal/locale/translations/pl_PL.json index 4025ceb4..b0d90999 100644 --- a/internal/locale/translations/pl_PL.json +++ b/internal/locale/translations/pl_PL.json @@ -244,6 +244,7 @@ "form.integration.karakeep_activate": "Zapisuj wpisy w Karakeep", "form.integration.karakeep_api_key": "Klucz API do Karakeep", "form.integration.karakeep_url": "Punkt końcowy API Karakeep", + "form.integration.karakeep_tags": "Znaczniki Karakeep", "form.integration.linkace_activate": "Zapisuj wpisy w LinkAce", "form.integration.linkace_api_key": "Klucz API do LinkAce", "form.integration.linkace_check_disabled": "Wyłącz sprawdzanie łączy", diff --git a/internal/locale/translations/pt_BR.json b/internal/locale/translations/pt_BR.json index dddfda8c..a77aed6b 100644 --- a/internal/locale/translations/pt_BR.json +++ b/internal/locale/translations/pt_BR.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Salvar itens no Karakeep", "form.integration.karakeep_api_key": "Chave de API do Karakeep", "form.integration.karakeep_url": "Endpoint de API do Karakeep", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Salvar itens no LinkAce", "form.integration.linkace_api_key": "Chave de API do LinkAce", "form.integration.linkace_check_disabled": "Desativar verificação de link", diff --git a/internal/locale/translations/ro_RO.json b/internal/locale/translations/ro_RO.json index 8a36225a..fbd9bcf6 100644 --- a/internal/locale/translations/ro_RO.json +++ b/internal/locale/translations/ro_RO.json @@ -244,6 +244,7 @@ "form.integration.karakeep_activate": "Salvare înregistrări în Karakeep", "form.integration.karakeep_api_key": "Cheie API Karakeep", "form.integration.karakeep_url": "Punct acces API Karakeep", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Salvează intrările în LinkAce", "form.integration.linkace_api_key": "Cheie API LinkAce", "form.integration.linkace_check_disabled": "Dezactivează verificarea link-urilor", diff --git a/internal/locale/translations/ru_RU.json b/internal/locale/translations/ru_RU.json index bbe9ea22..c9a70c56 100644 --- a/internal/locale/translations/ru_RU.json +++ b/internal/locale/translations/ru_RU.json @@ -244,6 +244,7 @@ "form.integration.karakeep_activate": "Сохранять статьи в Karakeep", "form.integration.karakeep_api_key": "API-ключ Karakeep", "form.integration.karakeep_url": "Конечная точка Karakeep API", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Сохранять статьи в LinkAce", "form.integration.linkace_api_key": "API-ключ LinkAce", "form.integration.linkace_check_disabled": "Отключить проверку ссылок", diff --git a/internal/locale/translations/tr_TR.json b/internal/locale/translations/tr_TR.json index e9ff7743..6838d53c 100644 --- a/internal/locale/translations/tr_TR.json +++ b/internal/locale/translations/tr_TR.json @@ -241,6 +241,7 @@ "form.integration.karakeep_activate": "Makaleleri Karakeep'a kaydet", "form.integration.karakeep_api_key": "Karakeep API anahtarı", "form.integration.karakeep_url": "Karakeep API Uç Noktası", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Makaleleri LinkAce'e kaydet", "form.integration.linkace_api_key": "LinkAce API anahtarı", "form.integration.linkace_check_disabled": "Link kontrolünü devre dışı bırak", diff --git a/internal/locale/translations/uk_UA.json b/internal/locale/translations/uk_UA.json index 85a25aa0..e795676d 100644 --- a/internal/locale/translations/uk_UA.json +++ b/internal/locale/translations/uk_UA.json @@ -244,6 +244,7 @@ "form.integration.karakeep_activate": "Зберігати статті до Karakeep", "form.integration.karakeep_api_key": "Ключ API Karakeep", "form.integration.karakeep_url": "Karakeep API Endpoint", + "form.integration.karakeep_tags": "Karakeep Tags", "form.integration.linkace_activate": "Save entries to LinkAce", "form.integration.linkace_api_key": "LinkAce API key", "form.integration.linkace_check_disabled": "Disable link check", diff --git a/internal/locale/translations/zh_CN.json b/internal/locale/translations/zh_CN.json index c467ce03..ad7761fb 100644 --- a/internal/locale/translations/zh_CN.json +++ b/internal/locale/translations/zh_CN.json @@ -238,6 +238,7 @@ "form.integration.karakeep_activate": "保存条目到 Karakeep", "form.integration.karakeep_api_key": "Karakeep API 密钥", "form.integration.karakeep_url": "Karakeep API 端点", + "form.integration.karakeep_tags": "Karakeep 标签", "form.integration.linkace_activate": "保存条目到 LinkAce", "form.integration.linkace_api_key": "LinkAce API 密钥", "form.integration.linkace_check_disabled": "禁用链接检查", diff --git a/internal/locale/translations/zh_TW.json b/internal/locale/translations/zh_TW.json index 2678cc0f..e9e42d69 100644 --- a/internal/locale/translations/zh_TW.json +++ b/internal/locale/translations/zh_TW.json @@ -238,6 +238,7 @@ "form.integration.karakeep_activate": "儲存文章到 Karakeep", "form.integration.karakeep_api_key": "Karakeep API 金鑰", "form.integration.karakeep_url": "Karakeep API 端點", + "form.integration.karakeep_tags": "Karakeep 標籤", "form.integration.linkace_activate": "儲存文章到 LinkAce", "form.integration.linkace_api_key": "LinkAce API 金鑰", "form.integration.linkace_check_disabled": "停用連結檢查", diff --git a/internal/model/integration.go b/internal/model/integration.go index e18c5794..47676678 100644 --- a/internal/model/integration.go +++ b/internal/model/integration.go @@ -100,6 +100,7 @@ type Integration struct { KarakeepEnabled bool KarakeepAPIKey string KarakeepURL string + KarakeepTags string RaindropEnabled bool RaindropToken string RaindropCollectionID string diff --git a/internal/storage/integration.go b/internal/storage/integration.go index da89fc4b..f5f94a26 100644 --- a/internal/storage/integration.go +++ b/internal/storage/integration.go @@ -222,6 +222,7 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { karakeep_enabled, karakeep_api_key, karakeep_url, + karakeep_tags, linktaco_enabled, linktaco_api_token, linktaco_org_slug, @@ -348,6 +349,7 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.KarakeepEnabled, &integration.KarakeepAPIKey, &integration.KarakeepURL, + &integration.KarakeepTags, &integration.LinktacoEnabled, &integration.LinktacoAPIToken, &integration.LinktacoOrgSlug, @@ -483,14 +485,15 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { karakeep_enabled=$110, karakeep_api_key=$111, karakeep_url=$112, - linktaco_enabled=$113, - linktaco_api_token=$114, - linktaco_org_slug=$115, - linktaco_tags=$116, - linktaco_visibility=$117, - archiveorg_enabled=$118 + karakeep_tags=$113, + linktaco_enabled=$114, + linktaco_api_token=$115, + linktaco_org_slug=$116, + linktaco_tags=$117, + linktaco_visibility=$118, + archiveorg_enabled=$119 WHERE - user_id=$119 + user_id=$120 ` _, err := s.db.Exec( query, @@ -606,6 +609,7 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.KarakeepEnabled, integration.KarakeepAPIKey, integration.KarakeepURL, + integration.KarakeepTags, integration.LinktacoEnabled, integration.LinktacoAPIToken, integration.LinktacoOrgSlug, diff --git a/internal/template/templates/views/integrations.html b/internal/template/templates/views/integrations.html index 0bb72204..9828b201 100644 --- a/internal/template/templates/views/integrations.html +++ b/internal/template/templates/views/integrations.html @@ -420,6 +420,9 @@ + + +
diff --git a/internal/ui/form/integration.go b/internal/ui/form/integration.go index 04ba208d..65e37d1c 100644 --- a/internal/ui/form/integration.go +++ b/internal/ui/form/integration.go @@ -103,6 +103,7 @@ type IntegrationForm struct { KarakeepEnabled bool KarakeepAPIKey string KarakeepURL string + KarakeepTags string RaindropEnabled bool RaindropToken string RaindropCollectionID string @@ -222,6 +223,7 @@ func (i IntegrationForm) Merge(integration *model.Integration) { integration.KarakeepEnabled = i.KarakeepEnabled integration.KarakeepAPIKey = i.KarakeepAPIKey integration.KarakeepURL = i.KarakeepURL + integration.KarakeepTags = i.KarakeepTags integration.RaindropEnabled = i.RaindropEnabled integration.RaindropToken = i.RaindropToken integration.RaindropCollectionID = i.RaindropCollectionID @@ -344,6 +346,7 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm { KarakeepEnabled: r.FormValue("karakeep_enabled") == "1", KarakeepAPIKey: r.FormValue("karakeep_api_key"), KarakeepURL: r.FormValue("karakeep_url"), + KarakeepTags: r.FormValue("karakeep_tags"), RaindropEnabled: r.FormValue("raindrop_enabled") == "1", RaindropToken: r.FormValue("raindrop_token"), RaindropCollectionID: r.FormValue("raindrop_collection_id"), diff --git a/internal/ui/integration_show.go b/internal/ui/integration_show.go index 6a7af48f..be75929f 100644 --- a/internal/ui/integration_show.go +++ b/internal/ui/integration_show.go @@ -116,6 +116,7 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) { KarakeepEnabled: integration.KarakeepEnabled, KarakeepAPIKey: integration.KarakeepAPIKey, KarakeepURL: integration.KarakeepURL, + KarakeepTags: integration.KarakeepTags, RaindropEnabled: integration.RaindropEnabled, RaindropToken: integration.RaindropToken, RaindropCollectionID: integration.RaindropCollectionID,