Skip to content

Commit a8e8d37

Browse files
committed
feat: add configuration options to control questions
1 parent 3d26d1d commit a8e8d37

File tree

3 files changed

+257
-113
lines changed

3 files changed

+257
-113
lines changed

popup/popup.css

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* {
22
padding: 0;
33
margin: 0;
4+
box-sizing: border-box;
45
}
56

67
*::-webkit-scrollbar {
@@ -17,12 +18,12 @@
1718
}
1819

1920
body {
20-
width: 300px;
21+
width: 330px;
2122
background-color: #eceff7;
2223
}
2324

2425
input {
25-
border: 1px solid rgb(210, 210, 210);
26+
border: 1px solid #cacaca;
2627
}
2728

2829
input:focus-visible {
@@ -33,37 +34,76 @@ input:focus-visible {
3334
padding: 5px 10px 10px;
3435
}
3536

37+
.partition {
38+
margin: 12px 0;
39+
height: 1px;
40+
background-color: #cecece;
41+
}
42+
3643
.title {
3744
text-align: center;
3845
}
3946

47+
/* config */
48+
4049
.config {
41-
margin-top: 10px;
42-
padding-bottom: 10px;
43-
border-bottom: 1px solid #cecece;
50+
padding: 0 2px;
4451
}
4552

46-
.config .item {
53+
/* config writes */
54+
55+
.config .writes .item {
4756
display: flex;
4857
justify-content: space-between;
49-
padding: 3px 10px;
58+
align-items: center;
59+
height: 26px;
60+
padding: 3px 0;
5061
}
5162

52-
.config .item span {
53-
width: 60px;
63+
.config .writes .item span {
64+
width: 55px;
65+
text-align: justify;
66+
text-align-last: justify;
5467
}
5568

56-
.config .item .config-ipt {
69+
.config .writes .item .config-input {
5770
flex: 1;
71+
height: 100%;
72+
margin-left: 5px;
73+
padding-left: 5px;
5874
border-radius: 5px;
5975
}
6076

77+
/* config options */
78+
79+
.config .options {
80+
display: flex;
81+
flex-direction: column;
82+
margin-top: 5px;
83+
}
84+
85+
.config .options .options-label {
86+
display: flex;
87+
align-items: center;
88+
height: 20px;
89+
}
90+
91+
.config .options .options-label .config-checkbox {
92+
margin-right: 8px;
93+
}
94+
95+
/* box */
96+
97+
.box {
98+
min-height: 300px;
99+
}
100+
61101
.box .search {
62102
display: flex;
63-
justify-content: center;
103+
justify-content: space-around;
64104
align-items: center;
65105
margin-top: 10px;
66-
border: 1px solid rgb(210, 210, 210);
106+
border: 1px solid #cacaca;
67107
border-radius: 10px;
68108
background-color: #ffff;
69109
}
@@ -84,25 +124,27 @@ input:focus-visible {
84124
border: none;
85125
border-radius: 5px;
86126
color: #ffff;
87-
background-color: #c5c5c5;
127+
background-color: #000;
128+
88129
}
89130

90-
.box .search .search-btn:hover {
91-
background-color: #bbbbbb;
131+
.box .search .search-btn[disabled] {
132+
background-color: #c5c5c5;
92133
}
93134

94135
/* message list */
95136

96137
.box .message-list {
97138
margin-top: 10px;
98-
max-height: 390px;
139+
max-height: 350px;
99140
overflow-y: scroll;
100141
word-wrap: break-word;
101142
}
102143

103144
.box .message-list .item {
104145
margin: 12px 0;
105146
padding: 6px;
147+
min-height: 30px;
106148
border-radius: 6px;
107149
background-color: #ffff;
108150
}

popup/popup.html

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,44 @@
22
<link rel="stylesheet" href="./popup.css" />
33

44
<div id="app">
5-
<h1 class="title">页面 AI</h1>
5+
<h1 class="title">Page AI</h1>
6+
7+
<div class="partition"></div>
68

79
<div class="config">
8-
<div class="item">
9-
<span>Base URL</span>
10-
<input type="text" class="config-ipt" data-name="BASE_URL" />
10+
<div class="writes">
11+
<div class="item">
12+
<span>Base URL</span>
13+
<input type="text" class="config-input" data-name="BASE_URL" />
14+
</div>
15+
<div class="item">
16+
<span>API Key</span>
17+
<input type="password" class="config-input" data-name="API_KEY" />
18+
</div>
19+
<div class="item">
20+
<span>模型</span>
21+
<input type="text" class="config-input" data-name="MODEL" />
22+
</div>
1123
</div>
12-
<div class="item">
13-
<span>API Key</span>
14-
<input type="password" class="config-ipt" data-name="API_KEY" />
24+
25+
<div class="options">
26+
<label class="options-label">
27+
<input
28+
class="config-checkbox"
29+
type="checkbox"
30+
data-name="READ_CONTEXT"
31+
/>
32+
<span>读取页面内容</span>
33+
</label>
1534
</div>
1635
</div>
1736

37+
<div class="partition"></div>
38+
1839
<div class="box">
1940
<div class="search">
2041
<input type="text" class="search-ipt" placeholder="" />
21-
<button class="search-btn">
42+
<button class="search-btn" disabled>
2243
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
2344
<path
2445
d="M7 11L12 6L17 11M12 18V7"

0 commit comments

Comments
 (0)