create-interview-cockpit 0.12.0 → 0.13.0
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/package.json +1 -1
- package/template/client/src/App.tsx +30 -1
- package/template/client/src/api.ts +22 -0
- package/template/client/src/components/CodeContextPanel.tsx +0 -622
- package/template/client/src/components/DeploymentLabModal.tsx +1941 -0
- package/template/client/src/components/LabsPanel.tsx +565 -0
- package/template/client/src/components/Sidebar.tsx +97 -55
- package/template/client/src/store.ts +52 -1
- package/template/client/src/types.ts +2 -0
- package/template/cockpit.json +1 -1
- package/template/server/src/index.ts +35 -1
- package/template/server/src/storage.ts +31 -0
package/package.json
CHANGED
|
@@ -3,12 +3,21 @@ import { useStore } from "./store";
|
|
|
3
3
|
import Sidebar from "./components/Sidebar";
|
|
4
4
|
import ChatView from "./components/ChatView";
|
|
5
5
|
import CodeContextPanel from "./components/CodeContextPanel";
|
|
6
|
+
import LabsPanel from "./components/LabsPanel";
|
|
6
7
|
import FileViewerModal from "./components/FileViewerModal";
|
|
7
8
|
import DocRefModal from "./components/DocRefModal";
|
|
8
9
|
import AiSettingsModal from "./components/AiSettingsModal";
|
|
9
10
|
import CodeRunnerModal from "./components/CodeRunnerModal";
|
|
10
11
|
import InfraLabModal from "./components/InfraLabModal";
|
|
11
|
-
import
|
|
12
|
+
import DeploymentLabModal from "./components/DeploymentLabModal";
|
|
13
|
+
import {
|
|
14
|
+
Code,
|
|
15
|
+
FlaskConical,
|
|
16
|
+
Plane,
|
|
17
|
+
PanelLeftClose,
|
|
18
|
+
PanelLeft,
|
|
19
|
+
Settings,
|
|
20
|
+
} from "lucide-react";
|
|
12
21
|
|
|
13
22
|
export default function App() {
|
|
14
23
|
const {
|
|
@@ -21,6 +30,8 @@ export default function App() {
|
|
|
21
30
|
currentQuestion,
|
|
22
31
|
showCodePanel,
|
|
23
32
|
toggleCodePanel,
|
|
33
|
+
showLabsPanel,
|
|
34
|
+
toggleLabsPanel,
|
|
24
35
|
showSidebar,
|
|
25
36
|
toggleSidebar,
|
|
26
37
|
viewingFile,
|
|
@@ -32,6 +43,7 @@ export default function App() {
|
|
|
32
43
|
closeSettings,
|
|
33
44
|
showCodeRunner,
|
|
34
45
|
showInfraLab,
|
|
46
|
+
showDeploymentLab,
|
|
35
47
|
closeCodeRunner,
|
|
36
48
|
} = useStore();
|
|
37
49
|
|
|
@@ -106,6 +118,17 @@ export default function App() {
|
|
|
106
118
|
>
|
|
107
119
|
<Code className="w-4 h-4" />
|
|
108
120
|
</button>
|
|
121
|
+
<button
|
|
122
|
+
onClick={toggleLabsPanel}
|
|
123
|
+
className={`p-1.5 rounded transition-colors ${
|
|
124
|
+
showLabsPanel
|
|
125
|
+
? "bg-violet-500/20 text-violet-400"
|
|
126
|
+
: "text-slate-500 hover:text-slate-300"
|
|
127
|
+
}`}
|
|
128
|
+
title="Toggle labs panel"
|
|
129
|
+
>
|
|
130
|
+
<FlaskConical className="w-4 h-4" />
|
|
131
|
+
</button>
|
|
109
132
|
</div>
|
|
110
133
|
</header>
|
|
111
134
|
|
|
@@ -144,6 +167,11 @@ export default function App() {
|
|
|
144
167
|
<CodeContextPanel />
|
|
145
168
|
</div>
|
|
146
169
|
)}
|
|
170
|
+
{showLabsPanel && (
|
|
171
|
+
<div className="min-h-0 flex overflow-hidden">
|
|
172
|
+
<LabsPanel />
|
|
173
|
+
</div>
|
|
174
|
+
)}
|
|
147
175
|
</div>
|
|
148
176
|
</main>
|
|
149
177
|
|
|
@@ -161,6 +189,7 @@ export default function App() {
|
|
|
161
189
|
{showSettings && <AiSettingsModal />}
|
|
162
190
|
{showCodeRunner && <CodeRunnerModal />}
|
|
163
191
|
{showInfraLab && <InfraLabModal />}
|
|
192
|
+
{showDeploymentLab && <DeploymentLabModal />}
|
|
164
193
|
</div>
|
|
165
194
|
);
|
|
166
195
|
}
|
|
@@ -274,6 +274,28 @@ export async function deleteQuestionFile(
|
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
export async function detachQuestionLabFile(
|
|
278
|
+
questionId: string,
|
|
279
|
+
fileId: string,
|
|
280
|
+
): Promise<ContextFile> {
|
|
281
|
+
const res = await fetch(
|
|
282
|
+
`${BASE}/questions/${questionId}/context-files/${fileId}/detach`,
|
|
283
|
+
{ method: "POST" },
|
|
284
|
+
);
|
|
285
|
+
return res.json();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export async function attachQuestionLabFile(
|
|
289
|
+
questionId: string,
|
|
290
|
+
fileId: string,
|
|
291
|
+
): Promise<ContextFile> {
|
|
292
|
+
const res = await fetch(
|
|
293
|
+
`${BASE}/questions/${questionId}/context-files/${fileId}/attach`,
|
|
294
|
+
{ method: "POST" },
|
|
295
|
+
);
|
|
296
|
+
return res.json();
|
|
297
|
+
}
|
|
298
|
+
|
|
277
299
|
export interface PickableFile {
|
|
278
300
|
fileId: string;
|
|
279
301
|
originalName: string;
|