Compare commits

..

66 Commits

Author SHA1 Message Date
Mohamedox
28523e591a fix 2019-09-26 16:43:11 +02:00
Mohamedox
e935cf8283 Adapt PR to comments 2019-09-26 16:18:44 +02:00
Mohamedox
87db911e5a delete forgotten comment 2019-09-26 15:57:40 +02:00
Mohamedox
ec6d3fd128 fix 2019-09-26 15:50:06 +02:00
Mohamedox
3aaafef88e adapt PR to comments 2019-09-26 15:22:38 +02:00
Mohamedox
714e4f4ea2 update changelog 2019-09-26 11:05:08 +02:00
Mohamedox
77b0914e48 fix 2019-09-26 10:31:28 +02:00
Mohamedox
5c4a362529 adapt PR to comments 2019-09-26 10:29:09 +02:00
Mohamedox
d7bcdfac19 fix 2019-09-25 17:20:32 +02:00
Mohamedox
5a3e895ce5 fix 2019-09-25 17:19:31 +02:00
Mohamedox
a7d08ac91e fix 2019-09-25 17:11:27 +02:00
Mohamedox
7ff48f3aa9 last fix 2019-09-25 16:38:27 +02:00
Mohamedox
7f42ab15dd fix 2019-09-25 16:22:35 +02:00
Mohamedox
3b7d02de95 fix 2019-09-25 16:17:43 +02:00
Mohamedox
3fdac01eb8 fix 2019-09-25 15:18:09 +02:00
Mohamedox
5601740334 fix 2019-09-25 14:48:50 +02:00
Mohamedox
f824cbe710 adapt PR to comments 2019-09-25 14:38:41 +02:00
Mohamedox
510f30eb23 fix 2019-09-25 13:38:56 +02:00
Mohamedox
c84eded0aa Adapt PR to comments 2019-09-25 11:59:10 +02:00
Mohamedox
02ed02926b update changelog 2019-09-25 10:17:56 +02:00
Mohamedox
77c172fce0 adapt Pr to comments 2019-09-25 10:17:55 +02:00
Mohamedox
c48e017711 fix 2019-09-25 10:17:55 +02:00
Mohamedox
855ec06628 Adapt PR to comments 2019-09-25 10:17:54 +02:00
Mohamedox
9e4b606372 fix 2019-09-25 10:17:32 +02:00
Mohamedox
de1c8f4d4f adapt PR to comments 2019-09-25 10:17:32 +02:00
Mohamedox
876562570c Adapt PR to comments 2019-09-25 10:17:31 +02:00
Mohamedox
bab514ffc4 fix 2019-09-25 10:17:00 +02:00
Mohamedox
dc15965972 fix 2019-09-25 10:16:59 +02:00
Mohamedox
903b7fed50 adapt PR to comments 2019-09-25 10:16:58 +02:00
Mohamedox
f62bdeae1b adapt PR to comments 2019-09-25 10:16:58 +02:00
Mohamedox
e259e72c92 fix 2019-09-25 10:16:57 +02:00
Mohamedox
2a64a4810b adapt PR to comments 2019-09-25 10:16:57 +02:00
Mohamedox
a543e05561 adapt pr to comments 2019-09-25 10:16:56 +02:00
Mohamedox
2c7ca39a77 Display error when pool has no default SR 2019-09-25 10:16:56 +02:00
Mohamedox
9ada70a5ab fix 2019-09-25 10:16:55 +02:00
Mohamedox
a574f9d8dc initialize template when changing page 2019-09-25 10:16:32 +02:00
Mohamedox
9a4f9a8978 fix 2019-09-25 10:16:31 +02:00
Mohamedox
1cdf14e587 fix 2019-09-25 10:16:30 +02:00
Mohamedox
9272524264 xva-store v1 2019-09-25 10:16:29 +02:00
Mohamedox
027dfd262f adapt PR to new specs 2019-09-25 10:16:28 +02:00
Mohamedox
8967ad94dc version 1.0 2019-09-25 10:16:27 +02:00
Mohamedox
48a0684097 xva store with popularity 2019-09-25 10:16:27 +02:00
Mohamedox
1caa98ea8b wip 2019-09-25 10:16:26 +02:00
Mohamedox
01e15ae4ec fix 2019-09-25 10:16:26 +02:00
Mohamedox
5077de953d adapt to new specs 2019-09-25 10:16:25 +02:00
Mohamedox
fab3751734 wip 2019-09-25 10:16:24 +02:00
Mohamedox
97df5d9e32 adapt PR to comments 2019-09-25 10:16:24 +02:00
Mohamedox
e2180303da change routing 2019-09-25 10:16:23 +02:00
Mohamedox
e2ddb62e5f mutualize code 2019-09-25 10:16:23 +02:00
Mohamedox
9e4265ae72 update changelog 2019-09-25 10:16:22 +02:00
Mohamedox
ec30e20278 fix 2019-09-25 10:15:51 +02:00
Mohamedox
1bf41b915c fix 2019-09-25 10:15:50 +02:00
Mohamedox
03e8cd0f7b change permission 2019-09-25 10:15:49 +02:00
Mohamedox
bf03dbd8dc fix 2019-09-25 10:15:49 +02:00
Mohamedox
570c9f6e0f enhance code quality 2019-09-25 10:15:48 +02:00
Mohamedox
e7016a4a40 fix 2019-09-25 10:15:47 +02:00
Mohamedox
f980ad58d4 xva 2019-09-25 10:15:46 +02:00
Mohamedox
a8af5a166d must subscribe 2019-09-25 10:15:46 +02:00
Mohamedox
d0acefaa04 poc version 2019-09-25 10:15:45 +02:00
Mohamedox
54fcc2e0db progress bar 2019-09-25 10:15:44 +02:00
Mohamedox
2d3f02cbbd wip 2019-09-25 10:15:43 +02:00
Mohamedox
13dd57bad7 only registred customer can download 2019-09-25 10:15:42 +02:00
Mohamedox
d9e26d155c wip 2019-09-25 10:15:41 +02:00
Mohamedox
c9556c44c9 WIP: feat(xo-web/hub): XO Vms HUB 2019-09-25 10:15:41 +02:00
Mohamedox
916b3ec662 adapt PR to comments 2019-09-25 10:15:40 +02:00
Mohamedox
f1cff1275c feat(xo-web/new-vm): create new VM with predefined template ID in URL query string
Fixes #4494
2019-09-25 10:15:39 +02:00
24 changed files with 63 additions and 142 deletions

View File

@@ -16,7 +16,7 @@
},
"dependencies": {
"golike-defer": "^0.4.1",
"xen-api": "^0.27.2"
"xen-api": "^0.27.1"
},
"scripts": {
"postversion": "npm publish"

View File

@@ -1,6 +1,6 @@
{
"name": "@xen-orchestra/log",
"version": "0.2.0",
"version": "0.1.4",
"license": "ISC",
"description": "",
"keywords": [],

View File

@@ -51,12 +51,11 @@ const symbol =
? Symbol.for('@xen-orchestra/log')
: '@@@xen-orchestra/log'
const { env } = process
global[symbol] = createTransport({
// display warnings or above, and all that are enabled via DEBUG or
// NODE_DEBUG env
filter: [env.DEBUG, env.NODE_DEBUG].filter(Boolean).join(','),
level: resolve(env.LOG_LEVEL, LEVELS.INFO),
filter: process.env.DEBUG || process.env.NODE_DEBUG,
level: LEVELS.INFO,
transport: createConsoleTransport(),
})

View File

@@ -1,5 +1,5 @@
import createTransport from './transports/console'
import LEVELS, { resolve } from './levels'
import LEVELS from './levels'
const symbol =
typeof Symbol !== 'undefined'
@@ -9,8 +9,7 @@ if (!(symbol in global)) {
// the default behavior, without requiring `configure` is to avoid
// logging anything unless it's a real error
const transport = createTransport()
const level = resolve(process.env.LOG_LEVEL, LEVELS.WARN)
global[symbol] = log => log.level >= level && transport(log)
global[symbol] = log => log.level > LEVELS.WARN && transport(log)
}
// -------------------------------------------------------------------
@@ -73,5 +72,5 @@ prototype.wrap = function(message, fn) {
}
}
export const createLogger = namespace => new Logger(namespace)
const createLogger = namespace => new Logger(namespace)
export { createLogger as default }

View File

@@ -13,22 +13,11 @@ for (const name in LEVELS) {
NAMES[LEVELS[name]] = name
}
// resolves to the number representation of a level
//
// returns `defaultLevel` if invalid
export const resolve = (level, defaultLevel) => {
const type = typeof level
if (type === 'number') {
if (level in NAMES) {
return level
}
} else if (type === 'string') {
const nLevel = LEVELS[level.toUpperCase()]
if (nLevel !== undefined) {
return nLevel
}
export const resolve = level => {
if (typeof level === 'string') {
level = LEVELS[level.toUpperCase()]
}
return defaultLevel
return level
}
Object.freeze(LEVELS)

View File

@@ -1,23 +1,26 @@
import LEVELS, { NAMES } from '../levels'
// Bind console methods (necessary for browsers)
/* eslint-disable no-console */
const debugConsole = console.log.bind(console)
const infoConsole = console.info.bind(console)
const warnConsole = console.warn.bind(console)
const errorConsole = console.error.bind(console)
/* eslint-enable no-console */
const { ERROR, INFO, WARN } = LEVELS
const consoleTransport = ({ data, level, namespace, message, time }) => {
const fn =
/* eslint-disable no-console */
level < INFO
? console.log
? debugConsole
: level < WARN
? console.info
? infoConsole
: level < ERROR
? console.warn
: console.error
/* eslint-enable no-console */
? warnConsole
: errorConsole
const args = [time.toISOString(), namespace, NAMES[level], message]
if (data != null) {
args.push(data)
}
fn.apply(console, args)
fn('%s - %s - [%s] %s', time.toISOString(), namespace, NAMES[level], message)
data != null && fn(data)
}
export default () => consoleTransport

View File

@@ -12,12 +12,6 @@
- [SDN Controller] Ability to configure MTU for private networks (PR [#4491](https://github.com/vatesfr/xen-orchestra/pull/4491))
- [VM Export] Filenames are now prefixed with datetime [#4503](https://github.com/vatesfr/xen-orchestra/issues/4503)
- [Backups] Improve performance by caching VM backups listing (PR [#4509](https://github.com/vatesfr/xen-orchestra/pull/4509))
- [Settings/Logs] Differenciate XS/XCP-ng errors from XO errors [#4101](https://github.com/vatesfr/xen-orchestra/issues/4101) (PR [#4385](https://github.com/vatesfr/xen-orchestra/pull/4385))
- [Backups] Improve performance by caching logs consolidation (PR [#4541](https://github.com/vatesfr/xen-orchestra/pull/4541))
- [New VM] Cloud Init available for all plans (PR [#4543](https://github.com/vatesfr/xen-orchestra/pull/4543))
- [Servers] IPv6 addresses can be used [#4520](https://github.com/vatesfr/xen-orchestra/issues/4520) (PR [#4521](https://github.com/vatesfr/xen-orchestra/pull/4521)) \
Note: They must enclosed in brackets to differentiate with the port, e.g.: `[2001:db8::7334]` or `[ 2001:db8::7334]:4343`
- [HUB] VM template store [#1918](https://github.com/vatesfr/xen-orchestra/issues/1918) (PR [#4442](https://github.com/vatesfr/xen-orchestra/pull/4442))
### Bug fixes
@@ -36,18 +30,15 @@
- [XOA] Remove "Updates" and "Licenses" tabs for non admin users (PR [#4526](https://github.com/vatesfr/xen-orchestra/pull/4526))
- [New VM] Ability to escape [cloud config template](https://xen-orchestra.com/blog/xen-orchestra-5-21/#cloudconfigtemplates) variables [#4486](https://github.com/vatesfr/xen-orchestra/issues/4486) (PR [#4501](https://github.com/vatesfr/xen-orchestra/pull/4501))
- [Backup NG] Properly log and report if job is already running [#4497](https://github.com/vatesfr/xen-orchestra/issues/4497) (PR [4534](https://github.com/vatesfr/xen-orchestra/pull/4534))
- [Host] Fix an issue where host was wrongly reporting time inconsistency (PR [#4540](https://github.com/vatesfr/xen-orchestra/pull/4540))
### Released packages
- xen-api v0.27.2
- xo-server-cloud v0.3.0
- @xen-orchestra/cron v1.0.4
- xo-server-sdn-controller v0.3.0
- @xen-orchestra/template v0.1.0
- xo-server v5.50.1
- xo-web v5.50.1
- xo-server v5.50.0
- xo-web v5.50.0
## **5.38.0** (2019-08-29)

View File

@@ -7,11 +7,18 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Settings/Logs] Differenciate XS/XCP-ng errors from XO errors [#4101](https://github.com/vatesfr/xen-orchestra/issues/4101) (PR [#4385](https://github.com/vatesfr/xen-orchestra/pull/4385))
- [Backups] Improve performance by caching logs consolidation (PR [#4541](https://github.com/vatesfr/xen-orchestra/pull/4541))
- [New VM] Cloud Init available for all plans (PR [#4543](https://github.com/vatesfr/xen-orchestra/pull/4543))
- [Servers] IPv6 addresses can be used [#4520](https://github.com/vatesfr/xen-orchestra/issues/4520) (PR [#4521](https://github.com/vatesfr/xen-orchestra/pull/4521)) \
Note: They must enclosed in brackets to differentiate with the port, e.g.: `[2001:db8::7334]` or `[ 2001:db8::7334]:4343`
- [HUB] VM template store [#1918](https://github.com/vatesfr/xen-orchestra/issues/1918) (PR [#4442](https://github.com/vatesfr/xen-orchestra/pull/4442))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Host] Fix an issue where host was wrongly reporting time inconsistency (PR [#4540](https://github.com/vatesfr/xen-orchestra/pull/4540))
### Released packages
@@ -20,5 +27,7 @@
>
> Rule of thumb: add packages on top.
- xen-api v0.27.2
- xo-server-cloud v0.3.0
- xo-server v5.51.0
- xo-web v5.51.0

View File

@@ -1,19 +1,15 @@
### Check list
> Check if done.
>
> Strikethrough if not relevant: ~~example~~ ([doc](https://help.github.com/en/articles/basic-writing-and-formatting-syntax)).
> Check items when done or if not relevant
- [ ] PR reference the relevant issue (e.g. `Fixes #007` or `See xoa-support#42`)
- [ ] PR reference the relevant issue (e.g. `Fixes #007`)
- [ ] if UI changes, a screenshot has been added to the PR
- [ ] if `xo-server` API changes, the corresponding test has been added to/updated on [`xo-server-test`](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-server-test)
- [ ] `CHANGELOG.unreleased.md`:
- enhancement/bug fix entry added
- list of packages to release updated (`${name} v${new version}`)
- [ ] documentation updated
- `CHANGELOG.unreleased.md`:
- [ ] enhancement/bug fix entry added
- [ ] list of packages to release updated (`${name} v${new version}`)
- **I have tested added/updated features** (and impacted code)
- [ ] unit tests (e.g. [`cron/parse.spec.js`](https://github.com/vatesfr/xen-orchestra/blob/b24400b21de1ebafa1099c56bac1de5c988d9202/%40xen-orchestra/cron/src/parse.spec.js))
- [ ] if `xo-server` API changes, the corresponding test has been added to/updated on [`xo-server-test`](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-server-test)
- [ ] at least manual testing
- [ ] **I have tested added/updated features** (and impacted code)
### Process
@@ -21,10 +17,3 @@
1. mark it as `WiP:` (Work in Progress) if not ready to be merged
1. when you want a review, add a reviewer (and only one)
1. if necessary, update your PR, and re- add a reviewer
From [_the Four Agreements_](https://en.wikipedia.org/wiki/Don_Miguel_Ruiz#The_Four_Agreements):
1. Be impeccable with your word.
1. Don't take anything personally.
1. Don't make assumptions.
1. Always do your best.

View File

@@ -41,7 +41,7 @@
"human-format": "^0.10.0",
"lodash": "^4.17.4",
"pw": "^0.0.4",
"xen-api": "^0.27.2"
"xen-api": "^0.27.1"
},
"devDependencies": {
"@babel/cli": "^7.1.5",

View File

@@ -1,6 +1,6 @@
{
"name": "xen-api",
"version": "0.27.2",
"version": "0.27.1",
"license": "ISC",
"description": "Connector to the Xen API",
"keywords": [

View File

@@ -36,7 +36,7 @@
"node": ">=6"
},
"dependencies": {
"@xen-orchestra/log": "^0.2.0",
"@xen-orchestra/log": "^0.1.4",
"human-format": "^0.10.0",
"lodash": "^4.13.1",
"moment-timezone": "^0.5.13"

View File

@@ -1,6 +1,6 @@
{
"name": "xo-server-cloud",
"version": "0.3.0",
"version": "0.2.4",
"license": "ISC",
"description": "",
"keywords": [

View File

@@ -28,7 +28,7 @@
"cross-env": "^5.2.0"
},
"dependencies": {
"@xen-orchestra/log": "^0.2.0",
"@xen-orchestra/log": "^0.1.4",
"lodash": "^4.17.11",
"node-openssl-cert": "^0.0.97",
"promise-toolbox": "^0.13.0",

View File

@@ -210,10 +210,6 @@ class XoConnection extends Xo {
return backups
}
getBackupLogs(filter) {
return this.call('backupNg.getLogs', { _forceRefresh: true, ...filter })
}
async _cleanDisposers(disposers) {
for (let n = disposers.length - 1; n > 0; ) {
const params = disposers[n--]

View File

@@ -221,7 +221,7 @@ describe('backupNg', () => {
expect(typeof schedule).toBe('object')
await xo.call('backupNg.runJob', { id: jobId, schedule: schedule.id })
const [log] = await xo.getBackupLogs({
const [log] = await xo.call('backupNg.getLogs', {
scheduleId: schedule.id,
})
expect(log.warnings).toMatchSnapshot()
@@ -260,7 +260,7 @@ describe('backupNg', () => {
tasks: [vmTask],
...log
},
] = await xo.getBackupLogs({
] = await xo.call('backupNg.getLogs', {
jobId,
scheduleId: schedule.id,
})
@@ -319,7 +319,7 @@ describe('backupNg', () => {
tasks: [task],
...log
},
] = await xo.getBackupLogs({
] = await xo.call('backupNg.getLogs', {
jobId,
scheduleId: schedule.id,
})
@@ -415,7 +415,7 @@ describe('backupNg', () => {
tasks: [{ tasks: subTasks, ...vmTask }],
...log
},
] = await xo.getBackupLogs({
] = await xo.call('backupNg.getLogs', {
jobId,
scheduleId: schedule.id,
})
@@ -506,7 +506,7 @@ describe('backupNg', () => {
expect(backups.length).toBe(exportRetention)
)
const backupLogs = await xo.getBackupLogs({
const backupLogs = await xo.call('backupNg.getLogs', {
jobId,
scheduleId: schedule.id,
})

View File

@@ -37,7 +37,7 @@
"dependencies": {
"@xen-orchestra/async-map": "^0.0.0",
"@xen-orchestra/cron": "^1.0.4",
"@xen-orchestra/log": "^0.2.0",
"@xen-orchestra/log": "^0.1.4",
"handlebars": "^4.0.6",
"html-minifier": "^4.0.0",
"human-format": "^0.10.0",

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "xo-server",
"version": "5.50.1",
"version": "5.50.0",
"license": "AGPL-3.0",
"description": "Server part of Xen-Orchestra",
"keywords": [
@@ -39,7 +39,7 @@
"@xen-orchestra/defined": "^0.0.0",
"@xen-orchestra/emit-async": "^0.0.0",
"@xen-orchestra/fs": "^0.10.1",
"@xen-orchestra/log": "^0.2.0",
"@xen-orchestra/log": "^0.1.4",
"@xen-orchestra/mixin": "^0.0.0",
"ajv": "^6.1.1",
"app-conf": "^0.7.0",
@@ -124,7 +124,7 @@
"value-matcher": "^0.2.0",
"vhd-lib": "^0.7.0",
"ws": "^6.0.0",
"xen-api": "^0.27.2",
"xen-api": "^0.27.1",
"xml2js": "^0.4.19",
"xo-acl-resolver": "^0.4.1",
"xo-collection": "^0.4.1",

View File

@@ -16,10 +16,6 @@ function scheduleRemoveCacheEntry(keys, expires) {
const defaultKeyFn = () => []
const { slice } = Array.prototype
export const REMOVE_CACHE_ENTRY = {}
// debounce an async function so that all subsequent calls in a delay receive
// the same result
//
@@ -30,14 +26,7 @@ export const REMOVE_CACHE_ENTRY = {}
export const debounceWithKey = (fn, delay, keyFn = defaultKeyFn) => {
const cache = new MultiKeyMap()
const delayFn = typeof delay === 'number' ? () => delay : delay
return function(arg) {
if (arg === REMOVE_CACHE_ENTRY) {
return removeCacheEntry(
cache,
ensureArray(keyFn.apply(this, slice.call(arguments, 1)))
)
}
return function() {
const keys = ensureArray(keyFn.apply(this, arguments))
let promise = cache.get(keys)
if (promise === undefined) {

View File

@@ -1,29 +0,0 @@
/* eslint-env jest */
import { debounceWithKey, REMOVE_CACHE_ENTRY } from './_pDebounceWithKey'
describe('REMOVE_CACHE_ENTRY', () => {
it('clears the cache', async () => {
let i = 0
const debouncedFn = debounceWithKey(
function() {
return Promise.resolve(++i)
},
Infinity,
id => id
)
// not cached accross keys
expect(await debouncedFn(1)).toBe(1)
expect(await debouncedFn(2)).toBe(2)
// retrieve the already cached values
expect(await debouncedFn(1)).toBe(1)
expect(await debouncedFn(2)).toBe(2)
// an entry for a specific key can be removed
debouncedFn(REMOVE_CACHE_ENTRY, 1)
expect(await debouncedFn(1)).toBe(3)
expect(await debouncedFn(2)).toBe(2)
})
})

View File

@@ -3,7 +3,6 @@ import { fromCallback } from 'promise-toolbox'
import { pipeline } from 'readable-stream'
import createNdJsonStream from '../_createNdJsonStream'
import { REMOVE_CACHE_ENTRY } from '../_pDebounceWithKey'
import { safeDateFormat } from '../utils'
export function createJob({ schedules, ...job }) {
@@ -185,20 +184,7 @@ getAllLogs.params = {
ndjson: { type: 'boolean', optional: true },
}
export function getLogs({
after,
before,
limit,
// TODO: it's a temporary work-around which should be removed
// when the consolidated logs will be stored in the DB
_forceRefresh = false,
...filter
}) {
if (_forceRefresh) {
this.getBackupNgLogs(REMOVE_CACHE_ENTRY)
}
export function getLogs({ after, before, limit, ...filter }) {
return this.getBackupNgLogsSorted({ after, before, limit, filter })
}

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "xo-web",
"version": "5.50.1",
"version": "5.50.0",
"license": "AGPL-3.0",
"description": "Web interface client for Xen-Orchestra",
"keywords": [

View File

@@ -54,7 +54,7 @@ export default decorate([
version,
} = this.props
const { isTemplateInstalled } = this.state
if (getXoaPlan() === 'Community') {
if (getXoaPlan(+process.env.XOA_PLAN) === 'Community') {
subscribeAlert()
return
}
@@ -96,7 +96,7 @@ export default decorate([
async create() {
const { isPoolCreated, installedTemplates } = this.state
const { name } = this.props
if (getXoaPlan() === 'Community') {
if (getXoaPlan(+process.env.XOA_PLAN) === 'Community') {
subscribeAlert()
return
}

View File

@@ -65,7 +65,7 @@ require('exec-promise')(() =>
const originalScripts = scripts
if (!pkg.private && !('postversion' in scripts)) {
scripts = { ...scripts, postversion: 'npm publish --access public' }
scripts = { ...scripts, postversion: 'npm publish' }
}
const prepublish = scripts.prepublish