Skip to content

Commit

Permalink
feat(xo-web): add warning icon in proxies menu
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierFL committed Dec 13, 2023
1 parent 489ad51 commit 4876663
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [REST API] _VM backup & Replication_ jobs have been moved from `/backup/jobs/:id` to `/backup/jobs/vm/:id` (redirections are in place for compatibility)
- [REST API] _XO config & Pool metadata Backup_ jobs are available at `/backup/jobs/metadata`
- [REST API] _Mirror Backup_ jobs are available at `/backup/jobs/metadata`
- [XO web] Added a warning icon in _Proxies_ menu, if unable to check _Proxy_ upgrade

### Bug fixes

Expand All @@ -38,5 +39,6 @@

- @xen-orchestra/xapi patch
- xo-server minor
- xo-web minor

<!--packages-end-->
1 change: 1 addition & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,7 @@ const messages = {
proxiesNeedUpgrade: 'Some proxies need to be upgraded.',
upgradeNeededForProxies: 'Some proxies need to be upgraded. Click here to get more information.',
xoProxyConcreteGuide: 'XO Proxy: a concrete guide',
proxiesMenuWarning: 'Some proxies have errors',

// ----- Utils -----
secondsFormat: '{seconds, plural, one {# second} other {# seconds}}',
Expand Down
11 changes: 10 additions & 1 deletion packages/xo-web/src/xo-app/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export default class Menu extends Component {
() => this.state.proxyStates,
proxyStates => some(proxyStates, state => state.endsWith('-upgrade-needed'))
)

_areProxiesErrors = createSelector(
() => this.state.proxyStates,
proxyStates => some(proxyStates, state => state === 'error')
)
_checkPermissions = createSelector(
() => this.props.isAdmin,
() => this.props.permissions,
Expand Down Expand Up @@ -468,6 +471,12 @@ export default class Menu extends Component {
]}
/>
</Tooltip>
) : this._areProxiesErrors() ? (
<Tooltip content={_('proxiesMenuWarning')}>
<span className='text-warning'>
<Icon icon='alarm' />
</span>
</Tooltip>
) : null,
],
},
Expand Down

0 comments on commit 4876663

Please sign in to comment.