From 4e6c507ba9ae20d31fc3e67d6dbfca055618f692 Mon Sep 17 00:00:00 2001 From: HamadaBrest Date: Wed, 23 Oct 2019 12:09:11 +0200 Subject: [PATCH] feat(xo-web/hub): extra hub template info (#4593) See xoa#35 --- CHANGELOG.unreleased.md | 1 + packages/xo-web/src/common/intl/messages.js | 4 + packages/xo-web/src/icons.scss | 9 ++ packages/xo-web/src/xo-app/hub/resource.js | 109 +++++++++++++++++--- 4 files changed, 111 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index e9d76674b..b93710939 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -12,6 +12,7 @@ > Users must be able to say: “Nice enhancement, I'm eager to test it” - [Hub] Ability to select SR in hub VM installation (PR [#4571](https://github.com/vatesfr/xen-orchestra/pull/4571)) +- [Hub] Display more info about downloadable templates (PR [#4593](https://github.com/vatesfr/xen-orchestra/pull/4593)) ### Bug fixes diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index bfdba2eb5..96d0ee2a6 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -17,6 +17,7 @@ const messages = { notifications: 'Notifications', noNotifications: 'No notifications so far.', notificationNew: 'NEW!', + moreDetails: 'More details', messageSubject: 'Subject', messageFrom: 'From', messageReply: 'Reply', @@ -2154,6 +2155,7 @@ const messages = { // Hub hubPage: 'Hub', + noDefaultSr: 'The selected pool has no default SR', successfulInstall: 'VM installed successfully', vmNoAvailable: 'No VMs available ', create: 'Create', @@ -2164,6 +2166,8 @@ const messages = { totalDiskSize: 'Total disk size', hideInstalledPool: 'Already installed templates are hidden', hubImportNotificationTitle: 'XVA import', + hubTemplateDescriptionNotAvailable: + 'No description available for this template', // Licenses xosanUnregisteredDisclaimer: diff --git a/packages/xo-web/src/icons.scss b/packages/xo-web/src/icons.scss index bf142f75c..50b273357 100644 --- a/packages/xo-web/src/icons.scss +++ b/packages/xo-web/src/icons.scss @@ -49,6 +49,15 @@ @extend .fa-check; @extend .text-success; } + &-true { + @extend .fa; + @extend .fa-check; + @extend .text-success; + } + &-false { + @extend .fa; + @extend .fa-times; + } &-undo { @extend .fa; @extend .fa-undo; diff --git a/packages/xo-web/src/xo-app/hub/resource.js b/packages/xo-web/src/xo-app/hub/resource.js index abf686495..8961fa113 100644 --- a/packages/xo-web/src/xo-app/hub/resource.js +++ b/packages/xo-web/src/xo-app/hub/resource.js @@ -3,6 +3,7 @@ import ActionButton from 'action-button' import decorate from 'apply-decorators' import defined from '@xen-orchestra/defined' import Icon from 'icon' +import marked from 'marked' import React from 'react' import { Card, CardBlock, CardHeader } from 'card' import { Col, Row } from 'grid' @@ -11,12 +12,21 @@ import { connectStore, formatSize, getXoaPlan } from 'utils' import { createGetObjectsOfType } from 'selectors' import { downloadAndInstallResource, deleteTemplates } from 'xo' import { error, success } from 'notification' -import { find, filter } from 'lodash' +import { find, filter, isEmpty, map, omit, startCase } from 'lodash' import { injectState, provideState } from 'reaclette' import { withRouter } from 'react-router' import ResourceForm from './resource-form' +const Li = props =>
  • +const Ul = props =>