R5 the server's own settings in decePub: instance, rules, announcements, relays, media limits, the staff's log, About
Build / Build (push) Successful in 1m5s
Build / Build (push) Successful in 1m5s
Administration's Pleroma placeholders give way to real sections: Instance (title, descriptions, contact, thumbnail, privacy policy, terms, the weekly activity), Rules, Announcements, Relays, Media limits and the Moderation log, next to Reports, blocked servers (now published or obfuscated), statistics and backups; moderators see Reports and the log. Every save sends the whole settings form built from the latest read, since PrivaPub replaces what it carries. /about shows the server's documents to anyone. The report dialog picks the rules a violation breaks, and reports show them. Announcements show above the feed tabs, dismissed and reacted to, live from the user stream. Login names the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
1 parent
b8d7858acb
commit
4c88980374
33 files changed
+3743
-239
No files matched your search
@@ -1,7 +1,10 @@
|
||||
@inherits LocalizableComponentBase
|
||||
|
||||
@* Servers blocked for everyone here (/clientapi/admin/domainblocks): suspended (nothing from or to them) or silenced
|
||||
(kept out of the public feeds), their media refused or not, with a comment for the public and one for the admins. *@
|
||||
(kept out of the public feeds), their media refused or not, with a comment for the public and one for the admins.
|
||||
A block is published (/api/v1/instance/domain_blocks, the About page) only when asked, since that tells the blocked
|
||||
server and everyone else; published, its name can be partly starred. Blocking a server again changes its block, so
|
||||
Edit fills the form with it. *@
|
||||
<div class="flex flex-col gap-3 w-full" data-server-blocks>
|
||||
<EditForm Model="form" OnValidSubmit="Block" class="flex flex-col gap-2 p-3 rounded-xl neo-inset neo-2xs">
|
||||
<DataAnnotationsValidator />
|
||||
@@ -13,13 +16,19 @@
|
||||
<DToggle LabelText="@Localizer["Suspend (otherwise silence)"]" @bind-Value="form.Suspend" />
|
||||
<DToggle LabelText="@Localizer["Refuse its media"]" @bind-Value="form.RejectMedia" />
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 items-center">
|
||||
<DToggle LabelText="@Localizer["Publish it"]" Value="form.Published" ValueChanged="Publish" ValueExpression="() => form.Published"
|
||||
data-server-block-published />
|
||||
<DToggle LabelText="@Localizer["Hide part of its name"]" @bind-Value="form.Obfuscate" disabled="@(!form.Published)" data-server-block-obfuscate />
|
||||
</div>
|
||||
<p class="text-xs opacity-70">@Localizer["A published block is listed on the About page and in the instance API: the blocked server, and everyone, can read it."]</p>
|
||||
<DInput TValue="string" @bind-Value="form.PublicComment" Immediate="true" autocomplete="off" maxlength="1000"
|
||||
placeholder="@Localizer["Why, for everyone to read"]" />
|
||||
<DInput TValue="string" @bind-Value="form.PrivateComment" Immediate="true" autocomplete="off" maxlength="1000"
|
||||
placeholder="@Localizer["Why, for the admins only"]" />
|
||||
<ErrorViewer />
|
||||
<DButton Type="submit" Size="DSize.Sm" Color="DColor.Error" class="self-end"
|
||||
Disabled="@(IsDefaultDisabled || isSaving || string.IsNullOrWhiteSpace(form.Domain))">
|
||||
Disabled="@(IsDefaultDisabled || isSaving || string.IsNullOrWhiteSpace(form.Domain))" data-server-block-save>
|
||||
@Localizer["Block server"]
|
||||
</DButton>
|
||||
</EditForm>
|
||||
@@ -48,7 +57,16 @@
|
||||
{
|
||||
<DBadge Size="DSize.Sm" Variant="DBadgeVariant.Soft">@Localizer["Media refused"]</DBadge>
|
||||
}
|
||||
@if (block.Published)
|
||||
{
|
||||
<DBadge Size="DSize.Sm" Variant="DBadgeVariant.Soft" Color="DColor.Info" data-server-block-public>
|
||||
@(block.Obfuscate ? Localizer["Published, partly hidden"] : Localizer["Published"])
|
||||
</DBadge>
|
||||
}
|
||||
<span class="text-xs opacity-70" title="@block.CreatedAt.ToLocalTime().ToString(SUtility.dateTimeFormat)">@block.CreatedAt.GetPassedTime(Localizer)</span>
|
||||
<DButton Size="DSize.Sm" Disabled="@(IsDefaultDisabled || busy.Contains(block.Domain))" OnClick="() => Edit(block)" data-server-block-edit>
|
||||
@Localizer["Edit"]
|
||||
</DButton>
|
||||
<DButton Size="DSize.Sm" Disabled="@(IsDefaultDisabled || busy.Contains(block.Domain))" OnClick="() => Unblock(block)">
|
||||
@Localizer["Unblock"]
|
||||
</DButton>
|
||||
@@ -89,6 +107,25 @@
|
||||
|
||||
async Task LoadData() => blocks = await AdminService.ServerBlocks();
|
||||
|
||||
// a block that isn't published can't be partly hidden either
|
||||
void Publish(bool published)
|
||||
{
|
||||
form.Published = published;
|
||||
if (!published)
|
||||
form.Obfuscate = false;
|
||||
}
|
||||
|
||||
void Edit(ViewDomainBlock block) => form = new()
|
||||
{
|
||||
Domain = block.Domain,
|
||||
Suspend = block.Severity == "Suspend",
|
||||
RejectMedia = block.RejectMedia,
|
||||
Published = block.Published,
|
||||
Obfuscate = block.Obfuscate,
|
||||
PublicComment = block.PublicComment,
|
||||
PrivateComment = block.PrivateComment
|
||||
};
|
||||
|
||||
async Task Block()
|
||||
{
|
||||
isSaving = true;
|
||||
|
||||
Reference in new issue
Block a user