Repository: louislam/uptime-kuma
File: src/components/notifications/Discord.vue (Vue)

Code before:
            <div class="form-text">
                {{ $t("whatHappensAtForumPost", { option: $t("postToExistingThread") }) }}
            </div>
        </div>
    </div>
    <div v-if="$parent.notification.discordChannelType === 'postToThread'">
        <div class="mb-3">
            <label for="discord-target" class="form-label">
                {{ $t("threadForumPostID") }}
            </label>
            <input id="discord-target" v-model="$parent.notification.threadId" type="text" class="form-control" autocomplete="false" :placeholder="$t('e.g. {discordThreadID}', { discordThreadID: 1177566663751782411 })">
            <div class="form-text">
                <i18n-t keypath="wayToGetDiscordThreadId">
                    <a
                        href="https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-"
                        target="_blank"
                    >{{ $t("here") }}</a>
                </i18n-t>
            </div>
        </div>
    </div>

    <div class="mb-3">
        <label for="discord-disable-url" class="form-label">{{ $t("Disable URL in Notification") }}</label>
        <div class="form-check form-switch">
            <input id="discord-disable-url" v-model="$parent.notification.disableUrl" class="form-check-input" type="checkbox">
            <label class="form-check-label" for="discord-disable-url">{{ $t("Disable URL") }}</label>
        </div>
    </div>
</template>
<script>
export default {
    mounted() {
        if (!this.$parent.notification.discordChannelType) {
            this.$parent.notification.discordChannelType = "channel";
        }
        if (this.$parent.notification.disableUrl === undefined) {
            this.$parent.notification.disableUrl = false;
        }
    }
};
</script>


Review comment (suggestion):
`role="switch"` can be quite nice for a11y.

```suggestion
            <input id="discord-disable-url" v-model="$parent.notification.disableUrl" class="form-check-input" type="checkbox" role="switch">
```

Code after:
            <div class="form-text">
                {{ $t("whatHappensAtForumPost", { option: $t("postToExistingThread") }) }}
            </div>
        </div>
    </div>
    <div v-if="$parent.notification.discordChannelType === 'postToThread'">
        <div class="mb-3">
            <label for="discord-target" class="form-label">
                {{ $t("threadForumPostID") }}
            </label>
            <input id="discord-target" v-model="$parent.notification.threadId" type="text" class="form-control" autocomplete="false" :placeholder="$t('e.g. {discordThreadID}', { discordThreadID: 1177566663751782411 })">
            <div class="form-text">
                <i18n-t keypath="wayToGetDiscordThreadId">
                    <a
                        href="https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-"
                        target="_blank"
                    >{{ $t("here") }}</a>
                </i18n-t>
            </div>
        </div>
    </div>

    <div class="mb-3">
        <div class="form-check form-switch">
            <input id="discord-disable-url" v-model="$parent.notification.disableUrl" class="form-check-input" type="checkbox" role="switch">
            <label class="form-check-label" for="discord-disable-url">{{ $t("Disable URL in Notification") }}</label>
        </div>
    </div>
</template>
<script>
export default {
    mounted() {
        if (!this.$parent.notification.discordChannelType) {
            this.$parent.notification.discordChannelType = "channel";
        }
        if (this.$parent.notification.disableUrl === undefined) {
            this.$parent.notification.disableUrl = false;
        }
    }
};
</script>