mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
minor terminal output copy updates
This commit is contained in:
parent
c111dfbddc
commit
d39a26477a
5 changed files with 33 additions and 24 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "gerbil",
|
||||
"productName": "Gerbil",
|
||||
"version": "1.14.1",
|
||||
"version": "1.15.0",
|
||||
"description": "Run Large Language Models locally",
|
||||
"main": "out/main/index.js",
|
||||
"homepage": "./",
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
"eslint-plugin-sonarjs": "^3.0.5",
|
||||
"globals": "^16.5.0",
|
||||
"jiti": "^2.6.1",
|
||||
"prettier": "^3.7.3",
|
||||
"prettier": "^3.7.4",
|
||||
"rollup-plugin-visualizer": "^6.0.5",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.2.6"
|
||||
|
|
|
|||
|
|
@ -40,7 +40,10 @@ export const StatusBar = ({ maxDataPoints = 60 }: StatusBarProps) => {
|
|||
|
||||
const tunnelUrl = useMemo(() => {
|
||||
if (!tunnelBaseUrl) return null;
|
||||
if (frontendPreference === 'sillytavern' || frontendPreference === 'openwebui') {
|
||||
if (
|
||||
frontendPreference === 'sillytavern' ||
|
||||
frontendPreference === 'openwebui'
|
||||
) {
|
||||
return tunnelBaseUrl;
|
||||
}
|
||||
return getTunnelInterfaceUrl(tunnelBaseUrl, {
|
||||
|
|
@ -48,7 +51,12 @@ export const StatusBar = ({ maxDataPoints = 60 }: StatusBarProps) => {
|
|||
imageGenerationFrontendPreference,
|
||||
isImageGenerationMode,
|
||||
});
|
||||
}, [tunnelBaseUrl, frontendPreference, imageGenerationFrontendPreference, isImageGenerationMode]);
|
||||
}, [
|
||||
tunnelBaseUrl,
|
||||
frontendPreference,
|
||||
imageGenerationFrontendPreference,
|
||||
isImageGenerationMode,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!systemMonitoringEnabled) {
|
||||
|
|
@ -90,7 +98,8 @@ export const StatusBar = ({ maxDataPoints = 60 }: StatusBarProps) => {
|
|||
}, [maxDataPoints, systemMonitoringEnabled]);
|
||||
|
||||
useEffect(() => {
|
||||
const cleanup = window.electronAPI.kobold.onTunnelUrlChanged(setTunnelBaseUrl);
|
||||
const cleanup =
|
||||
window.electronAPI.kobold.onTunnelUrlChanged(setTunnelBaseUrl);
|
||||
return cleanup;
|
||||
}, []);
|
||||
|
||||
|
|
@ -134,7 +143,11 @@ export const StatusBar = ({ maxDataPoints = 60 }: StatusBarProps) => {
|
|||
color={copied ? 'teal' : undefined}
|
||||
onClick={copy}
|
||||
>
|
||||
{copied ? <Check size="1.25rem" /> : <Globe size="1.25rem" />}
|
||||
{copied ? (
|
||||
<Check size="1.25rem" />
|
||||
) : (
|
||||
<Globe size="1.25rem" />
|
||||
)}
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ function spawnPreLaunchCommands(commands: string[]) {
|
|||
for (const command of commands) {
|
||||
if (!command.trim()) continue;
|
||||
|
||||
sendKoboldOutput(`[PRE-LAUNCH] Running: ${command}\n`);
|
||||
sendKoboldOutput(`Running: ${command}\n`);
|
||||
|
||||
try {
|
||||
const child = spawn(shell, [shellFlag, command], {
|
||||
|
|
@ -51,35 +51,31 @@ function spawnPreLaunchCommands(commands: string[]) {
|
|||
preLaunchProcesses.add(child);
|
||||
|
||||
child.stdout?.on('data', (data) => {
|
||||
sendKoboldOutput(`[PRE-LAUNCH] ${data.toString()}`, true);
|
||||
sendKoboldOutput(data.toString(), true);
|
||||
});
|
||||
|
||||
child.stderr?.on('data', (data) => {
|
||||
sendKoboldOutput(`[PRE-LAUNCH] ${data.toString()}`, true);
|
||||
sendKoboldOutput(data.toString(), true);
|
||||
});
|
||||
|
||||
child.on('error', (error) => {
|
||||
sendKoboldOutput(
|
||||
`[PRE-LAUNCH ERROR] Failed to run "${command}": ${error.message}\n`
|
||||
);
|
||||
sendKoboldOutput(`Failed to run "${command}": ${error.message}\n`);
|
||||
preLaunchProcesses.delete(child);
|
||||
});
|
||||
|
||||
child.on('exit', (code, signal) => {
|
||||
preLaunchProcesses.delete(child);
|
||||
if (code !== 0 && code !== null) {
|
||||
sendKoboldOutput(
|
||||
`[PRE-LAUNCH] Command "${command}" exited with code ${code}\n`
|
||||
);
|
||||
sendKoboldOutput(`Command "${command}" exited with code ${code}\n`);
|
||||
} else if (signal) {
|
||||
sendKoboldOutput(
|
||||
`[PRE-LAUNCH] Command "${command}" terminated with signal ${signal}\n`
|
||||
`Command "${command}" terminated with signal ${signal}\n`
|
||||
);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
sendKoboldOutput(
|
||||
`[PRE-LAUNCH ERROR] Failed to start "${command}": ${error instanceof Error ? error.message : String(error)}\n`
|
||||
`Failed to start "${command}": ${error instanceof Error ? error.message : String(error)}\n`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export const startTunnel = async () => {
|
|||
|
||||
tunnel.on('error', (error) => {
|
||||
logError(`Tunnel error: ${error.message}`, error);
|
||||
sendKoboldOutput(`[TUNNEL ERROR] ${error.message}`);
|
||||
sendKoboldOutput(`Tunnel error: ${error.message}`);
|
||||
});
|
||||
|
||||
tunnel.on('exit', (code, signal) => {
|
||||
|
|
@ -66,7 +66,7 @@ export const startTunnel = async () => {
|
|||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
logError(`Failed to start tunnel: ${errorMessage}`, error as Error);
|
||||
sendKoboldOutput(`[TUNNEL ERROR] ${errorMessage}`);
|
||||
sendKoboldOutput(`Failed to start tunnel: ${errorMessage}`);
|
||||
activeTunnel = null;
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
10
yarn.lock
10
yarn.lock
|
|
@ -3746,7 +3746,7 @@ __metadata:
|
|||
jiti: "npm:^2.6.1"
|
||||
lucide-react: "npm:^0.555.0"
|
||||
mime-types: "npm:^3.0.2"
|
||||
prettier: "npm:^3.7.3"
|
||||
prettier: "npm:^3.7.4"
|
||||
react: "npm:^19.2.0"
|
||||
react-dom: "npm:^19.2.0"
|
||||
react-error-boundary: "npm:^6.0.0"
|
||||
|
|
@ -5516,12 +5516,12 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"prettier@npm:^3.7.3":
|
||||
version: 3.7.3
|
||||
resolution: "prettier@npm:3.7.3"
|
||||
"prettier@npm:^3.7.4":
|
||||
version: 3.7.4
|
||||
resolution: "prettier@npm:3.7.4"
|
||||
bin:
|
||||
prettier: bin/prettier.cjs
|
||||
checksum: 10c0/ee86bb06121c74dadc54f30b6f99aff6288966d9b842ce501d6991e20d20c6ce2d45028651b3b0955ca6e5fa89c1bee1e72b6f810243a93cef8bc69737972ef7
|
||||
checksum: 10c0/9675d2cd08eacb1faf1d1a2dbfe24bfab6a912b059fc9defdb380a408893d88213e794a40a2700bd29b140eb3172e0b07c852853f6e22f16f3374659a1a13389
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue