|
64 | 64 | <div class="container" v-show="tab == 'exports'">Empty</div> |
65 | 65 | <div class="container" v-show="tab == 'members'"> |
66 | 66 |
|
67 | | - <div class="my-3 p-3 bg-white rounded shadow-sm"> |
| 67 | + <div class="card my-3 p-3 shadow-sm mr-2"> |
68 | 68 | <h6 class="border-bottom border-gray pb-2"><b>Invite Members</b></h6> |
69 | 69 |
|
70 | 70 | </div> |
71 | 71 |
|
72 | | - <div class="my-3 p-3 bg-white rounded shadow-sm"> |
| 72 | + <div class="card my-3 p-3 shadow-sm mr-2"> |
73 | 73 | <h6 class="border-bottom border-gray pb-2"><b>Exisiting Memebers</b></h6> |
74 | 74 |
|
75 | 75 | <div class="media text-muted pt-3" v-for="user in users"> |
|
87 | 87 | </div> |
88 | 88 |
|
89 | 89 | </div> |
90 | | - <div class="container" v-show="tab == 'statistics'">Stats</div> |
| 90 | + <div class="container" v-show="tab == 'statistics'"> |
| 91 | + <div v-if="stats == null"> |
| 92 | + Crunching numbers... |
| 93 | + </div> |
| 94 | + |
| 95 | + <div v-else> |
| 96 | + <div class="row"> |
| 97 | + |
| 98 | + <div v-if="stats.total" class="card my-3 p-3 shadow-sm col-3 mr-2"> |
| 99 | + <h6 class="border-bottom border-gray pb-2"><b>Total</b></h6> |
| 100 | + <div class="row" v-for="stat in Object.keys(stats.total)"> |
| 101 | + <strong class="col-8">{{stat}}:</strong> |
| 102 | + <span class="col-4">{{stats.total[stat]}}</span> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + |
| 106 | + <div v-if="stats.average" class="card my-3 p-3 shadow-sm col-4 mr-2"> |
| 107 | + <h6 class="border-bottom border-gray pb-2"><b>Average</b></h6> |
| 108 | + <div class="row" v-for="stat in Object.keys(stats.average)"> |
| 109 | + <strong class="col-8">{{stat}}:</strong> |
| 110 | + <span class="col-4">{{stats.average[stat].toFixed(2)}}</span> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + |
| 114 | + </div> |
| 115 | + |
| 116 | + </div> |
| 117 | + </div> |
91 | 118 | <div class="container" v-show="tab == 'settings'">settings</div> |
92 | 119 |
|
93 | 120 | </div> |
@@ -369,7 +396,8 @@ export default { |
369 | 396 | panel: { |
370 | 397 | showAnnotated: true, |
371 | 398 | showNotAnnotated: true |
372 | | - } |
| 399 | + }, |
| 400 | + stats: null |
373 | 401 | }; |
374 | 402 | }, |
375 | 403 | methods: { |
@@ -419,6 +447,12 @@ export default { |
419 | 447 | this.users = response.data |
420 | 448 | }); |
421 | 449 | }, |
| 450 | + getStats() { |
| 451 | + Dataset.getStats(this.dataset.id) |
| 452 | + .then(response => { |
| 453 | + this.stats = response.data; |
| 454 | + }); |
| 455 | + }, |
422 | 456 | createScanTask() { |
423 | 457 | if (this.scan.id != null) { |
424 | 458 | this.$router.push({ path: "/tasks", query: { id: this.scan.id } }); |
@@ -549,6 +583,7 @@ export default { |
549 | 583 | tab(tab) { |
550 | 584 | localStorage.setItem('dataset/tab', tab); |
551 | 585 | if (tab == 'members') this.getUsers(); |
| 586 | + if (tab == 'statistics') this.getStats(); |
552 | 587 | }, |
553 | 588 | queryAnnotated() { |
554 | 589 | this.updatePage(); |
@@ -671,10 +706,4 @@ export default { |
671 | 706 | padding: 0 5px 2px 5px; |
672 | 707 | overflow: auto; |
673 | 708 | } |
674 | | -
|
675 | | -.card-header { |
676 | | - padding: 5px 10px; |
677 | | -} |
678 | | -
|
679 | | -
|
680 | 709 | </style> |
0 commit comments