mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 15:06:37 +08:00
fix(admin): stop console Intl errors and log websocket drops
Use raw i18n for push template hints so ICU does not parse
{{placeholders}}. Pass total into the user list record count.
Allow log websocket origins behind the Next rewrite, skip the
proxy on Upgrade, and do not open a socket after unmount.
This commit is contained in:
@@ -252,10 +252,16 @@ export function AppLogs() {
|
||||
|
||||
// ---- Initialize ------------------------------------------------------
|
||||
useEffect(() => {
|
||||
loadHistory(0).then(() => connectWs());
|
||||
let cancelled = false;
|
||||
loadHistory(0).then(() => {
|
||||
if (cancelled) return;
|
||||
connectWs();
|
||||
});
|
||||
return () => {
|
||||
wsRef.current?.close();
|
||||
cancelled = true;
|
||||
const ws = wsRef.current;
|
||||
wsRef.current = null;
|
||||
ws?.close();
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
@@ -713,8 +713,8 @@ export function EventsTab() {
|
||||
</Label>
|
||||
<span className='text-[10px] text-muted-foreground font-mono flex items-center'>
|
||||
{newEventType === 'task'
|
||||
? t('taskTemplateVars')
|
||||
: t('eventTemplateVars')}
|
||||
? t.raw('taskTemplateVars')
|
||||
: t.raw('eventTemplateVars')}
|
||||
</span>
|
||||
</div>
|
||||
<Textarea
|
||||
@@ -893,8 +893,8 @@ export function EventsTab() {
|
||||
</Label>
|
||||
<span className='text-[10px] text-muted-foreground font-mono flex items-center'>
|
||||
{selectedEvent.task_type
|
||||
? t('taskTemplateVars')
|
||||
: t('eventTemplateVars')}
|
||||
? t.raw('taskTemplateVars')
|
||||
: t.raw('eventTemplateVars')}
|
||||
</span>
|
||||
</div>
|
||||
<Textarea
|
||||
|
||||
@@ -218,7 +218,7 @@ export function UserFilterBar() {
|
||||
|
||||
<div className='flex items-center gap-1.5 self-end lg:self-auto'>
|
||||
<span className='text-[10px] text-muted-foreground whitespace-nowrap'>
|
||||
{t('totalRecords', { count: total })}
|
||||
{t('totalRecords', { total })}
|
||||
</span>
|
||||
<div className='flex items-center border border-dashed rounded-md shadow-none'>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user