feat: harden CMPP delivery and platform workflows

This commit is contained in:
hectorzhao
2026-07-20 18:07:29 +08:00
parent 80fb5a8f53
commit f02c33cbb7
61 changed files with 1834 additions and 281 deletions
+30 -4
View File
@@ -177,6 +177,7 @@ function SendDetailModal({
onClose: () => void;
}) {
const routeRows = buildRouteRows(record);
const sentAccessNumber = `${record.channel?.srcId ?? ''}${record.applicationExtension ?? ''}`;
return (
<Modal
footer={<Button onClick={onClose} variant="ghost"></Button>}
@@ -207,6 +208,14 @@ function SendDetailModal({
<span></span>
<strong>{record.province ?? '-'} / {getCarrierLabel(record.carrier)}</strong>
</div>
<div>
<span></span>
<strong>{record.clientSrcId || '-'}</strong>
</div>
<div>
<span></span>
<strong>{sentAccessNumber || '-'}</strong>
</div>
</div>
<section>
<h3><MessageSquare size={18} /> </h3>
@@ -292,8 +301,19 @@ export function AdminSmsRecordsPage() {
const [error, setError] = useState('');
const [page, setPage] = useState(1);
function loadData() {
adminApi.listOperationMessages({
type MessageFilters = {
tenantId?: string;
applicationId?: string;
phoneNumber?: string;
contentKeyword?: string;
channelKeyword?: string;
queuedAtFrom?: string;
queuedAtTo?: string;
status?: string;
};
function currentFilters(): MessageFilters {
return {
tenantId: enterprise === 'all' ? undefined : enterprise,
applicationId: application === 'all' ? undefined : application,
phoneNumber: phoneKeyword || undefined,
@@ -302,9 +322,14 @@ export function AdminSmsRecordsPage() {
queuedAtFrom: dateRange.start,
queuedAtTo: dateRange.end,
status: status === 'all' ? undefined : status,
})
};
}
function loadData(filters = currentFilters()) {
adminApi.listOperationMessages(filters)
.then((items) => {
setRecords(items);
setSelectedRecord((current) => current ? items.find((item) => item.id === current.id) ?? null : null);
setPage(1);
setError('');
})
@@ -373,6 +398,7 @@ export function AdminSmsRecordsPage() {
setContentKeyword('');
setChannelKeyword('');
setStatus('all');
loadData({});
}
return (
@@ -412,7 +438,7 @@ export function AdminSmsRecordsPage() {
value={status}
/>
<div className="admin-sms-record-filter__actions">
<Button icon={<Search size={16} />} onClick={loadData}></Button>
<Button icon={<Search size={16} />} onClick={() => loadData()}></Button>
<Button onClick={resetFilters} variant="ghost"></Button>
</div>
</div>