Fold the certificate's order log away
The log of the last issuing run is only of interest when something went wrong. It is a collapsed section now, open when the last run failed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
@@ -188,6 +188,7 @@ type certificateData struct {
|
|||||||
Errors FormErrors
|
Errors FormErrors
|
||||||
Providers []DNSProvider
|
Providers []DNSProvider
|
||||||
Status string // the order's last result
|
Status string // the order's last result
|
||||||
|
Failed bool // the last order did not succeed: the log is shown open
|
||||||
Log string
|
Log string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +215,9 @@ func (a *app) certificateData(s Settings, f ACMEForm, errs FormErrors) certifica
|
|||||||
if first := splitList(f.Domains); len(first) > 0 && s.acme().Enabled {
|
if first := splitList(f.Domains); len(first) > 0 && s.acme().Enabled {
|
||||||
unit := "acme-order-renew-" + strings.ToLower(first[0]) + ".service"
|
unit := "acme-order-renew-" + strings.ToLower(first[0]) + ".service"
|
||||||
if st := unitProperty(unit, "ActiveState"); st != "" {
|
if st := unitProperty(unit, "ActiveState"); st != "" {
|
||||||
d.Status = st + ", result " + unitProperty(unit, "Result")
|
res := unitProperty(unit, "Result")
|
||||||
|
d.Status = st + ", result " + res
|
||||||
|
d.Failed = res != "success" || st == "failed"
|
||||||
d.Log, _ = command("journalctl", "--no-pager", "-o", "cat", "-n", "15", "-u", unit)
|
d.Log, _ = command("journalctl", "--no-pager", "-o", "cat", "-n", "15", "-u", unit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,11 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<button>Save</button>
|
<button>Save</button>
|
||||||
</form>
|
</form>
|
||||||
<section>
|
<details{{if .Failed}} open{{end}}>
|
||||||
<h2>Ordering</h2>
|
<summary>Issuing and renewal log{{if .Failed}} (the last run failed){{end}}</summary>
|
||||||
{{if .Status}}<p class="muted">{{.Status}}</p>{{if .Log}}<pre class="log">{{.Log}}</pre>{{end}}
|
{{if .Status}}<p class="muted">{{.Status}}</p>{{if .Log}}<pre class="log">{{.Log}}</pre>{{end}}
|
||||||
{{else}}<p class="muted">Nothing yet. After you save and apply, the router orders the certificate (a minute or two); renewals follow 30 days before it expires and need no restart.</p>{{end}}
|
{{else}}<p class="muted">Nothing yet. After you save and apply, the router orders the certificate (a minute or two); renewals follow 30 days before it expires and need no restart.</p>{{end}}
|
||||||
</section>
|
</details>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
Reference in New Issue
Block a user