scroll logs to bottom
This commit is contained in:
parent
f10830ee9b
commit
c9986277ab
|
|
@ -439,17 +439,15 @@ app.get('/job/:app/:name', async c => {
|
||||||
<Layout title={`${job.app}/${job.name}`} refresh={job.state === 'running'}>
|
<Layout title={`${job.app}/${job.name}`} refresh={job.state === 'running'}>
|
||||||
<BackLink href={backUrl}>← Back</BackLink>
|
<BackLink href={backUrl}>← Back</BackLink>
|
||||||
<DetailHeader>
|
<DetailHeader>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: '12px', flex: 1 }}>
|
<StatusDot style={{ backgroundColor: statusColor(job) }} />
|
||||||
<StatusDot style={{ backgroundColor: statusColor(job) }} />
|
<DetailTitle>{job.app}/{job.name}</DetailTitle>
|
||||||
<DetailTitle>{job.app}/{job.name}</DetailTitle>
|
|
||||||
<StatusBadge style={statusBadgeStyle(job)}>{statusLabel(job)}</StatusBadge>
|
|
||||||
</div>
|
|
||||||
<form method="post" action={`/run/${job.app}/${job.name}?return=detail&app=${appFilter || ''}`}>
|
<form method="post" action={`/run/${job.app}/${job.name}?return=detail&app=${appFilter || ''}`}>
|
||||||
<RunButton type="submit" disabled={job.state === 'running'}>
|
<RunButton type="submit" disabled={job.state === 'running'}>
|
||||||
{job.state === 'running' ? 'Running...' : 'Run Now'}
|
{job.state === 'running' ? 'Running...' : 'Run Now'}
|
||||||
</RunButton>
|
</RunButton>
|
||||||
</form>
|
</form>
|
||||||
</DetailHeader>
|
</DetailHeader>
|
||||||
|
<StatusBadge style={statusBadgeStyle(job)}>{statusLabel(job)}</StatusBadge>
|
||||||
<DetailMeta>
|
<DetailMeta>
|
||||||
<MetaItem><MetaLabel>Schedule</MetaLabel> {job.schedule}</MetaItem>
|
<MetaItem><MetaLabel>Schedule</MetaLabel> {job.schedule}</MetaItem>
|
||||||
<MetaItem><MetaLabel>Last run</MetaLabel> {job.state === 'running' ? 'now' : formatRelative(job.lastRun)}</MetaItem>
|
<MetaItem><MetaLabel>Last run</MetaLabel> {job.state === 'running' ? 'now' : formatRelative(job.lastRun)}</MetaItem>
|
||||||
|
|
@ -465,18 +463,19 @@ app.get('/job/:app/:name', async c => {
|
||||||
{job.lastOutput ? (
|
{job.lastOutput ? (
|
||||||
<OutputSection>
|
<OutputSection>
|
||||||
<OutputLabel>Output</OutputLabel>
|
<OutputLabel>Output</OutputLabel>
|
||||||
<OutputBlock>{job.lastOutput}</OutputBlock>
|
<OutputBlock id="output">{job.lastOutput}</OutputBlock>
|
||||||
</OutputSection>
|
</OutputSection>
|
||||||
) : job.state === 'running' ? (
|
) : job.state === 'running' ? (
|
||||||
<OutputSection>
|
<OutputSection>
|
||||||
<OutputLabel>Output</OutputLabel>
|
<OutputLabel>Output</OutputLabel>
|
||||||
<OutputBlock style={{ color: theme('colors-textMuted') }}>Waiting for output...</OutputBlock>
|
<OutputBlock id="output" style={{ color: theme('colors-textMuted') }}>Waiting for output...</OutputBlock>
|
||||||
</OutputSection>
|
</OutputSection>
|
||||||
) : job.lastRun && !job.lastError ? (
|
) : job.lastRun && !job.lastError ? (
|
||||||
<OutputSection>
|
<OutputSection>
|
||||||
<EmptyState>No output</EmptyState>
|
<EmptyState>No output</EmptyState>
|
||||||
</OutputSection>
|
</OutputSection>
|
||||||
) : null}
|
) : null}
|
||||||
|
<script dangerouslySetInnerHTML={{ __html: `var o=document.getElementById('output');if(o)o.scrollTop=o.scrollHeight` }} />
|
||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user