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
|
<!DOCTYPE html>
<html lang="{{ t('html.lang') }}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ollama-web</title>
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', path='vendor/github-dark.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', path='vendor/katex.min.css') }}" />
<script src="{{ url_for('static', path='vendor/marked.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/purify.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/highlight.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/katex.min.js') }}"></script>
<script>
window.I18N = {{ messages | tojson }};
</script>
<script src="{{ url_for('static', path='i18n.js') }}"></script>
</head>
<body>
<aside id="sidebar">
<div class="sidebar-header">
<h2>{{ t('chat.sessions') }}</h2>
<button id="new-session-btn" type="button" title="{{ t('chat.new_session') }}">+</button>
</div>
<ul id="session-list"></ul>
<div class="sidebar-footer">
<button id="mcp-settings-btn" type="button">{{ t('chat.mcp_settings') }}</button>
</div>
</aside>
<div id="sidebar-backdrop"></div>
<div id="main">
<header>
<button id="menu-btn" type="button" aria-label="{{ t('chat.session_list') }}">☰</button>
<h1>ollama-web</h1>
<div class="controls">
<label for="model-select">{{ t('chat.model_label') }}</label>
<select id="model-select">
{% if models %}
{% for m in models %}
<option value="{{ m }}" {% if m == default_model %}selected{% endif %}>{{ m }}</option>
{% endfor %}
{% else %}
<option value="{{ default_model }}" selected>{{ default_model }}</option>
{% endif %}
</select>
<label class="think-toggle">
<input type="checkbox" id="think-toggle" /> thinking
</label>
<button id="clear-btn" type="button">{{ t('common.clear') }}</button>
</div>
</header>
<main id="chat"></main>
<div id="attachments"></div>
<form id="input-form">
<div class="input-row">
<label class="attach-btn" title="{{ t('chat.attach_file') }}">
<input type="file" id="file-input" multiple accept="*/*" />
📎
</label>
<textarea id="input" placeholder="{{ t('chat.input_placeholder') }}"
rows="2" autofocus></textarea>
<button type="submit" id="send-btn">{{ t('common.send') }}</button>
<button type="button" id="cancel-btn" disabled>{{ t('common.stop') }}</button>
</div>
</form>
</div>
<div id="mcp-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>{{ t('mcp.server_settings') }}</h2>
<button id="mcp-modal-close" type="button" class="close-btn">×</button>
</div>
<div class="modal-body">
<div id="mcp-servers"></div>
<button id="mcp-add-btn" type="button" class="secondary">{{ t('mcp.add_server') }}</button>
</div>
<div class="modal-footer">
<button id="mcp-save-btn" type="button">{{ t('common.save') }}</button>
</div>
</div>
</div>
<script src="{{ url_for('static', path='tools.js') }}"></script>
<script src="{{ url_for('static', path='mcp.js') }}"></script>
<script src="{{ url_for('static', path='app.js') }}"></script>
</body>
</html>
|