refactor: style css -> tailwindcss

This commit is contained in:
tao.chen
2026-08-24 18:34:43 +08:00
parent 9ce0b106fa
commit 6b7701852f
9 changed files with 475 additions and 2142 deletions
@@ -32,20 +32,23 @@ export function ScheduleInspector({
}) {
if (!schedule) {
return (
<div className="schedule-inspector-empty">
<div className="flex min-h-full flex-col items-center justify-center p-[30px] text-center text-[#9aa8b6] [&>svg]:mb-[10px] [&>svg]:text-[#93b4d6]">
<Icon name="settings" size={28} />
<strong></strong>
<p>Cron </p>
<strong className="text-[14px] text-[#516a82]"></strong>
<p className="text-[11px] leading-[1.6]">
Cron
</p>
</div>
);
}
return (
<div className="schedule-inspector">
<section>
<h3></h3>
<label>
<span></span>
<div className="flex min-h-full flex-col">
<section className="flex flex-col gap-[10px] border-b border-[#e7ecf1] p-[14px]">
<h3 className="mb-[2px] text-[13px] text-[#273b50]"></h3>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<input
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.scheduleName}
onChange={(event) => onChange({
...form,
@@ -53,9 +56,10 @@ export function ScheduleInspector({
})}
/>
</label>
<label>
<span></span>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<textarea
className="w-full resize-y rounded-[5px] border border-line bg-white p-[7px_8px] text-[11px] leading-[1.5] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
rows={2}
value={form.description}
onChange={(event) => onChange({
@@ -64,13 +68,14 @@ export function ScheduleInspector({
})}
/>
</label>
<label className="schedule-switch-row">
<span>
<b></b>
<small>DAG </small>
<label className="flex flex-row items-center justify-between rounded-[6px] bg-[#f5f8fb] p-[8px_9px]">
<span className="flex flex-col gap-[2px]">
<b className="text-[11px] text-[#45596f]"></b>
<small className="text-[9px] font-normal text-[#94a1ae]">DAG </small>
</span>
<input
type="checkbox"
className="h-[18px] w-[34px] accent-brand"
checked={form.enabled}
onChange={(event) => onChange({
...form,
@@ -80,11 +85,12 @@ export function ScheduleInspector({
</label>
</section>
<section>
<h3></h3>
<label>
<span></span>
<section className="flex flex-col gap-[10px] border-b border-[#e7ecf1] p-[14px]">
<h3 className="mb-[2px] text-[13px] text-[#273b50]"></h3>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<select
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.triggerType}
onChange={(event) => onChange({
...form,
@@ -99,9 +105,10 @@ export function ScheduleInspector({
</label>
{form.triggerType === "cron" && (
<>
<label>
<span>Cron </span>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]">Cron </span>
<input
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.cronExpression}
onChange={(event) => onChange({
...form,
@@ -109,9 +116,10 @@ export function ScheduleInspector({
})}
/>
</label>
<label>
<span></span>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<input
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.timezone}
onChange={(event) => onChange({
...form,
@@ -120,7 +128,7 @@ export function ScheduleInspector({
/>
</label>
<button
className="inspector-secondary-button"
className="flex min-h-[34px] cursor-pointer items-center justify-center rounded-[6px] border border-[#bcd2e9] bg-[#f7fbff] text-[11px] text-[#2871bb] [font-weight:650] disabled:cursor-not-allowed disabled:opacity-[0.55]"
type="button"
disabled={busy}
onClick={onPreview}
@@ -128,7 +136,7 @@ export function ScheduleInspector({
5
</button>
{cronResult && (
<ol className="cron-preview-list">
<ol className="m-0 list-decimal rounded-[5px] bg-[#f5f8fb] p-[8px_8px_8px_28px] font-mono text-[9px] leading-[1.7] text-ink-muted">
{cronResult.occurrences.map((item) => (
<li key={item.utc_time}>
{new Date(item.local_time).toLocaleString("zh-CN", {
@@ -142,15 +150,16 @@ export function ScheduleInspector({
)}
</section>
<section>
<h3></h3>
<div className="inspector-grid">
<label>
<span></span>
<section className="flex flex-col gap-[10px] border-b border-[#e7ecf1] p-[14px]">
<h3 className="mb-[2px] text-[13px] text-[#273b50]"></h3>
<div className="grid grid-cols-2 gap-2">
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<input
type="number"
min="1"
max="64"
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.maxConcurrency}
onChange={(event) => onChange({
...form,
@@ -158,9 +167,10 @@ export function ScheduleInspector({
})}
/>
</label>
<label>
<span></span>
<label className="flex flex-col gap-[5px]">
<span className="text-[10px] font-semibold text-[#758497]"></span>
<select
className="h-[33px] w-full rounded-[5px] border border-line bg-white px-2 text-[11px] text-[#32475d] outline-none focus:border-[#81b2e7] focus:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]"
value={form.failurePolicy}
onChange={(event) => onChange({
...form,
@@ -172,14 +182,14 @@ export function ScheduleInspector({
</select>
</label>
</div>
<div className="schedule-next-run">
<div className="flex items-center justify-between rounded-[5px] bg-[#f5f8fb] p-[8px_9px] text-[10px] text-ink-subtle">
<span></span>
<strong>{formatTime(schedule.next_run_at)}</strong>
<strong className="text-[10px] text-[#425970]">{formatTime(schedule.next_run_at)}</strong>
</div>
</section>
<button
className="inspector-primary-button"
className="m-[14px] flex min-h-[34px] cursor-pointer items-center justify-center rounded-[6px] border border-brand bg-brand text-[11px] text-white [font-weight:650] disabled:cursor-not-allowed disabled:opacity-[0.55]"
type="button"
disabled={busy}
onClick={onSave}