Skip to content

Commit 838550e

Browse files
author
lhy
committed
添加加入pawsql的按钮
1 parent dd1290c commit 838550e

3 files changed

Lines changed: 40 additions & 16 deletions

File tree

src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"form.config.email.label": "PawSQL Account",
5252
"form.config.password.label": "Password",
5353
"form.config.backendUrl.label": "PawSQL Server Address",
54+
"form.config.joinPawSQL": "Join PawSQL",
5455
"form.config.description": "PawSQL Client enables developers to access core capabilities of the PawSQL directly within VSCode enviroment. PawSQL provides sophisticated SQL optimization features including smart index recommendations and query rewrites. More about PawSQL's capabilities, please visit ",
5556
"form.config.documentation.link": "docs.pawsql.com",
5657
"form.config.save": "Save",

src/i18n/zh-cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"form.config.email.label": "PawSQL 账号",
5252
"form.config.password.label": "密码",
5353
"form.config.backendUrl.label": "PawSQL 服务器",
54+
"form.config.joinPawSQL": "加入PawSQL",
5455
"form.config.description": "PawSQL Client让开发者能够在VS Code开发环境中直接使用PawSQL优化引擎的强大功能,包括智能索引推荐、查询重写建议、自动化性能验证等。想要了解更多关于PawSQL的优化能力,请参考",
5556
"form.config.documentation.link": "PawSQL官方文档",
5657
"form.config.save": "保存",

src/webview/components/ConfigForm.tsx

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@ const ConfigForm: React.FC<ConfigFormProps> = ({
121121
</Typography>
122122
</div>
123123
<TextField
124-
fullWidth
125-
name="backendUrl"
126-
label={formatMessage({ id: "form.config.backendUrl.label" })}
127-
variant="outlined"
128-
margin="normal"
129-
value={formState.backendUrl}
130-
onChange={handleInputChange}
131-
InputProps={{
132-
startAdornment: (
133-
<InputAdornment position="start">
134-
<PublicIcon sx={{ color: "#666" }} />
135-
</InputAdornment>
136-
),
137-
}}
138-
sx={{ mb: 2 }}
139-
/>
124+
fullWidth
125+
name="backendUrl"
126+
label={formatMessage({ id: "form.config.backendUrl.label" })}
127+
variant="outlined"
128+
margin="normal"
129+
value={formState.backendUrl}
130+
onChange={handleInputChange}
131+
InputProps={{
132+
startAdornment: (
133+
<InputAdornment position="start">
134+
<PublicIcon sx={{ color: "#666" }} />
135+
</InputAdornment>
136+
),
137+
}}
138+
sx={{ mb: 2 }}
139+
/>
140140
<form onSubmit={handleSubmit}>
141141
<TextField
142142
fullWidth
@@ -190,10 +190,32 @@ const ConfigForm: React.FC<ConfigFormProps> = ({
190190
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.15)",
191191
},
192192
transition: "all 0.3s ease",
193+
mb: 2,
193194
}}
194195
>
195196
<FormattedMessage id="form.config.save" />
196197
</Button>
198+
199+
{/* 新增的“Join PawSQL”按钮 */}
200+
<Button
201+
variant="outlined"
202+
fullWidth
203+
onClick={() => openExternalLink("https://www.pawsql.com/signup")}
204+
sx={{
205+
height: "48px",
206+
fontSize: "16px",
207+
color: "#007acc",
208+
borderColor: "#007acc",
209+
textTransform: "none",
210+
"&:hover": {
211+
backgroundColor: "#f0f8ff",
212+
borderColor: "#005999",
213+
},
214+
transition: "all 0.3s ease",
215+
}}
216+
>
217+
<FormattedMessage id="form.config.joinPawSQL" />
218+
</Button>
197219
</form>
198220
<Snackbar
199221
open={snackbarOpen}

0 commit comments

Comments
 (0)