Skip to content
Snippets Groups Projects
Commit ec16e3e3 authored by Aurore Chayrouse's avatar Aurore Chayrouse
Browse files

Dashboard Manager : init page + action realisees

parent 73378193
No related branches found
No related tags found
No related merge requests found
Pipeline #30572 failed
Showing
with 361 additions and 4 deletions
......@@ -9,5 +9,9 @@
"/images/logo_madis_cyber.png": "/images/logo_madis_cyber.png",
"/images/logoblancetorange.png": "/images/logoblancetorange.png",
"/images/rectangle.png": "/images/rectangle.png",
"/images/soluris-logo-white.png": "/images/soluris-logo-white.png"
"/images/soluris-logo-white.png": "/images/soluris-logo-white.png",
"/images/vendor/vuejs-datatable/docs/icons.png": "/images/vendor/vuejs-datatable/docs/icons.png",
"/images/vendor/vuejs-datatable/docs/icons@2x.png": "/images/vendor/vuejs-datatable/docs/icons@2x.png",
"/images/vendor/vuejs-datatable/docs/widgets.png": "/images/vendor/vuejs-datatable/docs/widgets.png",
"/images/vendor/vuejs-datatable/docs/widgets@2x.png": "/images/vendor/vuejs-datatable/docs/widgets@2x.png"
}
<template>
<div>
en construction admin
</div>
</template>
<script>
export default {
name: 'Dashboard Admin',
data () {
return {
}
},
computed: {
user () {
return this.$store.state.user
}
}
}
</script>
<template>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Actions à réaliser</th>
<th>Date limite de mise en oeuvre</th>
<th>Personne en charge</th>
</tr>
</thead>
<tbody v-if="evaluation">
<tr v-for="item in dangers" :key="item.id">
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script>
export default {
name: 'ActionsDoneCard',
data () {
return {
}
},
computed: {
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="card flex-row">
<div class="col-4 bg-primary">
<i class="fas fa-bullseye" style="font-size: 50px;"></i>
</div>
<div class="card-body col-8" v-if="plannedMeasures && doneMeasures">
<div class="card-text">
Actions réalisées <br />
<div class="small font-weight-bold">{{ doneMeasures.length }} sur {{ plannedMeasures.length }}</div>
</div>
<div class="progress progress-xs">
<div class="progress-bar bg-success" role="progressbar" :style="{ 'width' : `${doneMeasures.length / plannedMeasures.length * 100}%`}" aria-valuemin="0" aria-valuemax="100">
</div>
</div>
</div>
</div>
</template>
<script>
/* 2 : nombre de niveaux de mesure mises en place qui avait précédemment été planifiés dans l’évalution précédente
4 : nombre de mesures planifiées dans l’évaluation précédente */
export default {
name: 'ActionsDoneCard',
props : ['currentEvaluation', 'lastEvaluation'],
data () {
return {
}
},
computed: {
plannedMeasures () {
return this.lastEvaluation && this.lastEvaluation.measure_levels.filter(measure => measure.expected_level > measure.actual_level)
},
doneMeasures () {
// Compare lastLevel with currentLevel to know if currentLevel if better
if (this.currentEvaluation && this.plannedMeasures) {
return this.currentEvaluation.measure_levels
.filter(currentLevel => {
const lastLevel = this.plannedMeasures.find(ml => ml.measure_id === currentLevel.measure_id)
return lastLevel ? currentLevel.actual_level >= lastLevel.expected_level : false
})
}
}
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="card flex-row bg-primary">
<div class="card-body col-8">
<div class="card-text">
<div class="font-weight-bold h4 m-0">1,9</div>
Indice de maturité cyber moyen des structures
</div>
</div>
<div class="col-4">
<i class="fas fa-chart-line" style="font-size: 50px;"></i>
</div>
</div>
</template>
<script>
export default {
name: 'AverageMaturityCyberCard',
data () {
return {
}
},
computed: {
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="card flex-row">
<div class="col-4 bg-primary">
<i class="fas fa-chart-line" style="font-size: 50px;"></i>
</div>
<div class="card-body col-8">
<div class="card-text">
Indice de maturité cyber
<div class="small font-weight-bold">2,4</div>
</div>
<div class="progress progress-xs">
<div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="text-success mt-1">
<i class="fas fa-arrow-up"></i> <small>+20 %</small>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'MaturiteCyberCard',
data () {
return {
}
},
computed: {
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="card flex-row">
<div class="col-4 bg-primary">
<i class="fas fa-shield-alt" style="font-size: 50px;"></i>
</div>
<div class="card-body col-8 py-2">
<div class="card-text">
Mise en oeuvre des mesures de sécurité
<div class="small font-weight-bold">15 %</div>
</div>
<div class="progress progress-xs">
<div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'MeasureCard',
data () {
return {
}
},
computed: {
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="card flex-row bg-primary">
<div class="card-body col-8">
<div class="card-text">
<div class="font-weight-bold h4 m-0">2</div>
Structures évaluées
</div>
</div>
<div class="col-4">
<i class="fas fa-home" style="font-size: 50px;"></i>
</div>
</div>
</template>
<script>
export default {
name: 'StructuresEvalueesCard',
data () {
return {
}
},
computed: {
}
}
</script>
<style scoped>
.card.flex-row {
height: 120px;
}
.bg-primary {
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file
<template>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-6">
<ActionsDoneCard :currentEvaluation="currentEvaluation" :lastEvaluation="lastEvaluation"/>
</div>
<div class="col-md-6">
<MeasureCard />
</div>
<div class="col-md-6">
<MaturiteCyberCard />
</div>
<div class="col-md-12">
Plan d'actions
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6">
<OrganizationsCard />
</div>
<div class="col-md-6">
<AverageMaturityCyberCard />
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Dashboard Manager',
data () {
return {
}
},
components : {
ActionsDoneCard: () => import('./Components/ActionsDoneCard.vue'),
MeasureCard: () => import('./Components/MeasureCard.vue'),
MaturiteCyberCard: () => import('./Components/MaturityCyberCard.vue'),
OrganizationsCard: () => import('./Components/OrganizationsCard.vue'),
AverageMaturityCyberCard: () => import('./Components/AverageMaturityCyberCard.vue'),
},
computed: {
user () {
return this.$store.state.user
},
evaluations () {
return this.$store.state.evaluations.all.sort( (a,b) => new Date(b.updated_at) - new Date(a.updated_at))
},
currentEvaluation () {
return this.evaluations[0]
},
lastEvaluation () {
return this.evaluations[1]
},
}
}
</script>
<template>
<div class="container">
En construction
<div class="mb-5 mx-5 mt-0">
<AdminView v-if="isAdmin()"/>
<ManagerView v-else/>
</div>
</template>
<script>
import { isAdmin } from '../../utils/permissions'
import AdminView from './AdminView'
import ManagerView from './ManagerView'
export default {
name: 'Dashboard',
data () {
return {
isAdmin,
}
},
components : {
AdminView,
ManagerView,
},
computed: {
user () {
return this.$store.state.user
......
......@@ -217,4 +217,6 @@ select.form-control {
/* GRAPH */
#attackgraph canvas {
max-height:600px;
}
\ No newline at end of file
}
/* DASHBOARD */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment