chore: re-format code
This commit is contained in:
parent
4ff6eeb424
commit
90923c657d
@ -42,8 +42,8 @@ const getConfig = (key, ...args) => {
|
||||
return config === undefined
|
||||
? {}
|
||||
: typeof config === 'function'
|
||||
? config(...args)
|
||||
: config
|
||||
? config(...args)
|
||||
: config
|
||||
}
|
||||
|
||||
module.exports = function (pkg, plugins, presets) {
|
||||
|
@ -50,8 +50,8 @@ class Schedule {
|
||||
zone.toLowerCase() === 'utc'
|
||||
? moment.utc
|
||||
: zone === 'local'
|
||||
? moment
|
||||
: () => moment.tz(zone)
|
||||
? moment
|
||||
: () => moment.tz(zone)
|
||||
}
|
||||
|
||||
createJob (fn) {
|
||||
|
@ -13,10 +13,10 @@ const consoleTransport = ({ data, level, namespace, message, time }) => {
|
||||
level < INFO
|
||||
? debugConsole
|
||||
: level < WARN
|
||||
? infoConsole
|
||||
: level < ERROR
|
||||
? warnConsole
|
||||
: errorConsole
|
||||
? infoConsole
|
||||
: level < ERROR
|
||||
? warnConsole
|
||||
: errorConsole
|
||||
|
||||
fn('%s - %s - [%s] %s', time.toISOString(), namespace, NAMES[level], message)
|
||||
data != null && fn(data)
|
||||
|
@ -53,14 +53,12 @@ export default ({
|
||||
fromCallback(cb =>
|
||||
transporter.sendMail(
|
||||
{
|
||||
subject: evalTemplate(
|
||||
subject,
|
||||
key =>
|
||||
key === 'level'
|
||||
? NAMES[log.level]
|
||||
: key === 'time'
|
||||
? log.time.toISOString()
|
||||
: log[key]
|
||||
subject: evalTemplate(subject, key =>
|
||||
key === 'level'
|
||||
? NAMES[log.level]
|
||||
: key === 'time'
|
||||
? log.time.toISOString()
|
||||
: log[key]
|
||||
),
|
||||
text: prettyFormat(log.data),
|
||||
},
|
||||
|
@ -410,11 +410,10 @@ class P {
|
||||
|
||||
static text (text) {
|
||||
const { length } = text
|
||||
return new P(
|
||||
(input, pos) =>
|
||||
input.startsWith(text, pos)
|
||||
? new Success(pos + length, text)
|
||||
: new Failure(pos, `'${text}'`)
|
||||
return new P((input, pos) =>
|
||||
input.startsWith(text, pos)
|
||||
? new Success(pos + length, text)
|
||||
: new Failure(pos, `'${text}'`)
|
||||
)
|
||||
}
|
||||
|
||||
@ -478,17 +477,16 @@ class P {
|
||||
}
|
||||
}
|
||||
|
||||
P.eof = new P(
|
||||
(input, pos, end) =>
|
||||
pos < end ? new Failure(pos, 'end of input') : new Success(pos)
|
||||
P.eof = new P((input, pos, end) =>
|
||||
pos < end ? new Failure(pos, 'end of input') : new Success(pos)
|
||||
)
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
const parser = P.grammar({
|
||||
default: r =>
|
||||
P.seq(r.ws, r.term.repeat(), P.eof).map(
|
||||
([, terms]) => (terms.length === 0 ? new Null() : new And(terms))
|
||||
P.seq(r.ws, r.term.repeat(), P.eof).map(([, terms]) =>
|
||||
terms.length === 0 ? new Null() : new And(terms)
|
||||
),
|
||||
globPattern: new P((input, pos, end) => {
|
||||
let value = ''
|
||||
|
@ -228,16 +228,15 @@ export default class Vhd {
|
||||
return this._read(
|
||||
sectorsToBytes(blockAddr),
|
||||
onlyBitmap ? this.bitmapSize : this.fullBlockSize
|
||||
).then(
|
||||
buf =>
|
||||
onlyBitmap
|
||||
? { id: blockId, bitmap: buf }
|
||||
: {
|
||||
id: blockId,
|
||||
bitmap: buf.slice(0, this.bitmapSize),
|
||||
data: buf.slice(this.bitmapSize),
|
||||
buffer: buf,
|
||||
}
|
||||
).then(buf =>
|
||||
onlyBitmap
|
||||
? { id: blockId, bitmap: buf }
|
||||
: {
|
||||
id: blockId,
|
||||
bitmap: buf.slice(0, this.bitmapSize),
|
||||
data: buf.slice(this.bitmapSize),
|
||||
buffer: buf,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -667,8 +667,8 @@ class BackupReportsXoPlugin {
|
||||
const globalStatus = globalSuccess
|
||||
? `Success`
|
||||
: nFailures !== 0
|
||||
? `Failure`
|
||||
: `Skipped`
|
||||
? `Failure`
|
||||
: `Skipped`
|
||||
|
||||
let markdown = [
|
||||
`## Global status: ${globalStatus}`,
|
||||
@ -727,8 +727,8 @@ class BackupReportsXoPlugin {
|
||||
globalSuccess
|
||||
? ICON_SUCCESS
|
||||
: nFailures !== 0
|
||||
? ICON_FAILURE
|
||||
: ICON_SKIPPED
|
||||
? ICON_FAILURE
|
||||
: ICON_SKIPPED
|
||||
}`,
|
||||
nagiosStatus: globalSuccess ? 0 : 2,
|
||||
nagiosMarkdown: globalSuccess
|
||||
|
@ -251,12 +251,10 @@ function getTop (objects, options) {
|
||||
function computePercentage (curr, prev, options) {
|
||||
return zipObject(
|
||||
options,
|
||||
map(
|
||||
options,
|
||||
opt =>
|
||||
prev[opt] === 0 || prev[opt] === null
|
||||
? 'NONE'
|
||||
: `${((curr[opt] - prev[opt]) * 100) / prev[opt]}`
|
||||
map(options, opt =>
|
||||
prev[opt] === 0 || prev[opt] === null
|
||||
? 'NONE'
|
||||
: `${((curr[opt] - prev[opt]) * 100) / prev[opt]}`
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ export async function add ({ autoConnect = true, ...props }) {
|
||||
const server = await this.registerXenServer(props)
|
||||
|
||||
if (autoConnect) {
|
||||
;this.connectXenServer(server.id)::ignoreErrors()
|
||||
this.connectXenServer(server.id)::ignoreErrors()
|
||||
}
|
||||
|
||||
return server.id
|
||||
@ -105,7 +105,7 @@ set.params = {
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export async function connect ({ id }) {
|
||||
;this.updateXenServer(id, { enabled: true })::ignoreErrors()
|
||||
this.updateXenServer(id, { enabled: true })::ignoreErrors()
|
||||
await this.connectXenServer(id)
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ connect.params = {
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export async function disconnect ({ id }) {
|
||||
;this.updateXenServer(id, { enabled: false })::ignoreErrors()
|
||||
this.updateXenServer(id, { enabled: false })::ignoreErrors()
|
||||
await this.disconnectXenServer(id)
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { diffItems } from '../utils'
|
||||
|
||||
// TODO: move into vm and rename to removeInterface
|
||||
async function delete_ ({ vif }) {
|
||||
;this.allocIpAddresses(
|
||||
this.allocIpAddresses(
|
||||
vif.id,
|
||||
null,
|
||||
vif.allowedIpv4Addresses.concat(vif.allowedIpv6Addresses)
|
||||
|
@ -374,7 +374,7 @@ async function delete_ ({
|
||||
vm.type === 'VM' && // only regular VMs
|
||||
xapi.xo.getData(vm._xapiId, 'resourceSet') != null
|
||||
) {
|
||||
;this.setVmResourceSet(vm._xapiId, null)::ignoreErrors()
|
||||
this.setVmResourceSet(vm._xapiId, null)::ignoreErrors()
|
||||
}
|
||||
|
||||
return xapi.deleteVm(
|
||||
|
@ -78,19 +78,18 @@ export default class Redis extends Collection {
|
||||
.then(keys => keys.length !== 0 && redis.del(keys))
|
||||
).then(() =>
|
||||
asyncMap(redis.smembers(idsIndex), id =>
|
||||
redis.hgetall(`${prefix}:${id}`).then(
|
||||
values =>
|
||||
values == null
|
||||
? redis.srem(idsIndex, id) // entry no longer exists
|
||||
: asyncMap(indexes, index => {
|
||||
const value = values[index]
|
||||
if (value !== undefined) {
|
||||
return redis.sadd(
|
||||
`${prefix}_${index}:${String(value).toLowerCase()}`,
|
||||
id
|
||||
)
|
||||
}
|
||||
})
|
||||
redis.hgetall(`${prefix}:${id}`).then(values =>
|
||||
values == null
|
||||
? redis.srem(idsIndex, id) // entry no longer exists
|
||||
: asyncMap(indexes, index => {
|
||||
const value = values[index]
|
||||
if (value !== undefined) {
|
||||
return redis.sadd(
|
||||
`${prefix}_${index}:${String(value).toLowerCase()}`,
|
||||
id
|
||||
)
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -99,8 +99,8 @@ const testMetric = (test, type) =>
|
||||
typeof test === 'string'
|
||||
? test === type
|
||||
: typeof test === 'function'
|
||||
? test(type)
|
||||
: test.exec(type)
|
||||
? test(type)
|
||||
: test.exec(type)
|
||||
|
||||
const findMetric = (metrics, metricType) => {
|
||||
let testResult
|
||||
|
@ -208,8 +208,8 @@ export default class Xapi extends XapiBase {
|
||||
}
|
||||
|
||||
const loop = () =>
|
||||
this._waitObject(idOrUuidOrRef).then(
|
||||
object => (predicate(object) ? object : loop())
|
||||
this._waitObject(idOrUuidOrRef).then(object =>
|
||||
predicate(object) ? object : loop()
|
||||
)
|
||||
|
||||
return loop()
|
||||
@ -877,7 +877,7 @@ export default class Xapi extends XapiBase {
|
||||
//
|
||||
// The snapshot must not exist otherwise it could break the
|
||||
// next export.
|
||||
;this._deleteVdi(vdi)::ignoreErrors()
|
||||
this._deleteVdi(vdi)::ignoreErrors()
|
||||
return
|
||||
}
|
||||
|
||||
@ -1128,7 +1128,7 @@ export default class Xapi extends XapiBase {
|
||||
])
|
||||
|
||||
if (deleteBase && baseVm) {
|
||||
;this._deleteVm(baseVm)::ignoreErrors()
|
||||
this._deleteVm(baseVm)::ignoreErrors()
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
@ -1168,8 +1168,8 @@ export default class Xapi extends XapiBase {
|
||||
mapVdisSrs && mapVdisSrs[vdi.$id]
|
||||
? hostXapi.getObject(mapVdisSrs[vdi.$id]).$ref
|
||||
: sr !== undefined
|
||||
? hostXapi.getObject(sr).$ref
|
||||
: defaultSr.$ref // Will error if there are no default SR.
|
||||
? hostXapi.getObject(sr).$ref
|
||||
: defaultSr.$ref // Will error if there are no default SR.
|
||||
}
|
||||
}
|
||||
|
||||
@ -1316,7 +1316,7 @@ export default class Xapi extends XapiBase {
|
||||
}
|
||||
|
||||
if (onVmCreation != null) {
|
||||
;this._waitObject(
|
||||
this._waitObject(
|
||||
obj =>
|
||||
obj != null &&
|
||||
obj.current_operations != null &&
|
||||
@ -1654,12 +1654,12 @@ export default class Xapi extends XapiBase {
|
||||
|
||||
await this._startVm(vm)
|
||||
} finally {
|
||||
;this._setObjectProperties(vm, {
|
||||
this._setObjectProperties(vm, {
|
||||
PV_bootloader: bootloader,
|
||||
})::ignoreErrors()
|
||||
|
||||
forEach(bootables, ([vbd, bootable]) => {
|
||||
;this._setObjectProperties(vbd, { bootable })::ignoreErrors()
|
||||
this._setObjectProperties(vbd, { bootable })::ignoreErrors()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -511,11 +511,10 @@ export default {
|
||||
...(await Promise.all(
|
||||
mapFilter(this.objects.all, host => {
|
||||
if (host.$type === 'host') {
|
||||
return this._listMissingPoolPatchesOnHost(host).then(
|
||||
patches =>
|
||||
host.license_params.sku_type !== 'free'
|
||||
? pickBy(patches, { upgrade: false })
|
||||
: pickBy(patches, { paid: false, upgrade: false })
|
||||
return this._listMissingPoolPatchesOnHost(host).then(patches =>
|
||||
host.license_params.sku_type !== 'free'
|
||||
? pickBy(patches, { upgrade: false })
|
||||
: pickBy(patches, { paid: false, upgrade: false })
|
||||
)
|
||||
}
|
||||
})
|
||||
|
@ -435,9 +435,9 @@ export default {
|
||||
if (snapshot.snapshot_info['power-state-at-snapshot'] === 'Running') {
|
||||
const vm = snapshot.$snapshot_of
|
||||
if (vm.power_state === 'Halted') {
|
||||
;this.startVm(vm.$id)::ignoreErrors()
|
||||
this.startVm(vm.$id)::ignoreErrors()
|
||||
} else if (vm.power_state === 'Suspended') {
|
||||
;this.resumeVm(vm.$id)::ignoreErrors()
|
||||
this.resumeVm(vm.$id)::ignoreErrors()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -181,7 +181,7 @@ export default class {
|
||||
token = token.properties
|
||||
|
||||
if (!(token.expiration > Date.now())) {
|
||||
;this._tokens.remove(id)::ignoreErrors()
|
||||
this._tokens.remove(id)::ignoreErrors()
|
||||
|
||||
throw noSuchAuthenticationToken(id)
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ const getOldEntries = <T>(retention: number, entries?: T[]): T[] =>
|
||||
entries === undefined
|
||||
? []
|
||||
: retention > 0
|
||||
? entries.slice(0, -retention)
|
||||
: entries
|
||||
? entries.slice(0, -retention)
|
||||
: entries
|
||||
|
||||
const defaultSettings: Settings = {
|
||||
concurrency: 0,
|
||||
|
@ -144,8 +144,8 @@ const listPartitions = (() => {
|
||||
key === 'start' || key === 'size'
|
||||
? +value
|
||||
: key === 'type'
|
||||
? TYPES[+value] || value
|
||||
: value,
|
||||
? TYPES[+value] || value
|
||||
: value,
|
||||
})
|
||||
|
||||
return device =>
|
||||
@ -445,17 +445,17 @@ export default class {
|
||||
// Once done, (asynchronously) remove the (now obsolete) local
|
||||
// base.
|
||||
if (localBaseUuid) {
|
||||
;promise.then(() => srcXapi.deleteVm(localBaseUuid))::ignoreErrors()
|
||||
promise.then(() => srcXapi.deleteVm(localBaseUuid))::ignoreErrors()
|
||||
}
|
||||
|
||||
if (toRemove !== undefined) {
|
||||
;promise
|
||||
promise
|
||||
.then(() => asyncMap(toRemove, _ => targetXapi.deleteVm(_.$id)))
|
||||
::ignoreErrors()
|
||||
}
|
||||
|
||||
// (Asynchronously) Identify snapshot as future base.
|
||||
;promise
|
||||
promise
|
||||
.then(() => {
|
||||
return srcXapi._updateObjectMapProperty(srcVm, 'other_config', {
|
||||
[TAG_LAST_BASE_DELTA]: delta.vm.uuid,
|
||||
@ -593,7 +593,7 @@ export default class {
|
||||
base => base.snapshot_time
|
||||
)
|
||||
forEach(bases, base => {
|
||||
;xapi.deleteVdi(base.$id)::ignoreErrors()
|
||||
xapi.deleteVdi(base.$id)::ignoreErrors()
|
||||
})
|
||||
|
||||
// Export full or delta backup.
|
||||
@ -652,7 +652,7 @@ export default class {
|
||||
)
|
||||
const baseVm = bases.pop()
|
||||
forEach(bases, base => {
|
||||
;xapi.deleteVm(base.$id)::ignoreErrors()
|
||||
xapi.deleteVm(base.$id)::ignoreErrors()
|
||||
})
|
||||
|
||||
// Check backup dirs.
|
||||
@ -780,7 +780,7 @@ export default class {
|
||||
await this._removeOldDeltaVmBackups(xapi, { vm, handler, dir, retention })
|
||||
|
||||
if (baseVm) {
|
||||
;xapi.deleteVm(baseVm.$id)::ignoreErrors()
|
||||
xapi.deleteVm(baseVm.$id)::ignoreErrors()
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -56,8 +56,8 @@ const parsePartxLine = createPairsParser({
|
||||
key === 'start' || key === 'size'
|
||||
? +value
|
||||
: key === 'type'
|
||||
? PARTITION_TYPE_NAMES[+value] || value
|
||||
: value,
|
||||
? PARTITION_TYPE_NAMES[+value] || value
|
||||
: value,
|
||||
})
|
||||
|
||||
const listLvmLogicalVolumes = defer(
|
||||
|
@ -328,7 +328,7 @@ export default class Jobs {
|
||||
app.emit('job:terminated', undefined, job, schedule, runJobId)
|
||||
throw error
|
||||
} finally {
|
||||
;this.updateJob({ id, runId: null })::ignoreErrors()
|
||||
this.updateJob({ id, runId: null })::ignoreErrors()
|
||||
delete runningJobs[id]
|
||||
delete runs[runJobId]
|
||||
if (session !== undefined) {
|
||||
|
@ -44,7 +44,7 @@ export default class LevelDbLogger extends AbstractLogger {
|
||||
return promise.then(() => key)
|
||||
}
|
||||
|
||||
;promise::ignoreErrors()
|
||||
promise::ignoreErrors()
|
||||
return key
|
||||
}
|
||||
|
||||
|
@ -57,15 +57,13 @@ const normalize = set => ({
|
||||
id: set.id,
|
||||
ipPools: set.ipPools || [],
|
||||
limits: set.limits
|
||||
? map(
|
||||
set.limits,
|
||||
limit =>
|
||||
isObject(limit)
|
||||
? limit
|
||||
: {
|
||||
available: limit,
|
||||
total: limit,
|
||||
}
|
||||
? map(set.limits, limit =>
|
||||
isObject(limit)
|
||||
? limit
|
||||
: {
|
||||
available: limit,
|
||||
total: limit,
|
||||
}
|
||||
)
|
||||
: {},
|
||||
name: set.name || '',
|
||||
|
@ -10,10 +10,8 @@ import { forEach, isFunction, promisify } from '../utils'
|
||||
|
||||
const _levelHas = function has (key, cb) {
|
||||
if (cb) {
|
||||
return this.get(
|
||||
key,
|
||||
(error, value) =>
|
||||
error ? (error.notFound ? cb(null, false) : cb(error)) : cb(null, true)
|
||||
return this.get(key, (error, value) =>
|
||||
error ? (error.notFound ? cb(null, false) : cb(error)) : cb(null, true)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ export default class {
|
||||
.getAuthenticationTokensForUser(id)
|
||||
.then(tokens => {
|
||||
forEach(tokens, token => {
|
||||
;this._xo.deleteAuthenticationToken(id)::ignoreErrors()
|
||||
this._xo.deleteAuthenticationToken(id)::ignoreErrors()
|
||||
})
|
||||
})
|
||||
::ignoreErrors()
|
||||
@ -112,13 +112,13 @@ export default class {
|
||||
// Remove ACLs for this user.
|
||||
this._xo.getAclsForSubject(id).then(acls => {
|
||||
forEach(acls, acl => {
|
||||
;this._xo.removeAcl(id, acl.object, acl.action)::ignoreErrors()
|
||||
this._xo.removeAcl(id, acl.object, acl.action)::ignoreErrors()
|
||||
})
|
||||
})
|
||||
|
||||
// Remove the user from all its groups.
|
||||
forEach(user.groups, groupId => {
|
||||
;this.getGroup(groupId)
|
||||
this.getGroup(groupId)
|
||||
.then(group => this._removeUserFromGroup(id, group))
|
||||
::ignoreErrors()
|
||||
})
|
||||
@ -264,13 +264,13 @@ export default class {
|
||||
// Remove ACLs for this group.
|
||||
this._xo.getAclsForSubject(id).then(acls => {
|
||||
forEach(acls, acl => {
|
||||
;this._xo.removeAcl(id, acl.object, acl.action)::ignoreErrors()
|
||||
this._xo.removeAcl(id, acl.object, acl.action)::ignoreErrors()
|
||||
})
|
||||
})
|
||||
|
||||
// Remove the group from all its users.
|
||||
forEach(group.users, userId => {
|
||||
;this.getUser(userId)
|
||||
this.getUser(userId)
|
||||
.then(user => this._removeGroupFromUser(id, user))
|
||||
::ignoreErrors()
|
||||
})
|
||||
|
@ -82,7 +82,7 @@ export default class {
|
||||
}
|
||||
|
||||
async unregisterXenServer (id) {
|
||||
;this.disconnectXenServer(id)::ignoreErrors()
|
||||
this.disconnectXenServer(id)::ignoreErrors()
|
||||
|
||||
if (!(await this._servers.remove(id))) {
|
||||
throw noSuchObject(id, 'xenServer')
|
||||
|
@ -15,16 +15,14 @@ export { Ellipsis as default }
|
||||
|
||||
export const EllipsisContainer = ({ children }) => (
|
||||
<div style={ellipsisContainerStyle}>
|
||||
{React.Children.map(
|
||||
children,
|
||||
child =>
|
||||
child == null ||
|
||||
child.type === Ellipsis ||
|
||||
(child.type != null && child.type.originalRender === Ellipsis) ? (
|
||||
child
|
||||
) : (
|
||||
<span>{child}</span>
|
||||
)
|
||||
{React.Children.map(children, child =>
|
||||
child == null ||
|
||||
child.type === Ellipsis ||
|
||||
(child.type != null && child.type.originalRender === Ellipsis) ? (
|
||||
child
|
||||
) : (
|
||||
<span>{child}</span>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
@ -107,17 +107,16 @@ export default class IsoDevice extends Component {
|
||||
icon='vm-eject'
|
||||
/>
|
||||
</span>
|
||||
{mountedIso &&
|
||||
!cdDrive.device && (
|
||||
<Tooltip content={_('cdDriveNotInstalled')}>
|
||||
<a
|
||||
className='text-warning btn btn-link'
|
||||
onClick={this._showWarning}
|
||||
>
|
||||
<Icon icon='alarm' size='lg' />
|
||||
</a>
|
||||
</Tooltip>
|
||||
)}
|
||||
{mountedIso && !cdDrive.device && (
|
||||
<Tooltip content={_('cdDriveNotInstalled')}>
|
||||
<a
|
||||
className='text-warning btn btn-link'
|
||||
onClick={this._showWarning}
|
||||
>
|
||||
<Icon icon='alarm' size='lg' />
|
||||
</a>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -384,9 +384,8 @@ const GenericXoItem = connectStore(() => {
|
||||
return (state, props) => ({
|
||||
xoItem: getObject(state, props),
|
||||
})
|
||||
})(
|
||||
({ xoItem, ...props }) =>
|
||||
xoItem ? renderXoItem(xoItem, props) : renderXoUnknownItem()
|
||||
})(({ xoItem, ...props }) =>
|
||||
xoItem ? renderXoItem(xoItem, props) : renderXoUnknownItem()
|
||||
)
|
||||
|
||||
export const renderXoItemFromId = (id, props) => (
|
||||
|
@ -281,8 +281,8 @@ const TimePicker = decorate([
|
||||
step === 1
|
||||
? optionsValues
|
||||
: step !== undefined
|
||||
? optionsValues.filter((_, i) => i % step === 0)
|
||||
: value.split(',').map(Number),
|
||||
? optionsValues.filter((_, i) => i % step === 0)
|
||||
: value.split(',').map(Number),
|
||||
|
||||
// '*' => 1
|
||||
// '*/2' => 2
|
||||
@ -291,8 +291,8 @@ const TimePicker = decorate([
|
||||
value === '*'
|
||||
? 1
|
||||
: value.indexOf('/') === 1
|
||||
? +value.split('/')[1]
|
||||
: undefined,
|
||||
? +value.split('/')[1]
|
||||
: undefined,
|
||||
},
|
||||
}),
|
||||
injectState,
|
||||
|
@ -63,8 +63,8 @@ const getIds = value =>
|
||||
value == null || isString(value) || isInteger(value)
|
||||
? value
|
||||
: isArray(value)
|
||||
? map(value, getIds)
|
||||
: value.id
|
||||
? map(value, getIds)
|
||||
: value.id
|
||||
|
||||
const getOption = (object, container) => ({
|
||||
label: container
|
||||
@ -162,11 +162,11 @@ class GenericSelect extends React.Component {
|
||||
return isEmpty(missingObjects)
|
||||
? objects
|
||||
: withContainers
|
||||
? {
|
||||
...objects,
|
||||
missingObjects,
|
||||
}
|
||||
: [...objects, ...missingObjects]
|
||||
? {
|
||||
...objects,
|
||||
missingObjects,
|
||||
}
|
||||
: [...objects, ...missingObjects]
|
||||
}
|
||||
)
|
||||
|
||||
@ -620,13 +620,10 @@ export const SelectVdi = makeStoreSelect(
|
||||
)
|
||||
const getVdis = createGetObjectsOfType('VDI')
|
||||
.filter(
|
||||
createSelector(
|
||||
getSrs,
|
||||
getPredicate,
|
||||
(srs, predicate) =>
|
||||
predicate
|
||||
? vdi => srs[vdi.$SR] && predicate(vdi)
|
||||
: vdi => srs[vdi.$SR]
|
||||
createSelector(getSrs, getPredicate, (srs, predicate) =>
|
||||
predicate
|
||||
? vdi => srs[vdi.$SR] && predicate(vdi)
|
||||
: vdi => srs[vdi.$SR]
|
||||
)
|
||||
)
|
||||
.sort()
|
||||
@ -691,9 +688,9 @@ export const SelectSubject = makeSubscriptionSelect(
|
||||
const set = newSubjects => {
|
||||
subjects = newSubjects
|
||||
/* We must wait for groups AND users options to be loaded,
|
||||
* or a previously setted value belonging to one type or another might be discarded
|
||||
* by the internal <GenericSelect>
|
||||
*/
|
||||
* or a previously setted value belonging to one type or another might be discarded
|
||||
* by the internal <GenericSelect>
|
||||
*/
|
||||
if (usersLoaded && groupsLoaded) {
|
||||
subscriber({
|
||||
xoObjects: subjects,
|
||||
|
@ -146,15 +146,14 @@ export const createFilter = (collection, predicate) =>
|
||||
_create2(
|
||||
collection,
|
||||
predicate,
|
||||
_createCollectionWrapper(
|
||||
(collection, predicate) =>
|
||||
predicate === false
|
||||
? isArrayLike(collection)
|
||||
? EMPTY_ARRAY
|
||||
: EMPTY_OBJECT
|
||||
: predicate
|
||||
? (isArrayLike(collection) ? filter : pickBy)(collection, predicate)
|
||||
: collection
|
||||
_createCollectionWrapper((collection, predicate) =>
|
||||
predicate === false
|
||||
? isArrayLike(collection)
|
||||
? EMPTY_ARRAY
|
||||
: EMPTY_OBJECT
|
||||
: predicate
|
||||
? (isArrayLike(collection) ? filter : pickBy)(collection, predicate)
|
||||
: collection
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -502,8 +502,8 @@ export default class SortedTable extends Component {
|
||||
) {
|
||||
this.setState({
|
||||
highlighted:
|
||||
(itemIndex + visibleItems.length + 1) %
|
||||
visibleItems.length || 0,
|
||||
(itemIndex + visibleItems.length + 1) % visibleItems.length ||
|
||||
0,
|
||||
})
|
||||
}
|
||||
break
|
||||
@ -515,8 +515,8 @@ export default class SortedTable extends Component {
|
||||
) {
|
||||
this.setState({
|
||||
highlighted:
|
||||
(itemIndex + visibleItems.length - 1) %
|
||||
visibleItems.length || 0,
|
||||
(itemIndex + visibleItems.length - 1) % visibleItems.length ||
|
||||
0,
|
||||
})
|
||||
}
|
||||
break
|
||||
|
@ -149,7 +149,7 @@ class XoWeekChart extends Component {
|
||||
.selectAll('path')
|
||||
.remove()
|
||||
forEach(splittedData, data => {
|
||||
;svg
|
||||
svg
|
||||
.select('.horizon-area')
|
||||
.append('path')
|
||||
.datum(data)
|
||||
|
@ -66,42 +66,41 @@ export default class ChooseSrForEachVdisModal extends Component {
|
||||
value={mainSr}
|
||||
/>
|
||||
<br />
|
||||
{props.vdis != null &&
|
||||
mainSr != null && (
|
||||
<Collapsible
|
||||
buttonText={_('chooseSrForEachVdisModalSelectSr')}
|
||||
collapsible={props.vdis.length >= 3}
|
||||
>
|
||||
<br />
|
||||
<Container>
|
||||
<SingleLineRow>
|
||||
{props.vdis != null && mainSr != null && (
|
||||
<Collapsible
|
||||
buttonText={_('chooseSrForEachVdisModalSelectSr')}
|
||||
collapsible={props.vdis.length >= 3}
|
||||
>
|
||||
<br />
|
||||
<Container>
|
||||
<SingleLineRow>
|
||||
<Col size={6}>
|
||||
<strong>{_('chooseSrForEachVdisModalVdiLabel')}</strong>
|
||||
</Col>
|
||||
<Col size={6}>
|
||||
<strong>{_('chooseSrForEachVdisModalSrLabel')}</strong>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
{map(props.vdis, vdi => (
|
||||
<SingleLineRow key={vdi.uuid}>
|
||||
<Col size={6}>{vdi.name_label || vdi.name}</Col>
|
||||
<Col size={6}>
|
||||
<strong>{_('chooseSrForEachVdisModalVdiLabel')}</strong>
|
||||
</Col>
|
||||
<Col size={6}>
|
||||
<strong>{_('chooseSrForEachVdisModalSrLabel')}</strong>
|
||||
<SelectSr
|
||||
onChange={sr =>
|
||||
this._onChange({
|
||||
mapVdisSrs: { ...mapVdisSrs, [vdi.uuid]: sr },
|
||||
})
|
||||
}
|
||||
predicate={srPredicate}
|
||||
value={mapVdisSrs !== undefined && mapVdisSrs[vdi.uuid]}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
{map(props.vdis, vdi => (
|
||||
<SingleLineRow key={vdi.uuid}>
|
||||
<Col size={6}>{vdi.name_label || vdi.name}</Col>
|
||||
<Col size={6}>
|
||||
<SelectSr
|
||||
onChange={sr =>
|
||||
this._onChange({
|
||||
mapVdisSrs: { ...mapVdisSrs, [vdi.uuid]: sr },
|
||||
})
|
||||
}
|
||||
predicate={srPredicate}
|
||||
value={mapVdisSrs !== undefined && mapVdisSrs[vdi.uuid]}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
))}
|
||||
<i>{_('chooseSrForEachVdisModalOptionalEntry')}</i>
|
||||
</Container>
|
||||
</Collapsible>
|
||||
)}
|
||||
))}
|
||||
<i>{_('chooseSrForEachVdisModalOptionalEntry')}</i>
|
||||
</Container>
|
||||
</Collapsible>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -214,39 +214,41 @@ const createSubscription = cb => {
|
||||
}
|
||||
|
||||
running = true
|
||||
_signIn.then(() => cb()).then(
|
||||
result => {
|
||||
running = false
|
||||
_signIn
|
||||
.then(() => cb())
|
||||
.then(
|
||||
result => {
|
||||
running = false
|
||||
|
||||
if (n === 0) {
|
||||
return uninstall()
|
||||
if (n === 0) {
|
||||
return uninstall()
|
||||
}
|
||||
|
||||
timeout = setTimeout(loop, delay)
|
||||
|
||||
if (!isEqual(result, cache)) {
|
||||
cache = result
|
||||
|
||||
forEach(subscribers, subscriber => {
|
||||
// A subscriber might have disappeared during iteration.
|
||||
//
|
||||
// E.g.: if a subscriber triggers the subscription of another.
|
||||
if (subscriber) {
|
||||
subscriber(result)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
error => {
|
||||
running = false
|
||||
|
||||
if (n === 0) {
|
||||
return uninstall()
|
||||
}
|
||||
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
timeout = setTimeout(loop, delay)
|
||||
|
||||
if (!isEqual(result, cache)) {
|
||||
cache = result
|
||||
|
||||
forEach(subscribers, subscriber => {
|
||||
// A subscriber might have disappeared during iteration.
|
||||
//
|
||||
// E.g.: if a subscriber triggers the subscription of another.
|
||||
if (subscriber) {
|
||||
subscriber(result)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
error => {
|
||||
running = false
|
||||
|
||||
if (n === 0) {
|
||||
return uninstall()
|
||||
}
|
||||
|
||||
console.error(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
const subscribe = cb => {
|
||||
|
@ -73,12 +73,11 @@ export default class InstallPoolPatchesModalBody extends Component {
|
||||
|
||||
return (
|
||||
<Container>
|
||||
{!needDefaultSr &&
|
||||
!someCdsInserted && (
|
||||
<SingleLineRow>
|
||||
<Col>{_('confirmPoolPatch')}</Col>
|
||||
</SingleLineRow>
|
||||
)}
|
||||
{!needDefaultSr && !someCdsInserted && (
|
||||
<SingleLineRow>
|
||||
<Col>{_('confirmPoolPatch')}</Col>
|
||||
</SingleLineRow>
|
||||
)}
|
||||
{needDefaultSr && [
|
||||
<SingleLineRow className='mt-1' key='message'>
|
||||
<Col>
|
||||
|
@ -236,21 +236,20 @@ export default class MigrateVmModalBody extends BaseComponent {
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
{host &&
|
||||
!doNotMigrateVdis && (
|
||||
<div className={styles.groupBlock}>
|
||||
<SingleLineRow>
|
||||
<Col size={12}>
|
||||
<ChooseSrForEachVdisModal
|
||||
mainSrPredicate={this._getSrPredicate()}
|
||||
onChange={this.linkState('targetSrs')}
|
||||
value={targetSrs}
|
||||
vdis={vdis}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
{host && !doNotMigrateVdis && (
|
||||
<div className={styles.groupBlock}>
|
||||
<SingleLineRow>
|
||||
<Col size={12}>
|
||||
<ChooseSrForEachVdisModal
|
||||
mainSrPredicate={this._getSrPredicate()}
|
||||
onChange={this.linkState('targetSrs')}
|
||||
value={targetSrs}
|
||||
vdis={vdis}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
{intraPool !== undefined &&
|
||||
(!intraPool && (
|
||||
<div>
|
||||
|
@ -287,70 +287,66 @@ export default class MigrateVmsModalBody extends BaseComponent {
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
{host &&
|
||||
(!intraPool || !noVdisMigration) && (
|
||||
<div key='sr' style={LINE_STYLE}>
|
||||
<SingleLineRow>
|
||||
<Col size={6}>
|
||||
{!intraPool
|
||||
? _('migrateVmsSelectSr')
|
||||
: _('migrateVmsSelectSrIntraPool')}{' '}
|
||||
{(defaultSrId === undefined || !defaultSrConnectedToHost) && (
|
||||
<Tooltip
|
||||
content={
|
||||
defaultSrId !== undefined
|
||||
? _('migrateVmNotConnectedDefaultSrError')
|
||||
: _('migrateVmNoDefaultSrError')
|
||||
{host && (!intraPool || !noVdisMigration) && (
|
||||
<div key='sr' style={LINE_STYLE}>
|
||||
<SingleLineRow>
|
||||
<Col size={6}>
|
||||
{!intraPool
|
||||
? _('migrateVmsSelectSr')
|
||||
: _('migrateVmsSelectSrIntraPool')}{' '}
|
||||
{(defaultSrId === undefined || !defaultSrConnectedToHost) && (
|
||||
<Tooltip
|
||||
content={
|
||||
defaultSrId !== undefined
|
||||
? _('migrateVmNotConnectedDefaultSrError')
|
||||
: _('migrateVmNoDefaultSrError')
|
||||
}
|
||||
>
|
||||
<Icon
|
||||
icon={defaultSrId !== undefined ? 'alarm' : 'info'}
|
||||
className={
|
||||
defaultSrId !== undefined ? 'text-warning' : 'text-info'
|
||||
}
|
||||
>
|
||||
<Icon
|
||||
icon={defaultSrId !== undefined ? 'alarm' : 'info'}
|
||||
className={
|
||||
defaultSrId !== undefined
|
||||
? 'text-warning'
|
||||
: 'text-info'
|
||||
}
|
||||
size='lg'
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Col>
|
||||
<Col size={6}>
|
||||
<SelectSr
|
||||
onChange={this._selectSr}
|
||||
predicate={this._getSrPredicate()}
|
||||
value={srId}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
{host &&
|
||||
!intraPool && (
|
||||
<div key='network' style={LINE_STYLE}>
|
||||
<SingleLineRow>
|
||||
<Col size={6}>{_('migrateVmsSelectNetwork')}</Col>
|
||||
<Col size={6}>
|
||||
<SelectNetwork
|
||||
disabled={smartVifMapping}
|
||||
onChange={this._selectNetwork}
|
||||
predicate={this._getTargetNetworkPredicate()}
|
||||
value={networkId}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
<SingleLineRow>
|
||||
<Col size={6} offset={6}>
|
||||
<input
|
||||
type='checkbox'
|
||||
onChange={this._toggleSmartVifMapping}
|
||||
checked={smartVifMapping}
|
||||
/>{' '}
|
||||
{_('migrateVmsSmartMapping')}
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
size='lg'
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Col>
|
||||
<Col size={6}>
|
||||
<SelectSr
|
||||
onChange={this._selectSr}
|
||||
predicate={this._getSrPredicate()}
|
||||
value={srId}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
{host && !intraPool && (
|
||||
<div key='network' style={LINE_STYLE}>
|
||||
<SingleLineRow>
|
||||
<Col size={6}>{_('migrateVmsSelectNetwork')}</Col>
|
||||
<Col size={6}>
|
||||
<SelectNetwork
|
||||
disabled={smartVifMapping}
|
||||
onChange={this._selectNetwork}
|
||||
predicate={this._getTargetNetworkPredicate()}
|
||||
value={networkId}
|
||||
/>
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
<SingleLineRow>
|
||||
<Col size={6} offset={6}>
|
||||
<input
|
||||
type='checkbox'
|
||||
onChange={this._toggleSmartVifMapping}
|
||||
checked={smartVifMapping}
|
||||
/>{' '}
|
||||
{_('migrateVmsSmartMapping')}
|
||||
</Col>
|
||||
</SingleLineRow>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -10,37 +10,36 @@ import { isAdmin } from 'selectors'
|
||||
|
||||
const Upgrade = connectStore({
|
||||
isAdmin,
|
||||
})(
|
||||
({ available, children, isAdmin, place, required = available }) =>
|
||||
process.env.XOA_PLAN < required ? (
|
||||
<Card>
|
||||
<CardHeader>{_('upgradeNeeded')}</CardHeader>
|
||||
{isAdmin ? (
|
||||
<CardBlock className='text-xs-center'>
|
||||
<p>{_('availableIn', { plan: getXoaPlan(required) })}</p>
|
||||
<p>
|
||||
<a
|
||||
href={`https://xen-orchestra.com/#!/pricing?pk_campaign=xoa_${getXoaPlan()}_upgrade&pk_kwd=${place}`}
|
||||
className='btn btn-primary btn-lg'
|
||||
>
|
||||
<Icon icon='plan-upgrade' /> {_('upgradeNow')}
|
||||
</a>{' '}
|
||||
{_('or')}
|
||||
|
||||
<Link className='btn btn-success btn-lg' to='/xoa/update'>
|
||||
<Icon icon='plan-trial' /> {_('tryIt')}
|
||||
</Link>
|
||||
</p>
|
||||
</CardBlock>
|
||||
) : (
|
||||
<CardBlock className='text-xs-center'>
|
||||
<p>{_('notAvailable')}</p>
|
||||
</CardBlock>
|
||||
)}
|
||||
</Card>
|
||||
) : (
|
||||
children
|
||||
)
|
||||
})(({ available, children, isAdmin, place, required = available }) =>
|
||||
process.env.XOA_PLAN < required ? (
|
||||
<Card>
|
||||
<CardHeader>{_('upgradeNeeded')}</CardHeader>
|
||||
{isAdmin ? (
|
||||
<CardBlock className='text-xs-center'>
|
||||
<p>{_('availableIn', { plan: getXoaPlan(required) })}</p>
|
||||
<p>
|
||||
<a
|
||||
href={`https://xen-orchestra.com/#!/pricing?pk_campaign=xoa_${getXoaPlan()}_upgrade&pk_kwd=${place}`}
|
||||
className='btn btn-primary btn-lg'
|
||||
>
|
||||
<Icon icon='plan-upgrade' /> {_('upgradeNow')}
|
||||
</a>{' '}
|
||||
{_('or')}
|
||||
|
||||
<Link className='btn btn-success btn-lg' to='/xoa/update'>
|
||||
<Icon icon='plan-trial' /> {_('tryIt')}
|
||||
</Link>
|
||||
</p>
|
||||
</CardBlock>
|
||||
) : (
|
||||
<CardBlock className='text-xs-center'>
|
||||
<p>{_('notAvailable')}</p>
|
||||
</CardBlock>
|
||||
)}
|
||||
</Card>
|
||||
) : (
|
||||
children
|
||||
)
|
||||
)
|
||||
|
||||
Upgrade.propTypes = {
|
||||
|
@ -81,21 +81,20 @@ const ThinProvisionedTip = ({ label }) => (
|
||||
const normalizeTagValues = values => resolveIds(values).map(value => [value])
|
||||
|
||||
const normalizeSettings = ({ settings, exportMode, copyMode, snapshotMode }) =>
|
||||
settings.map(
|
||||
setting =>
|
||||
defined(
|
||||
setting.copyRetention,
|
||||
setting.exportRetention,
|
||||
setting.snapshotRetention
|
||||
) !== undefined
|
||||
? {
|
||||
copyRetention: copyMode ? setting.copyRetention : undefined,
|
||||
exportRetention: exportMode ? setting.exportRetention : undefined,
|
||||
snapshotRetention: snapshotMode
|
||||
? setting.snapshotRetention
|
||||
: undefined,
|
||||
}
|
||||
: setting
|
||||
settings.map(setting =>
|
||||
defined(
|
||||
setting.copyRetention,
|
||||
setting.exportRetention,
|
||||
setting.snapshotRetention
|
||||
) !== undefined
|
||||
? {
|
||||
copyRetention: copyMode ? setting.copyRetention : undefined,
|
||||
exportRetention: exportMode ? setting.exportRetention : undefined,
|
||||
snapshotRetention: snapshotMode
|
||||
? setting.snapshotRetention
|
||||
: undefined,
|
||||
}
|
||||
: setting
|
||||
)
|
||||
|
||||
const constructPattern = values =>
|
||||
@ -296,8 +295,8 @@ export default decorate([
|
||||
state.compression === undefined
|
||||
? undefined
|
||||
: state.compression
|
||||
? 'native'
|
||||
: '',
|
||||
? 'native'
|
||||
: '',
|
||||
settings: normalizeSettings({
|
||||
settings: settings || state.propSettings,
|
||||
exportMode: state.exportMode,
|
||||
@ -597,28 +596,27 @@ export default decorate([
|
||||
srPredicate: ({ srs }) => sr => isSrWritable(sr) && !includes(srs, sr.id),
|
||||
remotePredicate: ({ remotes }) => ({ id }) => !includes(remotes, id),
|
||||
propSettings: (_, { job }) =>
|
||||
Map(get(() => job.settings)).map(
|
||||
setting =>
|
||||
defined(
|
||||
setting.copyRetention,
|
||||
setting.exportRetention,
|
||||
setting.snapshotRetention
|
||||
)
|
||||
? {
|
||||
copyRetention: defined(
|
||||
setting.copyRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
exportRetention: defined(
|
||||
setting.exportRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
snapshotRetention: defined(
|
||||
setting.snapshotRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
}
|
||||
: setting
|
||||
Map(get(() => job.settings)).map(setting =>
|
||||
defined(
|
||||
setting.copyRetention,
|
||||
setting.exportRetention,
|
||||
setting.snapshotRetention
|
||||
)
|
||||
? {
|
||||
copyRetention: defined(
|
||||
setting.copyRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
exportRetention: defined(
|
||||
setting.exportRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
snapshotRetention: defined(
|
||||
setting.snapshotRetention,
|
||||
DEFAULT_RETENTION
|
||||
),
|
||||
}
|
||||
: setting
|
||||
),
|
||||
},
|
||||
}),
|
||||
|
@ -108,12 +108,11 @@ export default class HostItem extends Component {
|
||||
/>
|
||||
</Ellipsis>
|
||||
|
||||
{container &&
|
||||
host.id === container.master && (
|
||||
<span className='tag tag-pill tag-info'>
|
||||
{_('pillMaster')}
|
||||
</span>
|
||||
)}
|
||||
{container && host.id === container.master && (
|
||||
<span className='tag tag-pill tag-info'>
|
||||
{_('pillMaster')}
|
||||
</span>
|
||||
)}
|
||||
|
||||
{this.props.needsRestart && (
|
||||
<Tooltip content={_('rebootUpdateHostLabel')}>
|
||||
|
@ -1056,32 +1056,30 @@ export default class Home extends Component {
|
||||
<Icon icon='tags' /> {_('homeAllTags')}
|
||||
</Button>
|
||||
</OverlayTrigger>
|
||||
{showResourceSetsSelector &&
|
||||
isAdmin &&
|
||||
!noResourceSets && (
|
||||
<OverlayTrigger
|
||||
trigger='click'
|
||||
rootClose
|
||||
placement='bottom'
|
||||
overlay={
|
||||
<Popover
|
||||
className={styles.selectObject}
|
||||
id='resourceSetPopover'
|
||||
>
|
||||
<SelectResourceSet
|
||||
autoFocus
|
||||
multi
|
||||
onChange={this._updateSelectedResourceSets}
|
||||
value={selectedResourceSets}
|
||||
/>
|
||||
</Popover>
|
||||
}
|
||||
>
|
||||
<Button btnStyle='link'>
|
||||
<Icon icon='resource-set' /> {_('homeAllResourceSets')}
|
||||
</Button>
|
||||
</OverlayTrigger>
|
||||
)}
|
||||
{showResourceSetsSelector && isAdmin && !noResourceSets && (
|
||||
<OverlayTrigger
|
||||
trigger='click'
|
||||
rootClose
|
||||
placement='bottom'
|
||||
overlay={
|
||||
<Popover
|
||||
className={styles.selectObject}
|
||||
id='resourceSetPopover'
|
||||
>
|
||||
<SelectResourceSet
|
||||
autoFocus
|
||||
multi
|
||||
onChange={this._updateSelectedResourceSets}
|
||||
value={selectedResourceSets}
|
||||
/>
|
||||
</Popover>
|
||||
}
|
||||
>
|
||||
<Button btnStyle='link'>
|
||||
<Icon icon='resource-set' /> {_('homeAllResourceSets')}
|
||||
</Button>
|
||||
</OverlayTrigger>
|
||||
)}
|
||||
<DropdownButton
|
||||
bsStyle='link'
|
||||
id='sort'
|
||||
|
@ -88,9 +88,8 @@ const isRunning = host => host && host.power_state === 'Running'
|
||||
const getHostPatches = createSelector(
|
||||
createGetObjectsOfType('pool_patch'),
|
||||
createGetObjectsOfType('host_patch').pick(
|
||||
createSelector(
|
||||
getHost,
|
||||
host => (isString(host.patches[0]) ? host.patches : [])
|
||||
createSelector(getHost, host =>
|
||||
isString(host.patches[0]) ? host.patches : []
|
||||
)
|
||||
),
|
||||
(poolsPatches, hostsPatches) =>
|
||||
|
@ -149,18 +149,15 @@ export default ({
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
{pool &&
|
||||
host.id === pool.master && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col>
|
||||
<h3>
|
||||
<span className='tag tag-pill tag-info'>
|
||||
{_('pillMaster')}
|
||||
</span>
|
||||
</h3>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{pool && host.id === pool.master && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col>
|
||||
<h3>
|
||||
<span className='tag tag-pill tag-info'>{_('pillMaster')}</span>
|
||||
</h3>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
</Row>
|
||||
<Row>
|
||||
<Col>
|
||||
|
@ -196,10 +196,9 @@ const LOG_RESTORE_COLUMNS = [
|
||||
itemRenderer: ({ id, vm, status }) => (
|
||||
<div>
|
||||
{vm !== undefined && <VmItem id={vm.id} link newTab />}
|
||||
{vm === undefined &&
|
||||
status === 'success' && (
|
||||
<span className='text-warning'>{_('logsVmNotFound')}</span>
|
||||
)}{' '}
|
||||
{vm === undefined && status === 'success' && (
|
||||
<span className='text-warning'>{_('logsVmNotFound')}</span>
|
||||
)}{' '}
|
||||
<span style={{ fontSize: '0.5em' }} className='text-muted'>
|
||||
{id}
|
||||
</span>
|
||||
@ -321,9 +320,8 @@ export default decorate([
|
||||
logs: cb =>
|
||||
subscribeBackupNgLogs(logs =>
|
||||
cb(
|
||||
groupBy(
|
||||
logs,
|
||||
log => (log.message === 'restore' ? 'restore' : 'backup')
|
||||
groupBy(logs, log =>
|
||||
log.message === 'restore' ? 'restore' : 'backup'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
@ -69,10 +69,10 @@ const JobCallStateInfos = ({ end, error, isJobInterrupted }) => {
|
||||
? ['skipped', 'jobCallSkipped']
|
||||
: ['halted', 'failedJobCall']
|
||||
: end !== undefined
|
||||
? ['running', 'successfulJobCall']
|
||||
: isJobInterrupted
|
||||
? ['halted', 'jobInterrupted']
|
||||
: ['busy', 'jobCallInProgess']
|
||||
? ['running', 'successfulJobCall']
|
||||
: isJobInterrupted
|
||||
? ['halted', 'jobInterrupted']
|
||||
: ['busy', 'jobCallInProgess']
|
||||
|
||||
return (
|
||||
<Tooltip content={_(tooltip)}>
|
||||
@ -401,8 +401,8 @@ const LOG_COLUMNS = [
|
||||
log.hasErrors
|
||||
? 'tag-danger'
|
||||
: log.callSkipped
|
||||
? 'tag-info'
|
||||
: 'tag-success'
|
||||
? 'tag-info'
|
||||
: 'tag-success'
|
||||
)}
|
||||
>
|
||||
{_('jobFinished')}
|
||||
|
@ -82,15 +82,14 @@ export default decorate([
|
||||
title='Backup job failed'
|
||||
/>
|
||||
)}
|
||||
{state.jobFailed &&
|
||||
log.scheduleId !== undefined && (
|
||||
<ActionButton
|
||||
handler={effects.restartFailedVms}
|
||||
icon='run'
|
||||
size='small'
|
||||
tooltip={_('backupRestartFailedVms')}
|
||||
/>
|
||||
)}
|
||||
{state.jobFailed && log.scheduleId !== undefined && (
|
||||
<ActionButton
|
||||
handler={effects.restartFailedVms}
|
||||
icon='run'
|
||||
size='small'
|
||||
tooltip={_('backupRestartFailedVms')}
|
||||
/>
|
||||
)}
|
||||
</ButtonGroup>
|
||||
</span>
|
||||
),
|
||||
|
@ -1111,17 +1111,16 @@ export default class NewVm extends BaseComponent {
|
||||
</Button>
|
||||
</span>
|
||||
</span>
|
||||
{this.props.userSshKeys &&
|
||||
this.props.userSshKeys.length > 0 && (
|
||||
<span className={styles.fixedWidth}>
|
||||
<SelectSshKey
|
||||
disabled={installMethod !== 'SSH'}
|
||||
onChange={this._onChangeSshKeys}
|
||||
multi
|
||||
value={sshKeys || []}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
{this.props.userSshKeys && this.props.userSshKeys.length > 0 && (
|
||||
<span className={styles.fixedWidth}>
|
||||
<SelectSshKey
|
||||
disabled={installMethod !== 'SSH'}
|
||||
onChange={this._onChangeSshKeys}
|
||||
multi
|
||||
value={sshKeys || []}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
</LineItem>
|
||||
<br />
|
||||
<LineItem>
|
||||
@ -1680,17 +1679,16 @@ export default class NewVm extends BaseComponent {
|
||||
</Item>
|
||||
</SectionContent>
|
||||
),
|
||||
template &&
|
||||
template.virtualizationMode === 'hvm' && (
|
||||
<SectionContent>
|
||||
<Item label={_('vmVgpu')}>
|
||||
<SelectVgpuType
|
||||
onChange={this._linkState('vgpuType')}
|
||||
predicate={this._getVgpuTypePredicate()}
|
||||
/>
|
||||
</Item>
|
||||
</SectionContent>
|
||||
),
|
||||
template && template.virtualizationMode === 'hvm' && (
|
||||
<SectionContent>
|
||||
<Item label={_('vmVgpu')}>
|
||||
<SelectVgpuType
|
||||
onChange={this._linkState('vgpuType')}
|
||||
predicate={this._getVgpuTypePredicate()}
|
||||
/>
|
||||
</Item>
|
||||
</SectionContent>
|
||||
),
|
||||
]}
|
||||
</Section>
|
||||
)
|
||||
|
@ -223,30 +223,29 @@ class Plugin extends Component {
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
{expanded &&
|
||||
props.testable && (
|
||||
<form id={this.testFormId}>
|
||||
{props.testSchema && (
|
||||
<GenericInput
|
||||
label='Test data'
|
||||
schema={props.testSchema}
|
||||
uiSchema={generateUiSchema(props.testSchema)}
|
||||
required
|
||||
ref='testInput'
|
||||
/>
|
||||
)}
|
||||
<div className='form-group pull-right'>
|
||||
<ActionButton
|
||||
btnStyle='primary'
|
||||
form={this.testFormId}
|
||||
handler={this._test}
|
||||
icon='diagnosis'
|
||||
>
|
||||
Test plugin
|
||||
</ActionButton>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
{expanded && props.testable && (
|
||||
<form id={this.testFormId}>
|
||||
{props.testSchema && (
|
||||
<GenericInput
|
||||
label='Test data'
|
||||
schema={props.testSchema}
|
||||
uiSchema={generateUiSchema(props.testSchema)}
|
||||
required
|
||||
ref='testInput'
|
||||
/>
|
||||
)}
|
||||
<div className='form-group pull-right'>
|
||||
<ActionButton
|
||||
btnStyle='primary'
|
||||
form={this.testFormId}
|
||||
handler={this._test}
|
||||
icon='diagnosis'
|
||||
>
|
||||
Test plugin
|
||||
</ActionButton>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -44,14 +44,13 @@ const UnhealthyVdiChains = flowRight(
|
||||
createSelector((_, props) => props.chains, keys)
|
||||
),
|
||||
}))
|
||||
)(
|
||||
({ chains, vdis }) =>
|
||||
isEmpty(vdis) ? null : (
|
||||
<div>
|
||||
<h3>{_('srUnhealthyVdiTitle', { total: sum(values(chains)) })}</h3>
|
||||
<SortedTable collection={vdis} columns={COLUMNS} userData={chains} />
|
||||
</div>
|
||||
)
|
||||
)(({ chains, vdis }) =>
|
||||
isEmpty(vdis) ? null : (
|
||||
<div>
|
||||
<h3>{_('srUnhealthyVdiTitle', { total: sum(values(chains)) })}</h3>
|
||||
<SortedTable collection={vdis} columns={COLUMNS} userData={chains} />
|
||||
</div>
|
||||
)
|
||||
)
|
||||
|
||||
export default ({ sr }) => (
|
||||
|
@ -300,48 +300,45 @@ class Node extends Component {
|
||||
]}
|
||||
</div>,
|
||||
<div>
|
||||
{status &&
|
||||
status.length !== 0 && (
|
||||
<Row className='mt-1'>
|
||||
<Col>
|
||||
<table className='table' style={{ maxWidth: '50em' }}>
|
||||
<thead>
|
||||
<th>{_('xosanJob')}</th>
|
||||
<th>{_('xosanPath')}</th>
|
||||
<th>{_('xosanStatus')}</th>
|
||||
<th>{_('xosanPid')}</th>
|
||||
<th>{_('xosanPort')}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{map(status, job => (
|
||||
<tr key={job.pid}>
|
||||
<td>{job.hostname}</td>
|
||||
<td>{job.path}</td>
|
||||
<td>{job.status}</td>
|
||||
<td>{job.pid}</td>
|
||||
<td>{job.port}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{status && status.length !== 0 && (
|
||||
<Row className='mt-1'>
|
||||
<Col>
|
||||
<table className='table' style={{ maxWidth: '50em' }}>
|
||||
<thead>
|
||||
<th>{_('xosanJob')}</th>
|
||||
<th>{_('xosanPath')}</th>
|
||||
<th>{_('xosanStatus')}</th>
|
||||
<th>{_('xosanPid')}</th>
|
||||
<th>{_('xosanPort')}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{map(status, job => (
|
||||
<tr key={job.pid}>
|
||||
<td>{job.hostname}</td>
|
||||
<td>{job.path}</td>
|
||||
<td>{job.status}</td>
|
||||
<td>{job.pid}</td>
|
||||
<td>{job.port}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
</div>,
|
||||
<div>
|
||||
{heal &&
|
||||
heal.file &&
|
||||
heal.file.length !== 0 && (
|
||||
<div>
|
||||
<h4>{_('xosanFilesNeedingHealing')}</h4>
|
||||
{map(heal.file, file => (
|
||||
<Row key={file.gfid}>
|
||||
<Col size={5}>{file._}</Col>
|
||||
<Col size={4}>{file.gfid}</Col>
|
||||
</Row>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{heal && heal.file && heal.file.length !== 0 && (
|
||||
<div>
|
||||
<h4>{_('xosanFilesNeedingHealing')}</h4>
|
||||
{map(heal.file, file => (
|
||||
<Row key={file.gfid}>
|
||||
<Col size={5}>{file._}</Col>
|
||||
<Col size={4}>{file.gfid}</Col>
|
||||
</Row>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>,
|
||||
]}
|
||||
</Container>
|
||||
@ -812,43 +809,42 @@ export default class TabXosan extends Component {
|
||||
/>{' '}
|
||||
{_('xosanAdvanced')}
|
||||
</h2>
|
||||
{strippedVolumeInfo &&
|
||||
showAdvanced && (
|
||||
<div>
|
||||
<h3>{_('xosanVolume')}</h3>
|
||||
<Container>
|
||||
<Field title='Name'>{strippedVolumeInfo.name}</Field>
|
||||
<Field title='Status'>{strippedVolumeInfo.statusStr}</Field>
|
||||
<Field title='Type'>{strippedVolumeInfo.typeStr}</Field>
|
||||
<Field title='Brick Count'>
|
||||
{strippedVolumeInfo.brickCount}
|
||||
{strippedVolumeInfo && showAdvanced && (
|
||||
<div>
|
||||
<h3>{_('xosanVolume')}</h3>
|
||||
<Container>
|
||||
<Field title='Name'>{strippedVolumeInfo.name}</Field>
|
||||
<Field title='Status'>{strippedVolumeInfo.statusStr}</Field>
|
||||
<Field title='Type'>{strippedVolumeInfo.typeStr}</Field>
|
||||
<Field title='Brick Count'>
|
||||
{strippedVolumeInfo.brickCount}
|
||||
</Field>
|
||||
<Field title='Stripe Count'>
|
||||
{strippedVolumeInfo.stripeCount}
|
||||
</Field>
|
||||
<Field title='Replica Count'>
|
||||
{strippedVolumeInfo.replicaCount}
|
||||
</Field>
|
||||
<Field title='Arbiter Count'>
|
||||
{strippedVolumeInfo.arbiterCount}
|
||||
</Field>
|
||||
<Field title='Disperse Count'>
|
||||
{strippedVolumeInfo.disperseCount}
|
||||
</Field>
|
||||
<Field title='Redundancy Count'>
|
||||
{strippedVolumeInfo.redundancyCount}
|
||||
</Field>
|
||||
</Container>
|
||||
<h3 className='mt-1'>{_('xosanVolumeOptions')}</h3>
|
||||
<Container>
|
||||
{map(strippedVolumeInfo.options, option => (
|
||||
<Field key={option.name} title={option.name}>
|
||||
{option.value}
|
||||
</Field>
|
||||
<Field title='Stripe Count'>
|
||||
{strippedVolumeInfo.stripeCount}
|
||||
</Field>
|
||||
<Field title='Replica Count'>
|
||||
{strippedVolumeInfo.replicaCount}
|
||||
</Field>
|
||||
<Field title='Arbiter Count'>
|
||||
{strippedVolumeInfo.arbiterCount}
|
||||
</Field>
|
||||
<Field title='Disperse Count'>
|
||||
{strippedVolumeInfo.disperseCount}
|
||||
</Field>
|
||||
<Field title='Redundancy Count'>
|
||||
{strippedVolumeInfo.redundancyCount}
|
||||
</Field>
|
||||
</Container>
|
||||
<h3 className='mt-1'>{_('xosanVolumeOptions')}</h3>
|
||||
<Container>
|
||||
{map(strippedVolumeInfo.options, option => (
|
||||
<Field key={option.name} title={option.name}>
|
||||
{option.value}
|
||||
</Field>
|
||||
))}
|
||||
</Container>
|
||||
</div>
|
||||
)}
|
||||
))}
|
||||
</Container>
|
||||
</div>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
|
@ -51,24 +51,22 @@ const vmActionBarByState = {
|
||||
pending={includes(vm.current_operations, 'snapshot')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
</ActionBar>
|
||||
),
|
||||
Halted: ({ vm, isSelfUser, canAdministrate }) => (
|
||||
@ -79,15 +77,14 @@ const vmActionBarByState = {
|
||||
label={_('startVmLabel')}
|
||||
pending={includes(vm.current_operations, 'start')}
|
||||
/>
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={cloneVm}
|
||||
icon='vm-fast-clone'
|
||||
label={_('fastCloneVmLabel')}
|
||||
pending={includes(vm.current_operations, 'clone')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={cloneVm}
|
||||
icon='vm-fast-clone'
|
||||
label={_('fastCloneVmLabel')}
|
||||
pending={includes(vm.current_operations, 'clone')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && (
|
||||
<Action
|
||||
handler={migrateVm}
|
||||
@ -107,24 +104,22 @@ const vmActionBarByState = {
|
||||
pending={includes(vm.current_operations, 'snapshot')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
</ActionBar>
|
||||
),
|
||||
Suspended: ({ vm, isSelfUser, canAdministrate }) => (
|
||||
@ -143,24 +138,22 @@ const vmActionBarByState = {
|
||||
pending={includes(vm.current_operations, 'snapshot')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser &&
|
||||
canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={exportVm}
|
||||
icon='export'
|
||||
label={_('exportVmLabel')}
|
||||
pending={includes(vm.current_operations, 'export')}
|
||||
/>
|
||||
)}
|
||||
{!isSelfUser && canAdministrate && (
|
||||
<Action
|
||||
handler={copyVm}
|
||||
icon='vm-copy'
|
||||
label={_('copyVmLabel')}
|
||||
pending={includes(vm.current_operations, 'copy')}
|
||||
/>
|
||||
)}
|
||||
</ActionBar>
|
||||
),
|
||||
}
|
||||
|
@ -190,23 +190,22 @@ export default class Vm extends BaseComponent {
|
||||
onChange={this._setNameDescription}
|
||||
/>
|
||||
<span className='text-muted'>
|
||||
{vm.power_state === 'Running' &&
|
||||
container && (
|
||||
<span>
|
||||
<span> - </span>
|
||||
<Select
|
||||
onChange={this._migrateVm}
|
||||
options={hosts}
|
||||
renderer={this._selectOptionRenderer}
|
||||
useLongClick
|
||||
value={container}
|
||||
>
|
||||
<Link to={`/${container.type}s/${container.id}`}>
|
||||
{container.name_label}
|
||||
</Link>
|
||||
</Select>
|
||||
</span>
|
||||
)}{' '}
|
||||
{vm.power_state === 'Running' && container && (
|
||||
<span>
|
||||
<span> - </span>
|
||||
<Select
|
||||
onChange={this._migrateVm}
|
||||
options={hosts}
|
||||
renderer={this._selectOptionRenderer}
|
||||
useLongClick
|
||||
value={container}
|
||||
>
|
||||
<Link to={`/${container.type}s/${container.id}`}>
|
||||
{container.name_label}
|
||||
</Link>
|
||||
</Select>
|
||||
</span>
|
||||
)}{' '}
|
||||
{pool && (
|
||||
<Link to={`/pools/${pool.id}`}>{pool.name_label}</Link>
|
||||
)}
|
||||
|
@ -67,35 +67,34 @@ export default class TabConsole extends Component {
|
||||
|
||||
return (
|
||||
<Container>
|
||||
{!minimalLayout &&
|
||||
statsOverview && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='cpu' size={2} />{' '}
|
||||
<CpuSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='memory' size={2} />{' '}
|
||||
<MemorySparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='network' size={2} />{' '}
|
||||
<NetworkSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='disk' size={2} />{' '}
|
||||
<XvdSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{!minimalLayout && statsOverview && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='cpu' size={2} />{' '}
|
||||
<CpuSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='memory' size={2} />{' '}
|
||||
<MemorySparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='network' size={2} />{' '}
|
||||
<NetworkSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
<Col mediumSize={3}>
|
||||
<p>
|
||||
<Icon icon='disk' size={2} />{' '}
|
||||
<XvdSparkLines data={statsOverview} />
|
||||
</p>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
<Row>
|
||||
<Col mediumSize={3}>
|
||||
<IsoDevice vm={vm} />
|
||||
|
@ -165,15 +165,14 @@ export default connectStore(() => {
|
||||
</BlockLink>
|
||||
</Col>
|
||||
</Row>
|
||||
{!vm.xenTools &&
|
||||
vm.power_state === 'Running' && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col>
|
||||
<Icon icon='error' />
|
||||
<em> {_('noToolsDetected')}.</em>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{!vm.xenTools && vm.power_state === 'Running' && (
|
||||
<Row className='text-xs-center'>
|
||||
<Col>
|
||||
<Icon icon='error' />
|
||||
<em> {_('noToolsDetected')}.</em>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{/* TODO: use CSS style */}
|
||||
<br />
|
||||
<Row>
|
||||
|
@ -34,25 +34,24 @@ const HEADER = (
|
||||
const Xoa = routes('xoa', {
|
||||
update: Update,
|
||||
licenses: Licenses,
|
||||
})(
|
||||
({ children }) =>
|
||||
+process.env.XOA_PLAN === 5 ? (
|
||||
<Container>
|
||||
<h2 className='text-danger'>{_('noUpdaterCommunity')}</h2>
|
||||
<p>
|
||||
{_('considerSubscribe', {
|
||||
link: (
|
||||
<a href='https://xen-orchestra.com'>https://xen-orchestra.com</a>
|
||||
),
|
||||
})}
|
||||
</p>
|
||||
<p className='text-danger'>{_('noUpdaterWarning')}</p>
|
||||
</Container>
|
||||
) : (
|
||||
<Page header={HEADER} title='xoaPage' formatTitle>
|
||||
{children}
|
||||
</Page>
|
||||
)
|
||||
})(({ children }) =>
|
||||
+process.env.XOA_PLAN === 5 ? (
|
||||
<Container>
|
||||
<h2 className='text-danger'>{_('noUpdaterCommunity')}</h2>
|
||||
<p>
|
||||
{_('considerSubscribe', {
|
||||
link: (
|
||||
<a href='https://xen-orchestra.com'>https://xen-orchestra.com</a>
|
||||
),
|
||||
})}
|
||||
</p>
|
||||
<p className='text-danger'>{_('noUpdaterWarning')}</p>
|
||||
</Container>
|
||||
) : (
|
||||
<Page header={HEADER} title='xoaPage' formatTitle>
|
||||
{children}
|
||||
</Page>
|
||||
)
|
||||
)
|
||||
|
||||
export default Xoa
|
||||
|
@ -427,17 +427,16 @@ const Updates = decorate([
|
||||
{state.isTrialConsumed && <p>{_('trialConsumed')}</p>}
|
||||
</div>
|
||||
)}
|
||||
{process.env.XOA_PLAN > 1 &&
|
||||
process.env.XOA_PLAN < 5 && (
|
||||
<div>
|
||||
{xoaTrialState.state === 'trustedTrial' && (
|
||||
<p>{xoaTrialState.message}</p>
|
||||
)}
|
||||
{xoaTrialState.state === 'untrustedTrial' && (
|
||||
<p className='text-danger'>{xoaTrialState.message}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{process.env.XOA_PLAN > 1 && process.env.XOA_PLAN < 5 && (
|
||||
<div>
|
||||
{xoaTrialState.state === 'trustedTrial' && (
|
||||
<p>{xoaTrialState.message}</p>
|
||||
)}
|
||||
{xoaTrialState.state === 'untrustedTrial' && (
|
||||
<p className='text-danger'>{xoaTrialState.message}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{process.env.XOA_PLAN < 5 && (
|
||||
<div>
|
||||
{state.isUpdaterDown && (
|
||||
|
@ -180,12 +180,9 @@ const XOSAN_COLUMNS = [
|
||||
{_('xosanLicenseExpiresDate', {
|
||||
date: <ShortDate timestamp={license.expires} />,
|
||||
})}{' '}
|
||||
{expiresSoon &&
|
||||
isAdmin && (
|
||||
<Link to='/xoa/licenses'>
|
||||
{_('xosanUpdateLicenseMessage')}
|
||||
</Link>
|
||||
)}
|
||||
{expiresSoon && isAdmin && (
|
||||
<Link to='/xoa/licenses'>{_('xosanUpdateLicenseMessage')}</Link>
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
@ -398,7 +395,7 @@ export default class Xosan extends Component {
|
||||
}
|
||||
|
||||
if (!this._isXosanRegistered()) {
|
||||
;registerXosan()::ignoreErrors()
|
||||
registerXosan()::ignoreErrors()
|
||||
}
|
||||
|
||||
this.setState({ showNewXosanForm: true })
|
||||
|
Loading…
Reference in New Issue
Block a user