Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
6c9eb895
Commit
6c9eb895
authored
4 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #14383 TIME 0:10 fix tech info if no file
parent
bf7deee2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/frontend/app/indexation/technical-information/technical-information.component.html
+10
-7
10 additions, 7 deletions
...echnical-information/technical-information.component.html
src/frontend/service/functions.service.ts
+10
-6
10 additions, 6 deletions
src/frontend/service/functions.service.ts
with
20 additions
and
13 deletions
src/frontend/app/indexation/technical-information/technical-information.component.html
+
10
−
7
View file @
6c9eb895
...
...
@@ -10,12 +10,14 @@
<div
*ngIf=
"loading"
class=
"loading"
color=
"primary"
>
<mat-spinner></mat-spinner>
</div>
<mat-form-field
class=
"data-item"
*ngFor=
"let data of techData | keyvalue"
>
<mat-icon
matPrefix
[class]=
"data.value.icon"
color=
"primary"
style=
"width: 35px;text-align: center;"
></mat-icon>
<mat-label>
{{'lang.'+data.key | translate}}
</mat-label>
<input
matInput
[value]=
"data.value.value"
readonly
>
</mat-form-field>
<ng-container
*ngFor=
"let data of techData | keyvalue"
>
<mat-form-field
*ngIf=
"!functions.empty(data.value.value)"
class=
"data-item"
>
<mat-icon
matPrefix
[class]=
"data.value.icon"
color=
"primary"
style=
"width: 35px;text-align: center;"
>
</mat-icon>
<mat-label>
{{'lang.'+data.key | translate}}
</mat-label>
<input
matInput
[value]=
"data.value.value"
readonly
>
</mat-form-field>
</ng-container>
<mat-accordion
*ngIf=
"!isEmptyCustom()"
>
<mat-expansion-panel
expanded
>
<mat-expansion-panel-header>
...
...
@@ -24,7 +26,8 @@
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field
*ngFor=
"let custom of customsData | keyvalue"
class=
"data-item"
>
<mat-icon
matPrefix
[class]=
"custom.value.icon"
color=
"primary"
style=
"width: 35px;text-align: center;"
></mat-icon>
<mat-icon
matPrefix
[class]=
"custom.value.icon"
color=
"primary"
style=
"width: 35px;text-align: center;"
></mat-icon>
<mat-label>
{{custom.value.label}}
</mat-label>
<input
matInput
[value]=
"custom.value.value"
readonly
>
</mat-form-field>
...
...
This diff is collapsed.
Click to expand it.
src/frontend/service/functions.service.ts
+
10
−
6
View file @
6c9eb895
...
...
@@ -156,14 +156,18 @@ export class FunctionsService {
}
formatBytes
(
bytes
:
number
,
decimals
=
2
)
{
if
(
bytes
===
0
)
{
return
'
0 Octet
'
;
}
if
(
typeof
bytes
===
'
number
'
)
{
if
(
bytes
===
0
)
{
return
'
0 Octet
'
;
}
const
k
=
1024
;
const
dm
=
decimals
<
0
?
0
:
decimals
;
const
sizes
=
[
'
Octets
'
,
'
KO
'
,
'
MO
'
,
'
GO
'
,
'
TO
'
,
'
PO
'
,
'
EO
'
,
'
ZO
'
,
'
YO
'
];
const
k
=
1024
;
const
dm
=
decimals
<
0
?
0
:
decimals
;
const
sizes
=
[
'
Octets
'
,
'
KO
'
,
'
MO
'
,
'
GO
'
,
'
TO
'
,
'
PO
'
,
'
EO
'
,
'
ZO
'
,
'
YO
'
];
const
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
));
const
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
));
return
parseFloat
((
bytes
/
Math
.
pow
(
k
,
i
)).
toFixed
(
dm
))
+
'
'
+
sizes
[
i
];
return
parseFloat
((
bytes
/
Math
.
pow
(
k
,
i
)).
toFixed
(
dm
))
+
'
'
+
sizes
[
i
];
}
else
{
return
bytes
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment