Merge branch 'dev' into feat/path-to-cortexcpp

This commit is contained in:
Louis 2024-11-06 13:55:27 +07:00 committed by GitHub
commit c92b809883
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 35 deletions

View File

@ -47,9 +47,6 @@ async function migrateThemes() {
const themes = readdirSync(join(appResourcePath(), 'themes'))
for (const theme of themes) {
const themePath = join(appResourcePath(), 'themes', theme)
if (existsSync(themePath) && !lstatSync(themePath).isDirectory()) {
continue
}
await checkAndMigrateTheme(theme, themePath)
}
}
@ -64,21 +61,11 @@ async function checkAndMigrateTheme(
)
if (existingTheme) {
const desTheme = join(janDataThemesFolder, existingTheme)
if (!existsSync(desTheme) || !lstatSync(desTheme).isDirectory()) return
const desThemeData = JSON.parse(
readFileSync(join(desTheme, 'theme.json'), 'utf-8')
)
const sourceThemeData = JSON.parse(
readFileSync(join(sourceThemePath, 'theme.json'), 'utf-8')
)
if (desThemeData.version !== sourceThemeData.version) {
console.debug('Updating theme', existingTheme)
rmdirSync(desTheme, { recursive: true })
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
recursive: true,
})
}
} else {
console.debug('Adding new theme', sourceThemeName)
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {

View File

@ -1,7 +1,7 @@
import { useCallback, useEffect, useMemo, useState } from 'react'
import { extractInferenceParams, extractModelLoadParams } from '@janhq/core'
import { Accordion, AccordionItem, Input, Tooltip } from '@janhq/joi'
import { Accordion, AccordionItem, Input } from '@janhq/joi'
import { useAtomValue, useSetAtom } from 'jotai'
import { AlertTriangleIcon, CheckIcon, CopyIcon, InfoIcon } from 'lucide-react'
@ -95,7 +95,7 @@ const LocalServerRightPanel = () => {
<div className="mt-2">
<Input
value={selectedModel?.id || ''}
className="cursor-pointer"
className="cursor-pointer text-[hsla(var(--text-secondary))]"
readOnly
suffixIcon={
clipboard.copied ? (
@ -104,18 +104,13 @@ const LocalServerRightPanel = () => {
className="text-[hsla(var(--success-bg))]"
/>
) : (
<Tooltip
trigger={
<CopyIcon
size={14}
className="text-[hsla(var(--text-secondary))]"
className="cursor-pointer text-[hsla(var(--text-secondary))]"
onClick={() => {
clipboard.copy(selectedModel?.id)
}}
/>
}
content="Copy Model ID"
/>
)
}
/>

View File

@ -94,7 +94,7 @@ const ModelDownloadRow: React.FC<Props> = ({
return (
<div className="flex flex-col gap-4 rounded border border-[hsla(var(--app-border))] p-3 md:flex-row md:items-center md:justify-between xl:w-full">
<div className="flex max-w-[50%] justify-between">
<div className="flex">
<div className="flex min-w-[280px] max-w-[280px]">
{quantization && (
<Badge variant="soft" className="mr-1">
{quantization}
@ -109,10 +109,12 @@ const ModelDownloadRow: React.FC<Props> = ({
{fileName}
</h1>
</div>
<Badge theme="secondary" className="hidden md:flex">
<div className="md:min-w-[90px] md:max-w-[90px]">
<Badge theme="secondary" className="ml-4 hidden md:flex">
{toGibibytes(fileSize)}
</Badge>
</div>
</div>
{downloadedModel ? (
<Button