token-validator: update dashboard: include visualization for individual student
This commit is contained in:
parent
9f909b9cba
commit
85ad80a671
5 changed files with 130 additions and 39 deletions
|
@ -9,6 +9,14 @@
|
|||
font-size: 13px;
|
||||
margin-top: 0.2vh;
|
||||
}
|
||||
.dropdown a {
|
||||
display: block;
|
||||
color: black;
|
||||
}
|
||||
.dropdown a:hover {
|
||||
background-color: #ccc;
|
||||
text-decoration: none;
|
||||
}
|
||||
.student {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
@ -46,24 +54,70 @@
|
|||
<base href="/">
|
||||
</head>
|
||||
<body>
|
||||
<div ng-controller="StudentsProgressionController" class="d-flex flex-wrap" ng-cloak>
|
||||
<div class="card student student-title d-flex flex-column justify-content-around" style="background-image: url('https://srs.epita.fr/assets/images/logo-srs.png');">
|
||||
<h5 class="text-center" title="SRS" ng-cloak>ADLIN TP {{tutoid+1}}</h5>
|
||||
<div class="d-flex flex-wrap justify-content-around" style="padding: 0">
|
||||
<span class="badge" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-success': stats[ch].success > 0 || (tutoid == 0 && stats[ch].warning > 0), 'badge-warning': tutoid != 0 && stats[ch].success == 0 && stats[ch].warning > 0, 'badge-danger': !stats[ch] || (stats[ch].success == 0 && stats[ch].warning == 0)}" title="{{ t.title }}: {{ stats[ch].success }} - {{ stats[ch].warning }}/{{ stats.total }}" ng-cloak>{{ stats[ch].warning * 100 / stats.total | number:0 }} %</span>
|
||||
</div>
|
||||
<div ng-cloak ng-if="onestudent">
|
||||
<div ng-controller="StudentProgressionController" class="m-4">
|
||||
<div class="card-group col-6 offset-3">
|
||||
<div class="card">
|
||||
<img src="https://photos.cri.epita.fr/thumb/{{ img | lowercase }}" class="card-img-top" alt="{{ student.login }}">
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ student.login }}</h5>
|
||||
<p class="card-text" ng-controller="PingController">
|
||||
<span class="badge" ng-class="{'badge-success': PING && PING < 120, 'badge-info': PING && PING >= 120 && PING < 300, 'badge-warning': PING && PING >= 300 && PING < 900, 'badge-danger': PING && PING >= 900, 'badge-dark': !PING}" title="{{ PING_time }}">
|
||||
💻
|
||||
</span>
|
||||
<ng-pluralize count="PING" when="{'NaN': 'jamais vu', 'one': 'vu il y a {} seconde', 'other': 'vu il y a {} secondes'}"></ng-pluralize>
|
||||
<ul ng-if="ips" style="padding-left:0">
|
||||
<li><strong>Domaine :</strong> <a href="http://{{ips.adn}}/">{{ips.adn}}</a></li>
|
||||
<li><strong>Délégation :</strong> <a href="http://{{ips.ddn}}/">{{ips.ddn}}</a></li>
|
||||
<li><strong>IPv6 :</strong> {{ips.wg}}1/96</li>
|
||||
</ul>
|
||||
<div ng-repeat="(tutoid,tuto) in tuto_progress">
|
||||
<hr>
|
||||
<h6>TP {{tutoid+1}}</h6>
|
||||
<span class="badge mr-1" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-warning': mychallenges[ch] && mychallenges[ch].recent && (tutoid != 0 && mychallenges[ch].recent > 300), 'badge-info': mychallenges[ch] && mychallenges[ch].recent && mychallenges[ch].recent <= 300 && mychallenges[ch].recent >= 120, 'badge-success': mychallenges[ch] && mychallenges[ch].recent && (tutoid == 0 || mychallenges[ch].recent < 120), 'badge-danger': !mychallenges[ch]}" title="{{ t.title }} @ {{ mychallenges[ch].time | date: 'medium' }} {{ mychallenges[ch].recent }}" ng-bind="t.label"></span>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-cloak ng-if="!onestudent">
|
||||
<div ng-controller="StudentsProgressionController" class="d-flex flex-wrap">
|
||||
<div class="card student student-title d-flex flex-column justify-content-around" style="background-image: url('https://srs.epita.fr/assets/images/logo-srs.png');">
|
||||
<h5 class="text-center" title="SRS" ng-cloak>
|
||||
ADLIN TP {{tutoid+1}}
|
||||
<span ng-click="toogleDropdown()">
|
||||
<svg class="bi bi-chevron-down" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 01.708 0L8 10.293l5.646-5.647a.5.5 0 01.708.708l-6 6a.5.5 0 01-.708 0l-6-6a.5.5 0 010-.708z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</span>
|
||||
</h5>
|
||||
<div style="padding: 0 60px; position: absolute" class="student-title" ng-if="show_dropdown">
|
||||
<div style="background-color: #ddd" class="dropdown">
|
||||
<a href="/dashboard/1" ng-click="toogleDropdown()">TP 1</a>
|
||||
<a href="/dashboard/2" ng-click="toogleDropdown()">TP 2</a>
|
||||
<a href="/dashboard/3" ng-click="toogleDropdown()">TP 3</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-content-around" style="padding: 0">
|
||||
<span class="badge" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-success': stats[ch].success > 0 || (tutoid == 0 && stats[ch].warning > 0), 'badge-warning': tutoid != 0 && stats[ch].success == 0 && stats[ch].warning > 0, 'badge-danger': !stats[ch] || (stats[ch].success == 0 && stats[ch].warning == 0)}" title="{{ t.title }}: {{ stats[ch].success }} - {{ stats[ch].warning }}/{{ stats.total }}" ng-cloak>{{ stats[ch].warning * 100 / stats.total | number:0 }} %</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card student d-flex flex-column justify-content-between" ng-repeat="(login, mychallenges) in students" style="background-image: url('https://photos.cri.epita.fr/square/{{ mychallenges.img | lowercase }}')">
|
||||
<h5 class="login text-truncate" title="{{ login }}">
|
||||
<span class="badge" ng-class="{'badge-success': mychallenges['ping'] && mychallenges['ping'].recent < 120, 'badge-info': mychallenges['ping'] && mychallenges['ping'].recent >= 120 && mychallenges['ping'].recent < 300, 'badge-warning': mychallenges['ping'] && mychallenges['ping'].recent >= 300 && mychallenges['ping'].recent < 900, 'badge-danger': mychallenges['ping'] && mychallenges['ping'].recent >= 900, 'badge-dark': !mychallenges['ping']}" title="{{ mychallenges['ping'].time }}">
|
||||
💻
|
||||
</span>
|
||||
{{ login }}
|
||||
</h5>
|
||||
<div class="d-flex flex-wrap justify-content-around" style="padding: 0">
|
||||
<span class="badge" style="margin-left: .07rem" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-warning': mychallenges[ch] && mychallenges[ch].recent && (tutoid != 0 && mychallenges[ch].recent > 300), 'badge-info': mychallenges[ch] && mychallenges[ch].recent && mychallenges[ch].recent <= 300 && mychallenges[ch].recent >= 120, 'badge-success': mychallenges[ch] && mychallenges[ch].recent && (tutoid == 0 || mychallenges[ch].recent < 120), 'badge-danger': !mychallenges[ch]}" title="{{ t.title }} @ {{ mychallenges[ch].time | date: 'medium' }} {{ mychallenges[ch].recent }}" ng-bind="t.label"></span>
|
||||
</div>
|
||||
<div class="card student d-flex flex-column justify-content-between" ng-repeat="(login, mychallenges) in students" style="background-image: url('https://photos.cri.epita.fr/square/{{ mychallenges.img | lowercase }}')">
|
||||
<h5 class="login text-truncate" title="{{ login }}">
|
||||
<span class="badge" ng-class="{'badge-success': mychallenges['ping'] && mychallenges['ping'].recent < 120, 'badge-info': mychallenges['ping'] && mychallenges['ping'].recent >= 120 && mychallenges['ping'].recent < 300, 'badge-warning': mychallenges['ping'] && mychallenges['ping'].recent >= 300 && mychallenges['ping'].recent < 900, 'badge-danger': mychallenges['ping'] && mychallenges['ping'].recent >= 900, 'badge-dark': !mychallenges['ping']}" title="{{ mychallenges['ping'].time }}">
|
||||
💻
|
||||
</span>
|
||||
<a class="text-dark" href="/dashboard/{{login}}">{{ login }}</a>
|
||||
</h5>
|
||||
<div class="d-flex flex-wrap justify-content-around" style="padding: 0">
|
||||
<span class="badge" style="margin-left: .07rem" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-warning': mychallenges[ch] && mychallenges[ch].recent && (tutoid != 0 && mychallenges[ch].recent > 300), 'badge-info': mychallenges[ch] && mychallenges[ch].recent && mychallenges[ch].recent <= 300 && mychallenges[ch].recent >= 120, 'badge-success': mychallenges[ch] && mychallenges[ch].recent && (tutoid == 0 || mychallenges[ch].recent < 120), 'badge-danger': !mychallenges[ch]}" title="{{ t.title }} @ {{ mychallenges[ch].time | date: 'medium' }} {{ mychallenges[ch].recent }}" ng-bind="t.label"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Reference in a new issue