-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.html
159 lines (143 loc) · 5.17 KB
/
settings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings</title>
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
padding: 20px;
background: #f5f5f5;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h1 {
margin-top: 0;
color: #333;
font-size: 1.5em;
}
.input-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
color: #555;
}
input[type="text"],
input[type="password"],
textarea {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
textarea {
min-height: 100px;
resize: vertical;
}
button {
background: #007AFF;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: #0056b3;
}
.status {
margin-top: 10px;
color: #666;
}
.info-text {
font-size: 0.85em;
color: #666;
margin-top: 4px;
font-style: italic;
}
.radio-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.radio-option {
display: flex;
align-items: center;
gap: 8px;
}
#llmType {
width: 200px;
}
</style>
</head>
<body>
<div class="container">
<h1>⚙️ Settings</h1>
<div class="input-group">
<label for="llmType">🤖 LLM Provider:</label>
<select id="llmType" name="llmType" style="padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
<option value="pasteai">PasteAI Account</option>
<option value="ollama">Ollama (Local)</option>
<option value="openai">OpenAI</option>
</select>
</div>
<div id="pasteAISettings" class="input-group">
<label for="pasteAIEmail">📧 Email:</label>
<div style="display: flex; gap: 10px;">
<input type="email" id="pasteAIEmail" placeholder="Enter your email" style="flex: 1;">
<button id="loginButton" style="white-space: nowrap;">🔑 Login</button>
</div>
<div id="loginMessage" class="status" style="margin-top: 10px;"></div>
<div style="display: flex; gap: 10px; margin-top: 10px;">
<button id="checkQuotaButton">💰 Check Quota</button>
<div id="quotaDisplay" class="status"
style="flex: 1; font-size: 0.9em; display: flex; align-items: center;"></div>
</div>
</div>
<div id="ollamaSettings" class="input-group">
<label for="ollamaUrl">🌐 Ollama URL:</label>
<input type="text" id="ollamaUrl" value="http://localhost:11434">
<div id="ollamaStatus" class="status" style="display: none;">
⚠️ Ollama is not running. Please install it from <a href="https://ollama.com/download"
target="_blank">here</a>
</div>
</div>
<div id="ollamaModelSettings" class="input-group">
<label for="ollamaModel">🤖 Ollama Model:</label>
<select id="ollamaModel"
style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px;">
<option value="">Loading models...</option>
</select>
<div class="input-group" style="margin-top: 10px;">
<div style="display: flex; gap: 10px;">
<a href="#" id="installPhi" style="flex: 1; text-decoration: none;">Install phi3:mini</a>
</div>
<pre id="installOutput"
style="background: #f5f5f5; padding: 10px; border-radius: 4px; margin-top: 10px; display: none; max-height: 200px; overflow-y: auto;"></pre>
</div>
</div>
<div class="input-group">
<label for="apiKey">🔑 API Key:</label>
<input type="password" id="apiKey" placeholder="Enter your OpenAI API key">
</div>
<div class="input-group">
<label for="systemPrompt">💬 System Prompt:</label>
<textarea id="systemPrompt" placeholder="Enter your system prompt"></textarea>
<div class="info-text">Leave empty for default prompt</div>
</div>
<button id="saveButton">💾 Save</button>
</div>
<script type="module" src="/src/settings.ts"></script>
</body>
</html>