feat: add E2EE DMs, group chats, local serversettings.json, and security/perf fixes
This commit is contained in:
parent
b60b5a0774
commit
3b52de20d1
33 changed files with 5107 additions and 366 deletions
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<nav class="nav-tabs" id="navTabs">
|
||||
<button class="nav-tab active" data-tab="chat">[1:chat]</button>
|
||||
<button class="nav-tab" data-tab="channels">[2:channels]</button>
|
||||
<button class="nav-tab" data-tab="channels">[2:channels/dms]</button>
|
||||
<button class="nav-tab" data-tab="users">[3:users]</button>
|
||||
<button class="nav-tab" data-tab="files">[4:files]</button>
|
||||
</nav>
|
||||
|
|
@ -56,6 +56,7 @@
|
|||
<span class="user-name" id="currentUsername"></span>
|
||||
<span class="user-role" id="currentUserRole"></span>
|
||||
</div>
|
||||
<button class="btn btn-secondary btn-sm" id="e2eeVaultBtn" title="Manage E2EE PIN Vault & Encryption Settings" style="display:none;">[🔒 E2EE Vault]</button>
|
||||
<button class="btn btn-outline-danger btn-sm" id="logoutBtn" title="Logout">[Disconnect]</button>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -67,13 +68,17 @@
|
|||
<section id="view-chat" class="tab-view active">
|
||||
<div class="chat-header">
|
||||
<div class="channel-info">
|
||||
<span class="channel-hash">#</span>
|
||||
<select class="channel-dropdown" id="channelSelectDropdown" title="Switch Channel">
|
||||
<span class="channel-hash" id="activeConvPrefix">#</span>
|
||||
<select class="channel-dropdown" id="channelSelectDropdown" title="Switch Conversation">
|
||||
<option value="">general</option>
|
||||
</select>
|
||||
<span class="conv-security-badge" id="chatSecurityBadge" style="display:none; cursor:pointer;" title="Click to manage E2EE settings"></span>
|
||||
<span class="channel-topic" id="activeChannelTopic"></span>
|
||||
</div>
|
||||
<div class="chat-header-actions">
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="toggleDmE2eeBtn" style="display:none;" title="Toggle E2EE for this Direct Message">[DM E2EE: ON]</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="inviteGroupBtn" style="display:none;" title="Invite User to Group">[+ Invite]</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" id="leaveGroupBtn" style="display:none;" title="Leave Group">[Leave]</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-members" id="toggleMembersBtn" title="Toggle Online Members">
|
||||
[●] <span class="members-btn-label">Online</span> (<span id="chatHeaderOnlineCount">0</span>)
|
||||
</button>
|
||||
|
|
@ -85,7 +90,7 @@
|
|||
<div class="chat-messages" id="chatMessages">
|
||||
<div class="welcome-message">
|
||||
<div class="welcome-motd" id="welcomeMotd">== Connected to GsDChat ==</div>
|
||||
<div class="welcome-hint">> Select a channel or enter a message below. Type /help for commands.</div>
|
||||
<div class="welcome-hint">> Select a channel, group, or DM below. Type /help for commands.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -112,30 +117,88 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<!-- View 2: Channels View -->
|
||||
<!-- View 2: Channels, Groups & DMs View -->
|
||||
<section id="view-channels" class="tab-view">
|
||||
<div class="view-header">
|
||||
<h2>== SERVER CHANNELS ==</h2>
|
||||
<button class="btn btn-primary" id="openCreateChannelBtn" style="display:none;">[+] Create Channel</button>
|
||||
</div>
|
||||
<div class="channel-list" id="channelList">
|
||||
<!-- Populated by JS -->
|
||||
</div>
|
||||
<div class="conversations-scroll-area">
|
||||
<!-- Server Channels Section -->
|
||||
<div class="view-header">
|
||||
<h2>== SERVER CHANNELS ==</h2>
|
||||
<button class="btn btn-primary btn-sm" id="openCreateChannelBtn" style="display:none;">[+] Create Channel</button>
|
||||
</div>
|
||||
|
||||
<!-- Channel Creation Form -->
|
||||
<div class="card channel-create-card" id="createChannelCard" style="display:none;">
|
||||
<h3>[+] Create New Channel</h3>
|
||||
<div class="form-group">
|
||||
<label for="newChannelName">Channel Name</label>
|
||||
<input type="text" id="newChannelName" placeholder="e.g. gaming, dev, music">
|
||||
<div class="card channel-create-card" id="createChannelCard" style="display:none;">
|
||||
<h3>[+] Create New Channel</h3>
|
||||
<div class="form-group">
|
||||
<label for="newChannelName">Channel Name</label>
|
||||
<input type="text" id="newChannelName" placeholder="e.g. gaming, dev, music">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newChannelTopic">Topic (Optional)</label>
|
||||
<input type="text" id="newChannelTopic" placeholder="Channel description...">
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary" id="submitCreateChannelBtn">[Create]</button>
|
||||
<button class="btn btn-secondary" id="cancelCreateChannelBtn">[Cancel]</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newChannelTopic">Topic (Optional)</label>
|
||||
<input type="text" id="newChannelTopic" placeholder="Channel description...">
|
||||
|
||||
<div class="channel-list" id="channelList">
|
||||
<!-- Populated by JS -->
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary" id="submitCreateChannelBtn">[Create]</button>
|
||||
<button class="btn btn-secondary" id="cancelCreateChannelBtn">[Cancel]</button>
|
||||
|
||||
<!-- Group Chats Section -->
|
||||
<div class="view-header">
|
||||
<h2>== GROUP CHATS <span id="maxGroupUsersHint" class="section-sub-hint">(Max 10 users)</span> ==</h2>
|
||||
<button class="btn btn-primary btn-sm" id="openCreateGroupBtn">[+] Create Group</button>
|
||||
</div>
|
||||
|
||||
<div class="card channel-create-card" id="createGroupCard" style="display:none;">
|
||||
<h3>[+] Create New Group Chat</h3>
|
||||
<div class="form-group">
|
||||
<label for="newGroupName">Group Name</label>
|
||||
<input type="text" id="newGroupName" placeholder="e.g. Squad, Project Alpha">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newGroupMembers">Initial Members (comma-separated usernames)</label>
|
||||
<input type="text" id="newGroupMembers" placeholder="e.g. Bob, Charlie">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newGroupTopic">Topic (Optional)</label>
|
||||
<input type="text" id="newGroupTopic" placeholder="Group topic...">
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary" id="submitCreateGroupBtn">[Create Group]</button>
|
||||
<button class="btn btn-secondary" id="cancelCreateGroupBtn">[Cancel]</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="channel-list" id="groupChatList">
|
||||
<!-- Populated by JS -->
|
||||
</div>
|
||||
|
||||
<!-- Direct Messages Section -->
|
||||
<div class="view-header">
|
||||
<h2>== DIRECT MESSAGES <span id="dmE2eeStatusHint" class="section-sub-hint">[Full E2EE]</span> ==</h2>
|
||||
<div style="display:flex; gap:6px;">
|
||||
<button class="btn btn-secondary btn-sm" id="openE2eeSettingsBtn" title="Manage E2EE PIN & Account Encryption">[🔒 E2EE Vault]</button>
|
||||
<button class="btn btn-primary btn-sm" id="openStartDmBtn">[+] New DM</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card channel-create-card" id="startDmCard" style="display:none;">
|
||||
<h3>[+] Start Direct Message</h3>
|
||||
<div class="form-group">
|
||||
<label for="dmTargetUsername">Recipient Username</label>
|
||||
<input type="text" id="dmTargetUsername" placeholder="Enter @username">
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary" id="submitStartDmBtn">[Open DM]</button>
|
||||
<button class="btn btn-secondary" id="cancelStartDmBtn">[Cancel]</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="channel-list" id="dmList">
|
||||
<!-- Populated by JS -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -170,6 +233,42 @@
|
|||
<!-- Toast Notification Overlay -->
|
||||
<div id="toastContainer" class="toast-container"></div>
|
||||
|
||||
<!-- E2EE PIN / Key Vault Modal -->
|
||||
<div id="e2eeModal" class="modal-backdrop" style="display:none;">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
<div class="modal-badge">[ ZERO-KNOWLEDGE E2EE KEY VAULT ]</div>
|
||||
<h2 id="e2eeModalTitle">Direct Message Encryption</h2>
|
||||
<p class="modal-motd" id="e2eeModalSubtitle">Your E2EE PIN is never sent to the server. It wraps your P-256 keypair so you never lose DM history across devices.</p>
|
||||
</div>
|
||||
|
||||
<div id="e2eeVaultStatusBanner" class="system-notice" style="margin-bottom:12px;">
|
||||
Status: Checking E2EE Key Vault...
|
||||
</div>
|
||||
|
||||
<form id="e2eePinForm" class="auth-form" onsubmit="return false;">
|
||||
<div class="form-group">
|
||||
<label for="e2eePinInput" id="e2eePinLabel">Enter E2EE PIN / Passphrase</label>
|
||||
<input type="password" id="e2eePinInput" placeholder="Enter your dedicated E2EE PIN or passphrase..." autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="auth-error" id="e2eeModalError"></div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-block" id="e2eeSubmitPinBtn">[ Unlock / Initialize E2EE Vault ]</button>
|
||||
</form>
|
||||
|
||||
<div class="form-actions" style="flex-wrap:wrap; margin-top:12px;">
|
||||
<button type="button" class="btn btn-secondary btn-sm" id="e2eeToggleAccountBtn" style="flex:1;">[Account E2EE: ON]</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm" id="e2eeLockDeviceBtn" style="flex:1;">[Lock This Device]</button>
|
||||
<button type="button" class="btn btn-outline-danger btn-sm" id="e2eeResetPinBtn" style="flex:1;" title="Forgot your E2EE PIN? Enter a new PIN above and click here to generate a fresh keypair.">[Reset PIN / New Keys]</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
<button type="button" class="btn btn-secondary btn-block btn-sm" id="e2eeCloseModalBtn">[ Close / Continue ]</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Auth Modal (Login / Register) -->
|
||||
<div id="authModal" class="modal-backdrop">
|
||||
<div class="modal-card">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue