fix(education): ship 0.2.1 drag and Forgejo truth state
This commit is contained in:
parent
84a631d886
commit
28f68fa9ac
15 changed files with 171 additions and 17 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import { useMemo, useState, type MouseEvent } from 'react'
|
||||
import {
|
||||
bundledModules,
|
||||
formatForgejoVersion,
|
||||
parseSheetMetrics,
|
||||
routeInstruction,
|
||||
type InstructionRoute,
|
||||
|
|
@ -72,6 +74,21 @@ function LakeMark() {
|
|||
return <span className="lake-mark" aria-hidden="true"><i /><b /></span>
|
||||
}
|
||||
|
||||
function WindowDragHandle() {
|
||||
const startDragging = (event: MouseEvent<HTMLDivElement>) => {
|
||||
if (event.button !== 0) return
|
||||
event.preventDefault()
|
||||
void getCurrentWindow().startDragging()
|
||||
}
|
||||
|
||||
return <div
|
||||
className="native-drag-handle"
|
||||
data-tauri-drag-region
|
||||
aria-label="拖动窗口"
|
||||
onMouseDown={startDragging}
|
||||
/>
|
||||
}
|
||||
|
||||
function LoginGate({
|
||||
error,
|
||||
loading,
|
||||
|
|
@ -82,8 +99,8 @@ function LoginGate({
|
|||
onConnect: () => void
|
||||
}) {
|
||||
return <main className="login-gate">
|
||||
<WindowDragHandle />
|
||||
<section className="login-window">
|
||||
<div className="window-drag" data-tauri-drag-region />
|
||||
<LakeMark />
|
||||
<p>光湖分域 · 教育行业</p>
|
||||
<h1>进入自己的初始化频道</h1>
|
||||
|
|
@ -117,6 +134,8 @@ function StatusCard({ label, value, detail, tone = 'green' }: {
|
|||
|
||||
function ChannelHome({ snapshot, modules }: { snapshot: ChannelSnapshot; modules: ModuleEntry[] }) {
|
||||
const live = modules.filter((module) => module.state === 'LIVE_STAGE_1').length
|
||||
const brainCandidates = modules.filter((module) => module.group === 'persona-brain').length
|
||||
const liveAgent = modules.some((module) => module.group === 'persona-brain' && module.state === 'LIVE_STAGE_1')
|
||||
const mounted = snapshot.channel.mountedModules?.length ?? 0
|
||||
const repositoryCount = snapshot.codeChannel.repositories?.data?.length ?? 0
|
||||
return <div className="page-stack">
|
||||
|
|
@ -129,7 +148,8 @@ function ChannelHome({ snapshot, modules }: { snapshot: ChannelSnapshot; modules
|
|||
<StatusCard label="个人服务器" value={String(snapshot.node.state ?? '已连接')} detail="身份与现实数据锚点 · XX-GZ-001" />
|
||||
<StatusCard label="第五域协议" value={String(snapshot.fifthDomainLink.state ?? '未知')} detail="上游导航 · JD-FD-PRIMARY" tone="blue" />
|
||||
<StatusCard label="真实能力" value={`${live} 个`} detail={`模板已装配 ${mounted} 个模块地址`} tone="amber" />
|
||||
<StatusCard label="代码频道" value={snapshot.codeChannel.version?.version ?? '未知'} detail={`${repositoryCount} 个服务器内仓库`} tone="blue" />
|
||||
<StatusCard label="代码频道" value={formatForgejoVersion(snapshot.codeChannel.version?.version)} detail={`${repositoryCount} 个服务器内仓库 · Forgejo 数据面`} tone="blue" />
|
||||
<StatusCard label="人格体 Agent" value={liveAgent ? '已接入' : '未接入'} detail={`仅登记 ${brainCandidates} 个研究候选`} tone="amber" />
|
||||
</section>
|
||||
<section className="work-grid">
|
||||
<article className="work-panel">
|
||||
|
|
@ -303,6 +323,7 @@ function App() {
|
|||
if (!snapshot) return <LoginGate error={error} loading={connecting} onConnect={connect} />
|
||||
|
||||
return <main className="education-os">
|
||||
<WindowDragHandle />
|
||||
<aside className="side-rail">
|
||||
<div className="brand"><LakeMark /><span><strong>光湖分域 · 教育</strong><small>EDUCATION SUBDOMAIN OS</small></span></div>
|
||||
<nav>{navigation.map((item) => <button key={item.id} className={surface === item.id ? 'active' : ''} onClick={() => setSurface(item.id)}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue