1- <!-- NOT YET IMPLEMENTED IN NEW WIDGET SYSTEM -->
21<script lang =" ts" >
32 import Widget from ' ../../common/ModalWidget.svelte' ;
4- import Rambuilder from ' ../logic/RamBuilder.svelte' ;
53
6- export let ramData;
7- export let pagefileData;
4+ interface RamInfo {
5+ DeviceLocation: string ;
6+ BankLocator: string ;
7+ Manufacturer: string ;
8+ SerialNumber: string ;
9+ PartNumber: string ;
10+ ConfiguredSpeed: number ;
11+ Capacity: number ;
12+ }
13+
14+ interface PagefileInfo {
15+ AllocatedBaseSize: number ;
16+ Caption: string ;
17+ CurrentUsage: number ;
18+ PeakUsage: number ;
19+ }
20+
21+ interface Props {
22+ ram: Array <RamInfo >;
23+ pagefile: PagefileInfo ;
24+ }
25+
26+ let {
27+ ram,
28+ pagefile
29+ }: Props = $props ();
30+
31+ const flexBasis: string = ` ${100 / (Object .keys (ram ).length % 4 ? Object .keys (ram ).length % 4 : 4 )}% ` ;
32+
833 </script >
934
1035<!-- RAM -->
1136
12- <Widget title =" Memory" modalId =" ram-modal" >
13- <div slot =" values" >
14- <Rambuilder data ={ramData } />
15- </div >
37+ <Widget title =" Memory" >
38+
39+ {#snippet widgetContents ()}
40+ <div class =" flex-container" >
41+ {#each ram as ramStick , i }
1642
17- <div slot =" modal-body" >
43+ {#if ramStick .Capacity > 0 }
44+ <div style ="flex: 1 1 {flexBasis };" >
45+ <span >{Math .floor (ramStick .Capacity / 1000 )} GB</span >
46+ <div >DIMM {i + 1 }</div >
47+ </div >
48+ {:else }
49+ <div style ="flex: 1 1 {flexBasis };" >
50+ <span style =" color: rgb(215,27,27);" >--</span >
51+ <div >DIMM {i + 1 }</div >
52+ </div >
53+ {/if }
54+
55+ <!--
56+ Checks if report has more than 4 RAM Modules,
57+ and if each block has reached the 4th module in this row
58+ -->
59+ {#if Object .keys (ram ).length > 4 && (i + 1 ) % 4 == 0 }
60+ <div style =" flex-basis: 100%;" ></div >
61+ {/if }
62+ {/each }
63+ </div >
64+ {/ snippet }
65+
66+ {#snippet modalContents ()}
1867 <h5 >Physical Memory</h5 >
1968 <table class =" table" >
2069 <thead >
2776 </tr >
2877 </thead >
2978 <tbody >
30- {#each ramData as ramStick }
79+ {#each ram as ramStick }
3180 {#if ramStick [' Capacity' ] <= 0 }
3281 <tr >
3382 <td >{ramStick [' DeviceLocation' ]}</td >
5099 <tbody >
51100 <tr >
52101 <td >File Path</td >
53- <td >{pagefileData .Caption }</td >
102+ <td >{pagefile .Caption }</td >
54103 </tr >
55104 <tr >
56105 <td >Allocated Base Size</td >
57- <td >{pagefileData .AllocatedBaseSize } MB</td >
106+ <td >{pagefile .AllocatedBaseSize } MB</td >
58107 </tr >
59108 <tr >
60109 <td >Current Usage</td >
61- <td >{pagefileData .CurrentUsage } MB</td >
110+ <td >{pagefile .CurrentUsage } MB</td >
62111 </tr >
63112 <tr >
64113 <td >Peak Usage</td >
65- <td >{pagefileData .PeakUsage } MB</td >
114+ <td >{pagefile .PeakUsage } MB</td >
66115 </tr >
67116 </tbody >
68117 </table >
69- </ div >
118+ { / snippet }
70119</Widget >
120+
121+ <style >
122+ span {
123+ color : var (--color-secondary-50 );
124+ }
125+
126+ div {
127+ color : var (--color-surface-300 );
128+ font-size : 13pt ;
129+ }
130+
131+ .flex-container {
132+ display : flex ;
133+ flex-flow : row wrap ;
134+ max-width : inherit ;
135+ }
136+ </style >
0 commit comments