Faisal Amir faa09bd2bf
feat: Dekstop Revamp (#2877)
* feat: desktop revamp

* feat: refactor system monitor

* fix linter CI

* remove unused import component

* added responsive and resizeable component

* responsive and resizeable local server page

* finalize responsive and resizeable component

* fix scroll custom ui

* remove react scroll to bottom from modal troubleshoot

* fix modal troubleshoot ui

* fix setting gpu list

* text area custom scroll bar

* fix padding message input

* cleanup classname

* update inference engine model dropdown

* update loader style

* update quick ask ui

* prepare theme provider

* update dark theme

* remove update hotkey list model and navigation

* fix: cleanup hardcode classname

* fix: update feedback

* Set native theme electron

* update destop ui revamp from feedback

* update button icon component insider icon chat input message

* update model dropdown ui

* update tranaparent baclground

* update logo model provider

* fix: set background material acrylic support to blur background windows

* fix: update tranparent left and right panel

* fix: linter CI

* update app using frameless window

* styling custom style minimize, maximize and close app

* temporary hidden maximize window

* fix: responsive left and right panel

* fix: enable click outside when leftpanel responsive

* fix: remove unused import

* update transparent variable css windows

* fix: ui import model

* feat: Support Theme system (#2946)

* feat: update support theme system

* update select component

* feat: add theme folder in root project

* fix: padding left and right center panel

* fix: update padding left and right

* chore: migrate themes

* fix: rmdirsync error

* chore: update gitignore

* fix: cp recursive

* fix: files electron package json

* fix: migration

* fix: update fgit ignore

---------

Co-authored-by: Louis <louis@jan.ai>

* fix: update feedback missing state when refrash app

* fix: error test CI

* chore: refactor useLoadThemes

* chore: cleanup unused vars

* fix: revert back menubar windows

* fix minor ui

* fix: minor ui

---------

Co-authored-by: Louis <louis@jan.ai>
2024-05-29 13:37:18 +07:00

125 lines
4.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useState } from 'react'
import { Modal, ScrollArea } from '@janhq/joi'
import { motion as m } from 'framer-motion'
import { atom, useAtom } from 'jotai'
import { twMerge } from 'tailwind-merge'
import ServerLogs from '@/containers/ServerLogs'
import AppLogs from './AppLogs'
import DeviceSpecs from './DeviceSpecs'
export const modalTroubleShootingAtom = atom(false)
const logOption = ['App Logs', 'Server Logs', 'Device Specs']
const ModalTroubleShooting = () => {
const [modalTroubleShooting, setModalTroubleShooting] = useAtom(
modalTroubleShootingAtom
)
const [isTabActive, setIsTabActivbe] = useState(0)
return (
<Modal
open={modalTroubleShooting}
fullPage
onOpenChange={setModalTroubleShooting}
title="Troubleshooting Assistance"
content={
<div className="flex h-full w-full flex-col overflow-hidden ">
<div className="flex-shrink-0">
<p className="text-[hsla(var(--text-secondary)] mt-2 pr-3 leading-relaxed">
{`We're here to help! Your report is crucial for debugging and shaping
the next version. Heres how you can report & get further support:`}
</p>
</div>
<div className="my-3 rounded-lg border border-[hsla(var(--app-border))] p-4 shadow">
<h2 className="font-semibold">Step 1</h2>
<p className="text-[hsla(var(--text-secondary)] mt-1">
Follow our&nbsp;
<a
href="https://jan.ai/guides/troubleshooting"
target="_blank"
className="text-[hsla(var(--app-link))] hover:underline"
>
troubleshooting guide
</a>
&nbsp;for step-by-step solutions.
</p>
</div>
<div className="rounded-lg border border-[hsla(var(--app-border))] pb-2 pt-4 shadow">
<div className="px-4">
<h2 className="font-semibold">Step 2</h2>
<p className="text-[hsla(var(--text-secondary)] mt-1">
{`If you can't find what you need in our troubleshooting guide, feel
free reach out to us for extra help:`}
</p>
<ul className="mt-2 list-disc space-y-2 pl-6">
<li>
<p className="font-medium">
Copy your 2-hour logs & device specifications provided
below.{' '}
</p>
</li>
<li>
<p className="font-medium">
Go to our&nbsp;
<a
href="https://discord.gg/AsJ8krTT3N"
target="_blank"
className="text-[hsla(var(--app-link))] hover:underline"
>
Discord
</a>
&nbsp;& send it to #🆘|get-help channel for further support.
</p>
</li>
</ul>
</div>
<div className="flex h-full w-full flex-col pt-4">
<div className="relative border-y border-[hsla(var(--app-border))] px-4 py-2 ">
<ul className="inline-flex space-x-2 rounded-lg px-1">
{logOption.map((name, i) => {
return (
<li
className="relative cursor-pointer px-4 py-2"
key={i}
onClick={() => setIsTabActivbe(i)}
>
<span
className={twMerge(
'text-[hsla(var(--text-secondary)] relative z-50 font-medium',
isTabActive === i &&
'bg= font-bold text-[hsla(var(--primary-fg))]'
)}
>
{name}
</span>
{isTabActive === i && (
<m.div
className="absolute left-0 top-1 h-[calc(100%-8px)] w-full rounded-md bg-[hsla(var(--primary-bg))]"
layoutId="log-state-active"
/>
)}
</li>
)
})}
</ul>
</div>
<ScrollArea className="w-full">
{isTabActive === 0 && <AppLogs />}
{isTabActive === 1 && <ServerLogs limit={50} withCopy />}
{isTabActive === 2 && <DeviceSpecs />}
</ScrollArea>
</div>
</div>
</div>
}
/>
)
}
export default ModalTroubleShooting