Skip to content

Commit b79c899

Browse files
committed
refactor(docker): simplify image references and update service configurations
feat(dashboard): add Camera widget and update app definitions fix(i18n): update homepage title for clarity fix(vite): extend service worker denylist to include /xyzen chore(deps): upgrade @sciol/xyzen to version 0.4.3
1 parent 26bbd53 commit b79c899

7 files changed

Lines changed: 111 additions & 37 deletions

File tree

docker/docker-compose.infra.yaml

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: sciol-infra
22
services:
33
network-service:
4-
image: registry.sciol.ac.cn/library/alpine:3.22
4+
image: alpine:3.22
55
ports:
66
# - '${POSTGRES_PORT:-5432}:5432'
77
- '${MINIO_PORT:-9000}:9000'
@@ -16,8 +16,53 @@ services:
1616
networks:
1717
- sciol-network
1818

19+
# nacos:
20+
# image: nacos/nacos-server:v3.0.2
21+
# container_name: sciol-nacos
22+
# pull_policy: if_not_present
23+
# network_mode: 'service:network-service'
24+
# environment:
25+
# - MODE=standalone
26+
# - PREFER_HOST_MODE=hostname
27+
# - NACOS_AUTH_ENABLE=false
28+
# - NACOS_AUTH_TOKEN=012345678901234567890123456789012345678901234567890123456789
29+
# - NACOS_AUTH_IDENTITY_KEY=serverIdentity
30+
# - NACOS_AUTH_IDENTITY_VALUE=security
31+
# # - NACOS_AUTH_ADMIN_USERNAME=nacos
32+
# # - NACOS_AUTH_ADMIN_PASSWORD=nacos
33+
# restart: always
34+
# deploy:
35+
# replicas: ${NACOS_REPLICAS:-1}
36+
# volumes:
37+
# - nacos-data:/home/nacos/data
38+
# - ../infra/nacos/init.sh:/init.sh
39+
# entrypoint: >
40+
# /bin/sh -c "
41+
# /home/nacos/bin/docker-startup.sh &
42+
# pid=$$!
43+
44+
# # 等待 Nacos 启动
45+
# until curl -i http://localhost:8080 > /dev/null 2>&1; do
46+
# echo 'Waiting for Nacos to start...'
47+
# sleep 2
48+
# done
49+
50+
# # 执行初始化脚本
51+
# chmod +x /init.sh
52+
# /init.sh
53+
54+
# wait $$pid
55+
# "
56+
# healthcheck:
57+
# test:
58+
# ['CMD-SHELL', 'curl --fail --silent --max-time 3 http://localhost:8080']
59+
# interval: 30s
60+
# timeout: 5s
61+
# retries: 3
62+
# attach: false
63+
1964
postgresql:
20-
image: registry.sciol.ac.cn/library/postgres:16.8-alpine
65+
image: postgres:16.8-alpine
2166
pull_policy: if_not_present
2267
network_mode: 'service:network-service'
2368
restart: always
@@ -43,7 +88,7 @@ services:
4388
- db-data:/var/lib/postgresql/data
4489

4590
minio:
46-
image: registry.sciol.ac.cn/library/minio
91+
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
4792
container_name: sciol-minio
4893
network_mode: 'service:network-service'
4994
volumes:
@@ -82,6 +127,14 @@ services:
82127
echo 'Bucket casdoor already exists'
83128
fi
84129
130+
# 检查 Xyzen 存储桶是否存在,不存在则创建
131+
if ! mc ls myminio/xyzen > /dev/null 2>&1; then
132+
echo 'Creating bucket xyzen'
133+
mc mb myminio/xyzen
134+
else
135+
echo 'Bucket xyzen already exists'
136+
fi
137+
85138
mc anonymous set download myminio/casdoor
86139
87140
# 检查 Lab 收集存储桶是否启用,启用则创建
@@ -108,7 +161,7 @@ services:
108161
attach: false
109162

110163
redis:
111-
image: registry.sciol.ac.cn/library/redis:7.4.2-alpine
164+
image: redis:7.4.2-alpine
112165
network_mode: 'service:network-service'
113166
restart: always
114167
volumes:
@@ -123,7 +176,7 @@ services:
123176
replicas: ${REDIS_REPLICAS:-1}
124177

125178
casdoor:
126-
image: registry.sciol.ac.cn/library/casdoor:v2.43.0
179+
image: casbin/casdoor:v2.43.0
127180
container_name: sciol-casdoor
128181
network_mode: 'service:network-service'
129182
depends_on:
@@ -150,6 +203,8 @@ volumes:
150203
driver: local
151204
s3_data:
152205
driver: local
206+
# nacos-data:
207+
# driver: local
153208

154209
networks:
155210
sciol-network:

service/pkg/core/schedule/control/control.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func (i *control) Connect(ctx context.Context) {
161161
"ctx": ctx,
162162
"lab_uuid": lab.UUID,
163163
"lab_id": lab.ID,
164+
"lab_user_id": labUser.ID,
164165
}); err != nil {
165166
i.labClient.Delete(lab.UUID)
166167
if err := i.consumer.RemoveUser(ctx, lab.UUID.String()); err != nil {

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@radix-ui/react-slot": "^1.2.4",
2424
"@react-three/drei": "^10.7.6",
2525
"@react-three/fiber": "^9.4.0",
26-
"@sciol/xyzen": "^0.4.1",
26+
"@sciol/xyzen": "^0.4.3",
2727
"@tabler/icons-react": "^3.35.0",
2828
"@tailwindcss/postcss": "^4.1.14",
2929
"@tailwindcss/vite": "^4.1.14",

web/src/app/dashboard/Desktop.tsx

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import {
77
Activity,
88
Bell,
9+
Camera,
910
Cpu,
1011
Home,
1112
MessageSquare,
@@ -163,20 +164,16 @@ const WorkflowsWidget = () => {
163164
);
164165
};
165166

166-
// --- App Definitions ---
167-
type AppId =
168-
| 'nodes'
169-
| 'workflows'
170-
| 'notifications'
171-
| 'news'
172-
| 'activity'
173-
| 'trending'
174-
| 'articles'
175-
| 'home'
176-
| 'environment';
167+
const CameraWidget = () => {
168+
return (
169+
<div className="h-full w-full overflow-hidden">
170+
<CameraMonitor hostId="demo-host" cameraId="camera-1" />
171+
</div>
172+
);
173+
};
177174

178175
interface AppDefinition {
179-
id: AppId;
176+
id: string;
180177
title: string;
181178
icon: React.ReactNode;
182179
component: React.FC | null; // null for simple links like Home
@@ -197,6 +194,16 @@ const APPS: AppDefinition[] = [
197194
defaultHeight: 0,
198195
href: '/dashboard',
199196
},
197+
{
198+
id: 'camera',
199+
title: 'Camera',
200+
icon: (
201+
<Camera className="h-full w-full text-neutral-500 dark:text-neutral-300" />
202+
),
203+
component: CameraWidget,
204+
defaultWidth: 520,
205+
defaultHeight: 360,
206+
},
200207
{
201208
id: 'environment',
202209
title: 'Environment',
@@ -268,8 +275,8 @@ const APPS: AppDefinition[] = [
268275
defaultHeight: 400,
269276
},
270277
{
271-
id: 'articles',
272-
title: 'Articles',
278+
id: 'settings',
279+
title: 'Settings',
273280
icon: (
274281
<MessageSquare className="h-full w-full text-neutral-500 dark:text-neutral-300" />
275282
),
@@ -281,7 +288,7 @@ const APPS: AppDefinition[] = [
281288

282289
interface DesktopWindow {
283290
id: string; // unique instance id
284-
appId: AppId;
291+
appId: string;
285292
x: number;
286293
y: number;
287294
width: number;
@@ -345,6 +352,14 @@ export default function DashboardDesktop() {
345352
[windows, maxZIndex, bringToFront]
346353
);
347354

355+
// const openAppById = useCallback(
356+
// (appId: string) => {
357+
// const app = APPS.find((a) => a.id === appId);
358+
// if (app) openApp(app);
359+
// },
360+
// [openApp]
361+
// );
362+
348363
const closeWindow = useCallback((id: string) => {
349364
setWindows((prev) => prev.filter((w) => w.id !== id));
350365
}, []);
@@ -410,19 +425,20 @@ export default function DashboardDesktop() {
410425
}}
411426
>
412427
{/* Desktop Area */}
413-
<div className="absolute inset-0 z-0">
414-
{/* We could put desktop icons here if we wanted */}
415-
416-
{/* Camera Monitor pinned to background (optional) */}
417-
<div className="absolute top-8 left-8 w-80 opacity-90 hover:opacity-100 transition-opacity">
428+
{/* <div className="absolute inset-0 z-0">
429+
<button
430+
type="button"
431+
onClick={() => openAppById('camera')}
432+
className="absolute top-8 left-8 w-80 opacity-90 hover:opacity-100 transition-opacity text-left"
433+
>
418434
<div className="rounded-xl overflow-hidden shadow-2xl border border-white/20 backdrop-blur-md">
419435
<div className="bg-black/40 p-2 text-white text-xs font-medium">
420436
Camera Feed
421437
</div>
422438
<CameraMonitor hostId="demo-host" cameraId="camera-1" />
423439
</div>
424-
</div>
425-
</div>
440+
</button>
441+
</div> */}
426442

427443
{/* Windows Layer */}
428444
<AnimatePresence>
@@ -526,11 +542,12 @@ export default function DashboardDesktop() {
526542
</AnimatePresence>
527543

528544
{/* Xyzen Side Panel (Global) */}
529-
<div className="relative z-[88888]">
545+
<div className="relative">
530546
<Xyzen
531547
backendUrl={
532548
import.meta.env.DEV ? 'http://localhost:48196' : undefined
533549
}
550+
centeredInputPosition="bottom-right"
534551
/>
535552
</div>
536553

web/src/i18n/en-us/homepage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Find our latest feature update.": "Find our latest feature update. ",
33
"hero": {
4-
"title": "The OS for AI-Driven Labs",
4+
"title": "OpenSource Kernel for AI-Driven Labs",
55
"description": "ScienceOL is building the open-source operating system for the future of automated, AI-powered scientific research. Build, automate, and collaborate.",
66
"button": {
77
"primary": "Get Started",

web/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig(({ command }) => ({
3131
},
3232
workbox: {
3333
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MiB
34-
// 排除 /api 开头的请求,避免 Service Worker 拦截后端接口
34+
// 排除 /api 和 /xyzen 开头的请求,避免 Service Worker 拦截后端接口
3535
navigateFallbackDenylist: [/^\/api/, /^\/xyzen/],
3636
},
3737
}),

web/yarn.lock

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ __metadata:
26612661
languageName: node
26622662
linkType: hard
26632663

2664-
"@radix-ui/react-select@npm:2.2.6":
2664+
"@radix-ui/react-select@npm:2.2.6, @radix-ui/react-select@npm:^2.2.6":
26652665
version: 2.2.6
26662666
resolution: "@radix-ui/react-select@npm:2.2.6"
26672667
dependencies:
@@ -3537,16 +3537,17 @@ __metadata:
35373537
languageName: node
35383538
linkType: hard
35393539

3540-
"@sciol/xyzen@npm:^0.4.1":
3541-
version: 0.4.1
3542-
resolution: "@sciol/xyzen@npm:0.4.1"
3540+
"@sciol/xyzen@npm:^0.4.3":
3541+
version: 0.4.3
3542+
resolution: "@sciol/xyzen@npm:0.4.3"
35433543
dependencies:
35443544
"@dnd-kit/core": "npm:^6.3.1"
35453545
"@dnd-kit/modifiers": "npm:^9.0.0"
35463546
"@emotion/is-prop-valid": "npm:^1.3.1"
35473547
"@headlessui/react": "npm:^2.2.9"
35483548
"@heroicons/react": "npm:^2.2.0"
35493549
"@radix-ui/react-alert-dialog": "npm:^1.1.15"
3550+
"@radix-ui/react-select": "npm:^2.2.6"
35503551
"@radix-ui/react-slot": "npm:^1.2.4"
35513552
"@tabler/icons-react": "npm:^3.35.0"
35523553
"@tailwindcss/vite": "npm:^4.1.11"
@@ -3588,7 +3589,7 @@ __metadata:
35883589
peerDependenciesMeta:
35893590
vite:
35903591
optional: true
3591-
checksum: 10c0/b6625bbe17fb30b0516e5f553195d9181726b4e79393d9e194cea48d5716a07326451c73085dadcedd08c4c64fe8879a02d41ca104a5d42451ba1520e8566706
3592+
checksum: 10c0/9ca01073868ba229dea0c002c418a12007e4a695affbc77ed16e68f133223986d7723305517c6e01b0b5e2981e5d2252260ea0844d99e25cfd66b5b60f30a22e
35923593
languageName: node
35933594
linkType: hard
35943595

@@ -10640,7 +10641,7 @@ __metadata:
1064010641
"@radix-ui/react-slot": "npm:^1.2.4"
1064110642
"@react-three/drei": "npm:^10.7.6"
1064210643
"@react-three/fiber": "npm:^9.4.0"
10643-
"@sciol/xyzen": "npm:^0.4.1"
10644+
"@sciol/xyzen": "npm:^0.4.3"
1064410645
"@tabler/icons-react": "npm:^3.35.0"
1064510646
"@tailwindcss/postcss": "npm:^4.1.14"
1064610647
"@tailwindcss/vite": "npm:^4.1.14"

0 commit comments

Comments
 (0)