Spaces:
Running
Running
Fix bad switch to Pydantic for DirectoryEntry. Fix some TS errors.
Browse files
lynxkite-app/src/lynxkite_app/main.py
CHANGED
@@ -94,11 +94,12 @@ def list_dir(path: str):
|
|
94 |
return sorted(
|
95 |
[
|
96 |
DirectoryEntry(
|
97 |
-
p.relative_to(config.DATA_PATH),
|
98 |
-
"directory" if p.is_dir() else "workspace",
|
99 |
)
|
100 |
for p in path.iterdir()
|
101 |
-
]
|
|
|
102 |
)
|
103 |
|
104 |
|
|
|
94 |
return sorted(
|
95 |
[
|
96 |
DirectoryEntry(
|
97 |
+
name=str(p.relative_to(config.DATA_PATH)),
|
98 |
+
type="directory" if p.is_dir() else "workspace",
|
99 |
)
|
100 |
for p in path.iterdir()
|
101 |
+
],
|
102 |
+
key=lambda x: x.name,
|
103 |
)
|
104 |
|
105 |
|
lynxkite-app/web/src/Directory.tsx
CHANGED
@@ -122,7 +122,9 @@ export default function () {
|
|
122 |
newWorkspaceIn(
|
123 |
path || "",
|
124 |
list.data,
|
125 |
-
|
|
|
|
|
126 |
);
|
127 |
}}
|
128 |
>
|
@@ -151,7 +153,7 @@ export default function () {
|
|
151 |
newFolderIn(
|
152 |
path || "",
|
153 |
list.data,
|
154 |
-
e.target.folderName.value.trim(),
|
155 |
);
|
156 |
}}
|
157 |
>
|
|
|
122 |
newWorkspaceIn(
|
123 |
path || "",
|
124 |
list.data,
|
125 |
+
(
|
126 |
+
e.target as HTMLFormElement
|
127 |
+
).workspaceName.value.trim(),
|
128 |
);
|
129 |
}}
|
130 |
>
|
|
|
153 |
newFolderIn(
|
154 |
path || "",
|
155 |
list.data,
|
156 |
+
(e.target as HTMLFormElement).folderName.value.trim(),
|
157 |
);
|
158 |
}}
|
159 |
>
|