open-vault/ui/app/templates/components/pricing-metrics-config.hbs

75 lines
2.4 KiB
Handlebars
Raw Normal View History

{{#if (eq mode "edit")}}
<form onsubmit={{action "onSaveChanges"}} data-test-pricing-metrics-config-form>
<div class="box is-sideless is-fullwidth is-marginless">
{{message-error model=model errorMessage=error}}
{{#each model.configAttrs as |attr|}}
<FormField
data-test-field
@attr={{attr}}
@model={{model}}
/>
{{/each}}
</div>
<div class="field is-grouped-split box is-fullwidth is-bottomless">
<div class="control">
<button
type="submit"
disabled={{buttonDisabled}}
class="button is-primary"
data-test-edit-metrics-config-save=true
>
Save
</button>
{{#link-to
"vault.cluster.metrics.config"
class="button"
}}
Cancel
{{/link-to}}
</div>
</div>
</form>
<Modal
@title={{modalTitle}}
@onClose={{action (mut modalOpen) false}}
@isActive={{modalOpen}}
@type="warning"
@showCloseButton={{true}}
>
<section class="modal-card-body">
{{#if (eq model.enabled "On")}}
<p class="has-bottom-margin-s">Vault will start tracking data starting from todays date, {{date-format (now) "D MMMM YYYY"}}. You will not be able to see or query usage until the end of the month.</p>
<p>If youve previously enabled usage tracking, that historical data will still be available to you.</p>
{{else}}
<p class="has-bottom-margin-s">Turning usage tracking off means that all data for the current month will be deleted. You will still be able to query previous months.</p>
<p>Are you sure?</p>
{{/if}}
</section>
<footer class="modal-card-foot modal-card-foot-outlined">
<button
class="button is-secondary"
onclick={{action (mut modalOpen) false}}
data-test-metrics-config-cancel
>
Cancel
</button>
<button
class="button is-primary"
onclick={{perform save}}
>
Continue
</button>
</footer>
</Modal>
{{else}}
<div class="tabs-container box is-bottomless is-marginless is-fullwidth is-paddingless" data-test-pricing-metrics-config-table>
{{#each infoRows as |item|}}
{{info-table-row
label=item.label
helperText=item.helperText
value=(get model item.valueKey)
}}
{{/each}}
</div>
{{/if}}