zavadil-react-common 1.2.101 → 1.2.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/component/stats/CacheStatsControl.tsx +20 -10
- package/src/component/stats/JavaHeapControl.tsx +18 -16
- package/src/component/stats/QueueStatsControl.tsx +8 -10
|
@@ -8,18 +8,28 @@ export type CacheStatsControlProps = {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function CacheStatsControl({name, stats}: CacheStatsControlProps) {
|
|
11
|
-
const isEmpty = stats.cachedItems === 0 && stats.capacity === 0;
|
|
12
11
|
return (
|
|
13
|
-
<div
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
<div>
|
|
13
|
+
<div className="d-flex align-items-center gap-2">
|
|
14
|
+
<pre>{name}</pre>
|
|
15
|
+
<pre>
|
|
16
|
+
[
|
|
17
|
+
{stats.cachedItems}
|
|
18
|
+
{stats.capacity > 0 && ' / '}
|
|
19
|
+
{stats.capacity > 0 && stats.capacity}
|
|
20
|
+
]
|
|
21
|
+
</pre>
|
|
22
22
|
</div>
|
|
23
|
+
{
|
|
24
|
+
stats.capacity > 0 &&
|
|
25
|
+
<div className="flex-grow-1">
|
|
26
|
+
<ProgressBar
|
|
27
|
+
now={stats.cachedItems}
|
|
28
|
+
min={0}
|
|
29
|
+
max={stats.capacity}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
}
|
|
23
33
|
</div>
|
|
24
34
|
);
|
|
25
35
|
}
|
|
@@ -13,23 +13,25 @@ export function JavaHeapControl({stats}: WorkerJavaHeapControlProps) {
|
|
|
13
13
|
const used = size - free;
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<div
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<Badge className="bg-warning text-bg-warning">
|
|
21
|
-
{ByteUtil.formatByteSize(used)}
|
|
22
|
-
</Badge>
|
|
23
|
-
<pre>Free:</pre>
|
|
24
|
-
<Badge className="bg-success text-white">
|
|
25
|
-
{ByteUtil.formatByteSize(free)}
|
|
26
|
-
</Badge>
|
|
27
|
-
<div className="flex-grow-1">
|
|
28
|
-
<ProgressBar min={0} max={max}>
|
|
29
|
-
<ProgressBar variant="warning" min={0} now={used} max={max}/>
|
|
30
|
-
<ProgressBar variant="success" min={0} now={free} max={max}/>
|
|
31
|
-
</ProgressBar>
|
|
16
|
+
<div>
|
|
17
|
+
<div className="d-flex align-items-center gap-2">
|
|
18
|
+
<pre>Java Heap</pre>
|
|
19
|
+
<pre>[{ByteUtil.formatByteSize(size)} / {ByteUtil.formatByteSize(max)}]</pre>
|
|
32
20
|
</div>
|
|
21
|
+
<div>
|
|
22
|
+
<pre>Used:</pre>
|
|
23
|
+
<Badge className="bg-warning text-bg-warning">
|
|
24
|
+
{ByteUtil.formatByteSize(used)}
|
|
25
|
+
</Badge>
|
|
26
|
+
<pre>Free:</pre>
|
|
27
|
+
<Badge className="bg-success text-white">
|
|
28
|
+
{ByteUtil.formatByteSize(free)}
|
|
29
|
+
</Badge>
|
|
30
|
+
</div>
|
|
31
|
+
<ProgressBar min={0} max={max}>
|
|
32
|
+
<ProgressBar variant="warning" min={0} now={used} max={max}/>
|
|
33
|
+
<ProgressBar variant="success" min={0} now={free} max={max}/>
|
|
34
|
+
</ProgressBar>
|
|
33
35
|
</div>
|
|
34
36
|
);
|
|
35
37
|
}
|
|
@@ -11,16 +11,14 @@ export type QueueStatsControlProps = {
|
|
|
11
11
|
export function QueueStatsControl({name, stats}: QueueStatsControlProps) {
|
|
12
12
|
const max = stats.remaining + stats.processed;
|
|
13
13
|
return (
|
|
14
|
-
<div
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</ProgressBar>
|
|
23
|
-
|
|
14
|
+
<div>
|
|
15
|
+
<div className="d-flex align-items-center gap-2">
|
|
16
|
+
<pre>{name}</pre>
|
|
17
|
+
<pre>[{stats.processed} / {max}]</pre>
|
|
18
|
+
<QueueStateControl state={stats.state}/>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<ProgressBar variant="primary" striped={true} animated={true} min={0} now={stats.processed} max={max || 1}/>
|
|
24
22
|
</div>
|
|
25
23
|
</div>
|
|
26
24
|
);
|