Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
add warning when system is disabled + fix on/off button
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Verstraeten committed Aug 1, 2017
1 parent 0c3a52c commit b1df889
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 188 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public function index()

$directory = $this->config;
$settings = $this->reader->parse($directory)["instance"]["children"];
$isActive = ($settings["condition"]["dropdown"]["Enabled"]["children"]["active"]["value"] === "true") ? "none" : "block";

return View::make('dashboard', [
'isActive' => $isActive,
'cameraName' => $settings['name']['value'],
'days' => $days,
'kerberos' => $this->kerberos,
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ public function index($selectedDay = "")

$directory = $this->config;
$settings = $this->reader->parse($directory)["instance"]["children"];
$isActive = ($settings["condition"]["dropdown"]["Enabled"]["children"]["active"]["value"] === "true") ? "none" : "block";

// ----------------------------------------------------------------------
// Get last x days from the imagehandler -> move to BaseController

$days = $this->imageHandler->getDays(5);

return View::make('image', [
'isActive' => $isActive,
'cameraName' => $settings['name']['value'],
'days' => $days,
'selectedDay' => $selectedDay,
Expand Down
20 changes: 2 additions & 18 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function index()
{
$directory = $this->config;
$settings = $this->reader->parse($directory)["instance"]["children"];
$isActive = ($settings["condition"]["dropdown"]["Enabled"]["children"]["active"]["value"] === "true") ? "none" : "block";

$days = $this->imageHandler->getDays(5);

Expand All @@ -48,6 +49,7 @@ public function index()

return View::make('settings',
[
'isActive' => $isActive,
'cameraName' => $settings['name']['value'],
'days' => $days,
'settings' => $settings,
Expand All @@ -56,24 +58,6 @@ public function index()
]);
}

/********************************************
* Show the cloud page.
*/
public function cloud()
{
$directory = $this->config;

$settings = $this->reader->parse($directory)["instance"]["children"]['cloud']['dropdown']['S3']['children'];
$days = $this->imageHandler->getDays(5);

return View::make('cloud',
[
'days' => $days,
'settings' => $settings,
'isUpdateAvailable' => $this->isUpdateAvailable()
]);
}

public function getConfiguration()
{
return $this->kerberos;
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/SystemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ public function index()
{
$directory = $this->config;
$settings = $this->reader->parse($directory)["instance"]["children"];

$isActive = ($settings["condition"]["dropdown"]["Enabled"]["children"]["active"]["value"] === "true") ? "none" : "block";

$days = $this->imageHandler->getDays(5);
$insideDocker = (trim(shell_exec("[ -f /.dockerenv ] && echo true || echo false")) === 'true');

return View::make('system',
[
'isActive' => $isActive,
'cameraName' => $settings['name']['value'],
'days' => $days
]);
Expand Down
8 changes: 5 additions & 3 deletions public/js/app/controllers/toggleMachinery.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ define(["jquery"], function($)
{
self.status = data.active;

if(self.status)
if(self.status === "true")
{
$(".machinery-switch input[type='checkbox']").attr("checked", "checked");
$("#disabled-machinery").css("display", "none");
}
else
{
$(".machinery-switch input[type='checkbox']").removeAttr("checked");
$("#disabled-machinery").css("display", "table");
}
}
});
Expand All @@ -39,7 +41,7 @@ define(["jquery"], function($)
{
// -----------------------------------
// Load view and images

var self = this;
$(".machinery-switch input[type='checkbox']").attr("disabled", true);
$.get(_baseUrl + "/api/v1/condition/enabled",function(data)
Expand All @@ -51,4 +53,4 @@ define(["jquery"], function($)
});
}
};
});
});
70 changes: 37 additions & 33 deletions resources/lang/bg/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
|
*/

'system' => 'Система',
'system' => 'Система',

'diskAlmostFull' => 'Хей, дискът е почти пълен. Трябва да изтриеш някои снимки и видеа.',

'board' => 'Board',
'board' => 'Board',

'model' => 'Модел',

'os' => 'OS',

'osspecifications' => 'Детайли за OS',
Expand All @@ -32,67 +32,71 @@
'news' => 'Новини',

'systemIsOnlineFor' => 'Системата работи от',

'kernel' => 'Kernel',

'hostname' => 'Име на хоста',

'architecture' => 'Архитектура',

'thisMachine' => 'Тази система има',

'cpuRunning' => 'CPU-та с натовареност (average load) от',

'diskSpecs' => 'Детайли за Дискът',

'thereAre' => 'Има',

'harddisksAvailable' => 'диск(а) на тази система',

'networkSpecs' => 'Детайли за Мрежата',

'device' => 'Устройство',

'recieved' => 'Получено',

'sent' => 'Изпратено',

'twoServicesRunning' => 'има нужда от два компонента - Web и Machinery',

'versions' => 'Версии',

'numberOfImages' => '# снимки',

'numberOfDays' => '# дни',

'days' => 'Дни',

'downloadSystemFiles' => 'Свали системните файлове',

'downloadImages' => 'Свали снимките',

'removeImages' => 'Изтрии снимките',

'shutdown' => 'Изключи',

'reboot' => 'Рестартирай',

'release' => 'Release',

'publishedAt' => 'Публикуван на',

'install' => 'Инсталация',

'downloading' => 'Сваляне',

'unzipping' => 'Разархивиране',

'unpacking' => 'Разопаковане',

'transferring' => 'Трансфериране',

'rebooting' => 'Системата се рестартира',

'shuttingdown' => 'Системата се изключва',

/* to translate */ 'newVersion' => 'Good news, a new release of KiOS is available!',

/* to transalte */ 'disabled' => 'You\'ve disabled the system, this means that no images or videos will be saved to disk!'

);
6 changes: 5 additions & 1 deletion resources/lang/ca/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@
'unpacking' => 'Desempaquetant',

'transferring' => 'Transferint',

'rebooting' => 'El sistema s\'esto reiniciant',

'shuttingdown' => 'El sistema s\'esto apagant',

/* to translate */ 'newVersion' => 'Good news, a new release of KiOS is available!',

/* to transalte */ 'disabled' => 'You\'ve disabled the system, this means that no images or videos will be saved to disk!'

);
68 changes: 36 additions & 32 deletions resources/lang/de/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,83 +16,87 @@
'diskAlmostFull' => 'Hey, die Festplatte ist fast voll. Einfach mal paar Bilder entfernen...',

'board' => 'Platine',

'model' => 'Model',

'os' => 'OS',

'osspecifications' => 'OS Spezifikationen',

'warning-docker' => 'Keine Ahnung, bin in einem seperaten docker container..',

'statistics' => 'Statistiken',

'log' => 'Log',

'news' => 'News',

'systemIsOnlineFor' => 'System ist online für',

'kernel' => 'Kernel',

'hostname' => 'Hostname',

'architecture' => 'Architektur',

'thisMachine' => 'Die Maschine hat',

'cpuRunning' => 'CPU\'s laufen mit einer durchschnittlichen Auslastung von',

'diskSpecs' => 'Spezifikationen Festplatte',

'thereAre' => 'Es sind',

'harddisksAvailable' => 'Festplatten verfügbar in der Maschine.',

'networkSpecs' => 'Spezifikationen Netzwerk',

'device' => 'Gerät',

'recieved' => 'Erhalten',

'sent' => 'Gesendet',

'twoServicesRunning' => 'benötigt 2 Dienste: das web und die machinery',

'versions' => 'Versionen',

'numberOfImages' => '# Anzahl der Bilder',

'numberOfDays' => '# Anzahl der Tage',

'days' => 'Tage',

'downloadSystemFiles' => 'Systemdateien herunterladen',

'downloadImages' => 'Bilder herunterladen',

'removeImages' => 'Bilder entfernen',

'shutdown' => 'Herunterfahren',

'reboot' => 'Neustarten',

'release' => 'Release',

'publishedAt' => 'Veröffentlicht am',

'install' => 'Installieren',

'downloading' => 'Herunterladen',

'unzipping' => 'Entpacken',

'unpacking' => 'Auspacken',

'transferring' => 'Übertragen',

'rebooting' => 'System wird neugestartet',

'shuttingdown' => 'System wird heruntergefahren',

/* to translate */ 'newVersion' => 'Good news, a new release of KiOS is available!',

/* to transalte */ 'disabled' => 'You\'ve disabled the system, this means that no images or videos will be saved to disk!'

);
Loading

0 comments on commit b1df889

Please sign in to comment.