Compare commits

..

1 Commits

Author SHA1 Message Date
Julien Fontanet
dae51a61af wip 2024-09-02 13:31:44 +02:00
340 changed files with 5549 additions and 12858 deletions

View File

@@ -39,12 +39,6 @@ module.exports = {
version: '>=16',
},
],
'n/no-unsupported-features/es-builtins': [
'error',
{
version: '>=16',
},
],
'n/no-unsupported-features/es-syntax': [
'error',
{

View File

@@ -24,7 +24,7 @@
"@xen-orchestra/async-map": "^0.1.2",
"@xen-orchestra/log": "^0.6.0",
"promise-toolbox": "^0.21.0",
"xen-api": "^4.3.1"
"xen-api": "^4.2.0"
},
"devDependencies": {
"tap": "^18.7.0",

View File

@@ -6,11 +6,9 @@ exports.parseDuration = value => {
if (typeof value === 'number') {
return value
}
if (typeof value === 'string' && value !== '') {
const duration = ms(value)
if (duration !== undefined) {
return duration
}
const duration = ms(value)
if (duration === undefined) {
throw new TypeError(`not a valid duration: ${value}`)
}
throw new TypeError(`not a valid duration: ${value}`)
return duration
}

View File

@@ -1,22 +0,0 @@
import { describe, it } from 'node:test'
import { parseDuration } from '@vates/parse-duration'
import assert from 'node:assert/strict'
describe('parseDuration()', () => {
it('should parse string', () => {
const input = '2 days'
const expected = 172800000
assert.strictEqual(parseDuration(input), expected)
})
it('should return its input if already a number', () => {
const input = 172800000
assert.strictEqual(parseDuration(input), input)
})
for (const input of [undefined, '', 'invalid duration']) {
it('should throw an error for ' + input, () => {
assert.throws(() => parseDuration(input), { message: `not a valid duration: ${input}` })
})
}
})

View File

@@ -27,7 +27,6 @@
"ms": "^2.1.2"
},
"scripts": {
"postversion": "npm publish --access public",
"test": "node --test"
"postversion": "npm publish --access public"
}
}

View File

@@ -44,8 +44,6 @@ exports.makeOnProgress = function ({ onRootTaskEnd = noop, onRootTaskStart = noo
} else if (type === 'property') {
;(taskLog.properties ?? (taskLog.properties = { __proto__: null }))[event.name] = event.value
} else if (type === 'end') {
taskLogs.delete(id)
taskLog.end = event.timestamp
taskLog.result = event.result
taskLog.status = event.status

View File

@@ -13,7 +13,7 @@
"url": "https://vates.fr"
},
"license": "ISC",
"version": "0.4.1",
"version": "0.4.0",
"engines": {
"node": ">=14"
},

View File

@@ -7,7 +7,7 @@
"bugs": "https://github.com/vatesfr/xen-orchestra/issues",
"dependencies": {
"@xen-orchestra/async-map": "^0.1.2",
"@xen-orchestra/backups": "^0.54.0",
"@xen-orchestra/backups": "^0.53.0",
"@xen-orchestra/fs": "^4.1.7",
"filenamify": "^6.0.0",
"getopts": "^2.2.5",
@@ -27,7 +27,7 @@
"scripts": {
"postversion": "npm publish --access public"
},
"version": "1.0.25",
"version": "1.0.23",
"license": "AGPL-3.0-or-later",
"author": {
"name": "Vates SAS",

View File

@@ -49,25 +49,26 @@ export class HealthCheckVmBackup {
}
// wait for the 'Running' event to be really stored in local xapi object cache
restoredVm = await xapi.waitObjectState(restoredVm.$ref, vm => vm.power_state === 'Running', {
timeout: remainingTimeout,
timeoutMessage: refOrUuid =>
`local xapi did not get Running state for VM ${refOrUuid} after ${timeout / 1000} second`,
})
const running = new Date()
remainingTimeout -= running - started
if (remainingTimeout < 0) {
throw new Error(`local xapi did not get Running state for VM ${restoredId} after ${timeout / 1000} second`)
}
// wait for the guest tool version to be defined
await xapi.waitObjectState(restoredVm.guest_metrics, gm => gm?.PV_drivers_version?.major !== undefined, {
timeout: remainingTimeout,
timeoutMessage: refOrUuid =>
`timeout reached while waiting for ${refOrUuid} to report the driver version through the Xen tools. Please check or update the Xen tools.`,
})
const guestToolsReady = new Date()
remainingTimeout -= guestToolsReady - running
if (remainingTimeout < 0) {
throw new Error(`local xapi did not get he guest tools check ${restoredId} after ${timeout / 1000} second`)
}
if (waitForScript) {
const startedRestoredVm = await xapi.waitObjectState(
@@ -78,10 +79,19 @@ export class HealthCheckVmBackup {
vm.xenstore_data['vm-data/xo-backup-health-check'] === 'failure'),
{
timeout: remainingTimeout,
timeoutMessage: refOrUuid =>
`timeout reached while waiting for ${refOrUuid} to report the startup script execution.`,
}
)
const scriptOk = new Date()
remainingTimeout -= scriptOk - guestToolsReady
if (remainingTimeout < 0) {
throw new Error(
`Backup health check script did not update vm-data/xo-backup-health-check of ${restoredId} after ${
timeout / 1000
} second, got ${
startedRestoredVm.xenstore_data['vm-data/xo-backup-health-check']
} instead of 'success' or 'failure'`
)
}
if (startedRestoredVm.xenstore_data['vm-data/xo-backup-health-check'] !== 'success') {
const message = startedRestoredVm.xenstore_data['vm-data/xo-backup-health-check-error']

View File

@@ -18,7 +18,6 @@ import fromEvent from 'promise-toolbox/fromEvent'
import groupBy from 'lodash/groupBy.js'
import pDefer from 'promise-toolbox/defer'
import pickBy from 'lodash/pickBy.js'
import reduce from 'lodash/reduce.js'
import tar from 'tar'
import zlib from 'zlib'
@@ -827,29 +826,6 @@ export class RemoteAdapter {
}
return metadata
}
#computeTotalBackupSizeRecursively(backups) {
return reduce(
backups,
(prev, backup) => {
const _backup = Array.isArray(backup) ? this.#computeTotalBackupSizeRecursively(backup) : backup
return {
onDisk: prev.onDisk + (_backup.onDisk ?? _backup.size),
}
},
{ onDisk: 0 }
)
}
async getTotalVmBackupSize() {
return this.#computeTotalBackupSizeRecursively(await this.listAllVmBackups())
}
async getTotalBackupSize() {
const vmBackupSize = await this.getTotalVmBackupSize()
// @TODO: add `getTotalXoBackupSize` and `getTotalPoolBackupSize` once `size` is implemented by fs
return vmBackupSize
}
}
Object.assign(RemoteAdapter.prototype, {

View File

@@ -3,6 +3,7 @@ import ignoreErrors from 'promise-toolbox/ignoreErrors'
import { asyncMap } from '@xen-orchestra/async-map'
import { CancelToken } from 'promise-toolbox'
import { compareVersions } from 'compare-versions'
import { createVhdStreamWithLength } from 'vhd-lib'
import { defer } from 'golike-defer'
import { cancelableMap } from './_cancelableMap.mjs'
@@ -226,6 +227,9 @@ export const importIncrementalVm = defer(async function importIncrementalVm(
if (typeof stream === 'function') {
stream = await stream()
}
if (stream.length === undefined) {
stream = await createVhdStreamWithLength(stream)
}
await xapi.setField('VDI', vdi.$ref, 'name_label', `[Importing] ${vdiRecords[id].name_label}`)
await vdi.$importContent(stream, { cancelToken, format: 'vhd' })
await xapi.setField('VDI', vdi.$ref, 'name_label', vdiRecords[id].name_label)

View File

@@ -290,10 +290,10 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
for (const vdiRef of vdiRefs) {
try {
// data_destroy will fail with a VDI_NO_CBT_METADATA error if CBT is not enabled on this VDI
await this._xapi.VDI_dataDestroy(vdiRef)
await this._xapi.call('VDI.data_destroy', vdiRef)
Task.info(`Snapshot data has been deleted`, { vdiRef })
} catch (error) {
Task.warning(`Couldn't delete snapshot data`, { error, vdiRef })
Task.warning(`Couldn't deleted snapshot data`, { error, vdiRef })
}
}
}

View File

@@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/vatesfr/xen-orchestra.git"
},
"version": "0.54.0",
"version": "0.53.0",
"engines": {
"node": ">=14.18"
},
@@ -48,7 +48,7 @@
"uuid": "^9.0.0",
"value-matcher": "^0.2.0",
"vhd-lib": "^4.11.0",
"xen-api": "^4.3.1",
"xen-api": "^4.2.0",
"yazl": "^2.5.1"
},
"devDependencies": {
@@ -59,7 +59,7 @@
"tmp": "^0.2.1"
},
"peerDependencies": {
"@xen-orchestra/xapi": "^7.6.0"
"@xen-orchestra/xapi": "^7.3.0"
},
"license": "AGPL-3.0-or-later",
"author": {

View File

@@ -18,7 +18,7 @@
"preferGlobal": true,
"dependencies": {
"golike-defer": "^0.5.1",
"xen-api": "^4.3.1"
"xen-api": "^4.2.0"
},
"scripts": {
"postversion": "npm publish"

View File

@@ -1,29 +0,0 @@
### `defined()`
Returns the first non-`undefined` value from a list of arguments, evaluating functions if needed.
There is two ways to use this function:
- either with a single array argument: it should return the first non-undefined item
- or with multiple arguments: it should return the first non-undefined argument
If only `undefined` values, return `undefined`.
```js
import defined from '@xen-orchestra/defined/index.js'
defined(undefined, 'foo', 42)
// Returns 'foo'
defined([undefined, null, 10])
// Returns null
defined([undefined, undefined], [undefined, undefined, 10])
// Returns [undefined, undefined]
defined(() => 'bar', 42)
// Returns 'bar'
defined(undefined, undefined)
// Returns undefined
```

View File

@@ -14,37 +14,6 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/defin
npm install --save @xen-orchestra/defined
```
## Usage
### `defined()`
Returns the first non-`undefined` value from a list of arguments, evaluating functions if needed.
There is two ways to use this function:
- either with a single array argument: it should return the first non-undefined item
- or with multiple arguments: it should return the first non-undefined argument
If only `undefined` values, return `undefined`.
```js
import defined from '@xen-orchestra/defined/index.js'
defined(undefined, 'foo', 42)
// Returns 'foo'
defined([undefined, null, 10])
// Returns null
defined([undefined, undefined], [undefined, undefined, 10])
// Returns [undefined, undefined]
defined(() => 'bar', 42)
// Returns 'bar'
defined(undefined, undefined)
// Returns undefined
```
## Contributions
Contributions are _very_ welcomed, either on the documentation or on

View File

@@ -22,7 +22,7 @@ function defined() {
}
for (let i = 0; i < n; ++i) {
let arg = args[i]
let arg = arguments[i]
if (typeof arg === 'function') {
arg = get(arg)
}

View File

@@ -1,30 +0,0 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import defined_ from '@xen-orchestra/defined/index.js'
// for each test, use the flat syntax and the array syntax
for (const [title, defined] of Object.entries({
'defined(...values)': defined_,
'defined([ ...values ])': (...args) => defined_(args),
})) {
describe(title, () => {
it('returns the first non undefined value', () => {
assert.deepEqual(defined(undefined, 'foo', 42), 'foo')
})
it('returns undefined if only undefined values', () => {
assert.equal(defined(undefined, undefined), undefined)
})
it('resolves functions with `get(fn)`', () => {
const o = { foo: undefined, baz: 'baz' }
assert.deepEqual(
defined(
() => o.foo.bar,
() => o.baz
),
'baz'
)
})
})
}

View File

@@ -1,7 +1,7 @@
{
"private": false,
"name": "@xen-orchestra/defined",
"version": "0.0.2",
"version": "0.0.1",
"license": "ISC",
"description": "Utilities to help handling (possibly) undefined values",
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/defined",
@@ -23,7 +23,6 @@
"node": ">=6"
},
"scripts": {
"postversion": "npm publish",
"test": "node --test"
"postversion": "npm publish"
}
}

View File

@@ -17,13 +17,13 @@
"xo-lift-remote-immutability": "./liftProtection.mjs"
},
"license": "AGPL-3.0-or-later",
"version": "1.0.12",
"version": "1.0.10",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@vates/async-each": "^1.0.0",
"@xen-orchestra/backups": "^0.54.0",
"@xen-orchestra/backups": "^0.53.0",
"@xen-orchestra/log": "^0.6.0",
"app-conf": "^3.0.0",
"chokidar": "^3.5.3",

View File

@@ -2,10 +2,6 @@
## **next**
- Handle IPv6 hosts
## **0.4.0** (2024-09-30)
- [Settings] Default UI theme is now _auto_ instead of _dark_
## **0.2.7** (2024-07-31)

View File

@@ -5,6 +5,213 @@
- `yarn`
- `yarn dev`
## Guidelines
## Conventions
Please follow the guidelines from the `@xen-orchestra/web-core/docs/guidelines` directory.
### File names
| Type | Format | Exemple |
| ---------- | ---------------------------------------- | ----------------------------------- |
| Component | `components/<PascalCase>.vue` | `components/FooBar.vue` |
| View | `views/<PascalCase>View.vue` | `views/FooBarView.vue` |
| Composable | `composables/<kebab-case>.composable.ts` | `composables/foo-bar.composable.ts` |
| Store | `stores/<kebab-case>.store.ts` | `stores/foo-bar.store.ts` |
| Other | `libs/<kebab-case>.ts` | `libs/foo-bar.ts` |
For components and views, prepend the subdirectories names to the resulting filename.
Example: `components/foo/bar/FooBarBaz.vue`
### Vue Components
Use Vue Single File Components (`*.vue`).
Insert blocks in the following order: `template`, `script` then `style`.
#### Template
Use HTML.
If your component only has one root element, add the component name as a class.
```vue
<!-- MyComponent.vue -->
<template>
<div class="my-component">...</div>
</template>
```
#### Script
Use composition API + TypeScript + `setup` attribute (`<script lang="ts" setup>`).
Note: When reading Vue official doc, don't forget to set "API Preference" toggle (in the upper left) on "Composition".
```vue
<script lang="ts" setup>
import { computed, ref } from 'vue'
const props = defineProps<{
greetings: string
}>()
const firstName = ref('')
const lastName = ref('')
const fullName = computed(() => `${props.greetings} ${firstName.value} ${lastName.value}`)
</script>
```
#### CSS
Always use `scoped` attribute (`<style scoped>`).
Nested rules are allowed.
Vue variables can be interpolated with `v-bind`.
```vue
<script lang="ts" setup>
import { ref } from 'vue'
const fontSize = ref('2rem')
</script>
<style scoped>
.my-item {
.nested {
font-size: v-bind(fontSize);
}
}
</style>
```
### Icons
This project is using Font Awesome 6 Free.
Icons can be displayed with the `UiIcon` component.
Passing `undefined` as `icon` prop will disable the component (no need to use an additional `v-if` condition).
Use the `busy` prop to display a loader icon.
```vue
<template>
<div>
<UiIcon :icon="faDisplay" />
</div>
</template>
<script lang="ts" setup>
import UiIcon from '@/components/ui/icon/UiIcon.vue'
import { faDisplay } from '@fortawesome/free-solid-svg-icons'
</script>
```
#### Font weight <=> Style name
Here is the equivalent between font weight and style name.
| Style name | Font weight |
| ---------- | ----------- |
| Solid | 900 |
| Regular | 400 |
### CSS
Always use `rem` unit (`1rem` = `10px`)
### Store
Use Pinia store with setup function.
State are `ref`
Getters are `computed`
Actions/Mutations are simple functions
#### Naming convention
For a `foobar` store, create a `store/foobar.store.ts` then use `defineStore('foobar', setupFunc)`
#### Example
```typescript
import { computed, ref } from 'vue'
export const useFoobarStore = defineStore('foobar', () => {
const aStateVar = ref(0)
const otherStateVar = ref(0)
const aGetter = computed(() => aStateVar.value * 2)
const anAction = () => (otherStateVar.value += 10)
return {
aStateVar,
otherStateVar,
aGetter,
anAction,
}
})
```
### I18n
Internationalization of the app is done with [Vue-i18n](https://vue-i18n.intlify.dev/).
Locale files are located in `src/locales` directory.
Source of truth is `en-US.json` file.
To quickly check if there are missing translations in other locale files, open `main.ts` and check the `messages`
property of `createI18n()` for TypeScript error.
#### Example
```json
{
"hello": "Hello",
"hello_name": "Hello {name}",
"hello_linked": "@:hello_name how are you?",
"hello_plural": "No hello | Hello to you | Hello to {count} persons"
}
```
```html
<!-- String -->
<p>{{ $t("hello") }}</p>
<!-- Hello -->
<p>{{ $t("hello_name", { name: "World" }) }}</p>
<!-- Hello World -->
<p>{{ $t("hello_linked", { name: "World" }) }}</p>
<!-- Hello World how are you? -->
<p>{{ $tc("hello_plural", 0) }}</p>
<!-- No hello -->
<p>{{ $tc("hello_plural", 1) }}</p>
<!-- Hello to you -->
<p>{{ $tc("hello_plural", 4) }}</p>
<!-- Hello to 4 persons -->
<!-- Date and time -->
<p>{{ $d(date, "date_short") }}</p>
<!-- 9/10/2022 -->
<p>{{ $d(date, "date_medium") }}</p>
<!-- Sep 10, 2022 -->
<p>{{ $d(date, "date_long") }}</p>
<!-- September 10, 2022 -->
<p>{{ $d(date, "datetime_short") }}</p>
<!-- 9/10/2022, 06:30 PM -->
<p>{{ $d(date, "datetime_medium") }}</p>
<!-- Sep 10, 2022, 06:30 PM -->
<p>{{ $d(date, "datetime_long") }}</p>
<!-- September 10, 2022 at 06:30 PM -->
<p>{{ $d(date, "time") }}</p>
<!-- 06:30 PM -->
<!-- Number -->
<p>{{ $n(1234567.898765) }}</p>
<!-- 1,234,567.899 -->
```

View File

@@ -1,6 +1,6 @@
{
"name": "@xen-orchestra/lite",
"version": "0.4.0",
"version": "0.3.1",
"type": "module",
"scripts": {
"dev": "GIT_HEAD=$(git rev-parse HEAD) vite",
@@ -31,7 +31,7 @@
"@vueuse/core": "^10.7.1",
"@vueuse/math": "^10.7.1",
"@vueuse/shared": "^10.7.1",
"@xen-orchestra/web-core": "^0.3.0",
"@xen-orchestra/web-core": "^0.1.1",
"complex-matcher": "^0.7.1",
"d3-time-format": "^4.1.0",
"decorator-synchronized": "^0.6.0",
@@ -56,7 +56,7 @@
"postcss-nested": "^6.0.1",
"typescript": "~5.3.3",
"vite": "^5.0.11",
"vue": "~3.4.13",
"vue": "^3.4.13",
"vue-echarts": "^6.6.8",
"vue-i18n": "^9.9.0",
"vue-router": "^4.4.0",

View File

@@ -75,7 +75,7 @@ useUnreachableHosts()
overflow: auto;
flex: 1;
height: calc(100vh - 5.5rem);
background-color: var(--color-neutral-background-secondary);
background-color: var(--background-color-secondary);
&.no-ui {
height: 100vh;

View File

@@ -1,5 +1,5 @@
<template>
<MenuList placement="bottom-end" border>
<MenuList placement="bottom-end" shadow>
<template #trigger="{ open, isOpen }">
<button type="button" :class="{ active: isOpen }" class="account-button" @click="open">
<UiIcon :icon="faCircleUser" class="user-icon" />
@@ -51,14 +51,14 @@ const openSettings = () => router.push({ name: 'settings' })
display: flex;
align-items: center;
padding: 1rem;
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
border: none;
border-radius: 0.8rem;
background-color: var(--color-neutral-background-secondary);
background-color: var(--background-color-secondary);
gap: 0.8rem;
&:disabled {
color: var(--color-neutral-border);
color: var(--color-grey-500);
}
&:not(:disabled) {
@@ -67,12 +67,12 @@ const openSettings = () => router.push({ name: 'settings' })
&:hover,
&:active,
&.active {
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
}
&:active,
&.active {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
}
}
@@ -86,6 +86,6 @@ const openSettings = () => router.push({ name: 'settings' })
}
.menu-item-logout {
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
</style>

View File

@@ -39,8 +39,8 @@ const { trigger: navigationTrigger } = storeToRefs(navigationStore)
justify-content: space-between;
height: 5.5rem;
padding: 1rem;
border-bottom: 0.1rem solid var(--color-neutral-border);
background-color: var(--color-neutral-background-secondary);
border-bottom: 0.1rem solid var(--color-grey-500);
background-color: var(--background-color-secondary);
img {
width: 4rem;

View File

@@ -27,7 +27,7 @@
<FormCheckbox v-model="rememberMe" />
{{ $t('keep-me-logged') }}
</label>
<UiButton size="medium" color="normal" level="primary" type="submit" :busy="isConnecting">
<UiButton type="submit" :busy="isConnecting">
{{ $t('login') }}
</UiButton>
</template>
@@ -107,7 +107,6 @@ async function handleSubmit() {
display: flex;
margin: 1rem;
width: fit-content;
& .form-checkbox {
margin: auto 1rem auto auto;
}
@@ -120,7 +119,7 @@ async function handleSubmit() {
justify-content: center;
min-height: 100vh;
max-width: 100vw;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
}
form {
@@ -132,10 +131,10 @@ form {
justify-content: center;
margin: 0 auto;
padding: 8.5rem;
background-color: var(--color-neutral-background-secondary);
background-color: var(--background-color-secondary);
.error {
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
}
@@ -156,7 +155,7 @@ input {
max-width: 100%;
margin-bottom: 1rem;
padding: 1rem 1.5rem;
border: 1px solid var(--color-neutral-border);
border: 1px solid var(--color-grey-500);
border-radius: 0.8rem;
background-color: white;
}

View File

@@ -60,7 +60,7 @@ useEventListener(
}
code:not(.hljs-code) {
background-color: var(--color-normal-background-selected);
background-color: var(--background-color-purple-10);
padding: 0.3rem 0.6rem;
border-radius: 0.6rem;
}
@@ -81,12 +81,12 @@ useEventListener(
}
thead th {
border-bottom: 2px solid var(--color-neutral-border);
background-color: var(--color-neutral-background-secondary);
border-bottom: 2px solid var(--color-grey-500);
background-color: var(--background-color-secondary);
}
tbody td {
border-bottom: 1px solid var(--color-neutral-border);
border-bottom: 1px solid var(--color-grey-500);
}
}
@@ -103,11 +103,11 @@ useEventListener(
background-color: transparent;
&:hover {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
&:active {
color: var(--color-normal-txt-hover);
color: var(--color-purple-d20);
}
}
}

View File

@@ -45,8 +45,8 @@ whenever(isOpen, () => {
max-width: 37rem;
height: calc(100vh - 5.5rem);
padding: 0.5rem;
border-right: 1px solid var(--color-neutral-border);
background-color: var(--color-neutral-background-primary);
border-right: 1px solid var(--color-grey-500);
background-color: var(--background-color-primary);
&.collapsible {
position: fixed;

View File

@@ -181,7 +181,7 @@ const valueInputAfter = computed(() => (newFilter.value.builder.comparison === '
.collection-filter-row {
display: flex;
align-items: center;
border-bottom: 1px solid var(--color-neutral-background-secondary);
border-bottom: 1px solid var(--background-color-secondary);
gap: 1rem;
.or {

View File

@@ -54,14 +54,14 @@ const isIcon = (maybeIcon: any): maybeIcon is IconDefinition => typeof maybeIcon
align-items: stretch;
overflow: hidden;
padding: 0 0.7rem;
border: 1px solid var(--color-neutral-border);
border: 1px solid var(--color-grey-500);
border-radius: 0.8rem;
background-color: var(--color-neutral-background-primary);
background-color: var(--color-grey-600);
box-shadow: var(--shadow-100);
gap: 0.1rem;
&:focus-within {
outline: 1px solid var(--color-normal-item-active);
outline: 1px solid var(--color-purple-l40);
}
}
@@ -71,7 +71,7 @@ const isIcon = (maybeIcon: any): maybeIcon is IconDefinition => typeof maybeIcon
}
.form-widget:hover .widget {
border-color: var(--color-normal-item-hover);
border-color: var(--color-purple-l60);
}
.element {
@@ -93,8 +93,8 @@ const isIcon = (maybeIcon: any): maybeIcon is IconDefinition => typeof maybeIcon
font-size: inherit;
border: none;
outline: none;
color: var(--color-neutral-txt-primary);
background-color: var(--color-neutral-background-primary);
color: var(--color-grey-100);
background-color: var(--color-grey-600);
flex: 1;
&:disabled {
@@ -134,7 +134,7 @@ const isIcon = (maybeIcon: any): maybeIcon is IconDefinition => typeof maybeIcon
&:disabled {
cursor: not-allowed;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
}
}
</style>

View File

@@ -9,7 +9,7 @@
</th>
<td v-if="hasMultipleHosts">
<UiSpinner v-if="!areAllLoaded" />
<VtsCounter
<UiCounter
v-else
v-tooltip="{
placement: 'left',
@@ -19,9 +19,7 @@
}"
:value="patch.$hostRefs.size"
class="counter"
accent="danger"
variant="primary"
size="small"
color="error"
/>
</td>
</tr>
@@ -33,7 +31,7 @@ import UiCardSpinner from '@/components/ui/UiCardSpinner.vue'
import UiSpinner from '@/components/ui/UiSpinner.vue'
import UiTable from '@/components/ui/UiTable.vue'
import type { XenApiPatchWithHostRefs } from '@/composables/host-patches.composable'
import VtsCounter from '@core/components/counter/VtsCounter.vue'
import UiCounter from '@core/components/UiCounter.vue'
import { vTooltip } from '@core/directives/tooltip.directive'
import { useUiStore } from '@core/stores/ui.store'
import { computed } from 'vue'

View File

@@ -23,7 +23,7 @@ defineProps<{
<style lang="postcss" scoped>
.error {
margin: 0.5rem 0;
color: var(--color-danger-txt-base);
color: var(--color-red-base);
& svg {
margin-right: 0.5rem;

View File

@@ -22,6 +22,6 @@
margin: auto;
width: 8em;
font-style: normal;
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
</style>

View File

@@ -27,6 +27,6 @@
font-weight: 500;
font-size: 2rem;
line-height: 150%;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
</style>

View File

@@ -79,7 +79,7 @@ const objectRoute = computed(() => {
<style lang="postcss" scoped>
.unknown {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
font-style: italic;
}
</style>

View File

@@ -33,7 +33,7 @@ const isRecordNotFound = computed(() => props.isReady && !props.uuidChecker(id.v
}
.spinner {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
display: flex;
margin: auto;
width: 10rem;

View File

@@ -24,7 +24,7 @@ import UiStatusPanel from '@/components/ui/UiStatusPanel.vue'
<style lang="postcss" scoped>
.contact {
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
& a {
text-transform: lowercase;

View File

@@ -43,7 +43,7 @@ const masterSessionStorage = useSessionStorage('master', null)
<style lang="postcss" scoped>
.warning-not-current-pool {
color: var(--color-warning-txt-base);
color: var(--color-orange-base);
cursor: pointer;
.wrapper {

View File

@@ -26,22 +26,18 @@ const className = computed(() => `state-${props.state.toLocaleLowerCase()}`)
<style lang="postcss" scoped>
.power-state-icon {
color: var(--color-normal-txt-item);
color: var(--color-purple-d60);
&.state-running {
color: var(--color-success-item-base);
color: var(--color-green-base);
}
&.state-paused {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
}
&.state-suspended {
color: var(--color-normal-txt-hover);
}
&.state-halted {
color: var(--color-danger-item-base);
color: var(--color-purple-d20);
}
}
</style>

View File

@@ -39,7 +39,7 @@ const progress = computed(() => {
.progress-circle-fill {
animation: progress 1s ease-out forwards;
fill: none;
stroke: var(--color-success-item-base);
stroke: var(--color-green-base);
stroke-width: 1.2;
stroke-linecap: round;
stroke-dasharray: v-bind(progress), 100;
@@ -48,13 +48,13 @@ const progress = computed(() => {
.progress-circle-background {
fill: none;
stroke-width: 1.2;
stroke: var(--color-neutral-background-disabled);
stroke: var(--color-grey-500);
}
.progress-circle-text {
font-size: 0.7rem;
font-weight: bold;
fill: var(--color-success-item-base);
fill: var(--color-green-base);
text-anchor: middle;
alignment-baseline: middle;
}

View File

@@ -29,18 +29,18 @@ defineProps<{
align-items: center;
height: 6rem;
padding: 0 1.5rem;
border-bottom: 1px solid var(--color-neutral-border);
background-color: var(--color-neutral-background-primary);
border-bottom: 1px solid var(--color-grey-500);
background-color: var(--background-color-primary);
gap: 0.8rem;
}
.icon {
font-size: 2.5rem;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
.title {
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
}
.actions {

View File

@@ -60,28 +60,28 @@ const computedData = computed(() => {
}
.progress-item:nth-child(1) {
--progress-bar-color: var(--color-normal-txt-item);
--progress-bar-color: var(--color-purple-d60);
}
.progress-item:nth-child(2) {
--progress-bar-color: var(--color-normal-txt-active);
--progress-bar-color: var(--color-purple-d40);
}
.progress-item:nth-child(3) {
--progress-bar-color: var(--color-normal-txt-hover);
--progress-bar-color: var(--color-purple-d20);
}
.progress-item {
--progress-bar-height: 1.2rem;
--progress-bar-color: var(--color-normal-item-hover);
--progress-bar-background-color: var(--color-neutral-background-disabled);
--progress-bar-color: var(--color-purple-l20);
--progress-bar-background-color: var(--color-grey-500);
&.warning {
--progress-bar-color: var(--color-warning-item-base);
--progress-bar-color: var(--color-orange-base);
}
&.error {
--progress-bar-color: var(--color-danger-item-base);
--progress-bar-color: var(--color-red-base);
}
}
</style>

View File

@@ -1,24 +1,8 @@
<template>
<UiButton
v-if="xoaFound"
size="medium"
color="normal"
level="primary"
:left-icon="faArrowUpRightFromSquare"
class="xoa-button"
@click="openXoa()"
>
<UiButton v-if="xoaFound" :left-icon="faArrowUpRightFromSquare" class="xoa-button" @click="openXoa()">
{{ $t('access-xoa') }}
</UiButton>
<UiButton
v-else
size="medium"
color="normal"
level="primary"
:left-icon="faDownload"
class="xoa-button"
@click="openXoaDeploy()"
>
<UiButton v-else :left-icon="faDownload" class="xoa-button" @click="openXoaDeploy()">
{{ $t('deploy-xoa') }}
</UiButton>
</template>

View File

@@ -3,17 +3,11 @@
<TabItem v-bind="tab(TAB.PROPS, propParams)">Props</TabItem>
<TabItem class="event-tab" v-bind="tab(TAB.EVENTS, eventParams)">
Events
<VtsCounter
v-if="unreadEventsCount > 0"
:value="unreadEventsCount"
accent="success"
variant="primary"
size="small"
/>
<UiCounter v-if="unreadEventsCount > 0" :value="unreadEventsCount" color="success" />
</TabItem>
<TabItem v-bind="tab(TAB.SLOTS, slotParams)">Slots</TabItem>
<TabItem v-bind="tab(TAB.SETTINGS, settingParams)">Settings</TabItem>
<MenuList placement="bottom" border>
<MenuList placement="bottom" shadow>
<template #trigger="{ open, isOpen }">
<TabItem :active="isOpen" :disabled="presets === undefined" class="preset-tab" @click="open">
<UiIcon :icon="faSliders" />
@@ -41,9 +35,7 @@
<UiCardTitle>
Logs
<template #right>
<UiButton v-if="eventsLog.length > 0" size="medium" color="normal" level="tertiary" @click="eventsLog = []">
Clear
</UiButton>
<UiButton v-if="eventsLog.length > 0" level="tertiary" @click="eventsLog = []"> Clear </UiButton>
</template>
</UiCardTitle>
<div class="events-log">
@@ -86,11 +78,11 @@ import {
type Param,
} from '@/libs/story/story-param'
import UiButton from '@core/components/button/UiButton.vue'
import VtsCounter from '@core/components/counter/VtsCounter.vue'
import MenuItem from '@core/components/menu/MenuItem.vue'
import MenuList from '@core/components/menu/MenuList.vue'
import TabItem from '@core/components/tab/TabItem.vue'
import TabList from '@core/components/tab/TabList.vue'
import UiCounter from '@core/components/UiCounter.vue'
import { faSliders } from '@fortawesome/free-solid-svg-icons'
import 'highlight.js/styles/github-dark.css'
import { uniqueId, upperFirst } from 'lodash-es'

View File

@@ -22,12 +22,12 @@
th,
td {
padding: 0.3rem 0.6rem;
border-bottom: 0.1rem solid var(--color-neutral-border);
border-bottom: 0.1rem solid var(--color-grey-500);
vertical-align: center;
}
&:nth-child(odd) {
background-color: var(--color-normal-background-selected);
background-color: var(--background-color-purple-10);
}
}

View File

@@ -127,14 +127,14 @@ const openRawValueModal = (code: string) =>
align-items: center;
padding: 0.4rem 0.6rem;
cursor: pointer;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
border-radius: 0.4rem;
gap: 0.6rem;
&.active {
font-weight: 600;
cursor: default;
color: var(--color-success-item-hover);
color: var(--color-green-l20);
}
}
}
@@ -157,7 +157,7 @@ const openRawValueModal = (code: string) =>
.help {
font-style: italic;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
}
.default-value {
@@ -168,12 +168,12 @@ const openRawValueModal = (code: string) =>
font-weight: 600;
font-style: normal;
opacity: 1;
color: var(--color-success-txt-base);
color: var(--color-green-base);
}
}
.v-model-indicator,
.context-indicator {
color: var(--color-success-txt-base);
color: var(--color-green-base);
}
</style>

View File

@@ -81,7 +81,7 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
.input.indeterminate + .fake-checkbox > .icon {
opacity: 1;
color: var(--color-normal-txt-item);
color: var(--color-grey-300);
}
}
@@ -91,7 +91,7 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
.fake-checkbox {
width: 1.25em;
--background-color: var(--color-neutral-background-primary);
--background-color: var(--background-color-primary);
}
.icon {
@@ -114,7 +114,7 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
.fake-checkbox {
width: 2.5em;
--background-color: var(--color-neutral-border);
--background-color: var(--color-grey-500);
}
.icon {
@@ -128,7 +128,7 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
.input.indeterminate + .fake-checkbox > .icon {
opacity: 1;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
transform: translateX(0);
}
}
@@ -143,7 +143,7 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
.icon {
font-size: var(--checkbox-icon-size);
position: absolute;
color: var(--color-normal-txt-item);
color: var(--color-grey-600);
filter: drop-shadow(0 0.0625em 0.5em rgba(0, 0, 0, 0.1)) drop-shadow(0 0.1875em 0.1875em rgba(0, 0, 0, 0.06))
drop-shadow(0 0.1875em 0.25em rgba(0, 0, 0, 0.08));
@@ -162,43 +162,44 @@ const isIndeterminate = computed(() => (type === 'checkbox' || type === 'toggle'
background-color: var(--background-color);
box-shadow: var(--shadow-100);
--border-color: var(--color-normal-item-base);
--border-color: var(--color-grey-500);
}
.input:disabled {
& + .fake-checkbox {
cursor: not-allowed;
--border-color: var(--color-neutral-txt-secondary);
--background-color: var(--background-color-secondary);
--border-color: var(--color-grey-500);
}
&:checked + .fake-checkbox {
--border-color: transparent;
--background-color: var(--color-normal-item-disabled);
--background-color: var(--color-purple-l60);
}
}
.input:not(:disabled) {
&:hover + .fake-checkbox,
&:focus + .fake-checkbox {
--border-color: var(--color-normal-item-hover);
--border-color: var(--color-purple-l40);
}
&:active + .fake-checkbox {
--border-color: var(--color-normal-item-active);
--border-color: var(--color-purple-l20);
}
&:checked + .fake-checkbox {
--border-color: transparent;
--background-color: var(--color-normal-item-base);
--background-color: var(--color-purple-base);
}
&:checked:hover + .fake-checkbox,
&:checked:focus + .fake-checkbox {
--background-color: var(--color-normal-item-hover);
--background-color: var(--color-purple-d20);
}
&:checked:active + .fake-checkbox {
--background-color: var(--color-normal-item-active);
--background-color: var(--color-purple-d40);
}
}
</style>

View File

@@ -144,14 +144,14 @@ defineExpose({
--after-width: v-bind('afterWidth || "1.625em"');
--caret-width: 1.5em;
--text-color: var(--color-neutral-txt-primary);
--text-color: var(--color-grey-100);
&.empty {
--text-color: var(--color-neutral-txt-secondary);
--text-color: var(--color-grey-300);
}
&.disabled {
--text-color: var(--color-neutral-border);
--text-color: var(--color-grey-500);
}
}
@@ -188,74 +188,74 @@ defineExpose({
text-align: right;
}
--background-color: var(--color-neutral-background-primary);
--border-color: var(--color-neutral-border);
--background-color: var(--background-color-primary);
--border-color: var(--color-grey-500);
&:disabled {
cursor: not-allowed;
--background-color: var(--color-neutral-background-disabled);
--background-color: var(--background-color-secondary);
}
&:not(:disabled) {
&.info {
&:hover {
--border-color: var(--color-normal-item-hover);
--border-color: var(--color-purple-l60);
}
&:active {
--border-color: var(--color-normal-item-active);
--border-color: var(--color-purple-l40);
}
&:focus {
--border-color: var(--color-normal-item-base);
--border-color: var(--color-purple-base);
}
}
&.success {
--border-color: var(--color-success-item-base);
--border-color: var(--color-green-base);
&:hover {
--border-color: var(--color-success-item-hover);
--border-color: var(--color-green-l60);
}
&:active {
--border-color: var(--color-success-item-active);
--border-color: var(--color-green-l40);
}
&:focus {
--border-color: var(--color-success-item-base);
--border-color: var(--color-green-base);
}
}
&.warning {
--border-color: var(--color-warning-item-base);
--border-color: var(--color-orange-base);
&:hover {
--border-color: var(--color-warning-item-hover);
--border-color: var(--color-orange-l60);
}
&:active {
--border-color: var(--color-warning-item-active);
--border-color: var(--color-orange-l40);
}
&:focus {
--border-color: var(--color-warning-item-base);
--border-color: var(--color-orange-base);
}
}
&.error {
--border-color: var(--color-danger-item-base);
--border-color: var(--color-red-base);
&:hover {
--border-color: var(--color-danger-item-hover);
--border-color: var(--color-red-l60);
}
&:active {
--border-color: var(--color-danger-item-active);
--border-color: var(--color-red-l40);
}
&:focus-within {
--border-color: var(--color-danger-item-base);
--border-color: var(--color-red-base);
}
}
}

View File

@@ -101,12 +101,12 @@ useContext(DisabledContext, () => props.disabled)
padding: 1rem 0;
&.light {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
}
&:not(.light) {
text-transform: uppercase;
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
}
}
@@ -128,7 +128,7 @@ useContext(DisabledContext, () => props.disabled)
align-items: center;
gap: 0.5rem;
text-decoration: none;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
& > span {
text-decoration: underline;
@@ -136,14 +136,14 @@ useContext(DisabledContext, () => props.disabled)
}
.warning {
color: var(--color-warning-txt-base);
color: var(--color-orange-base);
}
.error {
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
.help {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
}
</style>

View File

@@ -53,7 +53,7 @@ whenever(
<style lang="postcss" scoped>
.collapsible {
padding: 1rem 1.5rem;
background-color: var(--color-normal-background-selected);
background-color: var(--background-color-purple-10);
border-radius: 0.8rem;
}
@@ -67,14 +67,14 @@ whenever(
display: flex;
align-items: center;
justify-content: space-between;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
border: none;
border-bottom: 1px solid var(--color-normal-txt-base);
border-bottom: 1px solid var(--color-purple-base);
width: 100%;
padding-bottom: 1rem;
.collapsible & {
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
padding-bottom: 0;
cursor: pointer;
}
@@ -85,6 +85,6 @@ whenever(
}
.collapse-icon {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
</style>

View File

@@ -3,15 +3,8 @@
<TreeItemLabel :icon="faServer" :route="{ name: 'host.dashboard', params: { uuid: host.uuid } }" @toggle="toggle()">
{{ host.name_label || '(Host)' }}
<template #addons>
<VtsIcon v-if="isPoolMaster" v-tooltip="$t('master')" :icon="faStar" accent="warning" />
<VtsCounter
v-if="isReady"
v-tooltip="$t('running-vm', { count: vmCount })"
:value="vmCount"
accent="brand"
variant="secondary"
size="small"
/>
<UiIcon v-if="isPoolMaster" v-tooltip="$t('master')" :icon="faStar" color="warning" />
<UiCounter v-if="isReady" v-tooltip="$t('running-vm', { count: vmCount })" :value="vmCount" color="info" />
</template>
</TreeItemLabel>
<template #sublist>
@@ -28,11 +21,11 @@ import type { XenApiHost } from '@/libs/xen-api/xen-api.types'
import { useHostStore } from '@/stores/xen-api/host.store'
import { usePoolStore } from '@/stores/xen-api/pool.store'
import { useVmStore } from '@/stores/xen-api/vm.store'
import VtsCounter from '@core/components/counter/VtsCounter.vue'
import VtsIcon from '@core/components/icon/VtsIcon.vue'
import UiIcon from '@core/components/icon/UiIcon.vue'
import TreeItem from '@core/components/tree/TreeItem.vue'
import TreeItemLabel from '@core/components/tree/TreeItemLabel.vue'
import TreeList from '@core/components/tree/TreeList.vue'
import UiCounter from '@core/components/UiCounter.vue'
import { vTooltip } from '@core/directives/tooltip.directive'
import { faServer, faStar } from '@fortawesome/free-solid-svg-icons'
import { useToggle } from '@vueuse/shared'

View File

@@ -39,27 +39,27 @@ defineProps<{
.infra-item-label {
display: flex;
align-items: stretch;
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
border-radius: 0.8rem;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
&:hover {
color: var(--color-neutral-txt-primary);
background-color: var(--color-neutral-background-secondary);
color: var(--color-grey-100);
background-color: var(--background-color-secondary);
}
&:active,
&.active {
color: var(--color-normal-txt-base);
background-color: var(--color-neutral-background-primary);
color: var(--color-purple-base);
background-color: var(--background-color-primary);
}
&.exact-active {
color: var(--color-neutral-txt-primary);
background-color: var(--color-normal-background-selected);
color: var(--color-grey-100);
background-color: var(--background-color-purple-10);
.icon {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
}
}

View File

@@ -23,11 +23,11 @@ defineProps<{
display: flex;
height: 6rem;
margin-bottom: 0.2rem;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
}
.icon {
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
}
.link-placeholder {
@@ -41,7 +41,7 @@ defineProps<{
.loader {
flex: 1;
animation: pulse alternate 1s infinite;
background-color: var(--color-normal-background-selected);
background-color: var(--background-color-purple-10);
}
@keyframes pulse {

View File

@@ -23,7 +23,7 @@
</template>
<template #buttons>
<UiButton size="medium" color="normal" level="tertiary" @click="addNewFilter()">
<UiButton level="tertiary" @click="addNewFilter()">
{{ $t('add-or') }}
</UiButton>
<ModalDeclineButton />

View File

@@ -6,7 +6,7 @@
</template>
<template #buttons>
<UiButton size="medium" color="normal" level="tertiary" @click="formatJson()">
<UiButton level="tertiary" @click="formatJson()">
{{ $t('reformat') }}
</UiButton>
<ModalDeclineButton />

View File

@@ -3,7 +3,7 @@
<UiCardTitle>
{{ $t('alarms') }}
<template v-if="isReady && alarms.length > 0" #right>
<VtsCounter :value="alarms.length" accent="danger" variant="primary" size="small" />
<UiCounter :value="alarms.length" color="error" />
</template>
</UiCardTitle>
<div v-if="!isStarted" class="pre-start">
@@ -11,7 +11,7 @@
<p class="text typo h4-medium">
{{ $t('click-to-display-alarms') }}
</p>
<UiButton size="medium" color="normal" level="primary" @click="start">{{ $t('load-now') }}</UiButton>
<UiButton @click="start">{{ $t('load-now') }}</UiButton>
</div>
<div>
<img alt="" src="@/assets/server-status.svg" />
@@ -46,7 +46,7 @@ import UiCardTitle from '@/components/ui/UiCardTitle.vue'
import UiTable from '@/components/ui/UiTable.vue'
import { useAlarmStore } from '@/stores/xen-api/alarm.store'
import UiButton from '@core/components/button/UiButton.vue'
import VtsCounter from '@core/components/counter/VtsCounter.vue'
import UiCounter from '@core/components/UiCounter.vue'
const { records: alarms, start, isStarted, isReady, hasError } = useAlarmStore().subscribe({ defer: true })
</script>
@@ -70,7 +70,7 @@ const { records: alarms, start, isStarted, isReady, hasError } = useAlarmStore()
}
.no-alarm & {
color: var(--color-success-txt-base);
color: var(--color-green-base);
}
}

View File

@@ -85,12 +85,12 @@ const hasError = computed(() => hostStoreHasError.value || vmStoreHasError.value
.progress-item {
margin-top: 2.6rem;
--progress-bar-height: 1.2rem;
--progress-bar-color: var(--color-normal-item-base);
--progress-bar-background-color: var(--color-neutral-background-disabled);
--progress-bar-color: var(--color-purple-base);
--progress-bar-background-color: var(--color-grey-500);
&.warning {
--progress-bar-color: var(--color-warning-item-base);
--footer-value-color: var(--color-warning-item-base);
--progress-bar-color: var(--color-orange-base);
--footer-value-color: var(--color-orange-base);
}
& .footer-value {

View File

@@ -31,7 +31,7 @@ const { count, patches, areSomeLoaded, areAllLoaded } = useHostPatches(hosts)
<style lang="postcss" scoped>
.patches-title {
--section-title-right-color: var(--color-danger-txt-base);
--section-title-right-color: var(--color-red-base);
}
.table-container {

View File

@@ -53,10 +53,10 @@ const inactive = computed(() => props.total - props.active)
width: 1.3rem;
height: 1.3rem;
border-radius: 0.65rem;
background-color: var(--color-success-item-base);
background-color: var(--color-green-base);
&.inactive {
background-color: var(--color-neutral-background-disabled);
background-color: var(--color-grey-500);
}
}

View File

@@ -37,7 +37,7 @@ defineProps<{
<style lang="postcss" scoped>
.level {
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
.on {

View File

@@ -56,7 +56,7 @@ const hasTasks = computed(() => props.pendingTasks.length > 0 || (props.finished
.no-tasks {
text-align: center;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
font-style: italic;
}
@@ -65,11 +65,11 @@ td[colspan='5'] {
}
.text-error {
color: var(--color-danger-txt-base);
color: var(--color-red-base);
}
.loader {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
display: block;
font-size: 4rem;
margin: 2rem auto 0;

View File

@@ -40,12 +40,12 @@ const isDisplayed = computed(() => !isNaN(percentUsed.value) && !isNaN(percentFr
.summary {
display: flex;
justify-content: space-between;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
margin-top: 2rem;
}
.summary-card {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
display: flex;
}

View File

@@ -46,24 +46,24 @@ const isDisabled = useContext(DisabledContext, () => props.disabled)
border: none;
border-radius: 0.8rem;
gap: 1rem;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
&.disabled {
color: var(--color-neutral-border);
color: var(--color-grey-500);
}
&:not(.disabled) {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
&:hover {
background-color: var(--color-neutral-background-secondary);
background-color: var(--background-color-secondary);
}
&:active,
&.active,
&.busy {
color: var(--color-normal-txt-base);
background-color: var(--color-normal-background-selected);
color: var(--color-purple-base);
background-color: var(--background-color-purple-10);
}
}
}

View File

@@ -22,8 +22,8 @@ defineProps<{
gap: 0.4rem;
padding: 0 0.8rem;
height: 1.8em;
color: var(--color-neutral-txt-primary);
color: var(--color-grey-600);
border-radius: 9.6rem;
background-color: var(--color-neutral-background-disabled);
background-color: var(--color-grey-300);
}
</style>

View File

@@ -34,6 +34,6 @@ const classProp = computed(() => {
}
.bg-primary {
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
}
</style>

View File

@@ -11,7 +11,7 @@
<style lang="postcss" scoped>
.footer {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
display: flex;
justify-content: space-between;
}

View File

@@ -17,7 +17,7 @@ import UiSpinner from '@/components/ui/UiSpinner.vue'
}
.spinner {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
font-size: 4rem;
}
</style>

View File

@@ -2,7 +2,7 @@
<div class="ui-section-title" :class="tags.left">
<component :is="tags.left" v-if="$slots.default || left" class="left">
<slot>{{ left }}</slot>
<VtsCounter v-if="count > 0" class="count" :value="count" accent="brand" variant="primary" size="small" />
<UiCounter v-if="count > 0" class="count" :value="count" color="info" />
</component>
<component :is="tags.right" v-if="$slots.right || right" class="right">
<slot name="right">{{ right }}</slot>
@@ -12,7 +12,7 @@
<script lang="ts" setup>
import { UiCardTitleLevel } from '@/types/enums'
import VtsCounter from '@core/components/counter/VtsCounter.vue'
import UiCounter from '@core/components/UiCounter.vue'
import { computed } from 'vue'
const props = withDefaults(
@@ -44,28 +44,28 @@ const tags = computed(() => {
justify-content: space-between;
--section-title-left-size: 2rem;
--section-title-left-color: var(--color-neutral-txt-primary);
--section-title-left-color: var(--color-grey-100);
--section-title-left-weight: 500;
--section-title-right-size: 1.6rem;
--section-title-right-color: var(--color-normal-txt-base);
--section-title-right-color: var(--color-purple-base);
--section-title-right-weight: 700;
&.h6 {
margin-bottom: 1rem;
--section-title-left-size: 1.5rem;
--section-title-left-color: var(--color-neutral-txt-secondary);
--section-title-left-color: var(--color-grey-300);
--section-title-left-weight: 400;
}
&.h5 {
margin-top: 2rem;
margin-bottom: 1rem;
border-bottom: 1px solid var(--color-normal-txt-base);
border-bottom: 1px solid var(--color-purple-base);
--section-title-left-size: 1.6rem;
--section-title-left-color: var(--color-normal-txt-base);
--section-title-left-color: var(--color-purple-base);
--section-title-left-weight: 700;
--section-title-right-size: 1.4rem;
--section-title-right-color: var(--color-normal-txt-base);
--section-title-right-color: var(--color-purple-base);
--section-title-right-weight: 400;
}
}

View File

@@ -26,11 +26,11 @@ const emit = defineEmits<{
align-items: stretch;
justify-content: center;
height: 3.4rem;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
border-radius: 1.7rem;
background-color: var(--color-normal-background-selected);
background-color: var(--background-color-purple-10);
gap: 1rem;
border: 1px solid var(--color-normal-txt-base);
border: 1px solid var(--color-purple-base);
}
.label,
@@ -54,10 +54,10 @@ const emit = defineEmits<{
border-radius: 1.4rem;
width: 2.8rem;
margin: 0.2rem;
background-color: var(--color-normal-item-active);
background-color: var(--color-purple-l40);
&:hover {
background-color: var(----color-danger-item-hover);
background-color: var(--color-red-l20);
}
}
</style>

View File

@@ -9,7 +9,7 @@
display: flex;
align-items: center;
padding: 1rem;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
gap: 1rem;
}
</style>

View File

@@ -19,7 +19,7 @@
.key {
padding-right: 2rem;
text-align: left;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
@media (--desktop) {
min-width: 20rem;

View File

@@ -4,7 +4,7 @@
<style lang="postcss" scoped>
.ui-raw {
background-color: var(--color-neutral-border);
background-color: var(--color-grey-500);
text-align: left;
overflow: auto;
max-width: 100%;

View File

@@ -5,7 +5,7 @@
<style lang="postcss" scoped>
.ui-separator {
border: none;
border-top: 1px solid var(--color-neutral-border);
border-top: 1px solid var(--color-grey-500);
margin: 2rem 0;
}
</style>

View File

@@ -24,7 +24,7 @@ defineProps<{
flex-direction: column;
align-items: center;
justify-content: center;
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
}
.title {

View File

@@ -15,14 +15,14 @@ defineProps<{
.ui-table {
width: 100%;
border-spacing: 0;
background-color: var(--color-neutral-background-primary);
background-color: var(--background-color-primary);
line-height: 2.4rem;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
:deep(th),
:deep(td) {
padding: 1rem;
border-top: 1px solid var(--color-neutral-border);
border-top: 1px solid var(--color-grey-500);
text-align: left;
}
@@ -33,7 +33,7 @@ defineProps<{
:deep(thead) {
th,
td {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
font-size: 1.4rem;
font-weight: 400;
text-transform: uppercase;
@@ -43,7 +43,7 @@ defineProps<{
&.vertical-border {
:deep(th),
:deep(td) {
border-right: 1px solid var(--color-neutral-border);
border-right: 1px solid var(--color-grey-500);
&:last-child {
border-right: none;
@@ -53,6 +53,6 @@ defineProps<{
}
.error {
background-color: var(--color-danger-background-selected);
background-color: var(--background-color-red-10);
}
</style>

View File

@@ -25,7 +25,7 @@ const tag = computed(() => {
line-height: 150%;
align-self: stretch;
flex-grow: 0;
color: var(--color-neutral-txt-primary);
color: var(--color-grey-100);
&.display {
font-size: 6.4rem;

View File

@@ -30,19 +30,16 @@ const icon = computed(() => {
color: var(--icon-color);
&.error {
--icon-color: var(--color-danger-item-base);
--icon-color: var(--color-red-base);
}
&.warning {
--icon-color: var(--color-warning-item-base);
--icon-color: var(--color-orange-base);
}
&.info {
--icon-color: var(--color-normal-item-base);
--icon-color: var(--color-purple-base);
}
&.success {
--icon-color: var(--color-success-item-base);
--icon-color: var(--color-green-base);
}
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<UiButton size="medium" color="normal" level="primary" :busy="modal.isBusy" type="submit">
<UiButton :busy="modal.isBusy" type="submit">
<slot />
</UiButton>
</template>

View File

@@ -1,5 +1,5 @@
<template>
<UiButton size="medium" color="normal" level="secondary" :busy="modal.isBusy" @click="modal.decline()">
<UiButton level="secondary" :busy="modal.isBusy" @click="modal.decline()">
<slot>{{ $t('cancel') }}</slot>
</UiButton>
</template>

View File

@@ -71,6 +71,6 @@ const { textClass } = useContext(ColorContext)
.subtitle {
font-weight: 400;
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-200);
}
</style>

View File

@@ -29,22 +29,22 @@ const cssFillWidth = computed(() => {
height: var(--progress-bar-height, 0.4rem);
margin: 1rem 0;
border-radius: 0.4rem;
background-color: var(--progress-bar-background-color, var(--color-normal-background-selected));
background-color: var(--progress-bar-background-color, var(--background-color-purple-10));
&.color-info {
--progress-bar-color: var(--color-normal-item-base);
--progress-bar-color: var(--color-purple-base);
}
&.color-success {
--progress-bar-color: var(--color-success-item-base);
--progress-bar-color: var(--color-green-base);
}
&.color-warning {
--progress-bar-color: var(--color-warning-item-base);
--progress-bar-color: var(--color-orange-base);
}
&.color-error {
--progress-bar-color: var(--color-danger-item-base);
--progress-bar-color: var(--color-red-base);
}
}

View File

@@ -19,7 +19,7 @@ withDefaults(
<style lang="postcss" scoped>
.unit {
color: var(--color-neutral-txt-secondary);
color: var(--color-grey-300);
display: flex;
justify-content: space-between;
letter-spacing: 0.04em;

View File

@@ -25,15 +25,15 @@ defineProps<{
}
.icon {
color: var(--color-normal-txt-base);
color: var(--color-purple-base);
font-size: 3.2rem;
}
.separator {
height: 4.5rem;
width: 0;
border-left: 0.1rem solid var(--color-normal-txt-base);
background-color: var(--color-normal-txt-base);
border-left: 0.1rem solid var(--color-purple-base);
background-color: var(--color-purple-base);
margin: 0 1.5rem;
}

View File

@@ -134,6 +134,6 @@ const getHostState = (host: XenApiHost) => (isHostRunning(host) ? VM_POWER_STATE
.star {
margin: 0 1rem;
color: var(--color-warning-item-base);
color: var(--color-orange-base);
}
</style>

View File

@@ -2,23 +2,16 @@
<TitleBar :icon="faDisplay">
{{ name }}
<template #actions>
<MenuList v-if="vm !== undefined" placement="bottom-end" border>
<MenuList v-if="vm !== undefined" placement="bottom-end" shadow>
<template #trigger="{ open, isOpen }">
<UiButton
size="medium"
color="normal"
level="primary"
:class="{ pressed: isOpen }"
:left-icon="faPowerOff"
@click="open"
>
<UiButton :class="{ pressed: isOpen }" :left-icon="faPowerOff" @click="open">
{{ $t('change-state') }}
<UiIcon :icon="faAngleDown" />
</UiButton>
</template>
<VmActionPowerStateItems :vm-refs="[vm.$ref]" />
</MenuList>
<MenuList v-if="vm !== undefined" placement="bottom-end" border>
<MenuList v-if="vm !== undefined" placement="bottom-end" shadow>
<template #trigger="{ open, isOpen }">
<ButtonIcon
v-tooltip="{

View File

@@ -2,7 +2,7 @@
<MenuList
:disabled="selectedRefs.length === 0"
:horizontal="!isMobile"
:border="isMobile"
:shadow="isMobile"
class="vms-actions-bar"
placement="bottom-end"
>
@@ -53,7 +53,7 @@ const { isMobile } = storeToRefs(useUiStore())
<style lang="postcss" scoped>
.vms-actions-bar {
padding-bottom: 1rem;
border-bottom: 1px solid var(--color-neutral-border);
background-color: var(--color-neutral-background-primary);
border-bottom: 1px solid var(--color-grey-500);
background-color: var(--background-color-primary);
}
</style>

View File

@@ -9,11 +9,11 @@ export const useChartTheme = () => {
const style = window.getComputedStyle(window.document.documentElement)
const getColors = () => ({
background: style.getPropertyValue('--color-neutral-background-primary'),
text: style.getPropertyValue('--color-neutral-txt-secondary'),
splitLine: style.getPropertyValue('--color-neutral-border'),
primary: style.getPropertyValue('--color-normal-txt-base'),
secondary: style.getPropertyValue('--color-warning-txt-base'),
background: style.getPropertyValue('--background-color-primary'),
text: style.getPropertyValue('--color-grey-300'),
splitLine: style.getPropertyValue('--color-grey-500'),
primary: style.getPropertyValue('--color-purple-base'),
secondary: style.getPropertyValue('--color-orange-base'),
})
const colors = ref(getColors())

View File

@@ -1,5 +1,4 @@
import { useModal } from '@/composables/modal.composable'
import { ipToHostname } from '@/libs/utils'
import { useHostStore } from '@/stores/xen-api/host.store'
import { whenever } from '@vueuse/core'
import { difference } from 'lodash-es'
@@ -13,7 +12,7 @@ export const useUnreachableHosts = () => {
difference(nextHosts, previousHosts).forEach(host => {
const url = new URL('http://localhost')
url.protocol = window.location.protocol
url.hostname = ipToHostname(host.address)
url.hostname = host.address
fetch(url, { mode: 'no-cors' }).catch(() => unreachableHostsUrls.value.add(url.toString()))
})
})

View File

@@ -418,7 +418,7 @@ export const isSlotParam = (param: any): param is SlotParam => param instanceof
export const isModelParam = (param: any): param is ModelParam => param instanceof ModelParam
export const colorProp = (name = 'color') =>
prop(name).type('Color').enum('normal', 'success', 'warning', 'danger').default('normal').widget()
prop(name).type('Color').enum('info', 'success', 'warning', 'error').default('info').widget()
export const iconProp = (name = 'icon') =>
prop(name)

View File

@@ -111,11 +111,3 @@ export function parseRamUsage(
}
export const getFirst = <T>(value: T | T[]): T | undefined => (Array.isArray(value) ? value[0] : value)
export function isIpv6(ip: string) {
return ip.includes(':')
}
export function ipToHostname(ip: string) {
return isIpv6(ip) ? `[${ip}]` : ip
}

View File

@@ -1,5 +1,4 @@
import { useModal } from '@/composables/modal.composable'
import { ipToHostname } from '@/libs/utils'
import type { VM_COMPRESSION_TYPE } from '@/libs/xen-api/xen-api.enums'
import type {
ObjectType,
@@ -91,7 +90,7 @@ export default class XenApi {
) {
const url = new URL('http://localhost')
url.protocol = window.location.protocol
url.hostname = ipToHostname(host.address)
url.hostname = host.address
url.pathname = pathname
url.search = new URLSearchParams({
...query,

View File

@@ -111,6 +111,7 @@
"keep-page-open": "Fenster bis zum Ende der Installation nicht Aktualisieren oder Schließen.",
"language": "Sprache",
"last-week": "Letzte Woche",
"learn-more": "Mehr erfahren",
"load-now": "Jetzt laden",
"loading-hosts": "Lade Hosts…",
"login": "Anmelden",

View File

@@ -112,6 +112,7 @@
"keep-page-open": "Do not refresh or quit tab before end of deployment.",
"language": "Language",
"last-week": "Last week",
"learn-more": "Learn more",
"load-now": "Load now",
"loading-hosts": "Loading hosts…",
"login": "Login",
@@ -202,6 +203,7 @@
"theme-light": "Light",
"this-vm-cant-be-migrated": "This VM can't be migrated",
"top-#": "Top {n}",
"total-cpus": "Total CPUs",
"total-free:": "Total free:",
"total-used:": "Total used:",
"unreachable-hosts": "Unreachable hosts",

View File

@@ -109,6 +109,7 @@
"keep-page-open": "قبل از پایان استقرار، برگه را ریفرش نکنید یا از آن خارج نشوید.",
"language": "زبان",
"last-week": "هفته گذشته",
"learn-more": "بیشتر بدانید",
"load-now": "اکنون بارگذاری کنید",
"loading-hosts": "در حال بارگذاری میزبان ها…",
"login": "ورود به سیستم",

View File

@@ -112,6 +112,7 @@
"keep-page-open": "Ne pas rafraichir ou quitter cette page avant la fin du déploiement.",
"language": "Langue",
"last-week": "Semaine dernière",
"learn-more": "En savoir plus",
"load-now": "Charger maintenant",
"loading-hosts": "Chargement des hôtes…",
"login": "Connexion",
@@ -202,6 +203,7 @@
"theme-light": "Clair",
"this-vm-cant-be-migrated": "Cette VM ne peut pas être migrée",
"top-#": "Top {n}",
"total-cpus": "Total CPUs",
"total-free:": "Total libre :",
"total-used:": "Total utilisé :",
"unreachable-hosts": "Hôtes inaccessibles",

View File

@@ -15,8 +15,8 @@
<template #title>{{ settings.title }}</template>
<template #subtitle>{{ settings.subtitle }}</template>
<template #buttons>
<UiButton level="secondary" color="normal" size="medium">I prefer not</UiButton>
<UiButton level="primary" color="normal" size="medium">Yes, I'm sure!</UiButton>
<UiButton level="secondary">I prefer not</UiButton>
<UiButton>Yes, I'm sure!</UiButton>
</template>
</ConfirmModalLayout>
</ComponentStory>

View File

@@ -23,8 +23,8 @@
</div>
<template #buttons>
<UiButton level="secondary" color="normal" size="medium">Cancel</UiButton>
<UiButton level="primary" color="normal" size="medium">Migrate 3 VMs</UiButton>
<UiButton level="secondary">Cancel</UiButton>
<UiButton>Migrate 3 VMs</UiButton>
</template>
</FormModalLayout>
</ComponentStory>

View File

@@ -19,7 +19,7 @@
setting('namedScopedSlotContent').widget(text()).preset('Content for named scoped slot'),
]"
>
<StoryExampleComponent v-bind="properties" v-model="defaultModel" v-model:custom-model="customModel">
<StoryExampleComponent v-bind="properties" v-model="defaultModel" v-model:customModel="customModel">
{{ settings.defaultSlotContent }}
<div>Default model value: {{ defaultModel }}</div>
<div>Custom model value: {{ customModel }}</div>

View File

@@ -7,10 +7,10 @@
]"
>
<ButtonGroup v-bind="properties">
<UiButton level="secondary" color="normal" size="medium">Cancel</UiButton>
<UiButton level="primary" color="normal" size="medium">Call to action</UiButton>
<UiButton level="secondary">Cancel</UiButton>
<UiButton>Call to action</UiButton>
<template #tertiary>
<UiButton level="tertiary" color="warning" size="medium">Secondary call to action</UiButton>
<UiButton level="tertiary" color="warning">Secondary call to action</UiButton>
</template>
</ButtonGroup>
</ComponentStory>

Some files were not shown because too many files have changed in this diff Show More