summaryrefslogtreecommitdiff
path: root/src/ollama_web/templates/index.html
blob: f59066d85049b9968fff3a1863fba26372de84a3 (plain)
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
<!DOCTYPE html>
<html lang="ja">
<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>
</head>
<body>
  <aside id="sidebar">
    <div class="sidebar-header">
      <h2>セッション</h2>
      <button id="new-session-btn" type="button" title="新規セッション">+</button>
    </div>
    <ul id="session-list"></ul>
    <div class="sidebar-footer">
      <button id="mcp-settings-btn" type="button">MCP設定</button>
    </div>
  </aside>
  <div id="sidebar-backdrop"></div>

  <div id="main">
    <header>
      <button id="menu-btn" type="button" aria-label="セッション一覧">☰</button>
      <h1>ollama-web</h1>
      <div class="controls">
        <label for="model-select">モデル:</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">クリア</button>
      </div>
    </header>

    <main id="chat"></main>

    <div id="attachments"></div>

    <form id="input-form">
      <div class="input-row">
        <label class="attach-btn" title="ファイルを添付">
          <input type="file" id="file-input" multiple accept="*/*" />
          📎
        </label>
        <textarea id="input" placeholder="メッセージを入力… (Enter で送信 / Shift+Enter で改行)"
                  rows="2" autofocus></textarea>
        <button type="submit" id="send-btn">送信</button>
        <button type="button" id="cancel-btn" disabled>停止</button>
      </div>
    </form>
  </div>

  <div id="mcp-modal" class="modal">
    <div class="modal-content">
      <div class="modal-header">
        <h2>MCPサーバー設定</h2>
        <button id="mcp-modal-close" type="button" class="close-btn">&times;</button>
      </div>
      <div class="modal-body">
        <div id="mcp-servers"></div>
        <button id="mcp-add-btn" type="button" class="secondary">+ サーバー追加</button>
      </div>
      <div class="modal-footer">
        <button id="mcp-save-btn" type="button">保存</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>