feat(registry): кнопка/эндпоинт «Запустить пополнение сейчас» (SuperAdmin)
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker API / Build + push API (push) Waiting to run
Docker API / Deploy API on stage (push) Blocked by required conditions
Docker Web / Build + push Web (push) Waiting to run
Docker Web / Deploy Web on stage (push) Blocked by required conditions
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker API / Build + push API (push) Waiting to run
Docker API / Deploy API on stage (push) Blocked by required conditions
Docker Web / Build + push Web (push) Waiting to run
Docker Web / Deploy Web on stage (push) Blocked by required conditions
Разовый запуск фонового пополнения реестра помимо расписания (POST /api/super-admin/product-registry/enrich/run-now). Джоб проверяет флаг. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
e39e4fe1d5
commit
81bf4c7b23
|
|
@ -121,6 +121,15 @@ public async Task<IActionResult> SetEnrich([FromBody] EnrichInput input, Cancell
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost("enrich/run-now")]
|
||||||
|
public IActionResult RunEnrichNow()
|
||||||
|
{
|
||||||
|
// Разовый запуск фонового пополнения (помимо расписания). Джоб сам
|
||||||
|
// проверяет флаг ProductRegistryEnrichEnabled и при ВЫКЛ ничего не делает.
|
||||||
|
_jobs.Enqueue<ProductRegistryService>(s => s.EnrichFromParticipantsAsync(CancellationToken.None));
|
||||||
|
return Accepted(new { enqueued = true });
|
||||||
|
}
|
||||||
|
|
||||||
// ── Наполнение «из МойСклад заново» ──────────────────────────────────────
|
// ── Наполнение «из МойСклад заново» ──────────────────────────────────────
|
||||||
[HttpGet("fill-status")]
|
[HttpGet("fill-status")]
|
||||||
public async Task<ActionResult<object>> FillStatus(CancellationToken ct)
|
public async Task<ActionResult<object>> FillStatus(CancellationToken ct)
|
||||||
|
|
|
||||||
|
|
@ -241,9 +241,15 @@ function EnrichSection({ enrich, onChange }: { enrich: EnrichDto | undefined; on
|
||||||
</div>
|
</div>
|
||||||
{err && <div className="text-sm text-red-600">{err}</div>}
|
{err && <div className="text-sm text-red-600">{err}</div>}
|
||||||
<Field label="Причина (≥10, в журнал)"><TextInput value={reason} onChange={e => setReason(e.target.value)} /></Field>
|
<Field label="Причина (≥10, в журнал)"><TextInput value={reason} onChange={e => setReason(e.target.value)} /></Field>
|
||||||
<Button onClick={save} disabled={busy || reason.trim().length < 10 || !enrich || pending === enrich.enabled}>
|
<div className="flex items-center gap-3">
|
||||||
<Save className="w-4 h-4" /> {pending ? 'Включить пополнение' : 'Выключить пополнение'}
|
<Button onClick={save} disabled={busy || reason.trim().length < 10 || !enrich || pending === enrich.enabled}>
|
||||||
</Button>
|
<Save className="w-4 h-4" /> {pending ? 'Включить пополнение' : 'Выключить пополнение'}
|
||||||
|
</Button>
|
||||||
|
<Button variant="secondary" disabled={busy || !enrich?.enabled}
|
||||||
|
onClick={async () => { await api.post('/api/super-admin/product-registry/enrich/run-now'); onChange() }}>
|
||||||
|
<RefreshCw className="w-4 h-4" /> Запустить сейчас
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue