@godscene/visualizer 1.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/es/component/blackboard/highlights.mjs +47 -0
- package/dist/es/component/blackboard/index.css +118 -0
- package/dist/es/component/blackboard/index.mjs +122 -0
- package/dist/es/component/config-selector/index.mjs +251 -0
- package/dist/es/component/context-preview/index.mjs +37 -0
- package/dist/es/component/env-config/index.mjs +237 -0
- package/dist/es/component/env-config-reminder/index.css +30 -0
- package/dist/es/component/env-config-reminder/index.mjs +27 -0
- package/dist/es/component/form-field/index.mjs +158 -0
- package/dist/es/component/history-selector/index.css +237 -0
- package/dist/es/component/history-selector/index.mjs +197 -0
- package/dist/es/component/index.mjs +1 -0
- package/dist/es/component/logo/index.css +19 -0
- package/dist/es/component/logo/index.mjs +20 -0
- package/dist/es/component/logo/logo.mjs +2 -0
- package/dist/es/component/misc/index.mjs +96 -0
- package/dist/es/component/nav-actions/index.mjs +14 -0
- package/dist/es/component/nav-actions/style.css +35 -0
- package/dist/es/component/player/index.css +296 -0
- package/dist/es/component/player/index.mjs +702 -0
- package/dist/es/component/player/playback-controls.mjs +4 -0
- package/dist/es/component/player/report-download.mjs +61 -0
- package/dist/es/component/player/scenes/StepScene.mjs +194 -0
- package/dist/es/component/player/scenes/derive-frame-state.mjs +229 -0
- package/dist/es/component/player/scenes/export-branded-video.mjs +360 -0
- package/dist/es/component/player/scenes/frame-calculator.mjs +149 -0
- package/dist/es/component/player/scenes/playback-frame.mjs +6 -0
- package/dist/es/component/player/scenes/playback-layout.mjs +12 -0
- package/dist/es/component/player/scenes/pointer-layout.mjs +36 -0
- package/dist/es/component/player/use-frame-player.mjs +87 -0
- package/dist/es/component/playground/index.css +930 -0
- package/dist/es/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/es/component/playground-result/index.css +92 -0
- package/dist/es/component/playground-result/index.mjs +232 -0
- package/dist/es/component/prompt-input/index.css +832 -0
- package/dist/es/component/prompt-input/index.mjs +959 -0
- package/dist/es/component/screenshot-viewer/index.css +237 -0
- package/dist/es/component/screenshot-viewer/index.mjs +319 -0
- package/dist/es/component/service-mode-control/index.mjs +107 -0
- package/dist/es/component/shiny-text/index.css +107 -0
- package/dist/es/component/shiny-text/index.mjs +15 -0
- package/dist/es/component/universal-playground/empty-state.mjs +5 -0
- package/dist/es/component/universal-playground/index.css +619 -0
- package/dist/es/component/universal-playground/index.mjs +558 -0
- package/dist/es/component/universal-playground/providers/context-provider.mjs +90 -0
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +280 -0
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +279 -0
- package/dist/es/component/universal-playground/universal-playground-electron.mjs +668 -0
- package/dist/es/hooks/useMinimalTypeGate.mjs +47 -0
- package/dist/es/hooks/usePlaygroundExecution.mjs +435 -0
- package/dist/es/hooks/usePlaygroundState.mjs +278 -0
- package/dist/es/hooks/useSafeOverrideAIConfig.mjs +20 -0
- package/dist/es/hooks/useServerValid.mjs +55 -0
- package/dist/es/hooks/useTheme.mjs +25 -0
- package/dist/es/icons/action-chevron.mjs +61 -0
- package/dist/es/icons/avatar.mjs +70 -0
- package/dist/es/icons/close.mjs +61 -0
- package/dist/es/icons/global-perspective.mjs +58 -0
- package/dist/es/icons/history.mjs +72 -0
- package/dist/es/icons/magnifying-glass.mjs +81 -0
- package/dist/es/icons/player-setting.mjs +68 -0
- package/dist/es/icons/prompt-history.mjs +70 -0
- package/dist/es/icons/setting.mjs +62 -0
- package/dist/es/icons/show-marker.mjs +58 -0
- package/dist/es/index.mjs +26 -0
- package/dist/es/static/image/logo.png +0 -0
- package/dist/es/store/history.mjs +128 -0
- package/dist/es/store/store.mjs +277 -0
- package/dist/es/types.mjs +73 -0
- package/dist/es/utils/action-label.mjs +15 -0
- package/dist/es/utils/color.mjs +35 -0
- package/dist/es/utils/constants.mjs +99 -0
- package/dist/es/utils/device-capabilities.mjs +13 -0
- package/dist/es/utils/empty-state-scroll.mjs +8 -0
- package/dist/es/utils/highlight-element.mjs +62 -0
- package/dist/es/utils/index.mjs +13 -0
- package/dist/es/utils/playground-utils.mjs +43 -0
- package/dist/es/utils/progress-action-icon.mjs +30 -0
- package/dist/es/utils/prompt-input-utils.mjs +49 -0
- package/dist/es/utils/prompt-placeholder.mjs +19 -0
- package/dist/es/utils/replay-scripts.mjs +428 -0
- package/dist/lib/component/blackboard/highlights.js +84 -0
- package/dist/lib/component/blackboard/index.css +118 -0
- package/dist/lib/component/blackboard/index.js +169 -0
- package/dist/lib/component/config-selector/index.js +295 -0
- package/dist/lib/component/context-preview/index.js +82 -0
- package/dist/lib/component/env-config/index.js +271 -0
- package/dist/lib/component/env-config-reminder/index.css +30 -0
- package/dist/lib/component/env-config-reminder/index.js +61 -0
- package/dist/lib/component/form-field/index.js +204 -0
- package/dist/lib/component/history-selector/index.css +237 -0
- package/dist/lib/component/history-selector/index.js +243 -0
- package/dist/lib/component/index.js +58 -0
- package/dist/lib/component/logo/index.css +19 -0
- package/dist/lib/component/logo/index.js +67 -0
- package/dist/lib/component/logo/logo.js +24 -0
- package/dist/lib/component/misc/index.js +152 -0
- package/dist/lib/component/nav-actions/index.js +48 -0
- package/dist/lib/component/nav-actions/style.css +35 -0
- package/dist/lib/component/player/index.css +296 -0
- package/dist/lib/component/player/index.js +747 -0
- package/dist/lib/component/player/playback-controls.js +38 -0
- package/dist/lib/component/player/report-download.js +98 -0
- package/dist/lib/component/player/scenes/StepScene.js +228 -0
- package/dist/lib/component/player/scenes/derive-frame-state.js +266 -0
- package/dist/lib/component/player/scenes/export-branded-video.js +403 -0
- package/dist/lib/component/player/scenes/frame-calculator.js +186 -0
- package/dist/lib/component/player/scenes/playback-frame.js +40 -0
- package/dist/lib/component/player/scenes/playback-layout.js +46 -0
- package/dist/lib/component/player/scenes/pointer-layout.js +88 -0
- package/dist/lib/component/player/use-frame-player.js +121 -0
- package/dist/lib/component/playground/index.css +930 -0
- package/dist/lib/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/lib/component/playground-result/index.css +92 -0
- package/dist/lib/component/playground-result/index.js +276 -0
- package/dist/lib/component/prompt-input/index.css +832 -0
- package/dist/lib/component/prompt-input/index.js +1005 -0
- package/dist/lib/component/screenshot-viewer/index.css +237 -0
- package/dist/lib/component/screenshot-viewer/index.js +353 -0
- package/dist/lib/component/service-mode-control/index.js +141 -0
- package/dist/lib/component/shiny-text/index.css +107 -0
- package/dist/lib/component/shiny-text/index.js +49 -0
- package/dist/lib/component/universal-playground/empty-state.js +39 -0
- package/dist/lib/component/universal-playground/index.css +619 -0
- package/dist/lib/component/universal-playground/index.js +607 -0
- package/dist/lib/component/universal-playground/providers/context-provider.js +133 -0
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +320 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +337 -0
- package/dist/lib/component/universal-playground/universal-playground-electron.js +717 -0
- package/dist/lib/hooks/useMinimalTypeGate.js +81 -0
- package/dist/lib/hooks/usePlaygroundExecution.js +478 -0
- package/dist/lib/hooks/usePlaygroundState.js +312 -0
- package/dist/lib/hooks/useSafeOverrideAIConfig.js +57 -0
- package/dist/lib/hooks/useServerValid.js +89 -0
- package/dist/lib/hooks/useTheme.js +59 -0
- package/dist/lib/icons/action-chevron.js +95 -0
- package/dist/lib/icons/avatar.js +104 -0
- package/dist/lib/icons/close.js +95 -0
- package/dist/lib/icons/global-perspective.js +92 -0
- package/dist/lib/icons/history.js +106 -0
- package/dist/lib/icons/magnifying-glass.js +115 -0
- package/dist/lib/icons/player-setting.js +102 -0
- package/dist/lib/icons/prompt-history.js +104 -0
- package/dist/lib/icons/setting.js +96 -0
- package/dist/lib/icons/show-marker.js +92 -0
- package/dist/lib/index.js +204 -0
- package/dist/lib/static/image/logo.png +0 -0
- package/dist/lib/store/history.js +135 -0
- package/dist/lib/store/store.js +287 -0
- package/dist/lib/types.js +119 -0
- package/dist/lib/utils/action-label.js +52 -0
- package/dist/lib/utils/color.js +75 -0
- package/dist/lib/utils/constants.js +172 -0
- package/dist/lib/utils/device-capabilities.js +50 -0
- package/dist/lib/utils/empty-state-scroll.js +42 -0
- package/dist/lib/utils/highlight-element.js +99 -0
- package/dist/lib/utils/index.js +69 -0
- package/dist/lib/utils/playground-utils.js +86 -0
- package/dist/lib/utils/progress-action-icon.js +67 -0
- package/dist/lib/utils/prompt-input-utils.js +89 -0
- package/dist/lib/utils/prompt-placeholder.js +53 -0
- package/dist/lib/utils/replay-scripts.js +474 -0
- package/dist/types/component/blackboard/highlights.d.ts +11 -0
- package/dist/types/component/blackboard/index.d.ts +10 -0
- package/dist/types/component/config-selector/index.d.ts +15 -0
- package/dist/types/component/context-preview/index.d.ts +9 -0
- package/dist/types/component/env-config/index.d.ts +8 -0
- package/dist/types/component/env-config-reminder/index.d.ts +6 -0
- package/dist/types/component/form-field/index.d.ts +17 -0
- package/dist/types/component/history-selector/index.d.ts +13 -0
- package/dist/types/component/index.d.ts +1 -0
- package/dist/types/component/logo/index.d.ts +5 -0
- package/dist/types/component/misc/index.d.ts +6 -0
- package/dist/types/component/nav-actions/index.d.ts +12 -0
- package/dist/types/component/player/index.d.ts +15 -0
- package/dist/types/component/player/playback-controls.d.ts +1 -0
- package/dist/types/component/player/report-download.d.ts +32 -0
- package/dist/types/component/player/scenes/StepScene.d.ts +9 -0
- package/dist/types/component/player/scenes/derive-frame-state.d.ts +40 -0
- package/dist/types/component/player/scenes/export-branded-video.d.ts +33 -0
- package/dist/types/component/player/scenes/frame-calculator.d.ts +40 -0
- package/dist/types/component/player/scenes/playback-frame.d.ts +3 -0
- package/dist/types/component/player/scenes/playback-layout.d.ts +7 -0
- package/dist/types/component/player/scenes/pointer-layout.d.ts +20 -0
- package/dist/types/component/player/use-frame-player.d.ts +17 -0
- package/dist/types/component/playground-result/index.d.ts +22 -0
- package/dist/types/component/prompt-input/index.d.ts +23 -0
- package/dist/types/component/screenshot-viewer/index.d.ts +23 -0
- package/dist/types/component/service-mode-control/index.d.ts +6 -0
- package/dist/types/component/shiny-text/index.d.ts +12 -0
- package/dist/types/component/universal-playground/empty-state.d.ts +3 -0
- package/dist/types/component/universal-playground/index.d.ts +4 -0
- package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
- package/dist/types/component/universal-playground/providers/indexeddb-storage-provider.d.ts +71 -0
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +58 -0
- package/dist/types/component/universal-playground/universal-playground-electron.d.ts +4 -0
- package/dist/types/hooks/useMinimalTypeGate.d.ts +72 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +40 -0
- package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
- package/dist/types/hooks/useSafeOverrideAIConfig.d.ts +16 -0
- package/dist/types/hooks/useServerValid.d.ts +1 -0
- package/dist/types/hooks/useTheme.d.ts +7 -0
- package/dist/types/index.d.ts +29 -0
- package/dist/types/store/history.d.ts +16 -0
- package/dist/types/store/store.d.ts +57 -0
- package/dist/types/types.d.ts +278 -0
- package/dist/types/utils/action-label.d.ts +11 -0
- package/dist/types/utils/color.d.ts +4 -0
- package/dist/types/utils/constants.d.ts +80 -0
- package/dist/types/utils/device-capabilities.d.ts +9 -0
- package/dist/types/utils/empty-state-scroll.d.ts +11 -0
- package/dist/types/utils/highlight-element.d.ts +3 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/playground-utils.d.ts +11 -0
- package/dist/types/utils/progress-action-icon.d.ts +12 -0
- package/dist/types/utils/prompt-input-utils.d.ts +24 -0
- package/dist/types/utils/prompt-placeholder.d.ts +1 -0
- package/dist/types/utils/replay-scripts.d.ts +50 -0
- package/package.json +82 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
.screenshot-viewer {
|
|
2
|
+
flex-direction: column;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.screenshot-viewer.screen-only {
|
|
8
|
+
min-height: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.screenshot-viewer.screen-only > .screenshot-content {
|
|
12
|
+
flex: 1;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
min-height: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.screenshot-viewer.screen-only > .screenshot-content .screenshot-image {
|
|
20
|
+
object-fit: contain;
|
|
21
|
+
object-position: center center;
|
|
22
|
+
border-radius: 0;
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: none;
|
|
25
|
+
height: 100%;
|
|
26
|
+
max-height: none;
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.screenshot-viewer.offline, .screenshot-viewer.loading, .screenshot-viewer.error {
|
|
31
|
+
text-align: center;
|
|
32
|
+
color: #666;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.screenshot-viewer.offline .screenshot-placeholder h3, .screenshot-viewer.loading .screenshot-placeholder h3, .screenshot-viewer.error .screenshot-placeholder h3 {
|
|
38
|
+
color: #1890ff;
|
|
39
|
+
text-transform: capitalize;
|
|
40
|
+
margin-bottom: 12px;
|
|
41
|
+
font-size: 18px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.screenshot-viewer.offline .screenshot-placeholder p, .screenshot-viewer.loading .screenshot-placeholder p, .screenshot-viewer.error .screenshot-placeholder p {
|
|
45
|
+
color: #666;
|
|
46
|
+
margin: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.screenshot-viewer.offline .screenshot-placeholder p.error-message, .screenshot-viewer.loading .screenshot-placeholder p.error-message, .screenshot-viewer.error .screenshot-placeholder p.error-message {
|
|
50
|
+
color: #ff4d4f;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.screenshot-viewer .screenshot-header {
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
align-items: center;
|
|
56
|
+
height: 56px;
|
|
57
|
+
display: flex;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.screenshot-viewer .screenshot-header .screenshot-title {
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.screenshot-viewer .screenshot-header .screenshot-title h3 {
|
|
67
|
+
color: #000;
|
|
68
|
+
text-transform: capitalize;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 8px;
|
|
71
|
+
margin: 0;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
display: flex;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.screenshot-viewer .screenshot-header .screenshot-title .screenshot-subtitle {
|
|
78
|
+
color: #999;
|
|
79
|
+
margin: 0;
|
|
80
|
+
font-size: 12px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.screenshot-viewer .screenshot-container {
|
|
84
|
+
background: #f2f4f7;
|
|
85
|
+
border-radius: 16px;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
flex: 1;
|
|
88
|
+
padding: 0 15px;
|
|
89
|
+
display: flex;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay {
|
|
94
|
+
z-index: 10;
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
align-items: flex-start;
|
|
97
|
+
padding: 12px 5px 8px;
|
|
98
|
+
display: flex;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .device-name-overlay {
|
|
102
|
+
color: rgba(0, 0, 0, .85);
|
|
103
|
+
text-transform: capitalize;
|
|
104
|
+
align-items: center;
|
|
105
|
+
gap: 8px;
|
|
106
|
+
font-size: 12px;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
display: flex;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .device-name-overlay .info-icon {
|
|
112
|
+
opacity: .8;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .device-name-overlay .info-icon:hover {
|
|
118
|
+
opacity: 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
box-sizing: border-box;
|
|
124
|
+
border-radius: 4px;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: 10px;
|
|
127
|
+
height: 18px;
|
|
128
|
+
padding: 4px 8px;
|
|
129
|
+
display: flex;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .last-update-time {
|
|
133
|
+
color: #666;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
font-size: 12px;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .operation-indicator {
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: 4px;
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
display: flex;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .ant-btn {
|
|
148
|
+
box-shadow: none;
|
|
149
|
+
background: none;
|
|
150
|
+
border: none;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: center;
|
|
153
|
+
width: 16px;
|
|
154
|
+
min-width: 16px;
|
|
155
|
+
height: 16px;
|
|
156
|
+
padding: 0;
|
|
157
|
+
display: flex;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .ant-btn:hover {
|
|
161
|
+
background-color: rgba(0, 0, 0, .06);
|
|
162
|
+
border-radius: 2px;
|
|
163
|
+
transition: all .2s;
|
|
164
|
+
transform: scale(1.1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .ant-btn .anticon {
|
|
168
|
+
color: #666;
|
|
169
|
+
font-size: 12px;
|
|
170
|
+
transition: color .2s;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.screenshot-viewer .screenshot-container .screenshot-content {
|
|
174
|
+
flex: 1;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
align-items: center;
|
|
177
|
+
min-height: 0;
|
|
178
|
+
display: flex;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.screenshot-viewer .screenshot-container .screenshot-content .screenshot-image {
|
|
182
|
+
object-fit: contain;
|
|
183
|
+
border-radius: 12px;
|
|
184
|
+
max-width: 100%;
|
|
185
|
+
height: auto;
|
|
186
|
+
max-height: 100%;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.screenshot-viewer .screenshot-container .screenshot-content .screenshot-placeholder {
|
|
190
|
+
text-align: center;
|
|
191
|
+
color: #999;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
[data-theme="dark"] .screenshot-viewer.offline, [data-theme="dark"] .screenshot-viewer.loading, [data-theme="dark"] .screenshot-viewer.error {
|
|
195
|
+
color: #f8fafd;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[data-theme="dark"] .screenshot-viewer.offline .screenshot-placeholder h3, [data-theme="dark"] .screenshot-viewer.loading .screenshot-placeholder h3, [data-theme="dark"] .screenshot-viewer.error .screenshot-placeholder h3 {
|
|
199
|
+
color: #1890ff;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
[data-theme="dark"] .screenshot-viewer.offline .screenshot-placeholder p, [data-theme="dark"] .screenshot-viewer.loading .screenshot-placeholder p, [data-theme="dark"] .screenshot-viewer.error .screenshot-placeholder p {
|
|
203
|
+
color: #f8fafd;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-theme="dark"] .screenshot-viewer.offline .screenshot-placeholder p.error-message, [data-theme="dark"] .screenshot-viewer.loading .screenshot-placeholder p.error-message, [data-theme="dark"] .screenshot-viewer.error .screenshot-placeholder p.error-message {
|
|
207
|
+
color: #ff4d4f;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-header .screenshot-title h3 {
|
|
211
|
+
color: #f8fafd;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-header .screenshot-title .screenshot-subtitle {
|
|
215
|
+
color: rgba(255, 255, 255, .45);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-container {
|
|
219
|
+
background: #141414;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-container .screenshot-overlay .device-name-overlay, [data-theme="dark"] .screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .last-update-time {
|
|
223
|
+
color: #f8fafd;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .ant-btn:hover {
|
|
227
|
+
background-color: rgba(255, 255, 255, .08);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-container .screenshot-overlay .screenshot-controls .ant-btn .anticon {
|
|
231
|
+
color: #f8fafd;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
[data-theme="dark"] .screenshot-viewer .screenshot-container .screenshot-content .screenshot-placeholder {
|
|
235
|
+
color: rgba(255, 255, 255, .45);
|
|
236
|
+
}
|
|
237
|
+
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InfoCircleOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
3
|
+
import { Button, Spin, Tooltip } from "antd";
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import "./index.css";
|
|
6
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7
|
+
try {
|
|
8
|
+
var info = gen[key](arg);
|
|
9
|
+
var value = info.value;
|
|
10
|
+
} catch (error) {
|
|
11
|
+
reject(error);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (info.done) resolve(value);
|
|
15
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
16
|
+
}
|
|
17
|
+
function _async_to_generator(fn) {
|
|
18
|
+
return function() {
|
|
19
|
+
var self = this, args = arguments;
|
|
20
|
+
return new Promise(function(resolve, reject) {
|
|
21
|
+
var gen = fn.apply(self, args);
|
|
22
|
+
function _next(value) {
|
|
23
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
24
|
+
}
|
|
25
|
+
function _throw(err) {
|
|
26
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
27
|
+
}
|
|
28
|
+
_next(void 0);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating = false, mjpegUrl, mode = 'default' }) {
|
|
33
|
+
const [screenshot, setScreenshot] = useState(null);
|
|
34
|
+
const [loading, setLoading] = useState(false);
|
|
35
|
+
const [error, setError] = useState(null);
|
|
36
|
+
const [lastUpdateTime, setLastUpdateTime] = useState(0);
|
|
37
|
+
const [interfaceInfo, setInterfaceInfo] = useState(null);
|
|
38
|
+
const [mjpegRetryToken, setMjpegRetryToken] = useState('');
|
|
39
|
+
const mjpegImageRef = useRef(null);
|
|
40
|
+
const isMjpeg = Boolean(mjpegUrl && serverOnline);
|
|
41
|
+
const showChrome = 'screen-only' !== mode;
|
|
42
|
+
const rootClassName = [
|
|
43
|
+
'screenshot-viewer',
|
|
44
|
+
'screen-only' === mode && 'screen-only'
|
|
45
|
+
].filter(Boolean).join(' ');
|
|
46
|
+
const pollingIntervalRef = useRef(null);
|
|
47
|
+
const isPollingPausedRef = useRef(false);
|
|
48
|
+
useEffect(()=>{
|
|
49
|
+
if (!isMjpeg) return;
|
|
50
|
+
const timer = window.setTimeout(()=>{
|
|
51
|
+
const image = mjpegImageRef.current;
|
|
52
|
+
if (!image || image.naturalWidth > 0 || image.naturalHeight > 0) return;
|
|
53
|
+
setMjpegRetryToken(String(Date.now()));
|
|
54
|
+
}, 2500);
|
|
55
|
+
return ()=>window.clearTimeout(timer);
|
|
56
|
+
}, [
|
|
57
|
+
isMjpeg,
|
|
58
|
+
mjpegRetryToken,
|
|
59
|
+
mjpegUrl
|
|
60
|
+
]);
|
|
61
|
+
const fetchScreenshot = useCallback((isManual = false)=>_async_to_generator(function*() {
|
|
62
|
+
if (!serverOnline) return;
|
|
63
|
+
setLoading(true);
|
|
64
|
+
if (isManual) setError(null);
|
|
65
|
+
try {
|
|
66
|
+
const result = yield getScreenshot();
|
|
67
|
+
console.log('Screenshot API response:', result);
|
|
68
|
+
if (null == result ? void 0 : result.screenshot) {
|
|
69
|
+
const screenshotData = result.screenshot.toString().trim();
|
|
70
|
+
if (screenshotData) {
|
|
71
|
+
setScreenshot(screenshotData);
|
|
72
|
+
setError(null);
|
|
73
|
+
setLastUpdateTime(Date.now());
|
|
74
|
+
} else setError('Empty screenshot data received');
|
|
75
|
+
} else setError('No screenshot data in response');
|
|
76
|
+
} catch (err) {
|
|
77
|
+
console.error('Screenshot fetch error:', err);
|
|
78
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch screenshot');
|
|
79
|
+
} finally{
|
|
80
|
+
setLoading(false);
|
|
81
|
+
}
|
|
82
|
+
})(), [
|
|
83
|
+
getScreenshot,
|
|
84
|
+
serverOnline
|
|
85
|
+
]);
|
|
86
|
+
const fetchInterfaceInfo = useCallback(()=>_async_to_generator(function*() {
|
|
87
|
+
if (!serverOnline || !getInterfaceInfo) return;
|
|
88
|
+
try {
|
|
89
|
+
const info = yield getInterfaceInfo();
|
|
90
|
+
if (info) setInterfaceInfo(info);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
console.error('Interface info fetch error:', err);
|
|
93
|
+
}
|
|
94
|
+
})(), [
|
|
95
|
+
getInterfaceInfo,
|
|
96
|
+
serverOnline
|
|
97
|
+
]);
|
|
98
|
+
const startPolling = useCallback(()=>{
|
|
99
|
+
if (pollingIntervalRef.current) clearInterval(pollingIntervalRef.current);
|
|
100
|
+
console.log('Starting screenshot polling (5s interval)');
|
|
101
|
+
pollingIntervalRef.current = setInterval(()=>{
|
|
102
|
+
if (!isPollingPausedRef.current && serverOnline) fetchScreenshot(false);
|
|
103
|
+
}, 5000);
|
|
104
|
+
}, [
|
|
105
|
+
fetchScreenshot,
|
|
106
|
+
serverOnline
|
|
107
|
+
]);
|
|
108
|
+
const stopPolling = useCallback(()=>{
|
|
109
|
+
if (pollingIntervalRef.current) {
|
|
110
|
+
console.log('Stopping screenshot polling');
|
|
111
|
+
clearInterval(pollingIntervalRef.current);
|
|
112
|
+
pollingIntervalRef.current = null;
|
|
113
|
+
}
|
|
114
|
+
}, []);
|
|
115
|
+
const pausePolling = useCallback(()=>{
|
|
116
|
+
console.log('Pausing screenshot polling');
|
|
117
|
+
isPollingPausedRef.current = true;
|
|
118
|
+
}, []);
|
|
119
|
+
const resumePolling = useCallback(()=>{
|
|
120
|
+
console.log('Resuming screenshot polling');
|
|
121
|
+
isPollingPausedRef.current = false;
|
|
122
|
+
}, []);
|
|
123
|
+
const handleManualRefresh = useCallback(()=>{
|
|
124
|
+
fetchScreenshot(true);
|
|
125
|
+
}, [
|
|
126
|
+
fetchScreenshot
|
|
127
|
+
]);
|
|
128
|
+
useEffect(()=>{
|
|
129
|
+
if (!serverOnline) {
|
|
130
|
+
setScreenshot(null);
|
|
131
|
+
setError(null);
|
|
132
|
+
setInterfaceInfo(null);
|
|
133
|
+
stopPolling();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
fetchInterfaceInfo();
|
|
137
|
+
if (isMjpeg) return void stopPolling();
|
|
138
|
+
fetchScreenshot(false);
|
|
139
|
+
startPolling();
|
|
140
|
+
return ()=>{
|
|
141
|
+
stopPolling();
|
|
142
|
+
};
|
|
143
|
+
}, [
|
|
144
|
+
serverOnline,
|
|
145
|
+
isMjpeg,
|
|
146
|
+
startPolling,
|
|
147
|
+
stopPolling,
|
|
148
|
+
fetchScreenshot,
|
|
149
|
+
fetchInterfaceInfo
|
|
150
|
+
]);
|
|
151
|
+
useEffect(()=>{
|
|
152
|
+
if (!serverOnline || isMjpeg) return;
|
|
153
|
+
if (isUserOperating) pausePolling();
|
|
154
|
+
else {
|
|
155
|
+
resumePolling();
|
|
156
|
+
fetchScreenshot(false);
|
|
157
|
+
}
|
|
158
|
+
}, [
|
|
159
|
+
isUserOperating,
|
|
160
|
+
pausePolling,
|
|
161
|
+
resumePolling,
|
|
162
|
+
fetchScreenshot,
|
|
163
|
+
serverOnline,
|
|
164
|
+
isMjpeg
|
|
165
|
+
]);
|
|
166
|
+
useEffect(()=>()=>{
|
|
167
|
+
stopPolling();
|
|
168
|
+
}, [
|
|
169
|
+
stopPolling
|
|
170
|
+
]);
|
|
171
|
+
if (!serverOnline) return /*#__PURE__*/ jsx("div", {
|
|
172
|
+
className: `${rootClassName} offline`,
|
|
173
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
174
|
+
className: "screenshot-placeholder",
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ jsx("h3", {
|
|
177
|
+
children: "\uD83D\uDCF1 Screen Preview"
|
|
178
|
+
}),
|
|
179
|
+
/*#__PURE__*/ jsx("p", {
|
|
180
|
+
children: "Start the playground server to see real-time screenshots"
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
if (!isMjpeg && loading && !screenshot) return /*#__PURE__*/ jsxs("div", {
|
|
186
|
+
className: `${rootClassName} loading`,
|
|
187
|
+
children: [
|
|
188
|
+
/*#__PURE__*/ jsx(Spin, {
|
|
189
|
+
size: "large"
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ jsx("p", {
|
|
192
|
+
children: "Loading screenshot..."
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
});
|
|
196
|
+
if (!isMjpeg && error && !screenshot) return /*#__PURE__*/ jsx("div", {
|
|
197
|
+
className: `${rootClassName} error`,
|
|
198
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
199
|
+
className: "screenshot-placeholder",
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ jsx("h3", {
|
|
202
|
+
children: "\uD83D\uDCF1 Screen Preview"
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ jsx("p", {
|
|
205
|
+
className: "error-message",
|
|
206
|
+
children: error
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
const formatLastUpdateTime = (timestamp)=>{
|
|
212
|
+
if (!timestamp) return '';
|
|
213
|
+
const now = Date.now();
|
|
214
|
+
const diff = Math.floor((now - timestamp) / 1000);
|
|
215
|
+
if (diff < 60) return `${diff}s ago`;
|
|
216
|
+
if (diff < 3600) return `${Math.floor(diff / 60)}m ago`;
|
|
217
|
+
return new Date(timestamp).toLocaleTimeString();
|
|
218
|
+
};
|
|
219
|
+
const screenshotContent = /*#__PURE__*/ jsx("div", {
|
|
220
|
+
className: "screenshot-content",
|
|
221
|
+
children: isMjpeg ? /*#__PURE__*/ jsx("img", {
|
|
222
|
+
ref: mjpegImageRef,
|
|
223
|
+
src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
|
|
224
|
+
alt: "Device Live Stream",
|
|
225
|
+
className: "screenshot-image",
|
|
226
|
+
onError: ()=>{
|
|
227
|
+
window.setTimeout(()=>setMjpegRetryToken(String(Date.now())), 500);
|
|
228
|
+
}
|
|
229
|
+
}, mjpegRetryToken || 'initial') : screenshot ? /*#__PURE__*/ jsx("img", {
|
|
230
|
+
src: screenshot.startsWith('data:image/') ? screenshot : `data:image/png;base64,${screenshot}`,
|
|
231
|
+
alt: "Device Screenshot",
|
|
232
|
+
className: "screenshot-image",
|
|
233
|
+
onLoad: ()=>console.log('Screenshot image loaded successfully'),
|
|
234
|
+
onError: (e)=>{
|
|
235
|
+
console.error('Screenshot image load error:', e);
|
|
236
|
+
console.error('Screenshot data preview:', screenshot.substring(0, 100));
|
|
237
|
+
setError('Failed to load screenshot image');
|
|
238
|
+
}
|
|
239
|
+
}) : /*#__PURE__*/ jsx("div", {
|
|
240
|
+
className: "screenshot-placeholder",
|
|
241
|
+
children: /*#__PURE__*/ jsx("p", {
|
|
242
|
+
children: "No screenshot available"
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
if (!showChrome) return /*#__PURE__*/ jsx("div", {
|
|
247
|
+
className: rootClassName,
|
|
248
|
+
children: screenshotContent
|
|
249
|
+
});
|
|
250
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
251
|
+
className: rootClassName,
|
|
252
|
+
children: [
|
|
253
|
+
/*#__PURE__*/ jsx("div", {
|
|
254
|
+
className: "screenshot-header",
|
|
255
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
256
|
+
className: "screenshot-title",
|
|
257
|
+
children: /*#__PURE__*/ jsx("h3", {
|
|
258
|
+
children: (null == interfaceInfo ? void 0 : interfaceInfo.type) ? interfaceInfo.type : 'Device Name'
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
}),
|
|
262
|
+
/*#__PURE__*/ jsxs("div", {
|
|
263
|
+
className: "screenshot-container",
|
|
264
|
+
children: [
|
|
265
|
+
/*#__PURE__*/ jsxs("div", {
|
|
266
|
+
className: "screenshot-overlay",
|
|
267
|
+
children: [
|
|
268
|
+
/*#__PURE__*/ jsxs("div", {
|
|
269
|
+
className: "device-name-overlay",
|
|
270
|
+
children: [
|
|
271
|
+
"Device Name",
|
|
272
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
273
|
+
title: null == interfaceInfo ? void 0 : interfaceInfo.description,
|
|
274
|
+
children: /*#__PURE__*/ jsx(InfoCircleOutlined, {
|
|
275
|
+
size: 16,
|
|
276
|
+
className: "info-icon"
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}),
|
|
281
|
+
!isMjpeg && /*#__PURE__*/ jsxs("div", {
|
|
282
|
+
className: "screenshot-controls",
|
|
283
|
+
children: [
|
|
284
|
+
lastUpdateTime > 0 && /*#__PURE__*/ jsxs("span", {
|
|
285
|
+
className: "last-update-time",
|
|
286
|
+
children: [
|
|
287
|
+
"Last updated ",
|
|
288
|
+
formatLastUpdateTime(lastUpdateTime)
|
|
289
|
+
]
|
|
290
|
+
}),
|
|
291
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
292
|
+
title: "Refresh screenshot",
|
|
293
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
294
|
+
icon: /*#__PURE__*/ jsx(ReloadOutlined, {}),
|
|
295
|
+
onClick: handleManualRefresh,
|
|
296
|
+
loading: loading,
|
|
297
|
+
size: "small"
|
|
298
|
+
})
|
|
299
|
+
}),
|
|
300
|
+
isUserOperating && /*#__PURE__*/ jsxs("span", {
|
|
301
|
+
className: "operation-indicator",
|
|
302
|
+
children: [
|
|
303
|
+
/*#__PURE__*/ jsx(Spin, {
|
|
304
|
+
size: "small"
|
|
305
|
+
}),
|
|
306
|
+
" Operating..."
|
|
307
|
+
]
|
|
308
|
+
})
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
}),
|
|
313
|
+
screenshotContent
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
export { ScreenshotViewer as default };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PlaygroundSDK } from "@godscene/playground";
|
|
3
|
+
import { Button, Tooltip, message } from "antd";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { safeOverrideAIConfig } from "../../hooks/useSafeOverrideAIConfig.mjs";
|
|
6
|
+
import { useServerValid } from "../../hooks/useServerValid.mjs";
|
|
7
|
+
import { useEnvConfig } from "../../store/store.mjs";
|
|
8
|
+
import { EnvConfig } from "../env-config/index.mjs";
|
|
9
|
+
import { iconForStatus } from "../misc/index.mjs";
|
|
10
|
+
const TITLE_TEXT = {
|
|
11
|
+
Server: 'Server Status',
|
|
12
|
+
'In-Browser': 'In-Browser'
|
|
13
|
+
};
|
|
14
|
+
const SWITCH_BUTTON_TEXT = {
|
|
15
|
+
Server: 'Switch to In-Browser Mode',
|
|
16
|
+
'In-Browser': 'Switch to Server Mode'
|
|
17
|
+
};
|
|
18
|
+
const ServiceModeControl = ({ serviceMode })=>{
|
|
19
|
+
const { setServiceMode, config } = useEnvConfig();
|
|
20
|
+
const serverValid = useServerValid('Server' === serviceMode);
|
|
21
|
+
const renderServerTip = ()=>{
|
|
22
|
+
if (serverValid) return /*#__PURE__*/ jsx(Tooltip, {
|
|
23
|
+
title: "Connected",
|
|
24
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
25
|
+
className: "server-tip",
|
|
26
|
+
children: iconForStatus('connected')
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
30
|
+
title: "Connection failed",
|
|
31
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
32
|
+
className: "server-tip",
|
|
33
|
+
children: iconForStatus('failed')
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const renderSwitchButton = ()=>{
|
|
38
|
+
const nextMode = 'Server' === serviceMode ? 'In-Browser' : 'Server';
|
|
39
|
+
const buttonText = SWITCH_BUTTON_TEXT[serviceMode];
|
|
40
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
41
|
+
title: /*#__PURE__*/ jsxs("span", {
|
|
42
|
+
children: [
|
|
43
|
+
"Server Mode: send the request through the server ",
|
|
44
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
45
|
+
"In-Browser Mode: send the request through the browser fetch API (The AI service should support CORS in this case)"
|
|
46
|
+
]
|
|
47
|
+
}),
|
|
48
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
49
|
+
type: "link",
|
|
50
|
+
onClick: (e)=>{
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
setServiceMode(nextMode);
|
|
53
|
+
},
|
|
54
|
+
children: buttonText
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
useEffect(()=>{
|
|
59
|
+
safeOverrideAIConfig(config, false, false);
|
|
60
|
+
if ('Server' === serviceMode) {
|
|
61
|
+
const playgroundSDK = new PlaygroundSDK({
|
|
62
|
+
type: 'remote-execution'
|
|
63
|
+
});
|
|
64
|
+
playgroundSDK.overrideConfig(config).catch((error)=>{
|
|
65
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
66
|
+
message.error(`Failed to apply AI configuration: ${errorMsg}`);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [
|
|
70
|
+
config,
|
|
71
|
+
serviceMode,
|
|
72
|
+
serverValid
|
|
73
|
+
]);
|
|
74
|
+
const statusContent = 'Server' === serviceMode && renderServerTip();
|
|
75
|
+
const title = TITLE_TEXT[serviceMode];
|
|
76
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
77
|
+
children: [
|
|
78
|
+
/*#__PURE__*/ jsxs("div", {
|
|
79
|
+
style: {
|
|
80
|
+
display: 'flex',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
justifyContent: 'space-between',
|
|
83
|
+
gap: '10px'
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ jsx("h3", {
|
|
87
|
+
style: {
|
|
88
|
+
whiteSpace: 'nowrap',
|
|
89
|
+
margin: 0,
|
|
90
|
+
flexShrink: 0
|
|
91
|
+
},
|
|
92
|
+
children: title
|
|
93
|
+
}),
|
|
94
|
+
statusContent,
|
|
95
|
+
/*#__PURE__*/ jsx(EnvConfig, {
|
|
96
|
+
showTooltipWhenEmpty: 'Server' !== serviceMode
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ jsx("div", {
|
|
101
|
+
className: "switch-btn-wrapper",
|
|
102
|
+
children: renderSwitchButton()
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
export { ServiceModeControl };
|