fix: session F5, terminal module core, logs proxmox
- router: tryRefresh() au premier chargement → plus besoin de se reconnecter après F5 (user restauré depuis le cookie refresh) - migration 003: terminal marqué is_core=1 + is_enabled=1 - proxmox.go: logs pour diagnostiquer l'erreur 502 (visible dans Paramètres → Logs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
88831e3967
commit
1886071922
3 changed files with 11 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
|
@ -49,12 +50,15 @@ func (h *ProxmoxHandler) initClient() {
|
|||
url, _, _ := h.db.GetSetting("proxmox_url")
|
||||
encryptedToken, _, _ := h.db.GetSetting("proxmox_token")
|
||||
if url == "" || encryptedToken == "" {
|
||||
log.Printf("[proxmox/init] Client non initialisé — proxmox_url=%q token_empty=%v", url, encryptedToken == "")
|
||||
return
|
||||
}
|
||||
token, err := h.encryptor.Decrypt(encryptedToken)
|
||||
if err != nil {
|
||||
log.Printf("[proxmox/init] Impossible de déchiffrer le token : %v", err)
|
||||
return
|
||||
}
|
||||
log.Printf("[proxmox/init] Client initialisé — url=%s", url)
|
||||
h.client = proxmox.NewClient(url, token)
|
||||
}
|
||||
|
||||
|
|
@ -71,6 +75,7 @@ func (h *ProxmoxHandler) GetResources(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
resources, err := h.client.GetResources("")
|
||||
if err != nil {
|
||||
log.Printf("[proxmox/resources] Erreur API : %v", err)
|
||||
JSONError(w, "Erreur API Proxmox : "+err.Error(), http.StatusBadGateway)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
3
backend/internal/db/migrations/003_terminal_core.sql
Normal file
3
backend/internal/db/migrations/003_terminal_core.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- Migration 003 : Terminal marqué comme module CORE actif
|
||||
-- Le terminal SSH est implémenté (api/terminal.go), il doit être core+enabled.
|
||||
UPDATE modules SET is_core = 1, is_enabled = 1 WHERE id = 'terminal';
|
||||
Loading…
Add table
Add a link
Reference in a new issue