Upload files to "html"

This commit is contained in:
2026-11-25 20:23:00 -06:00
parent b80c41310d
commit 58fdf2d087
5 changed files with 466 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Instance Administration</title>
<link rel="stylesheet" href="/css/admin.css?v=20261124-room-admin">
<script src="/js/admin.js?v=20261125-history1" defer></script>
</head>
<body>
<header><div><strong>Instance Administration</strong></div><div><a href="/">Open Media Server</a><button id="logoutBtn">Logout</button></div></header>
<main>
<nav class="admin-tabs" aria-label="Admin sections">
<button type="button" data-admin-nav="users" class="active">Users & Accounts</button>
<button type="button" data-admin-nav="rooms">Rooms & Access</button>
<button type="button" data-admin-nav="permissions">Permissions</button>
<button type="button" data-admin-nav="media-policy">Media Access</button>
<button type="button" data-admin-nav="templates">Room Templates</button>
<button type="button" data-admin-nav="appearance">Instance Settings</button>
</nav>
<section data-admin-panel="media-policy" hidden><h2>Individual media access</h2><p class="muted">Instance restrictions intersect with existing room permissions. Explicit policies deny newly created libraries until approved.</p><select id="policyUser"></select><label><input type="checkbox" id="policyInherit"> Inherit existing room access (no instance restriction)</label><div id="policyFields"></div><button id="policySave">Save user access</button><p id="policyStatus" role="status"></p></section>
<section data-admin-panel="templates" hidden><h2>Room media templates</h2><p class="muted">Media defaults copied into new rooms. Restrictions apply within the selected room. Instance account restrictions remain global.</p><select id="templateExisting"><option value="">New template</option></select><input id="templateName" placeholder="Template name" maxlength="100"><div id="templateFields"></div><h3>Media history defaults</h3><div id="templateHistory"></div><h3>AI access ceilings</h3><label><input type="checkbox" id="templateAI"> AI chat</label> <label><input type="checkbox" id="templateTools"> AI tools</label><h3>Room role permissions (cannot exceed instance grants)</h3><div id="templateRoles"></div><button id="templateSave">Save template</button><p id="templateStatus" role="status"></p></section>
<section data-admin-panel="templates" hidden><h2>Apply template to existing room</h2><p class="muted">Replaces only the copied template ceiling. Other existing restrictions remain. All affected members will be subject to the new ceiling in every room.</p><select id="applyRoom"></select><select id="applyTemplate"></select><button id="applyTemplateSave">Apply template</button><p id="applyStatus" role="status"></p></section>
<section data-admin-panel="appearance" hidden><h2>Instance branding</h2><p class="muted">Blank name keeps the login generic.</p><label>Instance name <input id="brandName" maxlength="120"></label><label>Login title <input id="brandTitle" maxlength="120"></label><label>Subtitle <input id="brandSubtitle" maxlength="120"></label><div><label><input type="checkbox" id="brandPowered"> Powered by Kronic</label> <label><input type="checkbox" id="brandRename"> Allow room owners to rename</label></div><button id="brandSave">Save instance settings</button><p id="brandStatus" role="status"></p></section>
<section data-admin-panel="appearance" hidden><h2>Room appearance</h2><p class="muted">Changes apply only to the selected chat room, not the instance or parent group. The internal room ID stays unchanged.</p><div style="display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:12px"><label>Room <select id="brandRoom"></select></label><label>Room page title <input id="brandRoomTitle" maxlength="100" style="width:min(280px,65vw)"></label><button type="button" id="brandRoomTitleSave">Save room title</button></div><label>Room icon (emoji or short text) <input id="brandIcon" maxlength="12"></label><label>Accent colour (hex, blank for default) <input id="brandAccent" placeholder="#365b86" maxlength="7"></label><button id="brandRoomSave">Save room appearance</button><p id="roomBrandStatus" role="status"></p></section>
<section data-admin-panel="appearance" hidden><h2>Media history</h2><p class="muted">Separate viewing history and resume positions without duplicating cached videos. Changing scope does not copy or erase existing history.</p><label>Room <select id="historyRoom"></select></label><div id="historyFields"></div><button id="historySave">Save history settings</button><p id="historyStatus" role="status"></p></section>
<section id="roomOverviewSection" data-admin-panel="rooms">
<h2>Rooms & access</h2>
<p class="muted">Each room belongs to a parent media group. Room access and group membership are shown together here; permissions remain separate in the database.</p>
<div id="roomOverview"></div>
</section>
<section data-admin-panel="users"><h2>Pending users</h2><div id="pendingUsers"></div></section>
<section data-admin-panel="users"><h2>Users</h2><div id="users"></div></section>
<section id="accountInventorySection" data-admin-panel="users"><h2>All database accounts <span id="inventoryCount" class="muted"></span></h2>
<p class="muted">Complete inventory of user records in the administration database, including pending, disabled, banned and denied accounts. Removed room members can still appear here if their user account exists. Permanently deleted accounts cannot be listed.</p>
<div class="inline" style="flex-wrap:wrap;gap:8px;margin-bottom:10px">
<input id="inventorySearch" type="search" placeholder="Search username, email, ID" aria-label="Search accounts">
<select id="inventoryStatus" aria-label="Filter by account status">
<option value="all">All statuses</option><option value="pending">Pending</option><option value="active">Active</option><option value="disabled">Disabled</option><option value="denied">Denied</option><option value="banned">Banned</option>
</select>
<button id="inventoryRefresh" type="button">Refresh database list</button>
<button id="purgeSelected" type="button" class="danger">Permanently purge selected</button>
</div>
<div id="inventoryError" role="alert" style="color:#f99"></div>
<div id="inventoryTable" style="overflow-x:auto"></div>
</section>
<section id="aiCommandPermissionSection" data-admin-panel="permissions">
<h2>AI Command access</h2>
<p class="muted">Choose which Kronic accounts can chat with the Balroc AI and which can use its tools. Tool access includes actions already enabled in the Balroc harness; it is not a per-device permission system.</p>
<div id="aiAccessError" role="alert" style="color:#f99"></div>
<div id="aiAccessTable" style="overflow-x:auto"></div>
</section>
<section id="rolePermissionSection" data-admin-panel="permissions"><h2>Role permissions</h2>
<p class="muted">Controls what a role can manage inside a chat room. Instance administrators always retain full control. These settings do not grant library playback or change group membership.</p>
<div id="rolePolicyError" role="alert" style="color:#f99"></div>
<div id="rolePolicyMatrix" style="overflow-x:auto"></div>
<div class="inline" style="margin-top:12px"><button id="saveRolePolicy" type="button">Save role permissions</button><button id="reloadRolePolicy" type="button">Reload permissions</button></div>
</section>
<section data-admin-panel="rooms"><h2>Media groups</h2><form id="groupForm" class="inline"><input id="groupName" placeholder="Group name" required><input id="groupSlug" placeholder="group-slug" required><input id="groupMaxUsers" type="number" min="1" value="10" title="Max users"><button>Create group</button></form><div id="groups"></div></section>
<section data-admin-panel="rooms"><h2>Chat rooms</h2>
<p class="muted">A media group does not create a chat room automatically. Create the room here before users can request access to it.</p>
<form id="createRoomForm" class="inline">
<select id="createRoomGroup" aria-label="Parent media group" required></select>
<input id="createRoomName" placeholder="room-name (e.g. kronic)" pattern="[a-z0-9][a-z0-9_-]{2,47}" required maxlength="48">
<input id="createRoomLabel" placeholder="Display name (optional)" maxlength="100">
<select id="createRoomTemplate" aria-label="Room media template"><option value="">No template</option></select><button type="submit">Create room</button>
</form><div id="managedRoomList" class="muted"></div></section>
<section id="roomMembershipSection" data-admin-panel="rooms" class="admin-advanced"><h2>Room memberships <span class="muted">(separate from media groups)</span></h2>
<p class="muted">Groups organize membership and limits. Room roles determine who can manage each chat room. Changes here do not alter group roles.</p>
<form id="roomMemberForm" class="inline">
<select id="instanceRoom" aria-label="Chat room"></select>
<select id="instanceRoomUser" aria-label="Room member"></select>
<select id="instanceRoomRole" aria-label="Room role"><option>member</option><option>moderator</option><option>admin</option><option>owner</option></select>
<button type="submit">Assign / update room role</button>
</form>
<div id="roomMembersAdmin"></div>
</section>
<section data-admin-panel="rooms" class="admin-advanced"><h2>Media group memberships</h2><form id="memberForm" class="inline"><select id="memberGroup"></select><select id="memberUser"></select><select id="memberRole"><option>member</option><option>moderator</option><option>admin</option><option>owner</option></select><button>Assign / update</button></form><p class="muted">These are parent-group roles, not per-room roles. To appoint a room owner, use Room memberships above.</p><div id="memberships"></div></section>
<div id="status"></div>
</main>
</body>
</html>