mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
* feat: new proj moderation page * make requested changes * add boolean for showing delay message * fix server icon + shortened code * fix server icon * refactor admonitions * msg correction. * correction + change spam-notice * Separate status info from instruction details * Tweak timing delay msg, thread activity warning, and refer to moderation with consistent terms. * Whoops, actually updated msgs correctly now. * prepr + margin * split out strings, simplify code again * fix: a few more moderation fixes (#6048) * fix: move tooltip to button * fix: lock status buttons after pressing * fix: unlisted/withheld icon on legacy badge * prepprrr * fix banners, add some extra dev mode stuff * fix thread id copy padding * tweak: adjust some of the status change messages (#6041) * update messages & bunch of other stuff * rename toggle * change hover to 2.5, fix error size * private msg overlay --------- Co-authored-by: coolbot100s <76798835+coolbot100s@users.noreply.github.com>
75 lines
1.9 KiB
Vue
75 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import { XCircleIcon, XIcon } from '@modrinth/assets'
|
|
import { ButtonStyled, defineMessages, PagewideBanner, useVIntl } from '@modrinth/ui'
|
|
|
|
const { formatMessage } = useVIntl()
|
|
const flags = useFeatureFlags()
|
|
|
|
const tempIgnored = ref(false)
|
|
|
|
const messages = defineMessages({
|
|
title: {
|
|
id: 'layout.banner.build-fail.title',
|
|
defaultMessage: 'Error generating state from API when building.',
|
|
},
|
|
description: {
|
|
id: 'layout.banner.build-fail.description',
|
|
defaultMessage:
|
|
"This deploy of Modrinth's frontend failed to generate state from the API. This may be due to an outage or an error in configuration. Rebuild when the API is available. Error codes: {errors}; Current API URL is: {url}",
|
|
},
|
|
ignoreErrors: {
|
|
id: 'layout.banner.build-fail.ignore',
|
|
defaultMessage: 'Ignore',
|
|
},
|
|
alwaysIgnore: {
|
|
id: 'layout.banner.build-fail.always-ignore',
|
|
defaultMessage: 'Always ignore',
|
|
},
|
|
})
|
|
|
|
defineProps<{
|
|
errors: any[] | undefined
|
|
apiUrl: string
|
|
}>()
|
|
|
|
function alwaysIgnoreBanner() {
|
|
flags.value.alwaysIgnoreErrorBanner = true
|
|
saveFeatureFlags()
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<PagewideBanner
|
|
v-if="
|
|
flags.showAllBanners || (errors?.length && !tempIgnored && !flags.alwaysIgnoreErrorBanner)
|
|
"
|
|
variant="error"
|
|
>
|
|
<template #title>
|
|
<span>{{ formatMessage(messages.title) }}</span>
|
|
</template>
|
|
<template #description>
|
|
{{
|
|
formatMessage(messages.description, {
|
|
errors: JSON.stringify(errors),
|
|
url: apiUrl,
|
|
})
|
|
}}
|
|
</template>
|
|
<template #actions_right>
|
|
<ButtonStyled color="red" type="transparent" hover-color-fill="background">
|
|
<button @click="alwaysIgnoreBanner">
|
|
<XCircleIcon />
|
|
{{ formatMessage(messages.alwaysIgnore) }}
|
|
</button>
|
|
</ButtonStyled>
|
|
<ButtonStyled color="red">
|
|
<button @click="tempIgnored = true">
|
|
<XIcon />
|
|
{{ formatMessage(messages.ignoreErrors) }}
|
|
</button>
|
|
</ButtonStyled>
|
|
</template>
|
|
</PagewideBanner>
|
|
</template>
|