UI: Center empty state, add license/version display
- Center "No Secrets" text and description - Show license tier badge and version in header 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -919,6 +919,14 @@ func webListSecrets(lic *license.Manager) http.HandlerFunc {
|
||||
ctx.Data["CanWrite"] = ctx.Repo.CanWrite(unit.TypeCode)
|
||||
ctx.Data["IsRepoAdmin"] = ctx.Repo.IsAdmin()
|
||||
|
||||
// License info for display
|
||||
licInfo := lic.Info()
|
||||
if licInfo != nil {
|
||||
ctx.Data["LicenseTier"] = licInfo.Tier
|
||||
ctx.Data["LicenseValid"] = licInfo.Valid
|
||||
}
|
||||
ctx.Data["VaultVersion"] = "1.0.24"
|
||||
|
||||
ctx.HTML(http.StatusOK, tplVaultList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div class="column right aligned">
|
||||
<span class="tw-mr-4 tw-text-sm tw-text-secondary">
|
||||
{{if .LicenseTier}}
|
||||
<span class="ui label {{if eq .LicenseTier "enterprise"}}purple{{else if eq .LicenseTier "team"}}blue{{else if eq .LicenseTier "pro"}}green{{else}}grey{{end}}">{{.LicenseTier}}</span>
|
||||
{{end}}
|
||||
{{if .VaultVersion}}v{{.VaultVersion}}{{end}}
|
||||
</span>
|
||||
{{if .CanWrite}}
|
||||
<a class="ui primary button" href="{{.RepoLink}}/vault/secrets/new">
|
||||
{{svg "octicon-plus" 16}} {{ctx.Locale.Tr "vault.new_secret"}}
|
||||
@@ -74,14 +80,14 @@
|
||||
</table>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="ui placeholder segment">
|
||||
<div class="ui icon header">
|
||||
<div class="ui placeholder segment tw-text-center">
|
||||
<div class="ui icon header tw-mx-auto">
|
||||
{{svg "octicon-lock" 48}}
|
||||
<h2>{{ctx.Locale.Tr "vault.no_secrets"}}</h2>
|
||||
<p>{{ctx.Locale.Tr "vault.no_secrets_description"}}</p>
|
||||
<h2 class="tw-mt-4">{{ctx.Locale.Tr "vault.no_secrets"}}</h2>
|
||||
<p class="tw-text-secondary">{{ctx.Locale.Tr "vault.no_secrets_description"}}</p>
|
||||
</div>
|
||||
{{if .CanWrite}}
|
||||
<a class="ui primary button" href="{{.RepoLink}}/vault/secrets/new">
|
||||
<a class="ui primary button tw-mt-4" href="{{.RepoLink}}/vault/secrets/new">
|
||||
{{svg "octicon-plus" 16}} {{ctx.Locale.Tr "vault.create_first_secret"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user