Skip to content

Commit 046ab23

Browse files
committed
Merge branch 'Dev' of https://github.com/sagitaz/plugin-frigate into Dev
2 parents eb2b916 + 984900d commit 046ab23

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

desktop/modal/editConfiguration.modal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@
6060
<div>
6161
<button id="synchroConfiguration" class="btn btn-success pull-left" title="{{Recharge le fichier de configuration depuis le serveur Frigate}}"><i class="fas fa-cloud-download-alt"></i> {{Récupérer la configuration}}</button>
6262
<button id="downloadConfiguration" class="btn btn-success pull-left" title="{{Télécharger le fichier de configuration depuis le serveur Frigate}}"><i class="fas fa-save"></i> {{Télécharger la configuration}}</button>
63-
<button id="sendConfigurationAndRestart" class="btn btn-warning pull-right" title="{{Envoie et remplace le fichier de configuration du serveur Frigate puis redémarre Frigate}}"><i class="fas fa-redo"></i> {{Envoyer la configuration et redémarrer Frigate}}</button>
63+
<button id="sendConfigurationAndRestart" class="btn btn-warning pull-right" style="margin-right: 0 !important;" title="{{Envoie et remplace le fichier de configuration du serveur Frigate puis redémarre Frigate}}"><i class="fas fa-redo"></i> {{Envoyer la configuration et redémarrer Frigate}}</button>
6464
<button id="sendConfiguration" class="btn btn-warning pull-right" title="{{Envoie et remplace le fichier de configuration Frigate}}"><i class="fas fa-cloud-upload-alt"></i> {{Envoyer la configuration}}</button>
6565
<br/>
6666
<br/>
67-
<div id='div_yamlAlert' class="alert"></div>
67+
<div id="div_yamlAlert" class="alert" style="text-align: center"></div>
6868
</div>
6969
<div class="bound-config">
7070
<textarea id="frigateConfiguration" class="boxsizingborder" spellcheck="false"></textarea>

desktop/php/events.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ function timeElapsedString($datetime, $full = false)
8080
's' => ['seconde', 'secondes'],
8181
];
8282

83-
$strings = [];
84-
85-
foreach ($units as $key => [$singular, $plural]) {
86-
if ($diff->$key) {
87-
$count = $diff->$key;
88-
$strings[] = $count . ' ' . ($count > 1 ? $plural : $singular);
83+
foreach ($string as $k => &$v) {
84+
if ($diff->$k) {
85+
$value = $diff->$k;
86+
if ($value > 1 && $k !== 'm') {
87+
$v .= 's';
88+
}
89+
$v = $value . ' ' . $v;
90+
} else {
91+
unset($string[$k]);
92+
}
8993
}
9094
}
9195

desktop/php/panel.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,17 @@ function timeElapsedString($datetime, $full = false)
120120
's' => ['seconde', 'secondes'],
121121
];
122122

123-
$strings = [];
123+
foreach ($string as $k => &$v) {
124+
if ($diff->$k) {
125+
$value = $diff->$k;
126+
if ($value > 1 && $k !== 'm') {
127+
$v .= 's';
128+
}
129+
$v = $value . ' ' . $v;
130+
} else {
131+
unset($string[$k]);
132+
}
133+
}
124134

125135
foreach ($units as $key => [$singular, $plural]) {
126136
if ($diff->$key) {

0 commit comments

Comments
 (0)