forked from ollama-ui/ollama-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
108 lines (97 loc) · 4.59 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
<!DOCTYPE html>
<html>
<head>
<title>Chat with Llama2</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link href="resources/bootstrap.min.css" rel="stylesheet"
integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<script src="resources/bootstrap.bundle.min.js"
integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm"
crossorigin="anonymous"></script>
<script src="resources/marked.min.js"
integrity="sha384-dZulhREgb+hCgQMhZ2VG0l37VQj5pJBq2w0h7Jn3tdMn36aXNepF1+FMLBB4O649"
crossorigin="anonymous"></script>
<script src="resources/purify.min.js" integrity="sha256-QigBQMy2be3IqJD2ezKJUJ5gycSmyYlRHj2VGBuITpU="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="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 id="model-controls" class="col-md-4 col-12 text-md-end text-start mb-3">
<div class="d-flex flex-column align-items-md-end align-items-start">
<div id="host-address-select">
<div class="d-flex align-items-center mb-2">
<label for="host-address" class="form-label me-2" style="font-size: smaller;">Hostname</label>
<input id="host-address" class="form-control" type="text" placeholder="http://localhost:11434" style="width: auto;"></select>
</div>
</div>
<div class="d-flex align-items-center mb-2">
<label for="model-select" class="form-label me-2" style="font-size: smaller;">Model:</label>
<select class="form-select" id="model-select" style="width: auto;"></select>
</div>
<div class="d-flex align-items-center">
<label for="chat-select" class="form-label me-2" style="font-size: smaller;">History:</label>
<select id="chat-select" class="form-select" style="width: auto;">
<option value="" disabled selected>Select a chat</option>
</select>
</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 class="container p-2 card" id="input-area">
<div class="input-group">
<textarea class="form-control" id="user-input" placeholder="Type your question here..."></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="api.js"></script>
<script src="chat.js"></script>
</body>
</html>