Skip to content

Commit 10fb128

Browse files
authored
Merge pull request #83 from K97i/v2-drives
Add Drive Modals
2 parents b77a7ad + eec14c8 commit 10fb128

File tree

3 files changed

+228
-211
lines changed

3 files changed

+228
-211
lines changed

new/apps/web/src/lib/components/Widgets.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</div>
3535

3636
<div class="widgets">
37-
<Drives />
37+
<Drives drives={report.Hardware.Storage}/>
3838
</div>
3939

4040
<div class="widgets">
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<script lang="ts">
2+
3+
interface PartitionInfo {
4+
PartitionCapacity: number;
5+
PartitionFree: number;
6+
PartitionLabel: string;
7+
PartitionLetter: null;
8+
Filesystem: string;
9+
CfgMgrErrorCode: number;
10+
LastErrorCode: number;
11+
DirtyBitSet: boolean;
12+
BitlockerEncryptionStatus: boolean;
13+
}
14+
15+
interface Props {
16+
partitions: Array<PartitionInfo>;
17+
}
18+
19+
let {
20+
partitions
21+
}: Props = $props();
22+
23+
const partitionTotal: number = partitions.reduce((total, part) => total + part.PartitionCapacity, 0)
24+
25+
</script>
26+
27+
<div class="partition-bar">
28+
{#each partitions as partition}
29+
<div class="partition" style="width: {(partition.PartitionCapacity / partitionTotal) * 100}%;">
30+
<span>{partition.PartitionLabel} ({partition.PartitionLetter}:)</span>
31+
<span>{partition.Filesystem}</span>
32+
<span>{Math.floor((partition.PartitionCapacity - partition.PartitionFree) / 1048576)} MB / {Math.floor(partition.PartitionCapacity / 1048576)} MB used</span>
33+
</div>
34+
{/each}
35+
</div>
36+
37+
<style>
38+
39+
.partition-bar {
40+
min-height: 3rem;
41+
max-height: 4rem;
42+
display: flex;
43+
flex-flow: row;
44+
}
45+
46+
.partition-bar > div {
47+
min-height: inherit;
48+
border: 1px solid #FFFFFF22;
49+
}
50+
51+
.partition-bar > div:nth-child(even){
52+
background-color: #00000022;
53+
}
54+
55+
.partition {
56+
overflow: hidden;
57+
display: flex;
58+
align-items: center;
59+
justify-content: middle;
60+
flex-flow: column;
61+
max-height: inherit;
62+
}
63+
64+
.partition > span {
65+
max-height: inherit;
66+
font-size: 0.75rem;
67+
}
68+
</style>

0 commit comments

Comments
 (0)