Skip to content

Commit 0a20426

Browse files
author
mayong
committed
解决windows 10下nodejs/claude 安装 问题。
1 parent de48f76 commit 0a20426

File tree

7 files changed

+227
-72
lines changed

7 files changed

+227
-72
lines changed

build_number

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17
1+
33

frontend/package.json.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dd60bfa4f8626d9229ede352562379f7
1+
f26173c7304a0bf8ea5c86eb567e7db2

frontend/src/App.tsx

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {useEffect, useState} from 'react';
1+
import {useEffect, useState, useRef} from 'react';
22
import './App.css';
33
import {buildNumber} from './version';
44
import {LoadConfig, SaveConfig, CheckEnvironment, ResizeWindow, LaunchClaude, SelectProjectDir, SetLanguage, GetUserHomeDir, CheckUpdate} from "../wailsjs/go/main/App";
5-
import {WindowHide, EventsOn, EventsOff, BrowserOpenURL, ClipboardGetText} from "../wailsjs/runtime";
5+
import {WindowHide, EventsOn, EventsOff, BrowserOpenURL, ClipboardGetText, Quit} from "../wailsjs/runtime";
66
import {main} from "../wailsjs/go/models";
77

88
const subscriptionUrls: {[key: string]: string} = {
@@ -289,7 +289,8 @@ function App() {
289289
const [status, setStatus] = useState("");
290290
const [activeTab, setActiveTab] = useState(0);
291291
const [isLoading, setIsLoading] = useState(true);
292-
const [envLog, setEnvLog] = useState("Initializing...");
292+
const [envLogs, setEnvLogs] = useState<string[]>(["Initializing..."]);
293+
const [showLogs, setShowLogs] = useState(false);
293294
const [yoloMode, setYoloMode] = useState(false);
294295
const [showAbout, setShowAbout] = useState(false);
295296
const [showModelSettings, setShowModelSettings] = useState(false);
@@ -301,6 +302,14 @@ function App() {
301302
const [managerStatus, setManagerStatus] = useState("");
302303
const [lang, setLang] = useState("en");
303304

305+
const logEndRef = useRef<HTMLTextAreaElement>(null);
306+
307+
useEffect(() => {
308+
if (logEndRef.current) {
309+
logEndRef.current.scrollTop = logEndRef.current.scrollHeight;
310+
}
311+
}, [envLogs]);
312+
304313
useEffect(() => {
305314
// Language detection
306315
const userLang = navigator.language;
@@ -322,9 +331,14 @@ function App() {
322331
SetLanguage(initialLang);
323332

324333
// Environment Check Logic
325-
const logHandler = (msg: string) => setEnvLog(msg);
334+
const logHandler = (msg: string) => {
335+
setEnvLogs(prev => [...prev, msg]);
336+
if (msg.toLowerCase().includes("failed") || msg.toLowerCase().includes("error")) {
337+
setShowLogs(true);
338+
}
339+
};
326340
const doneHandler = () => {
327-
ResizeWindow(792, 460);
341+
ResizeWindow(902, 480);
328342
setIsLoading(false);
329343
};
330344

@@ -615,7 +629,66 @@ function App() {
615629
animation: 'indeterminate 1.5s infinite linear'
616630
}}></div>
617631
</div>
618-
<div style={{fontSize: '0.9rem', color: '#6b7280'}}>{envLog}</div>
632+
633+
{showLogs ? (
634+
<textarea
635+
ref={logEndRef}
636+
readOnly
637+
value={envLogs.join('\n')}
638+
style={{
639+
width: '100%',
640+
height: '240px',
641+
padding: '10px',
642+
fontSize: '0.85rem',
643+
fontFamily: 'monospace',
644+
color: '#4b5563',
645+
backgroundColor: '#f9fafb',
646+
border: '1px solid #e5e7eb',
647+
borderRadius: '8px',
648+
resize: 'none',
649+
outline: 'none',
650+
marginBottom: '10px'
651+
}}
652+
/>
653+
) : (
654+
<div style={{fontSize: '0.9rem', color: '#6b7280', marginBottom: '15px', height: '20px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap'}}>
655+
{envLogs[envLogs.length - 1]}
656+
</div>
657+
)}
658+
659+
<div style={{display: 'flex', gap: '15px', alignItems: 'center'}}>
660+
<button
661+
onClick={() => setShowLogs(!showLogs)}
662+
style={{
663+
background: 'none',
664+
border: 'none',
665+
color: '#3b82f6',
666+
fontSize: '0.8rem',
667+
cursor: 'pointer',
668+
textDecoration: 'underline'
669+
}}
670+
>
671+
{showLogs ? (lang === 'zh-Hans' ? '隐藏详情' : 'Hide Details') : (lang === 'zh-Hans' ? '查看详情' : 'Show Details')}
672+
</button>
673+
674+
{showLogs && (
675+
<button
676+
onClick={Quit}
677+
style={{
678+
backgroundColor: '#ef4444',
679+
color: 'white',
680+
border: 'none',
681+
borderRadius: '4px',
682+
padding: '4px 12px',
683+
fontSize: '0.8rem',
684+
cursor: 'pointer'
685+
}}
686+
>
687+
{lang === 'zh-Hans' ? '退出程序' : 'Quit Application'}
688+
</button>
689+
)}
690+
</div>
691+
619692
<style>{`
620693
@keyframes indeterminate {
621694
0% { transform: translateX(-100%); }

frontend/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const buildNumber = "17";
1+
export const buildNumber = "33";

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func main() {
2525
appOptions := &options.App{
2626
Title: "Claude Code Easy Suite",
2727
Frameless: true,
28-
Width: 528,
28+
Width: 602,
2929
Height: 200,
3030
SingleInstanceLock: &options.SingleInstanceLock{
3131
UniqueId: "claude-code-easy-suite-lock",

0 commit comments

Comments
 (0)