文件传输12-移除分享会话按钮

This commit is contained in:
celebrateyang 2025-06-05 23:29:26 +08:00
parent 7777566e7a
commit 5e28e7f728
2 changed files with 8 additions and 55 deletions

View File

@ -18,15 +18,10 @@
function handleCreateSession() { function handleCreateSession() {
dispatch('createSession'); dispatch('createSession');
} }
function handleJoinSession() {
function handleJoinSession() {
dispatch('joinSession'); dispatch('joinSession');
} }
function handleShare() {
dispatch('shareSession');
}
function handleCleanup() { function handleCleanup() {
dispatch('cleanup'); dispatch('cleanup');
} }
@ -77,7 +72,6 @@
<div class="session-details"> <div class="session-id"> <div class="session-details"> <div class="session-id">
<span>{$t("clipboard.session_id")}:</span> <span>{$t("clipboard.session_id")}:</span>
<code>{sessionId}</code> <code>{sessionId}</code>
<button class="copy-btn" on:click={handleShare}>📋</button>
</div> </div>
{#if isCreator && sessionId && !peerConnected && qrCodeUrl} <div class="qr-code"> {#if isCreator && sessionId && !peerConnected && qrCodeUrl} <div class="qr-code">
@ -244,6 +238,7 @@
}.session-id { }.session-id {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
gap: 1rem; gap: 1rem;
padding: 1rem; padding: 1rem;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%); background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
@ -278,36 +273,12 @@
letter-spacing: 1px; letter-spacing: 1px;
color: #667eea; color: #667eea;
border: 1px solid rgba(102, 126, 234, 0.3); border: 1px solid rgba(102, 126, 234, 0.3);
font-size: 1.1rem; font-size: 1.1rem; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
flex: 1; flex: 1;
text-align: center; text-align: center;
} .copy-btn {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
border: 1px solid rgba(102, 126, 234, 0.2);
cursor: pointer;
padding: 0.75rem;
border-radius: 10px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
backdrop-filter: blur(8px);
font-size: 1.1rem;
display: flex;
align-items: center;
justify-content: center;
min-width: 44px;
height: 44px;
} }
.copy-btn:hover { .qr-code {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
border-color: rgba(102, 126, 234, 0.4);
transform: translateY(-2px) scale(1.05);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}
.copy-btn:active {
transform: translateY(0) scale(0.95);
} .qr-code {
text-align: center; text-align: center;
padding: 1rem; padding: 1rem;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%); background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
@ -542,13 +513,7 @@
.session-id code { .session-id code {
font-size: 0.95rem; font-size: 0.95rem;
padding: 0.6rem; padding: 0.6rem;
word-break: break-all; word-break: break-all; }
}
.copy-btn {
align-self: center;
min-width: 44px;
}
.qr-code { .qr-code {
max-width: 220px; max-width: 220px;

View File

@ -85,18 +85,12 @@
// Event handlers for components // Event handlers for components
function handleCreateSession() { function handleCreateSession() {
clipboardManager?.createSession(); clipboardManager?.createSession();
} } function handleJoinSession() {
function handleJoinSession() {
if (joinCode.trim()) { if (joinCode.trim()) {
clipboardManager?.joinSession(joinCode.trim()); clipboardManager?.joinSession(joinCode.trim());
} }
} }
function handleShareSession() {
clipboardManager?.shareSession(sessionId);
}
function handleCleanup() { function handleCleanup() {
clipboardManager?.cleanup(); clipboardManager?.cleanup();
} }
@ -264,11 +258,7 @@
<div class="session-management-section"> <div class="session-management-section">
<div class="session-info"> <div class="session-info">
<h3>会话管理</h3> <h3>会话管理</h3>
<p>会话ID: <code>{sessionId}</code></p> <p>会话ID: <code>{sessionId}</code></p> <div class="session-actions">
<div class="session-actions">
<button class="btn-secondary" on:click={handleShareSession}>
分享会话
</button>
<button class="btn-secondary danger" on:click={handleCleanup}> <button class="btn-secondary danger" on:click={handleCleanup}>
断开连接 断开连接
</button> </button>
@ -278,8 +268,7 @@
{:else} {:else}
<!-- Session Management Component - Show when not connected --> <!-- Session Management Component - Show when not connected -->
<SessionManager <SessionManager
{sessionId} {sessionId} {isConnected}
{isConnected}
{isCreating} {isCreating}
{isJoining} {isJoining}
{isCreator} {isCreator}
@ -287,7 +276,6 @@
{qrCodeUrl} {qrCodeUrl}
on:createSession={handleCreateSession} on:createSession={handleCreateSession}
on:joinSession={handleJoinSession} on:joinSession={handleJoinSession}
on:shareSession={handleShareSession}
on:cleanup={handleCleanup} on:cleanup={handleCleanup}
bind:joinCode bind:joinCode
/> />