mirror of
https://github.com/cline/cline.git
synced 2026-09-16 21:01:52 +08:00
adjusting welcome page language
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
VSCodeRadio,
|
||||
VSCodeRadioGroup,
|
||||
VSCodeTextField,
|
||||
VSCodeButton,
|
||||
} from "@vscode/webview-ui-toolkit/react"
|
||||
import { Fragment, memo, useCallback, useEffect, useMemo, useState } from "react"
|
||||
import { useEvent, useInterval } from "react-use"
|
||||
@@ -84,6 +85,10 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is
|
||||
const [azureApiVersionSelected, setAzureApiVersionSelected] = useState(!!apiConfiguration?.azureApiVersion)
|
||||
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false)
|
||||
|
||||
const handleClineLogin = () => {
|
||||
vscode.postMessage({ type: "accountLoginClicked" })
|
||||
}
|
||||
|
||||
const handleInputChange = (field: keyof ApiConfiguration) => (event: any) => {
|
||||
setApiConfiguration({ ...apiConfiguration, [field]: event.target.value })
|
||||
}
|
||||
@@ -170,6 +175,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is
|
||||
value={selectedProvider}
|
||||
onChange={handleInputChange("apiProvider")}
|
||||
style={{ minWidth: 130, position: "relative", zIndex: OPENROUTER_MODEL_PICKER_Z_INDEX + 1 }}>
|
||||
<VSCodeOption value="cline">Cline</VSCodeOption>
|
||||
<VSCodeOption value="openrouter">OpenRouter</VSCodeOption>
|
||||
<VSCodeOption value="anthropic">Anthropic</VSCodeOption>
|
||||
<VSCodeOption value="gemini">Google Gemini</VSCodeOption>
|
||||
@@ -185,6 +191,40 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage, is
|
||||
</VSCodeDropdown>
|
||||
</DropdownContainer>
|
||||
|
||||
{selectedProvider === "cline" && (
|
||||
<div>
|
||||
{apiConfiguration?.clineApiKey && (
|
||||
<VSCodeTextField
|
||||
value={apiConfiguration.clineApiKey}
|
||||
style={{ width: "100%" }}
|
||||
type="password"
|
||||
onInput={handleInputChange("clineApiKey")}
|
||||
placeholder={t("enterApiKey")}>
|
||||
<span style={{ fontWeight: 500 }}>Cline API Key</span>
|
||||
</VSCodeTextField>
|
||||
)}
|
||||
|
||||
{apiConfiguration?.clineApiKey && (
|
||||
<p
|
||||
style={{
|
||||
fontSize: "12px",
|
||||
marginTop: 3,
|
||||
color: "var(--vscode-descriptionForeground)",
|
||||
}}>
|
||||
{t("apiKeyInfo")}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{!apiConfiguration?.clineApiKey && (
|
||||
<div style={{ marginTop: 2 }}>
|
||||
<VSCodeButton appearance="primary" onClick={handleClineLogin}>
|
||||
Get Cline API Key
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{selectedProvider === "anthropic" && (
|
||||
<div>
|
||||
<VSCodeTextField
|
||||
@@ -963,6 +1003,8 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration):
|
||||
return { selectedProvider: provider, selectedModelId, selectedModelInfo }
|
||||
}
|
||||
switch (provider) {
|
||||
case "cline":
|
||||
return getProviderData(anthropicModels, anthropicDefaultModelId)
|
||||
case "anthropic":
|
||||
return getProviderData(anthropicModels, anthropicDefaultModelId)
|
||||
case "bedrock":
|
||||
|
||||
@@ -56,9 +56,8 @@ const WelcomeView = () => {
|
||||
|
||||
<div style={{ marginTop: "10px" }}>
|
||||
<ul style={{ paddingLeft: "20px", margin: "10px 0" }}>
|
||||
<li>Get $5 worth of free tokens</li>
|
||||
<li>No processing fees</li>
|
||||
<li>Seamless integration</li>
|
||||
<li>Get 1 task worth of free tokens</li>
|
||||
<li>No credit card required - just start using Cline immediately!</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user