Skip to content

Commit 4b8afb0

Browse files
committed
v.0.2.1 add link to params info
1 parent 057e480 commit 4b8afb0

File tree

3 files changed

+84
-24
lines changed

3 files changed

+84
-24
lines changed

chatgpt-web/index.html

+62-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,65 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>ChatGPT-Web</title>
7-
</head>
8-
<body>
9-
<a href="https://github.com/SmileBuild/ChatGPT-Web" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#70B7FD; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
10-
11-
<div id="app"></div>
12-
<script type="module" src="/src/main.js"></script>
13-
</body>
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>ChatGPT-Web</title>
8+
<style>
9+
body {
10+
margin: 0 !important;
11+
}
12+
</style>
13+
</head>
14+
15+
<body>
16+
<a href="https://github.com/SmileBuild/ChatGPT-Web" class="github-corner" aria-label="View source on GitHub"><svg
17+
width="80" height="80" viewBox="0 0 250 250"
18+
style="fill:#70B7FD; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
19+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
20+
<path
21+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
22+
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
23+
<path
24+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
25+
fill="currentColor" class="octo-body"></path>
26+
</svg></a>
27+
<style>
28+
.github-corner:hover .octo-arm {
29+
animation: octocat-wave 560ms ease-in-out
30+
}
31+
32+
@keyframes octocat-wave {
33+
34+
0%,
35+
100% {
36+
transform: rotate(0)
37+
}
38+
39+
20%,
40+
60% {
41+
transform: rotate(-25deg)
42+
}
43+
44+
40%,
45+
80% {
46+
transform: rotate(10deg)
47+
}
48+
}
49+
50+
@media (max-width:500px) {
51+
.github-corner:hover .octo-arm {
52+
animation: none
53+
}
54+
55+
.github-corner .octo-arm {
56+
animation: octocat-wave 560ms ease-in-out
57+
}
58+
}
59+
</style>
60+
61+
<div id="app"></div>
62+
<script type="module" src="/src/main.js"></script>
63+
</body>
64+
1465
</html>

chatgpt-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chatgpt-web",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"private": true,
55
"scripts": {
66
"dev": "vite",

chatgpt-web/src/components/MainPage.vue

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<template>
22
<el-container>
33
<el-header>
4-
<h1>ChatGPT-Web v0.2.0</h1>
4+
<h1>ChatGPT-Web v0.2.0 </h1>
55
</el-header>
66
<el-main>
77
<el-row :gutter="40">
88
<el-col :span="8" class="col-params" v-loading="loading" element-loading-text="Loading..."
99
:element-loading-spinner="svg" element-loading-svg-view-box="-10, -10, 50, 50"
1010
element-loading-background="rgba(122, 122, 122, 0.8)">
11-
1211
<h2>Params 参数配置</h2>
1312
<el-divider />
13+
1414
<el-form>
1515
<h4>API Key</h4>
16-
<el-input v-model="key" placeholder="API Key(API秘钥)" show-password type="password"></el-input>
16+
<el-input v-model="key" placeholder="API秘钥" show-password type="password"></el-input>
1717
<h4>Prompt</h4>
18-
<el-input type="textarea" v-model="prompt" placeholder="Prompt(输入内容)" rows="10"></el-input>
18+
<el-input type="textarea" v-model="prompt" placeholder="输入内容" rows="10"></el-input>
19+
1920
<h4>Max_tokens</h4>
21+
2022
<el-input-number type="number" v-model="max_tokens"></el-input-number>
2123
<h4>Temperature</h4>
2224
<div class="slider-block">
@@ -46,14 +48,21 @@
4648
</el-select>
4749
</el-form>
4850
<el-divider />
51+
4952
<el-button size="large" type="success" @click="submitForm">Confirm 确定</el-button>
53+
<el-divider />
54+
<el-link href="https://beta.openai.com/docs/api-reference/completions/create#completions/create-model"
55+
target="_blank" type="danger">param info (参数说明)</el-link>
56+
57+
58+
5059
</el-col>
5160
<el-col :span="16">
5261

5362
<h2>Repsonse 结果</h2>
5463
<el-divider />
5564
<el-button size="large" type="warning" @click="downloadTxt" :disabled="download_disable">save 保存</el-button>
56-
65+
5766
<p id="result" style="color:red;white-space: pre-wrap;">{{ response }}</p>
5867
</el-col>
5968
</el-row>
@@ -84,20 +93,20 @@ export default {
8493
download_disable: true
8594
}
8695
},
87-
watch:{
88-
response(resp){
89-
if (resp == ''){
96+
watch: {
97+
response(resp) {
98+
if (resp == '') {
9099
this.download_disable = true;
91-
}else{
100+
} else {
92101
this.download_disable = false;
93102
}
94103
}
95104
},
96105
methods: {
97106
downloadTxt() {
98-
let text = 'Prompt: '+ this.prompt + '\n' + document.getElementById('result').innerText;
107+
let text = 'Prompt: ' + this.prompt + '\n' + document.getElementById('result').innerText;
99108
let element = document.createElement("a");
100-
let file = new Blob([text], {type: 'text/plain'});
109+
let file = new Blob([text], { type: 'text/plain' });
101110
element.href = URL.createObjectURL(file);
102111
element.download = "download.txt";
103112
element.click();
@@ -137,7 +146,7 @@ export default {
137146
<style scoped>
138147
.el-header {
139148
background: var(--el-color-black);
140-
color:aliceblue;
149+
color: aliceblue;
141150
}
142151

143152
.slider-block {

0 commit comments

Comments
 (0)