Files
threshold-ui/ui/desktop/app/components/settings-card/client-agent/index.hbs
T
Zhihe Li 20e6df522a feat: 🎸 Hide daemon errors initially (#2477)
* feat: 🎸 Hide daemon errors initially

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14961

* feat: 🎸 Move the user and server cards up in settings

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14962
2024-09-24 11:58:26 -04:00

68 lines
1.8 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#if this.isClientAgentActive}}
<SettingsCard
@header={{t 'settings.client-agent.title'}}
@icon='network-alt'
@description={{t 'settings.client-agent.description'}}
>
<:state>
{{#if this.isClientAgentStatusRunning}}
<Hds::Badge
@text={{t 'states.running'}}
@icon='running'
@color='success'
/>
{{else}}
<Hds::Badge
@text={{t 'states.paused'}}
@icon='pause-circle'
@color='neutral'
/>
{{/if}}
</:state>
<:body>
<div>
<Hds::Text::Display>
{{t 'settings.version'}}
</Hds::Text::Display>
<Hds::Text::Body @tag='p' @weight='medium'>
{{@model.clientAgentStatus.version}}
</Hds::Text::Body>
</div>
{{#if @model.clientAgentStatus.errors}}
<Hds::Alert @type='inline' @color='warning' as |A|>
<A.Title>{{t 'settings.alerts.client-agent'}}</A.Title>
<A.Description>
<Hds::Reveal
@text={{t 'actions.show-errors'}}
@textWhenOpen={{t 'actions.hide-errors'}}
>
{{#each @model.clientAgentStatus.errors as |error|}}
<Hds::Text::Body @tag='p'>
{{error.message}}
</Hds::Text::Body>
{{/each}}
</Hds::Reveal>
</A.Description>
</Hds::Alert>
{{/if}}
</:body>
<:action>
<Hds::Button
@text={{t
(if this.isClientAgentStatusRunning 'actions.pause' 'actions.resume')
}}
@color='secondary'
@icon={{this.buttonIcon}}
@size='medium'
disabled={{(is-loading)}}
{{on 'click' this.changeClientAgentState}}
/>
</:action>
</SettingsCard>
{{/if}}