mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Adds task status on the device
* Show task status on device for now This shows the status of the last few tasks run on a device as a green/red circle on the device icon. This data live updates from data emitted over the websocket.
This commit is contained in:
@@ -173,7 +173,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http)
|
|||||||
$scope.rack_toolbox_controller = new fsm.FSMController($scope, toolbox_fsm.Start, $scope.inventory_toolbox_controller);
|
$scope.rack_toolbox_controller = new fsm.FSMController($scope, toolbox_fsm.Start, $scope.inventory_toolbox_controller);
|
||||||
//Rack Toolbox Setup
|
//Rack Toolbox Setup
|
||||||
$scope.rack_toolbox = new models.ToolBox(0, 'Rack', 'rack', 10, 200, 150, $scope.graph.height - 200 - 100);
|
$scope.rack_toolbox = new models.ToolBox(0, 'Rack', 'rack', 10, 200, 150, $scope.graph.height - 200 - 100);
|
||||||
$scope.rack_toolbox.items.push(new models.Group(0, 'Rack3', 'rack', 0, 0, 200, 1000, 'false'));
|
|
||||||
$scope.rack_toolbox.spacing = 200;
|
$scope.rack_toolbox.spacing = 200;
|
||||||
$scope.rack_toolbox.enabled = false;
|
$scope.rack_toolbox.enabled = false;
|
||||||
$scope.rack_toolbox_controller.remove_on_drop = false;
|
$scope.rack_toolbox_controller.remove_on_drop = false;
|
||||||
@@ -189,7 +188,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http)
|
|||||||
$scope.site_toolbox_controller = new fsm.FSMController($scope, toolbox_fsm.Start, $scope.rack_toolbox_controller);
|
$scope.site_toolbox_controller = new fsm.FSMController($scope, toolbox_fsm.Start, $scope.rack_toolbox_controller);
|
||||||
//Site Toolbox Setup
|
//Site Toolbox Setup
|
||||||
$scope.site_toolbox = new models.ToolBox(0, 'Sites', 'sites', 10, 200, 150, $scope.graph.height - 200 - 100);
|
$scope.site_toolbox = new models.ToolBox(0, 'Sites', 'sites', 10, 200, 150, $scope.graph.height - 200 - 100);
|
||||||
$scope.site_toolbox.items.push(new models.Group(0, 'Site3', 'site', 0, 0, 1000, 1000, 'false'));
|
|
||||||
$scope.site_toolbox.spacing = 200;
|
$scope.site_toolbox.spacing = 200;
|
||||||
$scope.site_toolbox.enabled = false;
|
$scope.site_toolbox.enabled = false;
|
||||||
$scope.site_toolbox_controller.remove_on_drop = false;
|
$scope.site_toolbox_controller.remove_on_drop = false;
|
||||||
@@ -623,6 +621,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http)
|
|||||||
$scope.all_buttons.extend($scope.layers);
|
$scope.all_buttons.extend($scope.layers);
|
||||||
|
|
||||||
$scope.onTaskStatus = function(data) {
|
$scope.onTaskStatus = function(data) {
|
||||||
|
console.log(['onTaskStatus', data]);
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var j = 0;
|
var j = 0;
|
||||||
var found = false;
|
var found = false;
|
||||||
@@ -648,11 +647,18 @@ var NetworkUIController = function($scope, $document, $location, $window, $http)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (data.status !== null) {
|
||||||
|
$scope.devices[i].status = data.status === "pass";
|
||||||
|
}
|
||||||
|
if (data.working !== null) {
|
||||||
|
$scope.devices[i].working = data.working;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.onDeviceStatus = function(data) {
|
$scope.onDeviceStatus = function(data) {
|
||||||
|
console.log(['onDeviceStatus', data]);
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (i = 0; i < $scope.devices.length; i++) {
|
for (i = 0; i < $scope.devices.length; i++) {
|
||||||
if ($scope.devices[i].name === data.name) {
|
if ($scope.devices[i].name === data.name) {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ _Ready.prototype.onPasteSite = function (controller, msg_type, message) {
|
|||||||
var device_map = {};
|
var device_map = {};
|
||||||
var inner_group = null;
|
var inner_group = null;
|
||||||
var c_messages = [];
|
var c_messages = [];
|
||||||
|
var membership_old_new = null;
|
||||||
scope.hide_groups = false;
|
scope.hide_groups = false;
|
||||||
|
|
||||||
scope.pressedX = scope.mouseX;
|
scope.pressedX = scope.mouseX;
|
||||||
@@ -218,9 +219,17 @@ _Ready.prototype.onPasteSite = function (controller, msg_type, message) {
|
|||||||
inner_group.type));
|
inner_group.type));
|
||||||
}
|
}
|
||||||
for(i=0; i< group.groups.length; i++) {
|
for(i=0; i< group.groups.length; i++) {
|
||||||
group.groups[i].update_membership(scope.devices, scope.groups);
|
membership_old_new = group.groups[i].update_membership(scope.devices, scope.groups);
|
||||||
|
c_messages.push(new messages.GroupMembership(controller.scope.client_id,
|
||||||
|
group.groups[i].id,
|
||||||
|
membership_old_new[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
membership_old_new = group.update_membership(scope.devices, scope.groups);
|
||||||
|
c_messages.push(new messages.GroupMembership(controller.scope.client_id,
|
||||||
|
group.id,
|
||||||
|
membership_old_new[2]));
|
||||||
|
|
||||||
scope.send_control_message(new messages.MultipleMessage(controller.scope.client_id, c_messages));
|
scope.send_control_message(new messages.MultipleMessage(controller.scope.client_id, c_messages));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<g ng-if="!hide_groups || item.type == 'site'">
|
<g ng-if="!hide_groups || item.type == 'site'">
|
||||||
|
<g ng-if="current_scale < 5">
|
||||||
<g ng-if="current_scale > 0.5 || item.type == 'site' || (item.type == 'rack' && current_scale > 0.1)" >
|
<g ng-if="current_scale > 0.5 || item.type == 'site' || (item.type == 'rack' && current_scale > 0.1)" >
|
||||||
|
|
||||||
<g ng-if="item.moving">
|
<g ng-if="item.moving">
|
||||||
@@ -129,3 +130,4 @@
|
|||||||
</g>
|
</g>
|
||||||
|
|
||||||
</g>
|
</g>
|
||||||
|
</g>
|
||||||
|
|||||||
@@ -70,7 +70,6 @@
|
|||||||
<g awx-net-default></g>
|
<g awx-net-default></g>
|
||||||
</g> <!-- end default -->
|
</g> <!-- end default -->
|
||||||
<g awx-net-status-light></g>
|
<g awx-net-status-light></g>
|
||||||
<g awx-net-task-status></g>
|
|
||||||
</g> <!-- end devices -->
|
</g> <!-- end devices -->
|
||||||
|
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
Reference in New Issue
Block a user