Release 202505280851
This commit is contained in:
@@ -685,9 +685,14 @@ if (!service) return Astro.rewrite('/404')
|
||||
label="Started At"
|
||||
name="startedAt"
|
||||
inputProps={{
|
||||
type: 'date',
|
||||
type: 'datetime-local',
|
||||
required: true,
|
||||
value: new Date(event.startedAt).toISOString().split('T')[0],
|
||||
value: new Date(
|
||||
new Date(event.startedAt).getTime() -
|
||||
new Date(event.startedAt).getTimezoneOffset() * 60000
|
||||
)
|
||||
.toISOString()
|
||||
.slice(0, 16),
|
||||
}}
|
||||
error={eventUpdateInputErrors.startedAt}
|
||||
/>
|
||||
@@ -696,7 +701,15 @@ if (!service) return Astro.rewrite('/404')
|
||||
label="Ended At"
|
||||
name="endedAt"
|
||||
inputProps={{
|
||||
value: event.endedAt ? new Date(event.endedAt).toISOString().split('T')[0] : '',
|
||||
type: 'datetime-local',
|
||||
value: event.endedAt
|
||||
? new Date(
|
||||
new Date(event.endedAt).getTime() -
|
||||
new Date(event.endedAt).getTimezoneOffset() * 60000
|
||||
)
|
||||
.toISOString()
|
||||
.slice(0, 16)
|
||||
: '',
|
||||
}}
|
||||
error={eventUpdateInputErrors.endedAt}
|
||||
description="- Empty: Event is ongoing.\n- Filled: Event with specific end date.\n- Same as start date: One-time event."
|
||||
@@ -756,9 +769,11 @@ if (!service) return Astro.rewrite('/404')
|
||||
label="Started At"
|
||||
name="startedAt"
|
||||
inputProps={{
|
||||
type: 'date',
|
||||
type: 'datetime-local',
|
||||
required: true,
|
||||
value: new Date().toISOString().split('T')[0],
|
||||
value: new Date(Date.now() - new Date().getTimezoneOffset() * 60000)
|
||||
.toISOString()
|
||||
.slice(0, 16),
|
||||
}}
|
||||
error={eventInputErrors.startedAt}
|
||||
/>
|
||||
@@ -767,7 +782,10 @@ if (!service) return Astro.rewrite('/404')
|
||||
label="Ended At"
|
||||
name="endedAt"
|
||||
inputProps={{
|
||||
value: new Date().toISOString().split('T')[0],
|
||||
type: 'datetime-local',
|
||||
value: new Date(Date.now() - new Date().getTimezoneOffset() * 60000)
|
||||
.toISOString()
|
||||
.slice(0, 16),
|
||||
}}
|
||||
error={eventInputErrors.endedAt}
|
||||
description="- Empty: Event is ongoing.\n- Filled: Event with specific end date.\n- Same as start date: One-time event."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { VerificationStepStatus } from '@prisma/client'
|
||||
import { VerificationStepStatus, EventType } from '@prisma/client'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { Markdown } from 'astro-remote'
|
||||
import { Schema } from 'astro-seo-schema'
|
||||
@@ -380,6 +380,10 @@ const ogImageTemplateData = {
|
||||
} satisfies OgImageAllTemplatesWithProps
|
||||
|
||||
const serviceVisibilityInfo = getServiceVisibilityInfo(service.serviceVisibility)
|
||||
|
||||
const activeAlertOrWarningEvents = service.events.filter(
|
||||
(event) => getEventTypeInfo(event.type).showBanner && (event.endedAt === null || event.endedAt >= now)
|
||||
)
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
@@ -480,6 +484,32 @@ const serviceVisibilityInfo = getServiceVisibilityInfo(service.serviceVisibility
|
||||
}),
|
||||
]}
|
||||
>
|
||||
{
|
||||
activeAlertOrWarningEvents.length > 0 && (
|
||||
<a
|
||||
href="#events"
|
||||
class={cn(
|
||||
'mb-4 block rounded-md px-3 py-2 text-sm font-medium',
|
||||
activeAlertOrWarningEvents.some((e) => e.type === EventType.ALERT)
|
||||
? 'bg-red-900/50 text-red-300 hover:bg-red-800/60'
|
||||
: 'bg-yellow-900/50 text-yellow-300 hover:bg-yellow-800/60'
|
||||
)}
|
||||
>
|
||||
<Icon
|
||||
name={
|
||||
activeAlertOrWarningEvents.some((e) => e.type === EventType.ALERT)
|
||||
? 'ri:alert-fill'
|
||||
: 'ri:alarm-warning-fill'
|
||||
}
|
||||
class="me-1.5 inline-block size-4 align-[-0.15em]"
|
||||
/>
|
||||
{activeAlertOrWarningEvents.some((e) => e.type === EventType.ALERT)
|
||||
? 'There is an active alert for this service. Click to see details.'
|
||||
: 'There is an active warning for this service. Click to see details.'}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
(serviceVisibilityInfo.value === 'UNLISTED' || serviceVisibilityInfo.value === 'ARCHIVED') && (
|
||||
<div class={cn('mb-4 rounded-md bg-yellow-900/50 px-3 py-2 text-sm text-yellow-400')}>
|
||||
@@ -1182,6 +1212,7 @@ const serviceVisibilityInfo = getServiceVisibilityInfo(service.serviceVisibility
|
||||
|
||||
<div class="mt-3 max-w-md pe-8">
|
||||
<h3 class="font-title text-lg leading-tight font-semibold text-pretty text-white">
|
||||
{typeInfo.isSolved && <BadgeSmall text="Solved" icon="ri:check-line" color="green" />}
|
||||
{event.title}
|
||||
</h3>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user