Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testcenter-frontend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
discontinued
testcenter-frontend
Commits
13079f28
Commit
13079f28
authored
4 years ago
by
paflov
Browse files
Options
Downloads
Patches
Plain Diff
nicer display of file-stats
parent
2dea9ccc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/workspace-admin/files/files.component.html
+16
-2
16 additions, 2 deletions
src/app/workspace-admin/files/files.component.html
src/app/workspace-admin/files/files.component.ts
+34
-12
34 additions, 12 deletions
src/app/workspace-admin/files/files.component.ts
with
50 additions
and
14 deletions
src/app/workspace-admin/files/files.component.html
+
16
−
2
View file @
13079f28
...
...
@@ -99,12 +99,26 @@
{{ i }}
</p>
<div
*ngFor=
"let stat of fileStats | keyvalue"
>
<div
*ngFor=
"let stat of fileStats
.types
| keyvalue"
>
<div
class=
"vertical-align-middle"
>
<mat-icon
class=
"report-info"
>
info
</mat-icon>
<alert
text=
"{{stat.value}} Dateien vom Typ `{{stat.key}}`"
></alert>
<span>
{{stat.value.valid}} valide Datei{{stat.value.valid == 1 ? '' : 'en'}} vom Typ {{stat.key}}
{{(stat.value.all > stat.value.valid) ? '(von insgesamt ' + stat.value.all + ')' : ''}}
</span>
</div>
</div>
<div
*ngIf=
"fileStats.valid < fileStats.all"
>
<div
class=
"vertical-align-middle"
>
<mat-icon
class=
"report-warning"
>
warning
</mat-icon>
<span>
{{fileStats.valid}} Datei{{fileStats.valid == 1 ? '' : 'en'}} von {{fileStats.all}}
sind nicht valide oder haben fehlende Abhängigkeiten und werden ignoriert!
</span>
</div>
</div>
</div>
</div>
<
This diff is collapsed.
Click to expand it.
src/app/workspace-admin/files/files.component.ts
+
34
−
12
View file @
13079f28
...
...
@@ -16,6 +16,17 @@ import { GetFileResponseData, CheckWorkspaceResponseData } from '../workspace.in
import
{
BackendService
,
FileDeletionReport
}
from
'
../backend.service
'
;
import
{
MainDataService
}
from
'
../../maindata.service
'
;
interface
FileStats
{
types
:
{
[
type
:
string
]:
{
all
:
number
;
valid
:
number
;
}
}
all
:
number
;
valid
:
number
;
}
@
Component
({
templateUrl
:
'
./files.component.html
'
,
styleUrls
:
[
'
./files.component.css
'
]
...
...
@@ -34,7 +45,11 @@ export class FilesComponent implements OnInit {
public
checkInfos
=
[];
@
ViewChild
(
MatSort
,
{
static
:
true
})
sort
:
MatSort
;
public
fileStats
:
{[
type
:
string
]:
number
};
public
fileStats
:
FileStats
=
{
types
:
{},
all
:
0
,
valid
:
0
};
constructor
(
@
Inject
(
'
SERVER_URL
'
)
private
serverUrl
:
string
,
...
...
@@ -136,18 +151,25 @@ export class FilesComponent implements OnInit {
}
}
private
static
getStats
(
fileList
:
GetFileResponseData
[]):
{[
type
:
string
]:
number
}
{
const
stats
:
{[
type
:
string
]:
number
}
=
{};
// TODO filter validity
return
fileList
.
reduce
((
carry
,
file
)
=>
{
if
(
typeof
carry
[
file
.
type
]
===
'
undefined
'
)
{
// eslint-disable-next-line no-param-reassign
carry
[
file
.
type
]
=
0
;
private
static
getStats
(
fileList
:
GetFileResponseData
[]):
FileStats
{
const
stats
:
FileStats
=
{
types
:
{},
all
:
0
,
valid
:
0
};
fileList
.
forEach
(
file
=>
{
if
(
typeof
stats
.
types
[
file
.
type
]
===
'
undefined
'
)
{
stats
.
types
[
file
.
type
]
=
{
all
:
0
,
valid
:
0
};
}
// eslint-disable-next-line no-param-reassign
carry
[
file
.
type
]
+=
1
;
return
carry
;
},
stats
);
stats
.
types
[
file
.
type
].
all
+=
1
;
stats
.
types
[
file
.
type
].
valid
+=
(
file
.
report
.
error
&&
file
.
report
.
error
.
length
)
?
1
:
0
;
stats
.
all
+=
1
;
stats
.
valid
+=
(
file
.
report
.
error
&&
file
.
report
.
error
.
length
)
?
1
:
0
;
});
return
stats
;
}
download
(
element
:
GetFileResponseData
):
void
{
...
...
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