From 545ad63b507704f79b4a7d1506087db08f59f4b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Nov 2025 14:00:16 +0000 Subject: [PATCH] Sort VM list by vmid for better readability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VM 목록을 vmid 순서로 정렬: - running_vms.sort(key=lambda x: x['vmid']) 추가 - 201, 202, 203 순서로 표시되도록 개선 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- VNC/pharmq-novnc-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VNC/pharmq-novnc-setup.sh b/VNC/pharmq-novnc-setup.sh index 741addd..784e8e6 100755 --- a/VNC/pharmq-novnc-setup.sh +++ b/VNC/pharmq-novnc-setup.sh @@ -114,11 +114,13 @@ get_vm_list_from_api() { "https://${pve_host}:8006/api2/json/nodes/${node_name}/qemu" \ --cookie "PVEAuthCookie=${ticket}") - # VM 목록 파싱 (running 상태만) + # VM 목록 파싱 (running 상태만, vmid 순서로 정렬) VM_LIST=$(echo "$vms_response" | python3 -c " import sys, json vms = json.load(sys.stdin)['data'] running_vms = [vm for vm in vms if vm.get('status') == 'running'] +# vmid 순서로 정렬 +running_vms.sort(key=lambda x: x['vmid']) for vm in running_vms: print(f\"{vm['vmid']}:{vm.get('name', 'VM-' + str(vm['vmid']))}\") " 2>/dev/null || echo "")