yangdx
commited on
Commit
·
00c75a0
1
Parent(s):
48f887a
Add reset button for edge size
Browse files
lightrag_webui/src/components/graph/Settings.tsx
CHANGED
@@ -313,19 +313,31 @@ export default function Settings() {
|
|
313 |
max={Math.min(maxEdgeSize, 10)}
|
314 |
/>
|
315 |
<span>-</span>
|
316 |
-
<
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
</div>
|
330 |
</div>
|
331 |
|
|
|
313 |
max={Math.min(maxEdgeSize, 10)}
|
314 |
/>
|
315 |
<span>-</span>
|
316 |
+
<div className="flex items-center gap-1">
|
317 |
+
<Input
|
318 |
+
type="number"
|
319 |
+
value={maxEdgeSize}
|
320 |
+
onChange={(e) => {
|
321 |
+
const newValue = Number(e.target.value);
|
322 |
+
if (!isNaN(newValue) && newValue >= minEdgeSize && newValue >= 1 && newValue <= 10) {
|
323 |
+
useSettingsStore.setState({ maxEdgeSize: newValue });
|
324 |
+
}
|
325 |
+
}}
|
326 |
+
className="h-6 w-16 min-w-0 pr-1"
|
327 |
+
min={minEdgeSize}
|
328 |
+
max={10}
|
329 |
+
/>
|
330 |
+
<Button
|
331 |
+
variant="ghost"
|
332 |
+
size="icon"
|
333 |
+
className="h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground"
|
334 |
+
onClick={() => useSettingsStore.setState({ minEdgeSize: 1, maxEdgeSize: 5 })}
|
335 |
+
type="button"
|
336 |
+
title={t('graphPanel.sideBar.settings.resetToDefault')}
|
337 |
+
>
|
338 |
+
<Undo2 className="h-3.5 w-3.5" />
|
339 |
+
</Button>
|
340 |
+
</div>
|
341 |
</div>
|
342 |
</div>
|
343 |
|