Explorar o código

限制执行记录滚动范围并调轻任务名称

sy hai 1 hora
pai
achega
c80a1922a7

+ 3 - 3
web-scaffold/src/pages/JobRunsDialog.tsx

@@ -158,8 +158,8 @@ export function JobRunsDialog({ preset, rows, onClose }: { preset: JobRunsPreset
         ) : state.runs.length === 0 ? (
           <div className="ops-empty">{RUNS_EMPTY}</div>
         ) : (
-          <div className="ops-list-shell">
-            <div className="job-runs-table">
+          <div className="ops-list-shell job-runs-list">
+            <div className="job-runs-table" role="region" aria-label="执行记录表格" tabIndex={0}>
               <table className="ops-table" role="table" aria-label="执行流水">
                 <OpsTableColumns widths={[17, 16, 11, 17, 17, 13, 9]} />
                 <thead role="rowgroup">
@@ -181,7 +181,7 @@ export function JobRunsDialog({ preset, rows, onClose }: { preset: JobRunsPreset
               </table>
             </div>
             {state.hasMore && (
-              <div className="ops-toolbar" style={{ justifyContent: "center" }}>
+              <div className="job-runs-pagination">
                 <Button size="sm" type="button" variant="outline" disabled={state.loadingMore} onClick={state.loadMore}>
                   {state.loadingMore ? "加载中…" : `加载更多(已显示 ${state.runs.length}/${state.matchedTotal ?? "—"} 条命中)`}
                 </Button>

+ 2 - 2
web-scaffold/src/pages/ScheduledJobManagementPage.tsx

@@ -256,7 +256,7 @@ function MaintRow({
     <tr>
       <td className="ops-mono">{row.key}</td>
       <td>
-        <strong>{row.displayName}</strong>
+        <span className="job-task-name">{row.displayName}</span>
       </td>
       <td>
         {row.cronHint}
@@ -413,7 +413,7 @@ export function ScheduledJobManagementPage() {
     return (
       <tr key={row.key}>
         <td>
-          <strong>{row.displayName}</strong>
+          <span className="job-task-name">{row.displayName}</span>
           <code className="ops-mono">{row.key}</code>
         </td>
         <td>

+ 18 - 2
web-scaffold/src/styles/scheduled-jobs.css

@@ -121,6 +121,7 @@
 .job-ledger td { padding-block: 11px; white-space: normal; overflow-wrap: anywhere; }
 .job-ledger td small { margin-top: 3px; font-size: var(--type-meta); }
 .job-ledger td code { display: block; margin-top: 4px; font-size: var(--type-meta); }
+.job-task-name { color: var(--foreground); font-weight: 500; }
 .job-ledger-trigger, .job-ledger-time { color: var(--foreground); }
 .job-ledger-time { font-variant-numeric: tabular-nums; }
 .job-ledger td .job-ledger-counts { font-size: var(--type-meta); letter-spacing: 0; }
@@ -209,10 +210,18 @@
 
 .scheduled-jobs-filters .ops-search{flex:1;max-width:390px}
 .job-runs-dialog { width: min(1200px, calc(100vw - 24px)); }
+.job-runs-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
+.job-runs-dialog > header { flex: none; }
 .job-round-dialog { width: min(680px, calc(100vw - 24px)); }
 .job-runs-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px clamp(14px, 3vw, 24px) 22px; }
-.job-runs-table { container-type: inline-size; }
-.job-runs-table .ops-table { min-width: 0; table-layout: fixed; }
+.job-runs-dialog > .job-runs-body { display: flex; flex-direction: column; min-height: 0; }
+.job-runs-dialog > .job-runs-body > :not(.job-runs-list) { flex: none; }
+.job-runs-list { display: flex; flex-direction: column; min-height: 0; }
+.job-runs-table { min-height: 0; overflow: hidden auto; overscroll-behavior-y: contain; container-type: inline-size; }
+.job-runs-table:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
+.job-runs-table .ops-table { min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
+.job-runs-table thead th { position: sticky; top: 0; z-index: 1; }
+.job-runs-pagination { flex: none; display: flex; justify-content: center; padding: 8px 12px; border-top: 1px solid var(--border-subtle); }
 .job-runs-table .ops-table :is(th, td) { min-width: 0; padding-inline: 9px; }
 .job-runs-table .ops-table :is(th, td):where(:first-child) { padding-inline-start: 14px; }
 .job-runs-table .ops-table :is(th, td):where(:last-child) { padding-inline-end: 14px; }
@@ -243,6 +252,13 @@
 }
 .job-runs-body > .ops-toolbar { padding: 0; }
 .job-runs-body .scheduled-jobs-filters input[type="date"] { width: auto; min-width: 0; }
+@media (max-height: 600px) {
+  .job-runs-dialog { max-height: calc(100dvh - 16px); }
+  .job-runs-dialog > header { padding-block: 8px; }
+  .job-runs-dialog > .job-runs-body { gap: 6px; padding-block: 8px; }
+  .job-runs-dialog .ops-toolbar { gap: 6px; }
+  .job-runs-pagination { padding-block: 4px; }
+}
 .job-round-table { max-height: 260px; overflow: auto; }
 .job-round-table .ops-table { min-width: 0; overflow-wrap: anywhere; }
 .job-round-actions { display: flex; justify-content: flex-end; }