diff --git a/packages/ui/src/components/Progress.svelte b/packages/ui/src/components/Progress.svelte index 070791cee38..0063416906c 100644 --- a/packages/ui/src/components/Progress.svelte +++ b/packages/ui/src/components/Progress.svelte @@ -24,6 +24,7 @@ export let color: number | undefined = undefined export let editable = false export let fallback: number = 0 + export let small: boolean = false $: proc = (max - min) / 100 $: if (value > max) value = max @@ -61,6 +62,9 @@ let drag: boolean = false $: position = proc !== 0 ? Math.round((value - min) / proc) : fallback + $: barWidth = small + ? `calc(calc(100% - 0.5rem) * ${position} / 100 + .25rem)` + : `calc(calc(100% - 1rem) * ${position} / 100 + .5rem)` @@ -68,7 +72,7 @@
0 ? Math.min(storageUsed / limits.storageLimit, 1) : 0 $: bandwidthPercent = limits.trafficLimit > 0 ? Math.min(trafficUsed / limits.trafficLimit, 1) : 0 + $: storageColor = storagePercent >= 0.9 ? PaletteColorIndexes.Firework : undefined + $: bandwidthColor = bandwidthPercent >= 0.9 ? PaletteColorIndexes.Firework : undefined + onMount(() => { // Initialize with current workspace currentWorkspace = workspace @@ -101,12 +103,11 @@ }} on:click={handleClick} > -
- +
+
- -
- +
+
@@ -115,11 +116,12 @@ display: flex; flex-direction: column; gap: 0.125rem; - border-radius: var(--small-BorderRadius); + border-radius: var(--extra-small-BorderRadius); cursor: pointer; transition: background-color 0.2s ease; - padding: 0.25rem; - border: none; + padding: 0.188rem; + width: 1.75rem; + border: 1px solid var(--theme-trans-color); background: none; outline: none; @@ -128,13 +130,8 @@ background-color: var(--theme-button-hovered); } } - .limit-item { - display: flex; - align-items: center; - padding: 0.0625rem; - border-radius: var(--small-BorderRadius); - transition: background-color 0.2s ease; - position: relative; - border: 1px solid var(--theme-trans-color); + + .progress-wrapper { + width: 100%; } diff --git a/plugins/billing-resources/src/components/UsageExtension.svelte b/plugins/billing-resources/src/components/UsageExtension.svelte new file mode 100644 index 00000000000..ec8a69a638d --- /dev/null +++ b/plugins/billing-resources/src/components/UsageExtension.svelte @@ -0,0 +1,21 @@ + + + +
+ +
diff --git a/plugins/billing-resources/src/components/UsageProgressBar.svelte b/plugins/billing-resources/src/components/UsageProgressBar.svelte deleted file mode 100644 index 954617f04d8..00000000000 --- a/plugins/billing-resources/src/components/UsageProgressBar.svelte +++ /dev/null @@ -1,65 +0,0 @@ - - - -
-
-
-
-
- - diff --git a/plugins/billing-resources/src/index.ts b/plugins/billing-resources/src/index.ts index 565c0ee52ff..56634ecc428 100644 --- a/plugins/billing-resources/src/index.ts +++ b/plugins/billing-resources/src/index.ts @@ -16,12 +16,12 @@ import type { Resources } from '@hcengineering/platform' import Settings from './components/Settings.svelte' import WorkbenchExtension from './components/WorkbenchExtension.svelte' -import LimitsIndicator from './components/LimitsIndicator.svelte' +import UsageExtension from './components/UsageExtension.svelte' export default async (): Promise => ({ component: { Settings, - UsageExtension: LimitsIndicator, + UsageExtension, WorkbenchExtension } })