Skip to content

Commit

Permalink
style:暗黑完善,去除非组件自带暗黑样式
Browse files Browse the repository at this point in the history
  • Loading branch information
QwQ-wuwuwu committed Jul 5, 2024
1 parent 58cd57f commit a45dbd0
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function AssistantSetting({ id, type }) {
{/* @ts-ignore */}
{form.isCheck && <SettingIcon onClick={(e) => { e.stopPropagation(); setOpen(!open) }} className="w-[32px] h-[32px]" />}
</SheetTrigger>
<SheetContent className="w-[500px] bg-background-login" onClick={(e) => e.stopPropagation()}>
<SheetContent className="w-[500px]" onClick={(e) => e.stopPropagation()}>
<SheetTitle className="font-[500] pl-3 pt-2">{t('build.contentSecuritySettings')}</SheetTitle>
<FormSet data={form} onChange={handleFormChange} onSave={() => setOpen(false)} onCancel={() => setOpen(false)} />
</SheetContent>
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/src/components/Pro/security/FormSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default function FormSet({ data, onChange, onSave, onCancel }) {
onChange={(e) => setForm({ ...form, words: e.target.value })}
placeholder={t('build.useNewlineToSeparate')}></Textarea>
<input type="file" accept=".txt" id="fileUpload" className="hidden" onChange={handleUploadFile} />
{/* @ts-ignore */}
<div className="flex items-center absolute right-1 top-1 cursor-pointer" onClick={() => document.querySelector('#fileUpload').click()}>
<UploadIcon id="ul" color="blue" className="w-3 h-3" />
<Label htmlFor="ul"><span className="text-xs text-primary cursor-pointer">{t('build.txtFile')}</span></Label>
Expand All @@ -102,8 +103,8 @@ export default function FormSet({ data, onChange, onSave, onCancel }) {
</div>
</div>
<div className="absolute bottom-10 right-4 sapce-x-10 flex space-x-8">
<Button className="dark:bg-[#282828]" onClick={onCancel} variant="outline">{t('cancel')}</Button>
<Button className="text-slate-50" onClick={handleSave}>{t('save')}</Button>
<Button onClick={onCancel} variant="outline">{t('cancel')}</Button>
<Button onClick={handleSave}>{t('save')}</Button>
</div>
</>
};
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default function CardComponent<T>({


// 侧边弹窗列表(sheet)
if (type === 'sheet') return <Card className="group w-[320px] cursor-pointer bg-[#F7F9FC] dark:bg-[#282828] dark:hover:bg-[#414141] hover:bg-[#EDEFF6] hover:shadow-none relative" onClick={onClick}>
if (type === 'sheet') return <Card className="group w-[320px] cursor-pointer bg-[#F7F9FC] dark:bg-background-main dark:hover:bg-background-login hover:bg-[#EDEFF6] hover:shadow-none relative" onClick={onClick}>
<CardHeader className="pb-2">
<CardTitle className="truncate-doubleline">
<div className="flex gap-2 pb-2 items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function SkillChatSheet({ children, onSelect }) {
<SheetDescription>{t('chat.chooseSkillOrAssistant')}</SheetDescription>
<SearchInput value={keyword} placeholder={t('chat.search')} className="my-6" onChange={(e) => setKeyword(e.target.value)} />
</div>
<div className="flex-1 min-w-[696px] bg-[#fff] dark:bg-[#303134] p-5 pt-12 h-full flex flex-wrap gap-1.5 overflow-y-auto scrollbar-hide content-start">
<div className="flex-1 min-w-[696px] bg-[#fff] dark:bg-[#030712] p-5 pt-12 h-full flex flex-wrap gap-1.5 overflow-y-auto scrollbar-hide content-start">
{
options.length ? options.map((flow, i) => (
<CardComponent key={i}
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function SkillSheet({ select, children, onSelect }) {
return (
<Sheet>
<SheetTrigger asChild>{children}</SheetTrigger>
<SheetContent className="bg-background-main sm:min-w-[966px]">
<SheetContent className="sm:min-w-[966px]">
<div className="flex h-full" onClick={(e) => e.stopPropagation()}>
<div className="w-fit p-6">
<SheetTitle>{t("build.addSkill")}</SheetTitle>
Expand All @@ -55,7 +55,7 @@ export default function SkillSheet({ select, children, onSelect }) {
{t("build.createSkill")}
</Button>
</div>
<div className="flex h-full min-w-[696px] flex-1 flex-wrap content-start gap-1.5 overflow-y-auto bg-background-login p-5 pt-12 scrollbar-hide">
<div className="flex h-full min-w-[696px] flex-1 flex-wrap content-start gap-1.5 overflow-y-auto p-5 pt-12 scrollbar-hide">
{onlineFlows[0] ? (
onlineFlows.map((flow, i) => (
<CardComponent
Expand All @@ -68,13 +68,13 @@ export default function SkillSheet({ select, children, onSelect }) {
footer={
<div className="flex justify-end">
{select.some((_) => _.id === flow.id) ? (
<Button size="sm" className="h-6 text-slate-50" disabled>
<Button size="sm" className="h-6" disabled>
{t("build.added")}
</Button>
) : (
<Button
size="sm"
className="h-6 text-slate-50"
className="h-6"
onClick={() => onSelect(flow)}
>
{t("build.add")}
Expand All @@ -89,7 +89,7 @@ export default function SkillSheet({ select, children, onSelect }) {
<p className="mb-3 text-sm text-muted-foreground">
{t("build.empty")}
</p>
<Button className="w-[200px] text-slate-50" onClick={toCreateFlow}>
<Button className="w-[200px]" onClick={toCreateFlow}>
{t("build.createSkill")}
</Button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export default function ToolsSheet({ select, onSelect, children }) {
<SheetTrigger asChild>
{children}
</SheetTrigger>
<SheetContent className="w-[1000px] sm:max-w-[1000px] bg-background-main">
<SheetContent className="w-[1000px] sm:max-w-[1000px]">
<div className="flex h-full" onClick={e => e.stopPropagation()}>
<div className="w-fit p-6">
<SheetTitle>{t('build.addTool')}</SheetTitle>
<SearchInput placeholder={t('build.search')} className="mt-6" onChange={(e) => setKeyword(e.target.value)} />
<Button
className="mt-4 w-full text-slate-50"
className="mt-4 w-full"
onClick={() => window.open(__APP_ENV__.BASE_URL + "/build/tools")}
>
{t('create')}{t("tools.createCustomTool")}
Expand All @@ -63,7 +63,7 @@ export default function ToolsSheet({ select, onSelect, children }) {
</div>
</div>
</div>
<div className="flex-1 bg-background-login p-5 pt-12 h-full overflow-auto scrollbar-hide">
<div className="flex-1 bg-background-main p-5 pt-12 h-full overflow-auto scrollbar-hide">
<Accordion type="single" collapsible className="w-full">
{
options.length ? options.map(el => (
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/bs-ui/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const ButtonNumber = React.forwardRef<HTMLButtonElement, {
setValue(updateValue)
onChange?.(updateValue)
}
return (<div className={cname("flex items-center border input-border bg-gray-50 rounded-md", className)}>
return (<div className={cname("flex items-center border input-border bg-gray-50 dark:bg-background-login rounded-md", className)}>
<Button variant="ghost" size={size} disabled={value === min} onClick={valueReduce}>-</Button>
<span className="min-w-10 block text-center">{value}</span>
<Button variant="ghost" size={size} disabled={value === max} onClick={valueAdd}>+</Button>
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export default function MainLayout() {
<div className="flex justify-between h-[64px]">
<div className="flex h-9 my-[14px]">
<Link className="inline-block" to='/'>
{/* @ts-ignore */}
<img src={__APP_ENV__.BASE_URL + '/login-logo-small.png'} className="w-[114px] h-9 ml-8 rounded dark:w-[124px] dark:pr-[10px] dark:hidden" alt="" />
{/* @ts-ignore */}
<img src={__APP_ENV__.BASE_URL + '/logo-small-dark.png'} className="w-[114px] h-9 ml-8 rounded dark:w-[124px] dark:pr-[10px] dark:block hidden" alt="" />
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/FileLibPage/files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function FilesPage() {
{loading && <div className="absolute w-full h-full top-0 left-0 flex justify-center items-center z-10 bg-[rgba(255,255,255,0.6)] dark:bg-blur-shared">
<span className="loading loading-infinity loading-lg"></span>
</div>}
<div className="h-full overflow-y-auto pb-10 bg-[#fff]">
<div className="h-full overflow-y-auto pb-10 bg-background-login">
<div className="flex justify-between items-center mb-4">
<div className="flex items-center">
<ShadTooltip content="back" side="top">
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/LogPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ export default function index() {
</Select>
</div>
<div>
<Button className="mr-3 px-6 dark:text-[#ECECEC]" onClick={handleSearch}>
<Button className="mr-3 px-6" onClick={handleSearch}>
{t('log.searchButton')}
</Button>
<Button variant="outline" className="px-6 dark:bg-[#282828]" onClick={handleReset}>
<Button variant="outline" className="px-6" onClick={handleReset}>
{t('log.resetButton')}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ ${t('build.exampleTwo')}
setLoading(true)
const res = await captureAndAlertRequestErrorHoc(createAssistantsApi(formData.name, formData.roleAndTasks))
if (res) {
//@ts-ignore
window.assistantCreate = true // 标记新建助手
navigate('/assistant/' + res.id)
}
Expand Down Expand Up @@ -112,9 +113,9 @@ ${t('build.exampleTwo')}
</div>
<DialogFooter>
<DialogClose>
<Button variant="outline" className="px-11 dark:bg-[#282828]" type="button" onClick={() => setFormData({ name: '', roleAndTasks: '' })}>{t('cancle')}</Button>
<Button variant="outline" className="px-11" type="button" onClick={() => setFormData({ name: '', roleAndTasks: '' })}>{t('cancle')}</Button>
</DialogClose>
<Button disabled={loading} type="submit" className="px-11 text-slate-50" onClick={handleSubmit}>
<Button disabled={loading} type="submit" className="px-11" onClick={handleSubmit}>
{loading && <LoadIcon className="mr-2" />}
{t('build.create')}</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/SkillPage/components/EditTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ const EditTool = forwardRef((props: any, ref) => {
</div>
)}
</div>
<SheetFooter className="absolute bottom-0 right-0 w-full px-6 py-4 bg-background-login">
<SheetFooter className="absolute bottom-0 right-0 w-full px-6 py-4">
{delShow && <Button
size="sm"
variant="destructive"
className="absolute left-6"
onClick={handleDelete}
>{t('tools.delete')}</Button>}
<Button size="sm" variant="outline" className="dark:bg-[#282828]" onClick={() => setEditShow(false)}>{t('tools.cancel')}</Button>
<Button size="sm" variant="outline" onClick={() => setEditShow(false)}>{t('tools.cancel')}</Button>
<Button size="sm" className="text-[white]" onClick={handleSave}>{t('tools.save')}</Button>
</SheetFooter>
</SheetContent>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/SkillPage/components/ToolItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function ToolItem({
{
api.api_params.map(param => (
<div>
<span className=" rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium text-white">{param.name}</span>
<span className=" rounded-xl bg-gray-200 dark:bg-background-login px-2 py-1 text-xs font-medium text-white">{param.name}</span>
{/* <span>{param.schema.type}</span> */}
</div>
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function AutoPromptDialog({ onOpenChange }) {
<Textarea ref={areaRef} className="h-full" defaultValue={assistantState.prompt}
placeholder={t('prompt')}
></Textarea>
<Button className="group-hover:flex text-slate-50 hidden h-6 absolute bottom-4 right-4" disabled={LoadType.Prompt <= loading} size="sm" onClick={handleUsePropmt}>{t('build.use')}</Button>
<Button className="group-hover:flex hidden h-6 absolute bottom-4 right-4" disabled={LoadType.Prompt <= loading} size="sm" onClick={handleUsePropmt}>{t('build.use')}</Button>
</div>
</div>
{/* 自动配置 */}
Expand All @@ -188,23 +188,23 @@ export default function AutoPromptDialog({ onOpenChange }) {
</div>
<div className="max-h-[660px] overflow-y-auto">
{/* 开场白 */}
<div className="group relative pb-12 bg-gray-100 dark:bg-[#282828] mt-4 px-4 py-2 rounded-md">
<div className="group relative pb-12 bg-gray-100 dark:bg-[#2A2B2E] mt-4 px-4 py-2 rounded-md">
<div className="text-md mb-2 font-medium leading-none flex">{t('build.openingRemarks')}{LoadType.GuideWord === loading && <LoadIcon className="ml-2 text-gray-600" />}</div>
<Textarea ref={guideAreaRef} className="bg-transparent border-none bg-gray-50"></Textarea>
<Button className="group-hover:flex text-slate-50 hidden h-6 absolute bottom-4 right-4" disabled={LoadType.GuideWord <= loading} size="sm" onClick={handleUseGuide}>{t('build.use')}</Button>
<Textarea ref={guideAreaRef} className="bg-transparent border-none bg-gray-50 dark:bg-[#171717]"></Textarea>
<Button className="group-hover:flex hidden h-6 absolute bottom-4 right-4" disabled={LoadType.GuideWord <= loading} size="sm" onClick={handleUseGuide}>{t('build.use')}</Button>
</div>
{/* 引导词 */}
<div className="group relative pb-12 bg-gray-100 dark:bg-[#282828] mt-4 px-4 py-2 rounded-md">
<div className="group relative pb-12 bg-gray-100 dark:bg-[#2A2B2E] mt-4 px-4 py-2 rounded-md">
<div className="text-md mb-2 font-medium leading-none flex">{t('build.guidingQuestions')}{LoadType.GuideQuestion === loading && <LoadIcon className="ml-2 text-gray-600" />}</div>
{
question.map(qs => (
<p key={qs} className="text-sm text-muted-foreground bg-gray-50 px-2 py-1 rounded-xl mb-2">{qs}</p>
<p key={qs} className="text-sm text-muted-foreground bg-gray-50 dark:bg-[#171717] px-2 py-1 rounded-xl mb-2">{qs}</p>
))
}
<Button className="group-hover:flex text-slate-50 hidden h-6 absolute bottom-4 right-4" disabled={LoadType.GuideQuestion <= loading} size="sm" onClick={handleUserQuestion}>{t('build.use')}</Button>
<Button className="group-hover:flex hidden h-6 absolute bottom-4 right-4" disabled={LoadType.GuideQuestion <= loading} size="sm" onClick={handleUserQuestion}>{t('build.use')}</Button>
</div>
{/* 工具 */}
<div className="group relative pb-10 bg-gray-100 dark:bg-[#282828] mt-4 px-4 py-2 rounded-md">
<div className="group relative pb-10 bg-gray-100 dark:bg-[#2A2B2E] mt-4 px-4 py-2 rounded-md">
<div className="text-md mb-2 font-medium leading-none flex">{t('build.tools')}{LoadType.Tool === loading && <LoadIcon className="ml-2 text-gray-600" />}</div>
<div className="pt-1">
{
Expand All @@ -223,7 +223,7 @@ export default function AutoPromptDialog({ onOpenChange }) {
>{t('build.use')}</Button>
</div>
{/* 技能 */}
<div className="group relative pb-10 bg-gray-100 dark:bg-[#282828] mt-4 px-4 py-2 rounded-md">
<div className="group relative pb-10 bg-gray-100 dark:bg-[#2A2B2E] mt-4 px-4 py-2 rounded-md">
<div className="text-md mb-2 font-medium leading-none flex">{t('build.skill')}{LoadType.Flow === loading && <LoadIcon className="ml-2 text-gray-600" />}</div>
<div className="pt-1">
{
Expand All @@ -247,9 +247,9 @@ export default function AutoPromptDialog({ onOpenChange }) {
</div>
<DialogFooter>
<DialogClose>
<Button variant="outline" className="px-11 dark:bg-[#282828]" type="button">{t('cancle')}</Button>
<Button variant="outline" className="px-11" type="button">{t('cancle')}</Button>
</DialogClose>
<Button type="submit" className="px-11 text-slate-50" disabled={!!loading} onClick={handleUseAll}>{t('build.useAll')}</Button>
<Button type="submit" className="px-11" disabled={!!loading} onClick={handleUseAll}>{t('build.useAll')}</Button>
</DialogFooter>
</DialogContent>
};
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export default function EditAssistantDialog({ name, desc, onSave }) {
</div>
<DialogFooter>
<DialogClose>
<Button variant="outline" className="px-11 dark:bg-[#282828]" type="button">{t('build.cancel')}</Button>
<Button variant="outline" className="px-11" type="button">{t('build.cancel')}</Button>
</DialogClose>
<Button type="submit" className="px-11 text-slate-50" onClick={handleSubmit}>{t('build.confirm')}</Button>
<Button type="submit" className="px-11" onClick={handleSubmit}>{t('build.confirm')}</Button>
</DialogFooter>
</DialogContent>
};
Expand Down
Loading

0 comments on commit a45dbd0

Please sign in to comment.