update layout
This commit is contained in:
@@ -1080,6 +1080,7 @@ function App() {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
/* User Section */
|
||||
<div className="user-section">
|
||||
<div className="user-info">
|
||||
<div className="user-profile">
|
||||
@@ -1187,7 +1188,6 @@ function App() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1197,25 +1197,25 @@ function App() {
|
||||
className={`tab-button ${activeTab === 'comments' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('comments')}
|
||||
>
|
||||
Comments ({comments.filter(shouldShowComment).length})
|
||||
comment ({comments.filter(shouldShowComment).length})
|
||||
</button>
|
||||
<button
|
||||
className={`tab-button ${activeTab === 'ai-chat' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('ai-chat')}
|
||||
>
|
||||
AI Chat ({aiChatHistory.length})
|
||||
chat ({aiChatHistory.length})
|
||||
</button>
|
||||
<button
|
||||
className={`tab-button ${activeTab === 'lang-en' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('lang-en')}
|
||||
>
|
||||
AI Lang:en ({langEnRecords.length})
|
||||
lang:en ({langEnRecords.length})
|
||||
</button>
|
||||
<button
|
||||
className={`tab-button ${activeTab === 'ai-comment' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('ai-comment')}
|
||||
>
|
||||
AI Comment ({aiCommentRecords.length})
|
||||
feedback ({aiCommentRecords.length})
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1534,11 +1534,113 @@ function App() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Show authentication status on non-post pages */}
|
||||
{/* User Section - moved from above */}
|
||||
{user && !appConfig.rkey && (
|
||||
<div className="auth-status">
|
||||
<p>✅ Authenticated as @{user.handle}</p>
|
||||
<p><small>Visit a post page to comment</small></p>
|
||||
<div className="user-section">
|
||||
<div className="user-info">
|
||||
<div className="user-profile">
|
||||
<img
|
||||
src={user.avatar || generatePlaceholderAvatar(user.handle)}
|
||||
alt="User Avatar"
|
||||
className="user-avatar"
|
||||
/>
|
||||
<div className="user-details">
|
||||
<h3>{user.displayName || user.handle}</h3>
|
||||
<p className="user-handle">@{user.handle}</p>
|
||||
<p className="user-did">{user.did}</p>
|
||||
</div>
|
||||
</div>
|
||||
<button onClick={handleLogout} className="logout-button">
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Admin Section - User Management */}
|
||||
{isAdmin(user) && (
|
||||
<div className="admin-section">
|
||||
<h3>管理者機能 - ユーザーリスト管理</h3>
|
||||
|
||||
{/* User List Form */}
|
||||
<div className="user-list-form">
|
||||
<textarea
|
||||
id="user-list-input"
|
||||
name="userList"
|
||||
value={userListInput}
|
||||
onChange={(e) => setUserListInput(e.target.value)}
|
||||
placeholder="ユーザーハンドルをカンマ区切りで入力 例: syui.ai, yui.syui.ai, user.bsky.social"
|
||||
rows={3}
|
||||
disabled={isPostingUserList}
|
||||
/>
|
||||
<div className="form-actions">
|
||||
<span className="admin-hint">カンマ区切りでハンドルを入力してください</span>
|
||||
<button
|
||||
onClick={handlePostUserList}
|
||||
disabled={isPostingUserList || !userListInput.trim()}
|
||||
className="post-button"
|
||||
>
|
||||
{isPostingUserList ? 'Posting...' : 'Post User List'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* User List Records */}
|
||||
<div className="user-list-records">
|
||||
<h4>投稿されたユーザーリスト</h4>
|
||||
{userListRecords.length === 0 ? (
|
||||
<p className="no-user-lists">ユーザーリストがまだ投稿されていません</p>
|
||||
) : (
|
||||
userListRecords.map((record, index) => (
|
||||
<div key={index} className="user-list-item">
|
||||
<div className="user-list-header">
|
||||
<span className="user-list-date">
|
||||
{new Date(record.value.createdAt).toLocaleString()}
|
||||
</span>
|
||||
<div className="user-list-actions">
|
||||
<button
|
||||
onClick={() => toggleJsonDisplay(record.uri)}
|
||||
className="json-button"
|
||||
title="Show/Hide JSON"
|
||||
>
|
||||
{showJsonFor === record.uri ? 'Hide' : 'JSON'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="user-list-content">
|
||||
{record.value.users && record.value.users.length > 0 && (
|
||||
<div className="user-handles">
|
||||
{record.value.users.map((user: any, userIndex: number) => (
|
||||
<span key={userIndex} className="user-handle-tag">
|
||||
@{user.handle}
|
||||
{user.pds && <span className="pds-info"> ({user.pds})</span>}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="user-list-meta">
|
||||
<small>URI: {record.uri}</small>
|
||||
<br />
|
||||
<small>Updated by: {record.value.updatedBy?.handle || 'unknown'}</small>
|
||||
</div>
|
||||
|
||||
{/* JSON Display */}
|
||||
{showJsonFor === record.uri && (
|
||||
<div className="json-display">
|
||||
<h5>JSON Record:</h5>
|
||||
<pre className="json-content">
|
||||
{JSON.stringify(record, null, 2)}
|
||||
</pre>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
@@ -1550,4 +1652,4 @@ function App() {
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
export default App;
|
||||
|
@@ -14,7 +14,7 @@ const response = await fetch(`${aiConfig.host}/api/generate`, {
|
||||
options: {
|
||||
temperature: 0.9,
|
||||
top_p: 0.9,
|
||||
num_predict: 80,
|
||||
num_predict: 200,
|
||||
repeat_penalty: 1.1,
|
||||
}
|
||||
}),
|
||||
|
@@ -199,7 +199,7 @@ Answer:`;
|
||||
options: {
|
||||
temperature: 0.9,
|
||||
top_p: 0.9,
|
||||
num_predict: 80, // Shorter responses for faster generation
|
||||
num_predict: 200, // Longer responses for better answers
|
||||
repeat_penalty: 1.1,
|
||||
}
|
||||
}),
|
||||
|
Reference in New Issue
Block a user