Merge branch 'dev' into feat/path-to-cortexcpp
This commit is contained in:
commit
c92b809883
@ -47,9 +47,6 @@ async function migrateThemes() {
|
|||||||
const themes = readdirSync(join(appResourcePath(), 'themes'))
|
const themes = readdirSync(join(appResourcePath(), 'themes'))
|
||||||
for (const theme of themes) {
|
for (const theme of themes) {
|
||||||
const themePath = join(appResourcePath(), 'themes', theme)
|
const themePath = join(appResourcePath(), 'themes', theme)
|
||||||
if (existsSync(themePath) && !lstatSync(themePath).isDirectory()) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
await checkAndMigrateTheme(theme, themePath)
|
await checkAndMigrateTheme(theme, themePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,21 +61,11 @@ async function checkAndMigrateTheme(
|
|||||||
)
|
)
|
||||||
if (existingTheme) {
|
if (existingTheme) {
|
||||||
const desTheme = join(janDataThemesFolder, 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)
|
console.debug('Updating theme', existingTheme)
|
||||||
rmdirSync(desTheme, { recursive: true })
|
rmdirSync(desTheme, { recursive: true })
|
||||||
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
|
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.debug('Adding new theme', sourceThemeName)
|
console.debug('Adding new theme', sourceThemeName)
|
||||||
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
|
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
|
|
||||||
import { extractInferenceParams, extractModelLoadParams } from '@janhq/core'
|
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 { useAtomValue, useSetAtom } from 'jotai'
|
||||||
import { AlertTriangleIcon, CheckIcon, CopyIcon, InfoIcon } from 'lucide-react'
|
import { AlertTriangleIcon, CheckIcon, CopyIcon, InfoIcon } from 'lucide-react'
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ const LocalServerRightPanel = () => {
|
|||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
<Input
|
<Input
|
||||||
value={selectedModel?.id || ''}
|
value={selectedModel?.id || ''}
|
||||||
className="cursor-pointer"
|
className="cursor-pointer text-[hsla(var(--text-secondary))]"
|
||||||
readOnly
|
readOnly
|
||||||
suffixIcon={
|
suffixIcon={
|
||||||
clipboard.copied ? (
|
clipboard.copied ? (
|
||||||
@ -104,18 +104,13 @@ const LocalServerRightPanel = () => {
|
|||||||
className="text-[hsla(var(--success-bg))]"
|
className="text-[hsla(var(--success-bg))]"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Tooltip
|
|
||||||
trigger={
|
|
||||||
<CopyIcon
|
<CopyIcon
|
||||||
size={14}
|
size={14}
|
||||||
className="text-[hsla(var(--text-secondary))]"
|
className="cursor-pointer text-[hsla(var(--text-secondary))]"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
clipboard.copy(selectedModel?.id)
|
clipboard.copy(selectedModel?.id)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
|
||||||
content="Copy Model ID"
|
|
||||||
/>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -94,7 +94,7 @@ const ModelDownloadRow: React.FC<Props> = ({
|
|||||||
return (
|
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 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 max-w-[50%] justify-between">
|
||||||
<div className="flex">
|
<div className="flex min-w-[280px] max-w-[280px]">
|
||||||
{quantization && (
|
{quantization && (
|
||||||
<Badge variant="soft" className="mr-1">
|
<Badge variant="soft" className="mr-1">
|
||||||
{quantization}
|
{quantization}
|
||||||
@ -109,10 +109,12 @@ const ModelDownloadRow: React.FC<Props> = ({
|
|||||||
{fileName}
|
{fileName}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</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)}
|
{toGibibytes(fileSize)}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{downloadedModel ? (
|
{downloadedModel ? (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user