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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Verstraeten committed Aug 3, 2017
2 parents 4c16190 + d4fb5dc commit 8363596
Show file tree
Hide file tree
Showing 19 changed files with 258 additions and 225 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
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
|
*/

'version' => '2.3.0',
'version' => '2.3.1',

'config' => '/etc/opt/kerberosio/config',

Expand Down
11 changes: 7 additions & 4 deletions public/js/app/controllers/hullselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ define(["jquery", "app/controllers/event", "app/models/Hull", "app/views/HullSel
getLatestImage: function(callback)
{
var image = {};
var self = this;

$.get( _baseUrl + "/api/v1/images/latest_sequence", function(sequence)
{
Expand All @@ -46,7 +47,6 @@ define(["jquery", "app/controllers/event", "app/models/Hull", "app/views/HullSel
image.src = "";
image.width = 600;
image.height = 480;

if(sequence.length)
{
var videos = _.filter(sequence, function(file)
Expand All @@ -66,15 +66,18 @@ define(["jquery", "app/controllers/event", "app/models/Hull", "app/views/HullSel
{
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;

video.pause();
video.play();
context.drawImage(video, 0, 0, canvas.width, canvas.height);
video.pause();

return callback({
callback({
src: canvas.toDataURL(),
width: canvas.width,
height: canvas.height
});

});
}
else
Expand Down Expand Up @@ -120,8 +123,6 @@ define(["jquery", "app/controllers/event", "app/models/Hull", "app/views/HullSel
model: hull,
});

this.hullView.render(callback);

var self = this;

$(window).resize(function()
Expand All @@ -136,6 +137,8 @@ define(["jquery", "app/controllers/event", "app/models/Hull", "app/views/HullSel
self.hullView.restore();
}
});

this.hullView.render(callback);
}
};
});
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($)
});
}
};
});
});
9 changes: 6 additions & 3 deletions public/js/app/controllers/toggleSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ define(["jquery", "app/controllers/hullselection", "app/controllers/twolines"],
{
return this.type;
},
reloadHull: function()
reloadHull: function(callback)
{
hull.setElement($(".hullselection .map"));
twolines.setElement($(".twolines .map"));
Expand All @@ -31,6 +31,8 @@ define(["jquery", "app/controllers/hullselection", "app/controllers/twolines"],
twolines.setCoordinates($(".twolines .coordinates").val());
twolines.setName($(".twolines .name").val());
twolines.initialize();

callback && callback();
});
},
setType: function(type)
Expand Down Expand Up @@ -61,20 +63,21 @@ define(["jquery", "app/controllers/hullselection", "app/controllers/twolines"],
}
});
},
initialize: function()
initialize: function(callback)
{
// -----------------------------------
// Load view and images

var self = this;
$(".configuration-switch input[type='checkbox']").attr("disabled", true);

$.get(_baseUrl + "/api/v1/configure",function(data)
{
self.type = data.type;
$(".configuration-switch input[type='checkbox']").attr("checked", (self.type === 'advanced'));
$(".configuration-switch input[type='checkbox']").attr("disabled", false);
$(".configuration-switch span.well").css("opacity", 1);
self.reloadHull();
self.reloadHull(callback);
});
}
};
Expand Down
10 changes: 7 additions & 3 deletions public/js/app/views/HullSelectionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ define(["underscore", "backbone", "app/models/Hull", "app/views/BaseView"], func

this.$el.find("input").val(coordinateString);
},
drawCoordinates: function()
drawCoordinates: function(callback)
{
var mapPosition = this.$el.find("img");
var delta = {
Expand All @@ -396,6 +396,8 @@ define(["underscore", "backbone", "app/models/Hull", "app/views/BaseView"], func

// close hull
this.closeHull();

callback && callback();
},
restore: function()
{
Expand All @@ -413,8 +415,10 @@ define(["underscore", "backbone", "app/models/Hull", "app/views/BaseView"], func
"coordinates": this.model.coordinates,
}));
this.writeCoordinates();
this.drawCoordinates();
callback && callback();
this.drawCoordinates(function()
{
callback && callback();
});

return this;
}
Expand Down
38 changes: 18 additions & 20 deletions public/js/app/views/SettingsBasicMotionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define(["underscore", "jquery", "backbone", "app/views/BaseView", "seiyria-boots
],
onInitialized: function()
{
callback();
setTimeout(callback, 500);
},
});

Expand Down Expand Up @@ -87,23 +87,19 @@ define(["underscore", "jquery", "backbone", "app/views/BaseView", "seiyria-boots
hull.setElement(this.$el.find("#region-selector"));
hull.getLatestImage(function(image)
{
hull.setImage(image.src);
hull.setImageSize(image.width, image.height);

var retrieveCoordinates = function()
if($("input[name='expositor__Hull__region']").length &&
$("input[name='expositor__Hull__region']").val() != '')
{
if($("input[name='expositor__Hull__region']").length &&
$("input[name='expositor__Hull__region']").val() != '')
hull.setImage(image.src);
hull.setImageSize(image.width, image.height);
hull.setCoordinates($("input[name='expositor__Hull__region']").val());
hull.setName("motion-hullselection");
hull.initialize(function()
{
hull.setCoordinates($("input[name='expositor__Hull__region']").val());
hull.setName("motion-hullselection");
hull.initialize(callback);
self.$el.find("#loading-image-view").remove();
clearInterval(interval);
}
};

var interval = setInterval(retrieveCoordinates, 500);
var loader = self.$el.find("#loading-image-view");
callback(loader);
});
}
});
},
enabledDevices: function()
Expand Down Expand Up @@ -192,11 +188,13 @@ define(["underscore", "jquery", "backbone", "app/views/BaseView", "seiyria-boots

self.createCarousel(function()
{
self.setRegionSelector(function()
self.createSlider();
self.setDevices();
self.setColor();

self.setRegionSelector(function(loader)
{
self.createSlider();
self.setDevices();
self.setColor();
loader.remove();
hull.restore();
});
});
Expand Down
Loading

0 comments on commit 8363596

Please sign in to comment.