Skip to content

Commit 4359912

Browse files
committed
Refactor SDK and Env Management in Webview
- Enhanced the local toolchain configuration interface in `index.vue` for better user experience, including improved layout and functionality for adding, editing, and deleting toolchains. - Implemented confirmation dialog for deletion of toolchains to prevent accidental removals. - Moved environment-related functions from `setting.ts` to a new module `settings_env.ts` for better organization and maintainability. - Created a new module `settings_sdk.ts` to handle SDK-related functionalities, including reading SDK package information, managing SDK configurations, and processing SDK-related messages. - Updated the message handling in `setting.ts` to delegate SDK and Env messages to their respective handlers. - Improved error handling and user feedback throughout the SDK and Env management processes.
1 parent b035515 commit 4359912

File tree

7 files changed

+1292
-423
lines changed

7 files changed

+1292
-423
lines changed
Lines changed: 200 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,205 @@
1-
.toolchains-container {
2-
width: 80%;
1+
/* SDK管理页面样式 */
2+
.sdk-container {
3+
width: 100%;
34
height: 100%;
45
padding: 20px;
6+
background-color: #f5f7fa;
7+
box-sizing: border-box;
8+
}
9+
10+
/* 页面头部 */
11+
.sdk-header {
12+
background-color: #fff;
13+
border-radius: 8px 8px 0 0;
14+
padding: 20px 24px;
15+
display: flex;
16+
justify-content: space-between;
17+
align-items: center;
18+
border-bottom: 1px solid #e4e7ed;
19+
}
20+
21+
.sdk-title {
22+
font-size: 20px;
23+
font-weight: 600;
24+
color: #303133;
25+
margin: 0;
26+
}
27+
28+
.sdk-actions {
29+
display: flex;
30+
gap: 12px;
31+
}
32+
33+
/* SDK内容区域 */
34+
.sdk-content {
35+
background-color: #fff;
36+
border-radius: 0 0 8px 8px;
37+
overflow: hidden;
38+
}
39+
40+
/* 表格样式 */
41+
.el-table {
42+
font-size: 14px;
543

6-
h1 {
7-
font-size: 24px;
8-
color: #333;
44+
.el-table__header {
45+
th {
46+
background-color: #f5f7fa;
47+
color: #606266;
48+
font-weight: 600;
49+
border-bottom: 1px solid #e4e7ed;
50+
}
51+
}
52+
53+
.el-table__row {
54+
&:hover {
55+
background-color: #f5f7fa;
56+
}
57+
}
58+
59+
// 隐藏默认的展开图标
60+
.el-table__expand-icon {
61+
display: none;
62+
}
63+
}
64+
65+
/* SDK名称样式 */
66+
.sdk-name {
67+
display: flex;
68+
align-items: center;
69+
gap: 8px;
70+
cursor: pointer;
71+
72+
.expand-icon {
73+
font-size: 12px;
74+
color: #909399;
75+
transition: transform 0.3s;
76+
77+
&.el-icon-arrow-down {
78+
transform: rotate(90deg);
79+
}
80+
}
81+
82+
span {
83+
color: #303133;
84+
font-weight: 500;
85+
}
86+
}
87+
88+
/* 安装状态样式 */
89+
.install-status {
90+
display: flex;
91+
align-items: center;
92+
gap: 8px;
93+
94+
.el-tag {
95+
min-width: 60px;
96+
}
97+
98+
.installed-version {
99+
color: #67c23a;
100+
font-weight: 500;
101+
}
102+
103+
.selected-version {
104+
color: #e6a23c;
105+
font-weight: 500;
106+
}
107+
}
108+
109+
/* 展开内容区域 */
110+
.sdk-expand-content {
111+
padding: 20px 40px;
112+
background-color: #fafbfc;
113+
border-top: 1px solid #ebeef5;
114+
}
115+
116+
.sdk-versions {
117+
.el-radio-group {
118+
display: flex;
119+
flex-direction: column;
120+
gap: 12px;
121+
align-items: flex-start;
122+
}
123+
124+
.el-radio {
125+
margin-right: 0;
126+
margin-left: 0;
127+
128+
.el-radio__label {
129+
font-size: 14px;
130+
color: #606266;
131+
padding-left: 10px;
132+
}
133+
134+
&.is-checked {
135+
.el-radio__label {
136+
color: #409eff;
137+
font-weight: 500;
138+
}
139+
}
140+
}
141+
}
142+
143+
/* 按钮样式 */
144+
.el-button {
145+
min-width: 80px;
146+
147+
&--primary {
148+
background-color: #409eff;
149+
border-color: #409eff;
150+
151+
&:hover {
152+
background-color: #66b1ff;
153+
border-color: #66b1ff;
154+
}
155+
156+
&.is-plain {
157+
color: #409eff;
158+
background: #ecf5ff;
159+
border-color: #b3d8ff;
160+
161+
&:hover {
162+
color: #fff;
163+
background-color: #409eff;
164+
border-color: #409eff;
165+
}
166+
}
167+
}
168+
}
169+
170+
/* 空数据状态 */
171+
.el-table__empty-text {
172+
color: #909399;
173+
font-size: 14px;
174+
padding: 40px 0;
175+
}
176+
177+
/* 响应式设计 */
178+
@media (max-width: 768px) {
179+
.sdk-container {
180+
padding: 12px;
181+
}
182+
183+
.sdk-header {
184+
flex-direction: column;
185+
align-items: flex-start;
186+
gap: 16px;
187+
padding: 16px;
188+
}
189+
190+
.sdk-title {
191+
font-size: 18px;
192+
}
193+
194+
.sdk-actions {
195+
width: 100%;
196+
197+
.el-button {
198+
flex: 1;
199+
}
200+
}
201+
202+
.sdk-expand-content {
203+
padding: 16px 20px;
9204
}
10205
}

0 commit comments

Comments
 (0)