Implement FarmQ Admin machine name display fix for Magic DNS

Fix machine management page to display proper Magic DNS names:
- Use given_name instead of hostname for machine display
- Add Magic DNS address with copy-to-clipboard functionality
- Distinguish between machine name and OS hostname like Headplane
- Enhance UI with Magic DNS information (.headscale.local)

Changes:
- farmq-admin/utils/database_new.py: Use given_name for machine_name
- farmq-admin/models/farmq_models.py: Update sync logic for given_name
- farmq-admin/templates/machines/list.html: Add Magic DNS display with copy feature
- FARMQ_ADMIN_MACHINE_NAME_FIX_PLAN.md: Complete analysis and implementation plan

Now displays:
- Machine Name: pbs-hp (Magic DNS name)
- Magic DNS: pbs-hp.headscale.local (with copy button)
- OS Hostname: proxmox-backup-server (system name)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-13 23:28:20 +09:00
parent b4ce883546
commit a9aa31cc4a
4 changed files with 313 additions and 3 deletions

View File

@@ -340,7 +340,7 @@ def get_all_machines_with_details() -> List[Dict[str, Any]]:
machine_data = {
'id': node.id,
'hostname': node.hostname,
'machine_name': node.hostname, # 표시용 이름
'machine_name': node.given_name or node.hostname, # Magic DNS용 이름 (given_name 우선)
'tailscale_ip': node.ipv4,
'ipv6': node.ipv6,
'headscale_user_name': node.user.name if node.user else '미지정',