mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 19:46:18 +00:00
Update virtual-machines.tsx
This commit is contained in:
@@ -562,6 +562,8 @@ export function VirtualMachines() {
|
|||||||
if (vmDetails?.config?.description) {
|
if (vmDetails?.config?.description) {
|
||||||
const decoded = decodeRecursively(vmDetails.config.description)
|
const decoded = decodeRecursively(vmDetails.config.description)
|
||||||
setEditedNotes(decoded)
|
setEditedNotes(decoded)
|
||||||
|
} else {
|
||||||
|
setEditedNotes("") // Ensure editedNotes is empty if no description exists
|
||||||
}
|
}
|
||||||
setIsEditingNotes(true)
|
setIsEditingNotes(true)
|
||||||
}
|
}
|
||||||
@@ -1155,26 +1157,24 @@ export function VirtualMachines() {
|
|||||||
Resources
|
Resources
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
{vmDetails.config.description && (
|
<Button
|
||||||
<Button
|
variant="outline"
|
||||||
variant="outline"
|
size="sm"
|
||||||
size="sm"
|
onClick={() => setShowNotes(!showNotes)}
|
||||||
onClick={() => setShowNotes(!showNotes)}
|
className="text-xs max-sm:bg-black/5 max-sm:dark:bg-white/5 sm:bg-transparent sm:hover:bg-black/5 sm:dark:hover:bg-white/5"
|
||||||
className="text-xs max-sm:bg-black/5 max-sm:dark:bg-white/5 sm:bg-transparent sm:hover:bg-black/5 sm:dark:hover:bg-white/5"
|
>
|
||||||
>
|
{showNotes ? (
|
||||||
{showNotes ? (
|
<>
|
||||||
<>
|
<ChevronUp className="h-3 w-3 mr-1" />
|
||||||
<ChevronUp className="h-3 w-3 mr-1" />
|
Hide Notes
|
||||||
Hide Notes
|
</>
|
||||||
</>
|
) : (
|
||||||
) : (
|
<>
|
||||||
<>
|
<ChevronDown className="h-3 w-3 mr-1" />
|
||||||
<ChevronDown className="h-3 w-3 mr-1" />
|
Notes
|
||||||
Notes
|
</>
|
||||||
</>
|
)}
|
||||||
)}
|
</Button>
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -1226,7 +1226,7 @@ export function VirtualMachines() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{showNotes && vmDetails.config.description && (
|
{showNotes && (
|
||||||
<div className="mt-6 pt-6 border-t border-border">
|
<div className="mt-6 pt-6 border-t border-border">
|
||||||
<div className="flex items-center justify-between mb-3">
|
<div className="flex items-center justify-between mb-3">
|
||||||
<h4 className="text-sm font-semibold text-muted-foreground uppercase tracking-wide">
|
<h4 className="text-sm font-semibold text-muted-foreground uppercase tracking-wide">
|
||||||
@@ -1271,7 +1271,7 @@ export function VirtualMachines() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : vmDetails.config.description ? (
|
||||||
<>
|
<>
|
||||||
{(() => {
|
{(() => {
|
||||||
const processed = processDescription(vmDetails.config.description)
|
const processed = processDescription(vmDetails.config.description)
|
||||||
@@ -1290,6 +1290,10 @@ export function VirtualMachines() {
|
|||||||
)
|
)
|
||||||
})()}
|
})()}
|
||||||
</>
|
</>
|
||||||
|
) : (
|
||||||
|
<div className="text-sm text-muted-foreground italic">
|
||||||
|
No notes yet. Click Edit to add notes.
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user