Expose instance feed config option in the API and show it on About page
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
cd874e1bfc
commit
bcf52ccdf7
|
@ -80,6 +80,9 @@ export const CONFIG = gql`
|
|||
avatar
|
||||
banner
|
||||
}
|
||||
instanceFeeds {
|
||||
enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
@ -113,6 +116,9 @@ export const ABOUT = gql`
|
|||
}
|
||||
version
|
||||
federating
|
||||
instanceFeeds {
|
||||
enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -984,5 +984,6 @@
|
|||
"Unable to create the group. One of the pictures may be too heavy.": "Unable to create the group. One of the pictures may be too heavy.",
|
||||
"Unable to update the profile. The avatar picture may be too heavy.": "Unable to update the profile. The avatar picture may be too heavy.",
|
||||
"Unable to create the profile. The avatar picture may be too heavy.": "Unable to create the profile. The avatar picture may be too heavy.",
|
||||
"Error while loading the preview": "Error while loading the preview"
|
||||
"Error while loading the preview": "Error while loading the preview",
|
||||
"Instance feeds": "Instance feeds"
|
||||
}
|
||||
|
|
|
@ -1078,5 +1078,6 @@
|
|||
"Unable to create the group. One of the pictures may be too heavy.": "Impossible de créer le groupe. Une des images est trop lourde.",
|
||||
"Unable to update the profile. The avatar picture may be too heavy.": "Impossible de mettre à jour le profil. L'image d'avatar est probablement trop lourde.",
|
||||
"Unable to create the profile. The avatar picture may be too heavy.": "Impossible de créer le profil. L'image d'avatar est probablement trop lourde.",
|
||||
"Error while loading the preview": "Erreur lors du chargement de l'aperçu"
|
||||
"Error while loading the preview": "Erreur lors du chargement de l'aperçu",
|
||||
"Instance feeds": "Flux de l'instance"
|
||||
}
|
||||
|
|
|
@ -94,4 +94,7 @@ export interface IConfig {
|
|||
avatar: number;
|
||||
banner: number;
|
||||
};
|
||||
instanceFeeds: {
|
||||
enabled: boolean;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -42,9 +42,13 @@
|
|||
<table class="table is-fullwidth">
|
||||
<tr>
|
||||
<td>{{ $t("Instance languages") }}</td>
|
||||
<td :title="this.config ? this.config.languages.join(', ') : ''">
|
||||
<td
|
||||
v-if="config.languages.length > 0"
|
||||
:title="this.config ? this.config.languages.join(', ') : ''"
|
||||
>
|
||||
{{ formattedLanguageList }}
|
||||
</td>
|
||||
<td v-else>{{ $t("No information") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $t("Mobilizon version") }}</td>
|
||||
|
@ -72,6 +76,29 @@
|
|||
</td>
|
||||
<td v-else>{{ $t("Disabled") }}</td>
|
||||
</tr>
|
||||
<tr class="instance-feeds">
|
||||
<td>{{ $t("Instance feeds") }}</td>
|
||||
<td v-if="config.instanceFeeds.enabled" class="buttons">
|
||||
<b-button
|
||||
tag="a"
|
||||
size="is-small"
|
||||
icon-left="rss"
|
||||
href="/feed/instance/atom"
|
||||
target="_blank"
|
||||
>{{ $t("RSS/Atom Feed") }}</b-button
|
||||
>
|
||||
|
||||
<b-button
|
||||
tag="a"
|
||||
size="is-small"
|
||||
icon-left="calendar-sync"
|
||||
href="/feed/instance/ics"
|
||||
target="_blank"
|
||||
>{{ $t("ICS/WebCal Feed") }}</b-button
|
||||
>
|
||||
</td>
|
||||
<td v-else>{{ $t("Disabled") }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
|
@ -177,5 +204,14 @@ section {
|
|||
}
|
||||
}
|
||||
}
|
||||
tr.instance-feeds {
|
||||
height: 3rem;
|
||||
td:first-child {
|
||||
vertical-align: middle;
|
||||
}
|
||||
td:last-child {
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -108,6 +108,10 @@ export const configMock = {
|
|||
avatar: 2_000_000,
|
||||
banner: 4_000_000,
|
||||
},
|
||||
instanceFeeds: {
|
||||
__typename: "InstanceFeeds",
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -139,6 +139,9 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
|||
default: Config.get([:instance, :upload_limit]),
|
||||
avatar: Config.get([:instance, :avatar_upload_limit]),
|
||||
banner: Config.get([:instance, :banner_upload_limit])
|
||||
},
|
||||
instance_feeds: %{
|
||||
enabled: Config.get([:instance, :enable_instance_feeds])
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -63,6 +63,7 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
|||
field(:rules, :string, description: "The instance's rules")
|
||||
|
||||
field(:auth, :auth, description: "The instance auth methods")
|
||||
field(:instance_feeds, :instance_feeds, description: "The instance's feed settings")
|
||||
end
|
||||
|
||||
@desc """
|
||||
|
@ -294,6 +295,10 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
|||
field(:banner, :integer, description: "The banner limitation, in bytes")
|
||||
end
|
||||
|
||||
object :instance_feeds do
|
||||
field(:enabled, :boolean, description: "Whether the instance-wide feeds are enabled")
|
||||
end
|
||||
|
||||
object :config_queries do
|
||||
@desc "Get the instance config"
|
||||
field :config, :config do
|
||||
|
|
Loading…
Reference in a new issue