refactor: improve some style in server status page

This commit is contained in:
moonrailgun 2024-09-15 23:48:50 +08:00
parent 6160d7bcb9
commit 427e9e3eb7
3 changed files with 16 additions and 15 deletions

View File

@ -86,8 +86,8 @@ export const MonitorListItem: React.FC<{
</span> </span>
</div> </div>
<div className="pl-2"> <div className="flex-1 pl-2">
<div className="text-base">{monitorName}</div> <div className="text-nowrap text-base">{monitorName}</div>
{/* <div> {/* <div>
{monitor.tags.map((tag) => ( {monitor.tags.map((tag) => (
<span <span
@ -100,7 +100,15 @@ export const MonitorListItem: React.FC<{
</div> */} </div> */}
</div> </div>
<div className="flex-1 flex-shrink items-center overflow-hidden px-1"> {showCurrentResponse && latestResponse && (
<Tooltip title={t('Current')}>
<div className="px-2 text-sm text-gray-800 dark:text-gray-400">
{latestResponse}
</div>
</Tooltip>
)}
<div className="flex-shrink basis-[160px] items-center overflow-hidden px-1">
<MonitorHealthBar <MonitorHealthBar
healthBarClassName="justify-end" healthBarClassName="justify-end"
workspaceId={workspaceId} workspaceId={workspaceId}
@ -109,14 +117,6 @@ export const MonitorListItem: React.FC<{
onBeatsItemUpdate={setBeats} onBeatsItemUpdate={setBeats}
/> />
</div> </div>
{showCurrentResponse && latestResponse && (
<Tooltip title={t('Current')}>
<div className="px-2 text-sm text-gray-800 dark:text-gray-400">
{latestResponse}
</div>
</Tooltip>
)}
</div> </div>
); );
}); });

View File

@ -227,6 +227,7 @@ export const MonitorStatusPageEditForm: React.FC<MonitorStatusPageEditFormProps>
<Button <Button
variant="dashed" variant="dashed"
type="button"
onClick={() => onClick={() =>
append({ append({
id: '', id: '',
@ -242,7 +243,7 @@ export const MonitorStatusPageEditForm: React.FC<MonitorStatusPageEditFormProps>
)} )}
/> />
<div className="!mt-8 flex gap-2"> <div className="!mt-8 flex justify-end gap-2">
<Button type="submit" loading={isLoading}> <Button type="submit" loading={isLoading}>
{props.saveButtonLabel ?? t('Save')} {props.saveButtonLabel ?? t('Save')}
</Button> </Button>

View File

@ -106,11 +106,11 @@ export const MonitorStatusPage: React.FC<MonitorStatusPageProps> = React.memo(
<div <div
className={clsx( className={clsx(
'mx-auto overflow-auto px-4 py-8', 'mx-auto overflow-auto px-4 py-8',
!editMode ? 'w-4/5 sm:w-full' : 'w-2/3' !editMode ? 'w-full' : 'w-2/3'
)} )}
> >
<div className="flex"> <div className="flex">
<div className="mb-4 flex-1 text-2xl">{info?.title}</div> <div className="mb-4 flex-1 text-2xl font-bold">{info?.title}</div>
<ColorSchemeSwitcher /> <ColorSchemeSwitcher />
</div> </div>
@ -132,7 +132,7 @@ export const MonitorStatusPage: React.FC<MonitorStatusPageProps> = React.memo(
<MarkdownViewer value={info?.description ?? ''} /> <MarkdownViewer value={info?.description ?? ''} />
</div> </div>
<div className="mb-2 text-lg">{t('Services')}</div> <div className="mb-2 text-lg font-semibold">{t('Services')}</div>
{info && ( {info && (
<StatusPageServices <StatusPageServices