mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix: migrate gifs to klipy service (#1220)
This commit is contained in:
1 parent
99eedf6d1e
commit
4a741d8396
79 files changed
+3032
-1653
No files matched your search
@@ -100,12 +100,6 @@ pub struct InstanceIntegrationsResponse {
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
pub struct InstanceGifIntegrationResponse {
|
||||
pub provider: Option<String>,
|
||||
#[serde(default)]
|
||||
pub effective_provider: String,
|
||||
#[serde(default)]
|
||||
pub tenor_api_key_set: bool,
|
||||
#[serde(default)]
|
||||
pub klipy_api_key_set: bool,
|
||||
#[serde(default)]
|
||||
pub effective_available: bool,
|
||||
@@ -549,10 +543,6 @@ pub struct InstanceIntegrationsUpdateRequest {
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize)]
|
||||
pub struct InstanceGifIntegrationUpdateRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub provider: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub tenor_api_key: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub klipy_api_key: Option<String>,
|
||||
}
|
||||
|
||||
@@ -603,8 +603,6 @@ fn build_integrations_update(form: &MultiValueForm) -> InstanceConfigUpdateReque
|
||||
policy: None,
|
||||
integrations: Some(InstanceIntegrationsUpdateRequest {
|
||||
gif: Some(InstanceGifIntegrationUpdateRequest {
|
||||
provider: clean("integration_gif_provider"),
|
||||
tenor_api_key: clean("integration_tenor_api_key"),
|
||||
klipy_api_key: clean("integration_klipy_api_key"),
|
||||
}),
|
||||
youtube: Some(InstanceYoutubeIntegrationUpdateRequest {
|
||||
|
||||
@@ -408,11 +408,6 @@ fn integrations_config_section(
|
||||
csrf_token: &str,
|
||||
integrations: &InstanceIntegrationsResponse,
|
||||
) -> Markup {
|
||||
let gif_provider = integrations
|
||||
.gif
|
||||
.provider
|
||||
.as_deref()
|
||||
.unwrap_or(integrations.gif.effective_provider.as_str());
|
||||
let captcha_provider = integrations
|
||||
.captcha
|
||||
.provider
|
||||
@@ -435,15 +430,9 @@ fn integrations_config_section(
|
||||
div class="flex flex-wrap items-center gap-2" {
|
||||
h3 class="text-sm font-semibold text-neutral-900" { "GIF provider" }
|
||||
(secret_badge("KLIPY key", integrations.gif.klipy_api_key_set))
|
||||
(secret_badge("Tenor key", integrations.gif.tenor_api_key_set))
|
||||
}
|
||||
div class="grid grid-cols-1 gap-4 sm:grid-cols-3" {
|
||||
(select_input("integration_gif_provider", "Provider", &[
|
||||
("klipy", "KLIPY"),
|
||||
("tenor", "Tenor"),
|
||||
], gif_provider))
|
||||
div class="grid grid-cols-1 gap-4" {
|
||||
(password_input("integration_klipy_api_key", "KLIPY API key", Some("Leave blank to keep the current key.")))
|
||||
(password_input("integration_tenor_api_key", "Tenor API key", Some("Leave blank to keep the current key.")))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user