Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
truenas-rk3588
webui
Commits
08b230d7
Unverified
Commit
08b230d7
authored
1 year ago
by
RehanY147
Committed by
GitHub
1 year ago
Browse files
Options
Download
Email Patches
Plain Diff
NAS-124044 / 23.10 / Adapt to 0 values (#8950)
parent
98645fe3
base
NAS-124325-23.10.0
NAS-124430
NAS-124481-23.10.0
NAS-124481-23.10.1
NAS-124555-23.10.0
NAS-124555-23.10.1
NAS-124707-23.10.0
NAS-124707-23.10.1
NAS-124846-23.10.0
NAS-124846-23.10.1
NAS-124892
NAS-124895-23.10.1
NAS-125213-23.10.1
NAS-125616-23.10.2
NAS-125703-23.10.2
NAS-125728
NAS-126795-test2
developer/lyy
rel-v0.0.1
release/23.10.0
release/23.10.1
release/23.10.1.1
release/23.10.1.2
release/23.10.1.3
release/23.10.2
stable/cobia
v0.0.2
TS-23.10.2
TS-23.10.1.3
TS-23.10.1.2
TS-23.10.1.1
TS-23.10.1
TS-23.10.0.1
TS-23.10.0
DN110M-CS-v2.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.html
+52
-35
...dashboard/components/widget-cpu/widget-cpu.component.html
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.ts
+9
-0
...s/dashboard/components/widget-cpu/widget-cpu.component.ts
with
61 additions
and
35 deletions
+61
-35
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.html
View file @
08b230d7
...
...
@@ -95,7 +95,7 @@
<strong>
{{ 'Highest Usage' | translate }}:
</strong>
</span>
<ng-container
*ngIf=
"usageMax
>
0; else noDataProvided"
>
<ng-container
*ngIf=
"usageMax
|| usageMax ===
0; else noDataProvided"
>
{{ usageMax }}%
<span
class=
"subtext"
>
({{
...
...
@@ -119,17 +119,22 @@
<span
class=
"label"
>
<strong>
{{ 'Hottest' | translate }}:
</strong>
</span>
<ng-container
*ngIf=
"tempMax > 0; else noDataProvided"
>
<span>
{{ tempMax }}°C
</span>
<span
class=
"subtext"
>
({{
tempMaxThreads.length === 0
? ('All Cores' | translate)
: tempMaxThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMaxThreads.toString
()
:
tempMaxThreads.length
+
('
cores
at
'
|
translate
)
+
tempMax
+
'°
C
'
}})
</
span
>
<ng-container
*ngIf=
"tempMax || tempMax === 0; else noDataProvided"
>
<ng-container
*ngIf=
"tempMax === 0; else tempMaxValues"
>
<span>
{{ 'N/A' | translate }}
</span>
</ng-container>
<ng-template
#tempMaxValues
>
<span>
{{ tempMax }}°C
</span>
<span
class=
"subtext"
>
({{
tempMaxThreads.length === 0
? ('All Cores' | translate)
: tempMaxThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMaxThreads.toString
()
:
tempMaxThreads.length
+
('
cores
at
'
|
translate
)
+
tempMax
+
'°
C
'
}})
</
span
>
</ng-template>
</ng-container>
</mat-list-item>
</mat-list>
...
...
@@ -178,39 +183,51 @@
</span>
</div>
<mat-list>
<ng-container
*ngIf=
"tempMax
>
0; else noDataProvided"
>
<ng-container
*ngIf=
"tempMax
|| tempMax ===
0; else noDataProvided"
>
<mat-list-item>
<span
class=
"label"
>
{{ 'Hottest:' | translate }}
</span>
{{ tempMax }}°C
<span
class=
"subtext"
>
({{
tempMaxThreads.length === 0
? ('All Cores' | translate)
: tempMaxThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMaxThreads.toString
()
:
tempMaxThreads.length
+
('
cores
at
'
|
translate
)
+
tempMax
+
'°
C
'
}})
</
span
>
<ng-container
*ngIf=
"tempMax === 0; else tempMaxValuesMobile"
>
{{ 'N/A' | translate }}
</ng-container>
<ng-template
#tempMaxValuesMobile
>
{{ tempMax }}°C
<span
class=
"subtext"
>
({{
tempMaxThreads.length === 0
? ('All Cores' | translate)
: tempMaxThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMaxThreads.toString
()
:
tempMaxThreads.length
+
('
cores
at
'
|
translate
)
+
tempMax
+
'°
C
'
}})
</
span
>
</ng-template>
</mat-list-item>
</ng-container>
<ng-container
*ngIf=
"tempMin
>
0; else noDataProvided"
>
<ng-container
*ngIf=
"tempMin
|| tempMin ===
0; else noDataProvided"
>
<mat-list-item>
<span
class=
"label"
>
{{ 'Coolest:' | translate }}
</span>
{{ tempMin }}°C
<span
class=
"subtext"
>
({{
tempMinThreads.length === 0
? ('All Cores' | translate)
: tempMinThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMinThreads.toString
()
:
tempMinThreads.length
+
('
cores
at
'
|
translate
)
+
tempMin
+
'°
C
'
}})
</
span
>
<ng-container
*ngIf=
"tempMin === 0; else tempMinValues"
>
{{ 'N/A' | translate }}
</ng-container>
<ng-template
#tempMinValues
>
{{ tempMin }}°C
<span
class=
"subtext"
>
({{
tempMinThreads.length === 0
? ('All Cores' | translate)
: tempMinThreads.length
<
2
?
('
Core
#
'
|
translate
)
+
tempMinThreads.toString
()
:
tempMinThreads.length
+
('
cores
at
'
|
translate
)
+
tempMin
+
'°
C
'
}})
</
span
>
</ng-template>
</mat-list-item>
</ng-container>
<mat-list-item>
<span
class=
"label"
>
{{ 'Highest Usage:' | translate }}
</span>
<ng-container
*ngIf=
"usageMax
>
0; else noDataProvided"
>
<ng-container
*ngIf=
"usageMax
|| usageMax ===
0; else noDataProvided"
>
{{ usageMax }}%
<span
class=
"subtext"
>
({{
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.ts
View file @
08b230d7
...
...
@@ -165,8 +165,13 @@ export class WidgetCpuComponent extends WidgetComponent implements AfterViewInit
setMobileStats
(
usage
:
number
[],
temps
:
number
[]):
void
{
// Usage
usage
.
splice
(
0
,
1
);
this
.
usageMin
=
Number
(
Math
.
min
(...
usage
).
toFixed
(
0
));
this
.
usageMin
=
Number
.
isFinite
(
this
.
usageMin
)
?
this
.
usageMin
:
0
;
this
.
usageMax
=
Number
(
Math
.
max
(...
usage
).
toFixed
(
0
));
this
.
usageMax
=
Number
.
isFinite
(
this
.
usageMax
)
?
this
.
usageMax
:
0
;
this
.
usageMinThreads
=
[];
this
.
usageMaxThreads
=
[];
for
(
let
i
=
0
;
i
<
usage
.
length
;
i
++
)
{
...
...
@@ -182,7 +187,11 @@ export class WidgetCpuComponent extends WidgetComponent implements AfterViewInit
// Temperature
temps
.
splice
(
0
,
1
);
this
.
tempMin
=
Number
(
Math
.
min
(...
temps
).
toFixed
(
0
));
this
.
tempMin
=
Number
.
isFinite
(
this
.
tempMin
)
?
this
.
tempMin
:
0
;
this
.
tempMax
=
Number
(
Math
.
max
(...
temps
).
toFixed
(
0
));
this
.
tempMax
=
Number
.
isFinite
(
this
.
tempMax
)
?
this
.
tempMax
:
0
;
this
.
tempMinThreads
=
[];
this
.
tempMaxThreads
=
[];
for
(
let
i
=
0
;
i
<
temps
.
length
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help