2
0
Files
logikonline a8d39d6aa5 feat(vault): add file type and enhance token metadata
Add 'file' as a new secret type option in vault templates and locale. Include CreatedUnix and UsedCount fields in token service responses. Refactor vault view template layout to use flexbox for better responsive design and remove version history table from main view.
2026-01-20 23:25:28 -05:00

57 lines
2.4 KiB
Cheetah

{{template "repo/vault/layout_head" (dict "ctxData" . "pageClass" "repository vault new-secret")}}
<div class="ui segment">
<div class="ui two column stackable grid">
<div class="column">
<h4 class="ui header">
{{svg "octicon-plus" 20}} {{ctx.Locale.Tr "vault.new_secret"}}
</h4>
</div>
<div class="column right aligned">
<a class="ui button" href="{{.RepoLink}}/vault">
{{svg "octicon-arrow-left" 16}} {{ctx.Locale.Tr "vault.back_to_list"}}
</a>
</div>
</div>
</div>
<div class="ui segment">
<form class="ui form" action="{{.RepoLink}}/vault/secrets/new" method="post">
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Name}}error{{end}}">
<label>{{ctx.Locale.Tr "vault.secret_name"}}</label>
<input type="text" name="name" value="{{.name}}" placeholder="{{ctx.Locale.Tr "vault.secret_name_placeholder"}}" required pattern="[a-zA-Z][a-zA-Z0-9_-]*" maxlength="100">
<p class="help">{{ctx.Locale.Tr "vault.secret_name_help"}}</p>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "vault.description"}}</label>
<input type="text" name="description" value="{{.description}}" placeholder="{{ctx.Locale.Tr "vault.description_placeholder"}}" maxlength="255">
</div>
<div class="field">
<label>{{ctx.Locale.Tr "vault.type"}}</label>
<select name="type" class="ui dropdown">
<option value="generic">{{ctx.Locale.Tr "vault.type_generic"}}</option>
<option value="password">{{ctx.Locale.Tr "vault.type_password"}}</option>
<option value="api_key">{{ctx.Locale.Tr "vault.type_api_key"}}</option>
<option value="certificate">{{ctx.Locale.Tr "vault.type_certificate"}}</option>
<option value="ssh_key">{{ctx.Locale.Tr "vault.type_ssh_key"}}</option>
<option value="file">{{ctx.Locale.Tr "vault.type_file"}}</option>
</select>
</div>
<div class="required field {{if .Err_Value}}error{{end}}">
<label>{{ctx.Locale.Tr "vault.secret_value"}}</label>
<textarea name="value" rows="4" placeholder="{{ctx.Locale.Tr "vault.value_placeholder"}}" required></textarea>
<p class="help">{{ctx.Locale.Tr "vault.value_help"}}</p>
</div>
<div class="divider"></div>
<button class="ui primary button" type="submit">
{{svg "octicon-lock" 16}} {{ctx.Locale.Tr "vault.create_secret"}}
</button>
<a class="ui button" href="{{.RepoLink}}/vault">
{{ctx.Locale.Tr "cancel"}}
</a>
</form>
</div>
{{template "repo/vault/layout_footer" .}}