forked from kennyroody/ollama-ui-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
126 lines (119 loc) · 5.46 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Chat with Ollama</title>
<link rel="shortcut icon" type="image/x-icon" href="resources/favicon.ico">
<link href="resources/bootstrap.min.css" rel="stylesheet">
<script src="resources/bootstrap.bundle.min.js"></script>
<script src="resources/marked.min.js"></script>
<script src="resources/purify.min.js"></script>
<link rel="stylesheet" href="resources/chat.css">
</head>
<body data-bs-theme="dark">
<div class="container">
<div class="row pt-3">
<div class="col-md-8 col-12">
<h1>Chat with Ollama</h1>
</div>
<div class="col-md-4 col-12">
<div class="accordion" id="modelControlsAccordion">
<div class="accordion-item">
<h2 class="accordion-header" id="modelControlsHeader">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#modelControlsContent" aria-expanded="false" aria-controls="modelControlsContent">
Model Controls
</button>
</h2>
<div id="modelControlsContent" class="accordion-collapse collapse" aria-labelledby="modelControlsHeader" data-bs-parent="#modelControlsAccordion">
<div class="accordion-body">
<div id="model-controls" class="text-md-end text-start mb-3">
<div class="d-flex flex-column align-items-md-end align-items-start">
<div id="prompt-input">
<div class="d-flex align-items-center mb-2">
System Prompt
<input id="system-prompt" class="form-control ms-2" type="text" placeholder="You are a helpful assistant" style="width: auto;">
</div>
</div>
<div id="host-address-select">
<div class="d-flex align-items-center mb-2">
Hostname
<input id="host-address" type="text" placeholder="http://localhost:11434" class="form-control ms-2">
</div>
</div>
<div class="d-flex align-items-center mb-2">
Model:
<select id="model-select" class="form-select ms-2"></select>
</div>
<div class="d-flex align-items-center">
History:
<select id="chat-select" class="form-select ms-2">
<option value="" disabled selected>Select a chat</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="scroll-wrapper">
<div id="chat-container" class="card">
<div class="text-end">
<button id="delete-chat" class="btn btn-danger" type="button">Delete Chat</button>
<button id="save-chat" class="btn btn-secondary" type="button" data-bs-toggle="modal" data-bs-target="#nameModal">Save Chat</button>
</div>
<div class="card-body">
<div id="chat-history"></div>
</div>
</div>
</div>
</div>
<div id="input-area" class="container p-2 card">
<div id="selected-files" class="mb-2"></div>
<div class="input-group">
<label for="file-input" class="btn btn-outline-secondary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-paperclip" viewBox="0 0 16 16">
<path d="M4.5 3a2.5 2.5 0 0 1 5 0v9a1.5 1.5 0 0 1-3 0V5a.5.5 0 0 1 1 0v7a.5.5 0 0 0 1 0V3a1.5 1.5 0 1 0-3 0v9a2.5 2.5 0 0 0 5 0V5a.5.5 0 0 1 1 0v7a3.5 3.5 0 1 1-7 0V3z"/>
</svg>
</label>
<input type="file" id="file-input" class="d-none" multiple>
<textarea id="user-input" class="form-control" rows="1" placeholder="Type your message..."></textarea>
<button id="send-button" class="btn btn-primary">Send</button>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="nameModal" tabindex="-1" aria-labelledby="nameModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="nameModalLabel">Enter Your Name</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="text" class="form-control" id="userName" placeholder="Your Name">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="saveName">Save</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="errorModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Unable to access Ollama server</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<p id="errorText"></p>
</div>
</div>
</div>
</div>
<script src="resources/api.js"></script>
<script src="resources/chat.js"></script>
</body>
</html>