Changeset 0.22.10 (#152)

This commit is contained in:
2026-03-04 22:37:57 +00:00
parent 6ed76fb2d3
commit 40d9834f64
15 changed files with 1014 additions and 515 deletions

View File

@@ -98,11 +98,11 @@ window.addEventListener('unhandledrejection', function(e) {
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
</button>
<div id="newChatDropdown" class="split-dropdown">
<button class="split-dropdown-item" onclick="document.getElementById('newChatDropdown').classList.remove('open'); newChat();">
<button class="split-dropdown-item" onclick="closeNewChatMenu(); newChat();">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
<span>New Chat</span>
</button>
<button class="split-dropdown-item" onclick="document.getElementById('newChatDropdown').classList.remove('open'); if(typeof createProject==='function') createProject();">
<button class="split-dropdown-item" onclick="closeNewChatMenu(); if(typeof createProject==='function') createProject();">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
<span>New Project</span>
</button>
@@ -153,6 +153,11 @@ window.addEventListener('unhandledrejection', function(e) {
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
<span class="sb-label">Notes</span>
</button>
{{/* Editor shortcut */}}
<a href="{{.BasePath}}/editor" class="sb-btn sidebar-editor-btn" title="Editor">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
<span class="sb-label">Editor</span>
</a>
<div class="sidebar-bottom-divider"></div>
<button id="userMenuBtn" class="user-btn">
<div id="userAvatar" class="user-avatar">
@@ -594,50 +599,104 @@ window.addEventListener('unhandledrejection', function(e) {
{{/* ── Team Admin Modal ────────────────────── */}}
<div id="teamAdminModal" class="modal-overlay">
<div class="modal-content modal-lg">
<div class="modal-header">
<div class="modal-content modal-lg" style="max-width:900px;height:80vh;display:flex;flex-direction:column;">
<div class="modal-header" style="flex-shrink:0;">
<h2 id="teamAdminTitle">Team Admin</h2>
<button id="teamAdminCloseBtn" class="modal-close"></button>
</div>
<div class="modal-body" style="display:flex;min-height:300px;">
<div id="teamAdminPicker" class="admin-sidebar">
<div class="modal-body" style="display:flex;flex:1;min-height:0;padding:0;">
{{/* Team picker (multi-team admins) */}}
<div id="teamAdminPicker" style="padding:20px;flex:1;overflow-y:auto;">
<div id="teamAdminPickerList"></div>
</div>
<div id="teamAdminContent" style="flex:1;overflow-y:auto;padding:16px;">
<div id="adminCurrentUser" style="display:none;"></div>
<div id="adminTeamDetail" style="display:none;">
<h3 id="adminTeamDetailName"></h3>
<div id="adminMemberList"></div>
<div id="adminAddMemberForm" style="display:none;">
<select id="adminMemberUser"></select>
</div>
<div id="adminTeamAllowProviders" style="display:none;"></div>
<div id="adminTeamPrivatePolicy" style="display:none;"></div>
{{/* Tabbed team management */}}
<div id="teamAdminContent" style="display:none;flex:1;display:flex;flex-direction:column;min-width:0;">
{{/* Tab bar */}}
<div id="teamAdminTabs" style="display:flex;gap:2px;padding:8px 16px;border-bottom:1px solid var(--border);flex-shrink:0;overflow-x:auto;">
<button class="admin-tab active" data-ttab="members" onclick="UI.switchTeamTab('members')">Members</button>
<button class="admin-tab" data-ttab="providers" onclick="UI.switchTeamTab('providers')">Providers</button>
<button class="admin-tab" data-ttab="personas" onclick="UI.switchTeamTab('personas')">Personas</button>
<button class="admin-tab" data-ttab="knowledge" onclick="UI.switchTeamTab('knowledge')">Knowledge</button>
<button class="admin-tab" data-ttab="groups" onclick="UI.switchTeamTab('groups')">Groups</button>
<button class="admin-tab" data-ttab="settings" onclick="UI.switchTeamTab('settings')">Settings</button>
<button class="admin-tab" data-ttab="usage" onclick="UI.switchTeamTab('usage')">Usage</button>
<button class="admin-tab" data-ttab="activity" onclick="UI.switchTeamTab('activity')">Activity</button>
</div>
<div id="adminGroupDetail" style="display:none;">
<div id="adminGroupDetailMeta"></div>
<h3 id="adminGroupDetailName"></h3>
<div id="adminGroupList" style="display:none;"></div>
<div id="adminGroupMemberList"></div>
<div id="adminAddGroupMemberForm" style="display:none;">
<select id="adminGroupMemberUser"></select>
{{/* Tab content panels */}}
<div style="flex:1;overflow-y:auto;padding:16px;">
{{/* Members */}}
<div id="teamTabMembers" class="team-tab-content">
<div id="settingsTeamMembers"></div>
<div id="settingsTeamAddMember" class="admin-inline-form" style="display:none;margin-top:12px;">
<div style="display:flex;gap:8px;align-items:flex-end;">
<div class="form-group" style="flex:1"><label>User</label><select id="settingsTeamMemberUser"><option value="">Select user...</option></select></div>
<div class="form-group"><label>Role</label><select id="settingsTeamMemberRole"><option value="member">Member</option><option value="admin">Admin</option></select></div>
<button class="btn-small btn-primary" id="settingsTeamAddMemberSubmit">Add</button>
<button class="btn-small" onclick="document.getElementById('settingsTeamAddMember').style.display='none'">Cancel</button>
</div>
</div>
<button class="btn-small" id="settingsTeamAddMemberBtn" style="margin-top:8px">+ Add Member</button>
</div>
{{/* Providers */}}
<div id="teamTabProviders" class="team-tab-content" style="display:none;">
<div id="settingsTeamProviders"></div>
<div id="settingsTeamProviderForm" style="display:none;margin-top:12px;"></div>
<button class="btn-small" id="settingsTeamAddProviderBtn" style="margin-top:8px">+ Add Provider</button>
</div>
{{/* Personas */}}
<div id="teamTabPersonas" class="team-tab-content" style="display:none;">
<div id="teamPersonaList"></div>
<div id="settingsTeamPersonas" style="display:none;"></div>
<div style="display:none;"><select id="teamPersona_model"></select></div>
</div>
{{/* Knowledge */}}
<div id="teamTabKnowledge" class="team-tab-content" style="display:none;">
<div id="teamKBContent"></div>
</div>
{{/* Groups */}}
<div id="teamTabGroups" class="team-tab-content" style="display:none;">
<div id="settingsTeamGroups"></div>
</div>
{{/* Settings */}}
<div id="teamTabSettings" class="team-tab-content" style="display:none;">
<div style="max-width:500px;">
<div class="form-group" style="margin-bottom:12px;">
<label class="toggle-label"><input type="checkbox" id="teamSettingPrivatePolicy"><span class="toggle-track"></span><span>Require private providers (BYOK)</span></label>
<div class="toggle-hint">Team members must use their own API keys</div>
</div>
<div class="form-group" style="margin-bottom:12px;">
<label class="toggle-label"><input type="checkbox" id="teamSettingAllowProviders" checked><span class="toggle-track"></span><span>Allow team providers</span></label>
<div class="toggle-hint">Team admins can add shared provider configs</div>
</div>
<button class="btn-small btn-primary" id="teamSettingSaveBtn">Save Settings</button>
</div>
</div>
{{/* Usage */}}
<div id="teamTabUsage" class="team-tab-content" style="display:none;">
<div id="settingsTeamUsageTotals"></div>
</div>
{{/* Activity (Audit) */}}
<div id="teamTabActivity" class="team-tab-content" style="display:none;">
<div style="margin-bottom:8px;">
<select id="teamAuditFilterAction" style="font-size:12px;padding:4px 8px;"><option value="">All actions</option></select>
</div>
<div id="settingsTeamAudit"></div>
<div id="teamAuditPagination" style="display:flex;gap:8px;align-items:center;margin-top:8px;">
<button id="teamAuditPrevBtn" class="btn-small" disabled>← Prev</button>
<span id="teamAuditPageInfo" class="text-muted" style="font-size:12px;"></span>
<button id="teamAuditNextBtn" class="btn-small">Next →</button>
</div>
</div>
</div>
<div id="adminAddTeamForm" style="display:none;"></div>
<div id="adminAddGroupForm" style="display:none;"></div>
<div id="adminAddProviderForm" style="display:none;"></div>
{{/* Team audit (inside team admin modal) */}}
<div id="teamKBContent" style="display:none;"></div>
<div style="display:none;">
<select id="teamAuditFilterAction"><option value="">All</option></select>
<div id="teamAuditPagination" style="display:flex;gap:8px;align-items:center;">
<button id="teamAuditPrevBtn" class="btn-small" disabled></button>
<span id="teamAuditPageInfo"></span>
<button id="teamAuditNextBtn" class="btn-small"></button>
</div>
</div>
{{/* Team persona model select */}}
<div style="display:none;"><select id="teamPersona_model"></select></div>
</div>
</div>
</div>