diff --git a/resources/views/cloudflare.html b/resources/views/cloudflare.html index 16ce6b3..8f6c778 100644 --- a/resources/views/cloudflare.html +++ b/resources/views/cloudflare.html @@ -262,10 +262,13 @@
-
Token ID:
+
Tipo auth:
Estado:
-
Longitud:
-
Tenía chars sucios:
+
Token ID:
+
Longitud:
+
Email:
+
Tenía chars sucios:
+
@@ -305,12 +308,43 @@
+
- + +
+ + +
+
+ +
+ + +

El email con el que accedes a dash.cloudflare.com

+
+ +
+ -

dash.cloudflare.com → Mi perfil → API Tokens → Crear token

+

+ dash.cloudflare.com → Mi perfil → API Tokens → Crear token +

+

+ dash.cloudflare.com → Mi perfil → API Tokens → Global API Key → View +

@@ -361,23 +395,32 @@ document.addEventListener('alpine:init', () => { diagnosLoading: false, diagnosData: null, diagnosError: '', - cfgForm: { id: 0, api_token: '', account_id: '', nota: '' }, + cfgForm: { + id: {{ if .Config }}{{ .Config.ID }}{{ else }}0{{ end }}, + auth_type: '{{ if .Config }}{{ .Config.AuthType }}{{ else }}token{{ end }}', + api_token: '', + email: '{{ if .Config }}{{ .Config.Email }}{{ else }}{{ end }}', + account_id: '{{ if .Config }}{{ .Config.AccountID }}{{ else }}{{ end }}', + nota: '{{ if .Config }}{{ .Config.Nota }}{{ else }}{{ end }}', + }, toast: { show: false, msg: '', type: 'ok' }, async init() { try { - const [uRes, zRes] = await Promise.all([ - axios.get('/app/cloudflare/user'), - axios.get('/app/cloudflare/zones'), - ]); - this.user = uRes.data.data || {}; + const zRes = await axios.get('/app/cloudflare/zones'); this.zones = zRes.data.data || []; this.hasConfig = true; this.lastFetch = new Date().toLocaleTimeString(); } catch (e) { if (e.response?.status === 503) this.hasConfig = false; else this.hasConfig = true; + return; } + // /user puede fallar para tokens de zona → no bloquea la carga + try { + const uRes = await axios.get('/app/cloudflare/user'); + this.user = uRes.data.data || {}; + } catch (_) {} }, setTab(tab) {