fix: update style cortex dialog (#5245)

This commit is contained in:
Faisal Amir 2025-06-12 00:09:19 +07:00 committed by GitHub
parent 35a0a4e9a5
commit d2e88ffdc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,13 +18,10 @@ export function CortexFailureDialog() {
useEffect(() => {
let unlisten: (() => void) | undefined
const setupListener = async () => {
unlisten = await listen<null>(
'cortex_max_restarts_reached',
(event) => {
console.log('Cortex max restarts reached event received:', event)
setShowDialog(true)
}
)
unlisten = await listen<null>('cortex_max_restarts_reached', (event) => {
console.log('Cortex max restarts reached event received:', event)
setShowDialog(true)
})
}
setupListener()
@ -55,32 +52,38 @@ export function CortexFailureDialog() {
<Dialog open={showDialog} onOpenChange={setShowDialog}>
<DialogContent>
<DialogHeader>
<DialogTitle>{t('cortexFailureDialog.title', 'Local AI Engine Issue')}</DialogTitle>
<DialogTitle>
{t('cortexFailureDialog.title', 'Local AI Engine Issue')}
</DialogTitle>
</DialogHeader>
<DialogDescription>
{t('cortexFailureDialog.description', 'The local AI engine (Cortex) failed to start after multiple attempts. This might prevent some features from working correctly.')}
{t(
'cortexFailureDialog.description',
'The local AI engine (Cortex) failed to start after multiple attempts. This might prevent some features from working correctly.'
)}
</DialogDescription>
<DialogFooter className="gap-2 sm:gap-0">
<DialogFooter className="flex gap-2">
<Button
asChild
variant="default"
className="bg-transparent border border-main-view-fg/20 hover:bg-main-view-fg/10"
className="bg-transparent border border-main-view-fg/20 hover:bg-main-view-fg/4"
onClick={() => {
window.open('https://jan.ai/support', '_blank')
setShowDialog(false)
}}
>
{t('cortexFailureDialog.contactSupport', 'Contact Support')}
<a
href="https://jan.ai/support"
target="_blank"
rel="noopener noreferrer"
>
<span className="text-main-view-fg/70">
{t('cortexFailureDialog.contactSupport', 'Contact Support')}
</span>
</a>
</Button>
<Button
variant="default"
className="bg-transparent border border-main-view-fg/20 hover:bg-main-view-fg/10"
onClick={handleRestartJan}
>
<Button onClick={handleRestartJan}>
{t('cortexFailureDialog.restartJan', 'Restart Jan')}
</Button>
<Button onClick={() => setShowDialog(false)}>
{t('common.okay', 'Okay')}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>