Skip to content
Snippets Groups Projects
Commit 5374f541 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

add units on blockchain's parameters

parent 02482934
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@
"infos": "Informationen",
"inout": "Bei- und Austritte des Vertrauensnetz in den 2 letzten Tagen",
"inpreparation": "In Vorbereitung",
"jours": "0 Tage | 1 Tag | {n} Tage",
"jours": "0 Tage | 1 Tag | {n} Tage",
"lexique": "Lexicon",
"membre": {
"calculant": {
......
......@@ -86,7 +86,7 @@
"infos": "Informations",
"inout": "Entries and exits of the web of trust for the last 2 days",
"inpreparation": "In preparation",
"jours": "0 days | 1 day | {n} days",
"jours": "0 days | 1 day | {n} days",
"lexique": "Lexicon",
"membre": {
"calculant": {
......
......@@ -86,7 +86,7 @@
"infos": "Informaciones",
"inout": "Entradas y salidas de la red de confianza en los últimos 2 días",
"inpreparation": "En preparación",
"jours": "0 días | 1 día | {n} días",
"jours": "0 días | 1 día | {n} días",
"lexique": "Léxico",
"membre": {
"calculant": {
......
......@@ -86,7 +86,7 @@
"infos": "Informations",
"inout": "Entrées et sorties de la toile de confiance des 2 derniers jours",
"inpreparation": "En préparation",
"jours": "0 jours | 1 jour | {n} jours",
"jours": "0 jours | 1 jour | {n} jours",
"lexique": "Lexique",
"membre": {
"calculant": {
......
......@@ -20,7 +20,19 @@
<td class="d-none d-sm-table-cell">
{{ param.par_type }}
</td>
<td>{{ param.value }}</td>
<td
v-if="param.par_type == 'DURATION'"
v-html="getDuration(param.value)"></td>
<td v-else-if="param.par_type == 'DATE'">
{{ $d(new Date(param.value * 1000), "short") }}
</td>
<td v-else-if="param.par_type == 'FLOAT'">
{{ param.value * 100 + "%" }}
</td>
<td
v-else-if="param.name == 'ud0'"
v-html="param.value / 100 + '&nbsp;Ğ1'"></td>
<td v-else>{{ param.value }}</td>
<td
class="d-none d-md-table-cell"
v-html="$t('params.name.' + param.name)"></td>
......@@ -51,6 +63,23 @@ export default {
error: null
}
},
methods: {
getDuration(duration) {
let min = Math.floor(duration / 60)
let sec = duration % 60
let h = Math.floor(min / 60)
min = min % 60
let days = Math.floor(h / 24)
h = h % 24
sec = sec == 0 ? "" : sec + "s"
min = min == 0 ? "" : min + "min"
h = h == 0 ? "" : h + "h"
days = days == 0 ? "" : this.$tc("jours", days) + "&nbsp;"
return days + h + min + sec
}
},
apollo: {
allParameters: {
query: PARAMS,
......
......@@ -12,9 +12,11 @@
aria-describedby="periodHelp"
v-model="period"
@change="save">
<option v-for="index in 30" :key="index" :value="index">
{{ $tc("jours", index) }}
</option>
<option
v-for="index in 30"
:key="index"
:value="index"
v-html="$tc('jours', index)"></option>
</select>
<small id="periodHelp" class="form-text text-muted">{{
$t("previsions.period.desc")
......
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