From bf5a3a95c43837552d17c91aac2610456deb2342 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Fri, 8 Jul 2022 14:46:29 -0400 Subject: [PATCH] Add ability to disabled instances (#33) --- src/JobsJobsJobs/App/src/api/types.ts | 4 +++ .../App/src/views/citizen/LogOn.vue | 5 +++- .../Domain/JobsJobsJobs.Domain.fsproj | 7 ++--- src/JobsJobsJobs/Domain/SharedTypes.fs | 26 ++++++++++++------- src/JobsJobsJobs/Server/App.fs | 2 +- src/JobsJobsJobs/Server/Handlers.fs | 12 +++++---- .../Server/JobsJobsJobs.Server.fsproj | 4 ++- src/JobsJobsJobs/Server/appsettings.json | 12 ++++++--- 8 files changed, 49 insertions(+), 23 deletions(-) diff --git a/src/JobsJobsJobs/App/src/api/types.ts b/src/JobsJobsJobs/App/src/api/types.ts index 2c98c89..8a67533 100644 --- a/src/JobsJobsJobs/App/src/api/types.ts +++ b/src/JobsJobsJobs/App/src/api/types.ts @@ -43,6 +43,10 @@ export interface Instance { abbr : string /** The client ID (assigned by the Mastodon server) */ clientId : string + /** Whether this instance is enabled */ + isEnabled : boolean + /** If disabled, the reason why it is disabled */ + reason : string } /** A job listing */ diff --git a/src/JobsJobsJobs/App/src/views/citizen/LogOn.vue b/src/JobsJobsJobs/App/src/views/citizen/LogOn.vue index 959abaa..438328e 100644 --- a/src/JobsJobsJobs/App/src/views/citizen/LogOn.vue +++ b/src/JobsJobsJobs/App/src/views/citizen/LogOn.vue @@ -5,7 +5,10 @@ article template(v-else) p.text-center Please select your No Agenda-affiliated Mastodon instance p.text-center(v-for="it in instances" :key="it.abbr") - button.btn.btn-primary(@click.prevent="select(it.abbr)") {{it.name}} + template(v-if="it.isEnabled") + button.btn.btn-primary(@click.prevent="select(it.abbr)") {{it.name}} + template(v-else). + #[button.btn.btn-secondary(disabled="disabled") {{it.name}}]#[br]#[em {{it.reason}}]