Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Queue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Queue
Merge requests
!804
Add sort buttons and fix header name
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Add sort buttons and fix header name
small-stats-improvements
into
development
Overview
1
Commits
1
Pipelines
0
Changes
3
Merged
Add sort buttons and fix header name
Stefan Hugtenburg
requested to merge
small-stats-improvements
into
development
10 months ago
Overview
1
Commits
1
Pipelines
0
Changes
3
Small changes to the lab stats page to fix a header and make the table sortable.
0
0
Merge request reports
Compare
development
version 2
861b06f4
10 months ago
version 1
f9a79c96
10 months ago
development (base)
and
latest version
latest version
9be1cf88
1 commit,
10 months ago
version 2
861b06f4
1 commit,
10 months ago
version 1
f9a79c96
1 commit,
10 months ago
3 files
+
89
−
16
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
src/main/resources/static/js/lab_specific_status.js
+
13
−
11
View file @ 9be1cf88
Edit in single-file editor
Open in Web IDE
Show full file
@@ -10,23 +10,25 @@ let requestDistributionChart;
*/
function
updateAssistantFrequencyTable
(
table
)
{
return
data
=>
{
$
(
table
).
find
(
"
tbody
"
).
children
(
"
:not(:first)
"
).
remove
();
$
(
table
).
find
(
"
tbody
"
).
children
().
remove
();
const
assistantNames
=
data
[
"
assistantNames
"
];
const
requestsPerAssistant
=
data
[
"
requestsPerAssistant
"
];
const
timeSinceLastRequestInteraction
=
data
[
"
timeSinceLastRequestInteraction
"
];
Object
.
keys
(
assistantNames
).
forEach
(
assistantId
=>
{
const
assistantName
=
assistantNames
[
assistantId
];
const
numRequestsTaken
=
requestsPerAssistant
[
assistantId
]
||
0
;
const
lastInteraction
=
timeSinceLastRequestInteraction
[
assistantId
]
?
msToHumanReadableTime
(
timeSinceLastRequestInteraction
[
assistantId
])
:
"
No Activity
"
;
Object
.
keys
(
assistantNames
)
.
sort
()
.
forEach
(
assistantId
=>
{
const
assistantName
=
assistantNames
[
assistantId
];
const
numRequestsTaken
=
requestsPerAssistant
[
assistantId
]
||
0
;
const
lastInteraction
=
timeSinceLastRequestInteraction
[
assistantId
]
?
msToHumanReadableTime
(
timeSinceLastRequestInteraction
[
assistantId
])
:
"
No Activity
"
;
$
(
table
)
.
find
(
"
tbody
:last-child
"
)
.
append
(
"
<tr><td>
"
+
assistantName
+
"
</td><td>
"
+
numRequestsTaken
+
"
</td><td>
"
+
lastInteraction
+
"
</td></tr>
"
);
});
$
(
table
)
.
find
(
"
tbody
"
)
.
append
(
"
<tr><td>
"
+
assistantName
+
"
</td><td>
"
+
numRequestsTaken
+
"
</td><td>
"
+
lastInteraction
+
"
</td></tr>
"
);
});
};
}
Loading