mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-17 05:21:49 -05:00
Removes early experiments from network UI.
* Removing unused widgets app * Removes dead code for rack from move * Removes experimental touch support * Removes unused Group corners function * Removes experimental tables app * Removes stencil and layers * Removes status light and task status * Removes configuration * Removes unused PasteGroup message and handler * Removes unused inventory clip path partial * Removes old recordings * Removes unused table messages * Removes unused Task and Configuration models
This commit is contained in:
@@ -50,8 +50,6 @@ _Ready.prototype.onMouseDown = function (controller) {
|
||||
};
|
||||
_Ready.prototype.onMouseDown.transitions = ['Pressed'];
|
||||
|
||||
_Ready.prototype.onTouchStart = _Ready.prototype.onMouseDown;
|
||||
|
||||
_Ready.prototype.start = function (controller) {
|
||||
|
||||
controller.scope.enabled = true;
|
||||
@@ -95,8 +93,6 @@ _Pressed.prototype.onMouseUp = function (controller) {
|
||||
};
|
||||
_Pressed.prototype.onMouseUp.transitions = ['Clicked'];
|
||||
|
||||
_Pressed.prototype.onTouchEnd = _Pressed.prototype.onMouseUp;
|
||||
|
||||
_Disabled.prototype.onEnable = function (controller) {
|
||||
|
||||
controller.changeState(Ready);
|
||||
|
||||
@@ -52,8 +52,6 @@ _Ready.prototype.onMouseDown = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Ready.prototype.onMouseDown.transitions = ['ButtonPressed'];
|
||||
|
||||
_Ready.prototype.onTouchStart = _Ready.prototype.onMouseDown;
|
||||
|
||||
_Ready.prototype.onMouseMove = function (controller, msg_type, $event) {
|
||||
|
||||
if (!controller.scope.hide_buttons) {
|
||||
@@ -97,4 +95,3 @@ _ButtonPressed.prototype.onMouseUp = function (controller, msg_type, $event) {
|
||||
};
|
||||
_ButtonPressed.prototype.onMouseUp.transitions = ['Ready'];
|
||||
|
||||
_ButtonPressed.prototype.onTouchEnd = _ButtonPressed.prototype.onMouseUp;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/configuration.partial.svg');
|
||||
|
||||
function configuration () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.configuration = configuration;
|
||||
@@ -33,7 +33,6 @@
|
||||
<text ng-attr-x="{{graph.right_column}}" y="595" class="NetworkUI__debug-text">Time State: {{time_controller.state.name}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="615" class="NetworkUI__debug-text">Time Pointer: {{time_pointer}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="635" class="NetworkUI__debug-text">History: {{history.length}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="655" class="NetworkUI__debug-text">Touch Data: {{touch_data.xb}} {{touch_data.yb}} {{touch_data.d}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="675" class="NetworkUI__debug-text">Group State: {{group_controller.state.name}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="695" class="NetworkUI__debug-text">Selected groups: {{selected_groups.length}}</text>
|
||||
<text ng-attr-x="{{graph.right_column}}" y="715" class="NetworkUI__debug-text">Hotkeys State: {{hotkeys_controller.state.name}}</text>
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
<g ng-switch-default> <!-- begin default -->
|
||||
<g awx-net-default></g>
|
||||
</g> <!-- end default -->
|
||||
<g awx-net-status-light></g>
|
||||
<g awx-net-task-status></g>
|
||||
</g> <!-- end transform class switch -->
|
||||
|
||||
<g transform="translate(0, 500)">
|
||||
|
||||
@@ -415,43 +415,6 @@ _Ready.prototype.onNewGroup = function (controller, msg_type, message) {
|
||||
};
|
||||
_Ready.prototype.onNewGroup.transitions = ['Placing'];
|
||||
|
||||
_Ready.prototype.onPasteGroup = function (controller, msg_type, message) {
|
||||
|
||||
var scope = controller.scope;
|
||||
scope.hide_groups = false;
|
||||
|
||||
scope.pressedX = scope.mouseX;
|
||||
scope.pressedY = scope.mouseY;
|
||||
scope.pressedScaledX = scope.scaledX;
|
||||
scope.pressedScaledY = scope.scaledY;
|
||||
|
||||
var group = new models.Group(controller.scope.group_id_seq(),
|
||||
message.group.name,
|
||||
message.group.type,
|
||||
scope.scaledX,
|
||||
scope.scaledY,
|
||||
scope.scaledX + message.group.x2,
|
||||
scope.scaledY + message.group.y2,
|
||||
false);
|
||||
|
||||
scope.send_control_message(new messages.GroupCreate(scope.client_id,
|
||||
group.id,
|
||||
group.x1,
|
||||
group.y1,
|
||||
group.x2,
|
||||
group.y2,
|
||||
group.name,
|
||||
group.type));
|
||||
|
||||
scope.groups.push(group);
|
||||
scope.selected_groups.push(group);
|
||||
group.selected = true;
|
||||
controller.changeState(Selected2);
|
||||
};
|
||||
_Ready.prototype.onPasteGroup.transitions = ['Selected2'];
|
||||
|
||||
|
||||
|
||||
_EditLabel.prototype.start = function (controller) {
|
||||
controller.scope.selected_groups[0].edit_label = true;
|
||||
};
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/inventory_toolbox_clip_path.partial.svg');
|
||||
|
||||
function inventoryToolboxClipPath () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.inventoryToolboxClipPath = inventoryToolboxClipPath;
|
||||
@@ -63,10 +63,6 @@
|
||||
<g awx-net-process> </g>
|
||||
</g> <!-- end site -->
|
||||
|
||||
<g ng-switch-when="configuration"> <!-- begin site -->
|
||||
<g awx-net-configuration> </g>
|
||||
</g> <!-- end site -->
|
||||
|
||||
<g ng-switch-default> <!-- begin default -->
|
||||
<g awx-net-default></g>
|
||||
</g> <!-- end default -->
|
||||
@@ -110,10 +106,6 @@
|
||||
<g awx-net-process> </g>
|
||||
</g> <!-- end site -->
|
||||
|
||||
<g ng-switch-when="configuration"> <!-- begin site -->
|
||||
<g awx-net-configuration> </g>
|
||||
</g> <!-- end site -->
|
||||
|
||||
<g ng-switch-default> <!-- begin default -->
|
||||
<g awx-net-default></g>
|
||||
</g> <!-- end default -->
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
|
||||
<rect ng-attr-x="{{toolbox.x}}"
|
||||
ng-attr-y="{{toolbox.y}}"
|
||||
ng-attr-width="{{toolbox.width}}"
|
||||
ng-attr-height="{{toolbox.height}}"></rect>
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/layer.partial.svg');
|
||||
|
||||
function layer () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.layer = layer;
|
||||
@@ -1,14 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
|
||||
|
||||
<rect ng-attr-class="{{layer.is_pressed ? 'NetworkUI__layer--button-pressed' : layer.mouse_over ? 'NetworkUI__layer--button-hover' : 'NetworkUI__layer'}}"
|
||||
x=0
|
||||
y=0
|
||||
ng-attr-width={{layer.width}}
|
||||
ng-attr-height={{layer.height}}
|
||||
rx=5></rect>
|
||||
<text ng-attr-class="{{layer.is_pressed ? 'NetworkUI__layer-text--button-pressed' : layer.mouse_over ? 'NetworkUI__layer-text--button-hover' : 'NetworkUI__layer-text'}}"
|
||||
ng-attr-x="{{layer.width/2}}"
|
||||
ng-attr-y="{{layer.height/2}}"
|
||||
dy=".3em"
|
||||
text-anchor="middle">{{layer.name}}</text>
|
||||
@@ -1,12 +1,5 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
var networkUI = require('./network.ui.app.js');
|
||||
var networkWidgets = require('./network.widgets.app.js');
|
||||
var tablesUI = require('./tables.ui.app.js');
|
||||
var tower = require('./tower.app.js');
|
||||
var ngTouch = require('./ngTouch.js');
|
||||
exports.networkUI = networkUI.networkUI;
|
||||
exports.tablesUI = tablesUI.tablesUI;
|
||||
exports.tower = tower.tower;
|
||||
exports.ngTouch = ngTouch;
|
||||
exports.networkWidgets = networkWidgets;
|
||||
|
||||
|
||||
@@ -213,14 +213,6 @@ function KeyEvent(sender, key, keyCode, type, altKey, shiftKey, ctrlKey, metaKey
|
||||
}
|
||||
exports.KeyEvent = KeyEvent;
|
||||
|
||||
function TouchEvent(sender, type, touches) {
|
||||
this.msg_type = "TouchEvent";
|
||||
this.sender = sender;
|
||||
this.type = type;
|
||||
this.touches = touches;
|
||||
}
|
||||
exports.TouchEvent = TouchEvent;
|
||||
|
||||
function StartRecording(sender, trace_id) {
|
||||
this.msg_type = "StartRecording";
|
||||
this.sender = sender;
|
||||
@@ -266,11 +258,6 @@ function NewGroup(type) {
|
||||
}
|
||||
exports.NewGroup = NewGroup;
|
||||
|
||||
function PasteGroup(group) {
|
||||
this.group = group;
|
||||
}
|
||||
exports.PasteGroup = PasteGroup;
|
||||
|
||||
function PasteRack(group) {
|
||||
this.group = group;
|
||||
}
|
||||
@@ -360,17 +347,6 @@ function GroupMembership(sender, id, members) {
|
||||
}
|
||||
exports.GroupMembership = GroupMembership;
|
||||
|
||||
function TableCellEdit(sender, sheet, col, row, old_value, new_value) {
|
||||
this.msg_type = "TableCellEdit";
|
||||
this.sender = sender;
|
||||
this.sheet = sheet;
|
||||
this.col = col;
|
||||
this.row = row;
|
||||
this.old_value = old_value;
|
||||
this.new_value = new_value;
|
||||
}
|
||||
exports.TableCellEdit = TableCellEdit;
|
||||
|
||||
function ProcessCreate(sender, id, name, type, device_id, x, y) {
|
||||
this.msg_type = "ProcessCreate";
|
||||
this.id = id;
|
||||
|
||||
@@ -419,16 +419,6 @@ ContextMenuButton.prototype.is_selected = function (x, y) {
|
||||
|
||||
};
|
||||
|
||||
function Task(id, name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.status = null;
|
||||
this.working = null;
|
||||
}
|
||||
exports.Task = Task;
|
||||
|
||||
Task.prototype.describeArc = util.describeArc;
|
||||
|
||||
|
||||
function Group(id, name, type, x1, y1, x2, y2, selected) {
|
||||
this.id = id;
|
||||
@@ -533,18 +523,6 @@ Group.prototype.has_corner_selected = function (x, y) {
|
||||
return false;
|
||||
};
|
||||
|
||||
Group.prototype.corners = function () {
|
||||
|
||||
return [{x: this.left_extent(),
|
||||
y: this.top_extent()},
|
||||
{x: this.right_extent(),
|
||||
y: this.top_extent()},
|
||||
{x: this.left_extent(),
|
||||
y: this.bottom_extent()},
|
||||
{x: this.left_extent(),
|
||||
y: this.bottom_extent()}];
|
||||
};
|
||||
|
||||
Group.prototype.select_corner = function (x, y) {
|
||||
|
||||
var corners = [[util.distance(this.x1, this.y1, x, y), TOP_LEFT],
|
||||
@@ -698,22 +676,6 @@ function ToolBox(id, name, type, x, y, width, height) {
|
||||
exports.ToolBox = ToolBox;
|
||||
|
||||
|
||||
function Configuration(id, name, type, x, y, content) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.height = 50;
|
||||
this.width = 50;
|
||||
this.size = 50;
|
||||
this.content = content;
|
||||
this.selected = null;
|
||||
this.enabled = true;
|
||||
this.icon = false;
|
||||
}
|
||||
exports.Configuration = Configuration;
|
||||
|
||||
function Process(id, name, type, x, y) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
|
||||
@@ -119,14 +119,6 @@ _Ready.prototype.onNewDevice = function (controller, msg_type, message) {
|
||||
scope.scaledY,
|
||||
"switch");
|
||||
}
|
||||
else if (message.type === "rack") {
|
||||
id = controller.scope.device_id_seq();
|
||||
device = new models.Device(id,
|
||||
"Rack" + id,
|
||||
scope.scaledX,
|
||||
scope.scaledY,
|
||||
"rack");
|
||||
}
|
||||
else if (message.type === "host") {
|
||||
id = controller.scope.device_id_seq();
|
||||
device = new models.Device(id,
|
||||
@@ -225,9 +217,6 @@ _Ready.prototype.onMouseDown = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Ready.prototype.onMouseDown.transitions = ['Selected1'];
|
||||
|
||||
_Ready.prototype.onTouchStart = _Ready.prototype.onMouseDown;
|
||||
|
||||
|
||||
_Start.prototype.start = function (controller) {
|
||||
|
||||
controller.changeState(Ready);
|
||||
@@ -302,8 +291,6 @@ _Selected2.prototype.onMouseDown = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Selected2.prototype.onMouseDown.transitions = ['Ready', 'Selected3'];
|
||||
|
||||
_Selected2.prototype.onTouchStart = _Selected2.prototype.onMouseDown;
|
||||
|
||||
_Selected2.prototype.onKeyDown = function (controller, msg_type, $event) {
|
||||
|
||||
if ($event.keyCode === 8) {
|
||||
@@ -368,8 +355,6 @@ _Selected1.prototype.onMouseMove = function (controller) {
|
||||
};
|
||||
_Selected1.prototype.onMouseMove.transitions = ['Move'];
|
||||
|
||||
_Selected1.prototype.onTouchMove = _Selected1.prototype.onMouseMove;
|
||||
|
||||
_Selected1.prototype.onMouseUp = function (controller) {
|
||||
|
||||
controller.changeState(Selected2);
|
||||
@@ -377,8 +362,6 @@ _Selected1.prototype.onMouseUp = function (controller) {
|
||||
};
|
||||
_Selected1.prototype.onMouseUp.transitions = ['Selected2'];
|
||||
|
||||
_Selected1.prototype.onTouchEnd = _Selected1.prototype.onMouseUp;
|
||||
|
||||
_Selected1.prototype.onMouseDown = util.noop;
|
||||
|
||||
_Move.prototype.start = function (controller) {
|
||||
@@ -389,8 +372,6 @@ _Move.prototype.start = function (controller) {
|
||||
for (i = 0; i < devices.length; i++) {
|
||||
devices[i].moving = true;
|
||||
for (j = 0; j < controller.scope.devices.length; j++) {
|
||||
console.log(Math.pow(devices[i].x - controller.scope.devices[j].x, 2) +
|
||||
Math.pow(devices[i].y - controller.scope.devices[j].y, 2));
|
||||
if ((Math.pow(devices[i].x - controller.scope.devices[j].x, 2) +
|
||||
Math.pow(devices[i].y - controller.scope.devices[j].y, 2)) < 160000) {
|
||||
controller.scope.devices[j].moving = true;
|
||||
@@ -451,9 +432,6 @@ _Move.prototype.onMouseMove = function (controller) {
|
||||
}
|
||||
};
|
||||
|
||||
_Move.prototype.onTouchMove = _Move.prototype.onMouseMove;
|
||||
|
||||
|
||||
_Move.prototype.onMouseUp = function (controller, msg_type, $event) {
|
||||
|
||||
controller.changeState(Selected1);
|
||||
@@ -461,8 +439,6 @@ _Move.prototype.onMouseUp = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Move.prototype.onMouseUp.transitions = ['Selected1'];
|
||||
|
||||
_Move.prototype.onTouchEnd = _Move.prototype.onMouseUp;
|
||||
|
||||
_Move.prototype.onMouseDown = function (controller) {
|
||||
|
||||
controller.changeState(Selected1);
|
||||
@@ -484,20 +460,11 @@ _Selected3.prototype.onMouseUp = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Selected3.prototype.onMouseUp.transitions = ['ContextMenu'];
|
||||
|
||||
_Selected3.prototype.onTouchEnd = function (controller) {
|
||||
controller.changeState(Selected2);
|
||||
};
|
||||
_Selected3.prototype.onTouchEnd.transitions = ['Selected2'];
|
||||
|
||||
|
||||
_Selected3.prototype.onMouseMove = function (controller) {
|
||||
controller.changeState(Move);
|
||||
};
|
||||
_Selected3.prototype.onMouseMove.transitions = ['Move'];
|
||||
|
||||
_Selected3.prototype.onTouchMove = _Selected3.prototype.onMouseMove;
|
||||
|
||||
|
||||
_EditLabel.prototype.start = function (controller) {
|
||||
controller.scope.selected_items[0].edit_label = true;
|
||||
};
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
var angular = require('angular');
|
||||
var NetworkUIController = require('./network.ui.controller.js');
|
||||
var cursor = require('./cursor.directive.js');
|
||||
var touch = require('./touch.directive.js');
|
||||
var router = require('./router.directive.js');
|
||||
var switchd = require('./switch.directive.js');
|
||||
var host = require('./host.directive.js');
|
||||
@@ -20,29 +19,21 @@ var chevronLeft = require('./chevron.left.directive.js');
|
||||
var contextMenu = require('./context.menu.directive.js');
|
||||
var contextMenuButton = require('./context.menu.button.directive.js');
|
||||
var process = require('./process.directive.js');
|
||||
var configuration = require('./configuration.directive.js');
|
||||
var map = require('./map.directive.js');
|
||||
var deviceDetail = require('./device.detail.directive.js');
|
||||
var defaultd = require('./default.directive.js');
|
||||
var quadrants = require('./quadrants.directive.js');
|
||||
var stencil = require('./stencil.directive.js');
|
||||
var layer = require('./layer.directive.js');
|
||||
var button = require('./button.directive.js');
|
||||
var inventoryToolbox = require('./inventory.toolbox.directive.js');
|
||||
var inventoryToolboxClipPath = require('./inventory.toolbox.clip.path.directive.js');
|
||||
var statusLight = require('./status.light.directive.js');
|
||||
var taskStatus = require('./task.status.directive.js');
|
||||
var debug = require('./debug.directive.js');
|
||||
var test_results = require('./test_results.directive.js');
|
||||
var awxNetworkUI = require('./network.ui.directive.js');
|
||||
|
||||
var networkUI = angular.module('networkUI', [
|
||||
'monospaced.mousewheel',
|
||||
'ngTouch'
|
||||
])
|
||||
.controller('NetworkUIController', NetworkUIController.NetworkUIController)
|
||||
.directive('awxNetCursor', cursor.cursor)
|
||||
.directive('awxNetTouch', touch.touch)
|
||||
.directive('awxNetDebug', debug.debug)
|
||||
.directive('awxNetRouter', router.router)
|
||||
.directive('awxNetSwitch', switchd.switchd)
|
||||
@@ -59,18 +50,12 @@ var networkUI = angular.module('networkUI', [
|
||||
.directive('awxNetContextMenu', contextMenu.contextMenu)
|
||||
.directive('awxNetContextMenuButton', contextMenuButton.contextMenuButton)
|
||||
.directive('awxNetProcess', process.process)
|
||||
.directive('awxNetConfiguration', configuration.configuration)
|
||||
.directive('awxNetMap', map.map)
|
||||
.directive('awxNetDeviceDetail', deviceDetail.deviceDetail)
|
||||
.directive('awxNetDefault', defaultd.defaultd)
|
||||
.directive('awxNetQuadrants', quadrants.quadrants)
|
||||
.directive('awxNetStencil', stencil.stencil)
|
||||
.directive('awxNetLayer', layer.layer)
|
||||
.directive('awxNetButton', button.button)
|
||||
.directive('awxNetInventoryToolbox', inventoryToolbox.inventoryToolbox)
|
||||
.directive('awxNetInventoryToolboxClipPath', inventoryToolboxClipPath.inventoryToolboxClipPath)
|
||||
.directive('awxNetStatusLight', statusLight.statusLight)
|
||||
.directive('awxNetTaskStatus', taskStatus.taskStatus)
|
||||
.directive('awxNetTestResults', test_results.test_results)
|
||||
.directive('awxNetworkUi', awxNetworkUI.awxNetworkUI);
|
||||
|
||||
|
||||
@@ -103,13 +103,10 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
$scope.frame = 0;
|
||||
$scope.recording = false;
|
||||
$scope.replay = false;
|
||||
$scope.touch_data = {};
|
||||
$scope.touches = [];
|
||||
$scope.devices = [];
|
||||
$scope.links = [];
|
||||
$scope.groups = [];
|
||||
$scope.processes = [];
|
||||
$scope.configurations = [];
|
||||
$scope.tests = [];
|
||||
$scope.current_tests = [];
|
||||
$scope.current_test = null;
|
||||
@@ -142,8 +139,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
catch(err) {
|
||||
$scope.initial_messages.push(message);
|
||||
}
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -402,9 +397,9 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
devices[i].selected = true;
|
||||
$scope.send_control_message(new messages.DeviceSelected($scope.client_id, devices[i].id));
|
||||
last_selected_device = devices[i];
|
||||
if ($scope.selected_items.indexOf($scope.devices[i]) === -1) {
|
||||
$scope.selected_items.push($scope.devices[i]);
|
||||
}
|
||||
if ($scope.selected_items.indexOf($scope.devices[i]) === -1) {
|
||||
$scope.selected_items.push($scope.devices[i]);
|
||||
}
|
||||
if ($scope.selected_devices.indexOf(devices[i]) === -1) {
|
||||
$scope.selected_devices.push(devices[i]);
|
||||
}
|
||||
@@ -492,7 +487,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
$scope.last_event = $event;
|
||||
$scope.first_channel.send('MouseDown', $event);
|
||||
$scope.onMouseDownResult = getMouseEventResult($event);
|
||||
$event.preventDefault();
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onMouseUp = function ($event) {
|
||||
@@ -503,7 +498,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
$scope.last_event = $event;
|
||||
$scope.first_channel.send('MouseUp', $event);
|
||||
$scope.onMouseUpResult = getMouseEventResult($event);
|
||||
$event.preventDefault();
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onMouseLeave = function ($event) {
|
||||
@@ -513,7 +508,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
}
|
||||
$scope.onMouseLeaveResult = getMouseEventResult($event);
|
||||
$scope.cursor.hidden = true;
|
||||
$event.preventDefault();
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onMouseMove = function ($event) {
|
||||
@@ -530,7 +525,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
$scope.updateScaledXY();
|
||||
$scope.first_channel.send('MouseMove', $event);
|
||||
$scope.onMouseMoveResult = getMouseEventResult($event);
|
||||
$event.preventDefault();
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onMouseOver = function ($event) {
|
||||
@@ -540,7 +535,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
}
|
||||
$scope.onMouseOverResult = getMouseEventResult($event);
|
||||
$scope.cursor.hidden = false;
|
||||
$event.preventDefault();
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onMouseEnter = $scope.onMouseOver;
|
||||
@@ -550,7 +545,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
var delta = $event.delta;
|
||||
var deltaX = $event.deltaX;
|
||||
var deltaY = $event.deltaY;
|
||||
// console.log([$event, delta, deltaX, deltaY]);
|
||||
if ($scope.recording) {
|
||||
$scope.send_control_message(new messages.MouseWheelEvent($scope.client_id, delta, deltaX, deltaY, $event.type, $event.originalEvent.metaKey, $scope.trace_id));
|
||||
}
|
||||
@@ -581,77 +575,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
|
||||
$document.bind("keydown", $scope.onKeyDown);
|
||||
|
||||
// Touch Event Handlers
|
||||
//
|
||||
|
||||
$scope.onTouchStart = function($event) {
|
||||
var touches = [];
|
||||
var i = 0;
|
||||
for (i = 0; i < $event.touches.length; i++) {
|
||||
touches.push({screenX: $event.touches[i].screenX, screenY: $event.touches[i].screenY});
|
||||
}
|
||||
$scope.touches = touches;
|
||||
if ($scope.recording) {
|
||||
$scope.send_control_message(new messages.TouchEvent($scope.client_id, "touchstart", touches));
|
||||
}
|
||||
|
||||
if ($event.touches.length === 1) {
|
||||
$scope.cursor.hidden = false;
|
||||
$scope.cursor.x = $event.touches[0].screenX;
|
||||
$scope.cursor.y = $event.touches[0].screenY;
|
||||
$scope.mouseX = $event.touches[0].screenX;
|
||||
$scope.mouseY = $event.touches[0].screenY;
|
||||
$scope.updateScaledXY();
|
||||
}
|
||||
$scope.first_channel.send('TouchStart', $event);
|
||||
$scope.onTouchStartEvent = $event;
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onTouchEnd = function($event) {
|
||||
var touches = [];
|
||||
var i = 0;
|
||||
for (i = 0; i < $event.touches.length; i++) {
|
||||
touches.push({screenX: $event.touches[i].screenX, screenY: $event.touches[i].screenY});
|
||||
}
|
||||
$scope.touches = touches;
|
||||
if ($scope.recording) {
|
||||
$scope.send_control_message(new messages.TouchEvent($scope.client_id, "touchend", touches));
|
||||
}
|
||||
$scope.first_channel.send('TouchEnd', $event);
|
||||
$scope.onTouchEndEvent = $event;
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.onTouchMove = function($event) {
|
||||
var touches = [];
|
||||
var i = 0;
|
||||
for (i = 0; i < $event.touches.length; i++) {
|
||||
touches.push({screenX: $event.touches[i].screenX, screenY: $event.touches[i].screenY});
|
||||
}
|
||||
$scope.touches = touches;
|
||||
if ($scope.recording) {
|
||||
$scope.send_control_message(new messages.TouchEvent($scope.client_id, "touchmove", touches));
|
||||
}
|
||||
|
||||
if ($event.touches.length === 1) {
|
||||
$scope.cursor.hidden = false;
|
||||
$scope.cursor.x = $event.touches[0].screenX;
|
||||
$scope.cursor.y = $event.touches[0].screenY;
|
||||
$scope.mouseX = $event.touches[0].screenX;
|
||||
$scope.mouseY = $event.touches[0].screenY;
|
||||
$scope.updateScaledXY();
|
||||
}
|
||||
|
||||
$scope.first_channel.send('TouchMove', $event);
|
||||
$scope.onTouchMoveEvent = $event;
|
||||
$event.preventDefault();
|
||||
};
|
||||
|
||||
$scope.$watchCollection('selected_items', function(){
|
||||
$scope.onDetailsContextButton(false);
|
||||
});
|
||||
|
||||
// Conext Menu Button Handlers
|
||||
$scope.onDetailsContextButton = function (panelBoolean) {
|
||||
if (!$scope.disconnected) {
|
||||
@@ -677,14 +600,12 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
};
|
||||
|
||||
$scope.onRenameContextButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.context_menus[0].enabled = false;
|
||||
$scope.first_channel.send("LabelEdit", {});
|
||||
};
|
||||
|
||||
// Button Event Handlers
|
||||
$scope.onToggleToolboxButtonLeft = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.first_channel.send("ToggleToolbox", {});
|
||||
$scope.action_icons[0].fsm.handle_message("Disable", {});
|
||||
$scope.action_icons[1].fsm.handle_message("Enable", {});
|
||||
@@ -692,7 +613,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
};
|
||||
|
||||
$scope.onToggleToolboxButtonRight = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.first_channel.send("ToggleToolbox", {});
|
||||
$scope.action_icons[0].fsm.handle_message("Enable", {});
|
||||
$scope.action_icons[1].fsm.handle_message("Disable", {});
|
||||
@@ -701,18 +621,14 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
|
||||
|
||||
$scope.onDeployButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.send_control_message(new messages.Deploy($scope.client_id));
|
||||
};
|
||||
|
||||
$scope.onDestroyButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.resetStatus();
|
||||
$scope.send_control_message(new messages.Destroy($scope.client_id));
|
||||
};
|
||||
|
||||
$scope.onRecordButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.recording = ! $scope.recording;
|
||||
if ($scope.recording) {
|
||||
$scope.trace_id = $scope.trace_id_seq();
|
||||
@@ -744,7 +660,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
};
|
||||
|
||||
$scope.onExportButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.cursor.hidden = true;
|
||||
$scope.debug.hidden = true;
|
||||
$scope.hide_buttons = true;
|
||||
@@ -757,12 +672,10 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
};
|
||||
|
||||
$scope.onLayoutButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.send_control_message(new messages.Layout($scope.client_id));
|
||||
};
|
||||
|
||||
$scope.onDiscoverButton = function (button) {
|
||||
console.log(button.name);
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "http://" + window.location.host + "/api/v1/job_templates/7/launch/", true);
|
||||
xhr.onload = function () {
|
||||
@@ -775,7 +688,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
};
|
||||
|
||||
$scope.onConfigureButton = function (button) {
|
||||
console.log(button.name);
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "http://" + window.location.host + "/api/v1/job_templates/9/launch/", true);
|
||||
xhr.onload = function () {
|
||||
@@ -806,7 +718,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
|
||||
|
||||
$scope.onExportYamlButton = function (button) {
|
||||
console.log(button);
|
||||
$window.open('/network_ui/topology.yaml?topology_id=' + $scope.topology_id , '_blank');
|
||||
};
|
||||
|
||||
@@ -827,23 +738,19 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
new models.ActionIcon("chevron-right", 15, $scope.graph.height/2, 16, $scope.onToggleToolboxButtonRight, false, $scope)
|
||||
];
|
||||
|
||||
$scope.onDownloadTraceButton = function (button) {
|
||||
console.log(button.label);
|
||||
$scope.onDownloadTraceButton = function (button) {
|
||||
window.open("/network_ui/download_trace?topology_id=" + $scope.topology_id + "&trace_id=" + $scope.trace_id + "&client_id=" + $scope.client_id);
|
||||
};
|
||||
|
||||
$scope.onDownloadRecordingButton = function (button) {
|
||||
console.log(button.label);
|
||||
$scope.onDownloadRecordingButton = function (button) {
|
||||
window.open("/network_ui/download_recording?topology_id=" + $scope.topology_id + "&trace_id=" + $scope.trace_id + "&client_id=" + $scope.client_id);
|
||||
};
|
||||
|
||||
$scope.onUploadTestButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.onUploadTestButton = function (button) {
|
||||
window.open("/network_ui/upload_test", "_top");
|
||||
};
|
||||
|
||||
$scope.onRunTestsButton = function (button) {
|
||||
console.log(button.name);
|
||||
$scope.onRunTestsButton = function (button) {
|
||||
|
||||
$scope.test_results = [];
|
||||
$scope.current_tests = $scope.tests.slice();
|
||||
@@ -868,88 +775,10 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
new models.Button("RUN TESTS", button_offset + 120, 88, 100, 30, $scope.onRunTestsButton, $scope),
|
||||
];
|
||||
|
||||
var LAYERS_X = 160;
|
||||
|
||||
$scope.layers = [
|
||||
new models.ToggleButton("APPLICATION", $scope.graph.width - LAYERS_X, 10, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("PRESENTATION", $scope.graph.width - LAYERS_X, 50, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("SESSION", $scope.graph.width - LAYERS_X, 90, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("TRANSPORT", $scope.graph.width - LAYERS_X, 130, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("NETWORK", $scope.graph.width - LAYERS_X, 170, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("DATA-LINK", $scope.graph.width - LAYERS_X, 210, 120, 30, util.noop, util.noop, true, $scope),
|
||||
new models.ToggleButton("PHYSICAL",
|
||||
$scope.graph.width - LAYERS_X, 250, 120, 30,
|
||||
$scope.onTogglePhysical,
|
||||
$scope.onUnTogglePhysical,
|
||||
true,
|
||||
$scope),
|
||||
new models.ToggleButton("GROUP",
|
||||
$scope.graph.width - LAYERS_X, 290, 120, 30,
|
||||
$scope.onToggleGroup,
|
||||
$scope.onUnToggleGroup,
|
||||
true,
|
||||
$scope)
|
||||
];
|
||||
|
||||
$scope.layers = [];
|
||||
|
||||
$scope.all_buttons = [];
|
||||
$scope.all_buttons.extend($scope.context_menu_buttons);
|
||||
$scope.all_buttons.extend($scope.action_icons);
|
||||
$scope.all_buttons.extend($scope.buttons);
|
||||
$scope.all_buttons.extend($scope.layers);
|
||||
|
||||
$scope.onTaskStatus = function(data) {
|
||||
console.log(['onTaskStatus', data]);
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var found = false;
|
||||
for (i = 0; i < $scope.devices.length; i++) {
|
||||
if ($scope.devices[i].name === data.device_name) {
|
||||
found = false;
|
||||
for (j = 0; j < $scope.devices[i].tasks.length; j++) {
|
||||
if ($scope.devices[i].tasks[j].id === data.task_id) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
$scope.devices[i].tasks.push(new models.Task(data.task_id,
|
||||
data.device_name));
|
||||
}
|
||||
for (j = 0; j < $scope.devices[i].tasks.length; j++) {
|
||||
if ($scope.devices[i].tasks[j].id === data.task_id) {
|
||||
if (data.status !== null) {
|
||||
$scope.devices[i].tasks[j].status = data.status === "pass";
|
||||
}
|
||||
if (data.working !== null) {
|
||||
$scope.devices[i].tasks[j].working = data.working;
|
||||
}
|
||||
}
|
||||
}
|
||||
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) {
|
||||
console.log(['onDeviceStatus', data]);
|
||||
var i = 0;
|
||||
for (i = 0; i < $scope.devices.length; i++) {
|
||||
if ($scope.devices[i].name === data.name) {
|
||||
if (data.status !== null) {
|
||||
$scope.devices[i].status = data.status === "pass";
|
||||
}
|
||||
if (data.working !== null) {
|
||||
$scope.devices[i].working = data.working;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.onFacts = function(data) {
|
||||
var i = 0;
|
||||
@@ -1123,9 +952,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
|
||||
$scope.create_interface = function(data) {
|
||||
var i = 0;
|
||||
console.log(data);
|
||||
var new_interface = new models.Interface(data.id, data.name);
|
||||
console.log(new_interface);
|
||||
for (i = 0; i < $scope.devices.length; i++){
|
||||
if ($scope.devices[i].id === data.device_id) {
|
||||
$scope.devices[i].interface_seq = util.natural_numbers(data.id);
|
||||
@@ -1403,7 +1230,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
$scope.onToolboxItem = function (data) {
|
||||
if (data.toolbox_name === "Site") {
|
||||
var site = JSON.parse(data.data);
|
||||
console.log(site);
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var site_copy = new models.Group(site.id,
|
||||
@@ -1446,7 +1272,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
device_copy.processes.push(process_copy);
|
||||
}
|
||||
}
|
||||
console.log(device_map);
|
||||
var group, group_copy;
|
||||
for (i = 0; i < site.groups.length; i++) {
|
||||
group = site.groups[i];
|
||||
@@ -1554,14 +1379,14 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
process.type,
|
||||
0,
|
||||
0));
|
||||
new_process.device = new_device;
|
||||
new_process.device = new_device;
|
||||
new_device.processes.push(new_process);
|
||||
}
|
||||
for (j = 0; j < device.interfaces.length; j++) {
|
||||
intf = device.interfaces[j];
|
||||
new_intf = (new models.Interface(intf.id,
|
||||
intf.name));
|
||||
new_intf.device = new_device;
|
||||
new_intf.device = new_device;
|
||||
device_interface_map[device.id][intf.id] = new_intf;
|
||||
new_device.interfaces.push(new_intf);
|
||||
}
|
||||
@@ -1682,36 +1507,16 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
}
|
||||
};
|
||||
|
||||
$scope.resetStatus = function() {
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var devices = $scope.devices;
|
||||
var links = $scope.links;
|
||||
for (i = 0; i < devices.length; i++) {
|
||||
devices[i].status = null;
|
||||
devices[i].working = false;
|
||||
devices[i].tasks = [];
|
||||
for (j = devices[i].interfaces.length - 1; j >= 0; j--) {
|
||||
devices[i].interfaces[j].status = null;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < links.length; i++) {
|
||||
links[i].status = null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.control_socket.onmessage = function(message) {
|
||||
$scope.first_channel.send('Message', message);
|
||||
$scope.$apply();
|
||||
};
|
||||
|
||||
$scope.control_socket.onopen = function() {
|
||||
$scope.control_socket.onopen = function() {
|
||||
//ignore
|
||||
};
|
||||
|
||||
$scope.send_initial_messages = function() {
|
||||
$scope.send_initial_messages = function() {
|
||||
var i = 0;
|
||||
var messages_to_send = $scope.initial_messages;
|
||||
var message = null;
|
||||
@@ -1723,12 +1528,12 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
data = messages.serialize(message);
|
||||
$scope.control_socket.send(data);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Call onopen directly if $scope.control_socket is already open
|
||||
if ($scope.control_socket.readyState === WebSocket.OPEN) {
|
||||
$scope.control_socket.onopen();
|
||||
}
|
||||
// Call onopen directly if $scope.control_socket is already open
|
||||
if ($scope.control_socket.readyState === WebSocket.OPEN) {
|
||||
$scope.control_socket.onopen();
|
||||
}
|
||||
|
||||
$scope.send_control_message = function (message) {
|
||||
var i = 0;
|
||||
@@ -1742,8 +1547,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
var data = messages.serialize(message);
|
||||
if (!$scope.disconnected) {
|
||||
$scope.control_socket.send(data);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1751,17 +1554,17 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
// End web socket
|
||||
//
|
||||
|
||||
angular.element($window).bind('resize', function(){
|
||||
angular.element($window).bind('resize', function(){
|
||||
|
||||
$scope.graph.width = $window.innerWidth;
|
||||
$scope.graph.right_column = 300;
|
||||
$scope.graph.height = $window.innerHeight;
|
||||
$scope.graph.width = $window.innerWidth;
|
||||
$scope.graph.right_column = 300;
|
||||
$scope.graph.height = $window.innerHeight;
|
||||
|
||||
$scope.update_size();
|
||||
|
||||
// manuall $digest required as resize event
|
||||
// is outside of angular
|
||||
$scope.$digest();
|
||||
// manuall $digest required as resize event
|
||||
// is outside of angular
|
||||
$scope.$digest();
|
||||
});
|
||||
|
||||
//60fps ~ 17ms delay
|
||||
@@ -1778,10 +1581,6 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
});
|
||||
|
||||
$scope.update_size = function () {
|
||||
var i = 0;
|
||||
for (i = 0; i < $scope.layers.length; i++) {
|
||||
$scope.layers[i].x = $scope.graph.width - 140;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.update_offsets = function () {
|
||||
@@ -1808,11 +1607,11 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
var test_event = null;
|
||||
if ($scope.test_events.length > 0) {
|
||||
test_event = $scope.test_events.shift();
|
||||
console.log(test_event);
|
||||
test_event.sender = 0;
|
||||
try {
|
||||
$scope.first_channel.send(test_event.msg_type, test_event);
|
||||
} catch (err) {
|
||||
console.log(["Test Error:", $scope.current_test, err]);
|
||||
$scope.test_errors.push(err);
|
||||
}
|
||||
}
|
||||
@@ -1820,7 +1619,7 @@ var NetworkUIController = function($scope, $document, $location, $window, $http,
|
||||
}, 10);
|
||||
|
||||
ConfigService
|
||||
.getConfig()
|
||||
.getConfig()
|
||||
.then(function(config){
|
||||
$scope.version = config.version;
|
||||
});
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
//console.log = function () { };
|
||||
var angular = require('angular');
|
||||
var NetworkWidgetsController = require('./network.widgets.controller.js');
|
||||
var cursor = require('./cursor.directive.js');
|
||||
var touch = require('./touch.directive.js');
|
||||
var router = require('./router.directive.js');
|
||||
var switchd = require('./switch.directive.js');
|
||||
var host = require('./host.directive.js');
|
||||
var link = require('./link.directive.js');
|
||||
var stream = require('./stream.directive.js');
|
||||
var rack = require('./rack.directive.js');
|
||||
var rackIcon = require('./rack.icon.directive.js');
|
||||
var group = require('./group.directive.js');
|
||||
var site = require('./site.directive.js');
|
||||
var siteIcon = require('./site.icon.directive.js');
|
||||
var process = require('./process.directive.js');
|
||||
var configuration = require('./configuration.directive.js');
|
||||
var map = require('./map.directive.js');
|
||||
var deviceDetail = require('./device.detail.directive.js');
|
||||
var defaultd = require('./default.directive.js');
|
||||
var quadrants = require('./quadrants.directive.js');
|
||||
var stencil = require('./stencil.directive.js');
|
||||
var layer = require('./layer.directive.js');
|
||||
var button = require('./button.directive.js');
|
||||
var inventoryToolbox = require('./inventory.toolbox.directive.js');
|
||||
var inventoryToolboxClipPath = require('./inventory.toolbox.clip.path.directive.js');
|
||||
var statusLight = require('./status.light.directive.js');
|
||||
var taskStatus = require('./task.status.directive.js');
|
||||
var debug = require('./debug.directive.js');
|
||||
var awxNetworkWidgets = require('./network.widgets.directive.js');
|
||||
|
||||
var networkWidgets = angular.module('networkWidgets', [
|
||||
'monospaced.mousewheel',
|
||||
'ngTouch'
|
||||
])
|
||||
.controller('NetworkWidgetsController', NetworkWidgetsController.NetworkWidgetsController)
|
||||
.directive('awxNetCursor', cursor.cursor)
|
||||
.directive('awxNetTouch', touch.touch)
|
||||
.directive('awxNetDebug', debug.debug)
|
||||
.directive('awxNetRouter', router.router)
|
||||
.directive('awxNetSwitch', switchd.switchd)
|
||||
.directive('awxNetHost', host.host)
|
||||
.directive('awxNetLink', link.link)
|
||||
.directive('awxNetStream', stream.stream)
|
||||
.directive('awxNetRack', rack.rack)
|
||||
.directive('awxNetGroup', group.group)
|
||||
.directive('awxNetSite', site.site)
|
||||
.directive('awxNetSiteIcon', siteIcon.siteIcon)
|
||||
.directive('awxNetRackIcon', rackIcon.rackIcon)
|
||||
.directive('awxNetProcess', process.process)
|
||||
.directive('awxNetConfiguration', configuration.configuration)
|
||||
.directive('awxNetMap', map.map)
|
||||
.directive('awxNetDeviceDetail', deviceDetail.deviceDetail)
|
||||
.directive('awxNetDefault', defaultd.defaultd)
|
||||
.directive('awxNetQuadrants', quadrants.quadrants)
|
||||
.directive('awxNetStencil', stencil.stencil)
|
||||
.directive('awxNetLayer', layer.layer)
|
||||
.directive('awxNetButton', button.button)
|
||||
.directive('awxNetInventoryToolbox', inventoryToolbox.inventoryToolbox)
|
||||
.directive('awxNetInventoryToolboxClipPath', inventoryToolboxClipPath.inventoryToolboxClipPath)
|
||||
.directive('awxNetStatusLight', statusLight.statusLight)
|
||||
.directive('awxNetTaskStatus', taskStatus.taskStatus)
|
||||
.directive('awxNetworkWidgets', awxNetworkWidgets.awxNetworkWidgets);
|
||||
|
||||
exports.networkWidgets = networkWidgets;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/network_widgets.partial.svg');
|
||||
|
||||
function awxNetworkWidgets () {
|
||||
return { restrict: 'E', templateUrl};
|
||||
}
|
||||
exports.awxNetworkWidgets = awxNetworkWidgets;
|
||||
@@ -9,10 +9,6 @@
|
||||
ng-mouseleave="onMouseLeave($event)"
|
||||
ng-mousemove="onMouseMove($event)"
|
||||
ng-mouseover="onMouseOver($event)"
|
||||
ng-touchstart="onTouchStart($event)"
|
||||
ng-touchmove="onTouchMove($event)"
|
||||
ng-touchend="onTouchEnd($event)"
|
||||
ng-tap="onTap($event)"
|
||||
msd-wheel="onMouseWheel($event, $delta, $deltaX, $deltaY)">
|
||||
<defs>
|
||||
<filter x="0" y="0" width="1" height="1" id="selected">
|
||||
@@ -101,14 +97,6 @@
|
||||
<g awx-net-button></g>
|
||||
</g>
|
||||
</g> <!-- end buttons -->
|
||||
|
||||
<g> <!-- layers -->
|
||||
<g ng-repeat="layer in layers"
|
||||
ng-attr-transform="translate({{layer.x}},{{layer.y}})"
|
||||
class="button">
|
||||
<g awx-net-layer> </g>
|
||||
</g>
|
||||
</g> <!-- end layers -->
|
||||
</g>
|
||||
<g awx-net-context-menu
|
||||
context_menu="context_menus[0]"
|
||||
@@ -118,8 +106,5 @@
|
||||
<g awx-net-debug></g>
|
||||
<g awx-net-test-results></g>
|
||||
<g awx-net-cursor></g>
|
||||
<g ng-repeat="touch in touches">
|
||||
<g awx-net-touch></g>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
<div ng-controller="NetworkWidgetsController">
|
||||
<svg id="frame" class="NetworkUI"
|
||||
ng-attr-height="{{graph.height}}"
|
||||
ng-attr-width="{{graph.width}}"
|
||||
ng-mousedown="onMouseDown($event)"
|
||||
ng-mouseup="onMouseUp($event)"
|
||||
ng-mouseenter="onMouseEnter($event)"
|
||||
ng-mouseleave="onMouseLeave($event)"
|
||||
ng-mousemove="onMouseMove($event)"
|
||||
ng-mouseover="onMouseOver($event)"
|
||||
ng-touchstart="onTouchStart($event)"
|
||||
ng-touchmove="onTouchMove($event)"
|
||||
ng-touchend="onTouchEnd($event)"
|
||||
ng-tap="onTap($event)"
|
||||
msd-wheel="onMouseWheel($event, $delta, $deltaX, $deltaY)">
|
||||
<defs>
|
||||
<filter x="0" y="0" width="1" height="1" id="selected">
|
||||
<feFlood flood-color="#b3d8fd"/>
|
||||
<feComposite in="SourceGraphic" operator="xor"/>
|
||||
</filter>
|
||||
<filter x="0" y="0" width="1" height="1" id="background">
|
||||
<feFlood flood-color="#ffffff"/>
|
||||
<feComposite in="SourceGraphic" operator="xor"/>
|
||||
</filter>
|
||||
<clipPath id="inventory-toolbox-clip-path">
|
||||
<rect ng-attr-x="{{inventory_toolbox.x}}"
|
||||
ng-attr-y="{{inventory_toolbox.y}}"
|
||||
ng-attr-width="{{inventory_toolbox.width}}"
|
||||
ng-attr-height="{{inventory_toolbox.height}}"
|
||||
rx=5></rect>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g transform="scale(1.0)" id="frame_g">
|
||||
<g ng-if="current_mode == 'MultiSite'" transform="translate(-300000, -200000) scale(1000)" awx-net-map></g>
|
||||
<g ng-if="!hide_links">
|
||||
<g ng-if="current_scale > 0.5 && current_scale < 5">
|
||||
<g ng-repeat="link in links">
|
||||
<g awx-net-link></g>
|
||||
</g> <!-- end ng-repeat link in links-->
|
||||
</g> <!-- end ng-if current_scale -->
|
||||
</g> <!-- end hide_links -->
|
||||
<g ng-repeat="link in links">
|
||||
<g ng-if="link.selected || link.to_interface.selected || link.from_interface.selected" link></g>
|
||||
</g>
|
||||
<g ng-if="current_scale > 0.5 && current_scale < 5">
|
||||
<g ng-repeat="stream in streams">
|
||||
<g awx-net-stream></g>
|
||||
</g> <!-- end ng-repeat stream in streams-->
|
||||
</g> <!-- end ng-if current_scale -->
|
||||
<g ng-if="current_scale > 0.5 && current_scale < 5">
|
||||
|
||||
<g ng-repeat="item in devices"
|
||||
ng-attr-transform="translate({{item.x}},{{item.y}})"
|
||||
ng-attr-class="{{item.type}}"
|
||||
ng-switch on="item.type">
|
||||
<g ng-switch-when="router"><!-- begin router -->
|
||||
<g awx-net-router></g>
|
||||
</g> <!-- end router -->
|
||||
|
||||
<g ng-switch-when="switch"> <!-- begin switch -->
|
||||
<g awx-net-switch> </g>
|
||||
</g> <!-- end switch -->
|
||||
|
||||
<g ng-switch-when="host"> <!-- begin host -->
|
||||
<g awx-net-host> </g>
|
||||
|
||||
</g> <!-- end host -->
|
||||
|
||||
<g ng-switch-default> <!-- begin default -->
|
||||
<g awx-net-default></g>
|
||||
</g> <!-- end default -->
|
||||
<g awx-net-status-light></g>
|
||||
<g awx-net-task-status></g>
|
||||
</g> <!-- end devices -->
|
||||
|
||||
</g>
|
||||
<g ng-if="current_scale >= 5">
|
||||
<g ng-repeat="item in devices"
|
||||
ng-attr-transform="translate({{item.x}},{{item.y}})">
|
||||
<g awx-net-device-detail> </g>
|
||||
</g>
|
||||
</g>
|
||||
<g ng-repeat="item in groups">
|
||||
<g awx-net-group></g>
|
||||
</g>
|
||||
<g ng-attr-transform="translate({{scaledX}},{{scaledY}})" ng-attr-class="{{debug.hidden && 'hidden' || ''}} debug-cursor" >
|
||||
<line x1="-5" y1="0" x2="5" y2="0"/>
|
||||
<line x1="0" y1="-5" x2="0" y2="5"/>
|
||||
</g>
|
||||
<g awx-net-quadrants>
|
||||
</g>
|
||||
</g>
|
||||
<g ng-repeat="toolbox in [site_toolbox, rack_toolbox, inventory_toolbox, app_toolbox]">
|
||||
<g awx-net-inventory-toolbox></g>
|
||||
</g>
|
||||
<g ng-if="!hide_buttons">
|
||||
<g> <!-- buttons -->
|
||||
<g ng-repeat="button in buttons"
|
||||
ng-attr-transform="translate({{button.x}},{{button.y}})">
|
||||
<g awx-net-button></g>
|
||||
</g>
|
||||
</g> <!-- end buttons -->
|
||||
|
||||
<g> <!-- stencils -->
|
||||
<g ng-repeat="stencil in stencils"
|
||||
ng-attr-transform="translate({{stencil.x}},{{stencil.y}})"
|
||||
class="button">
|
||||
<g awx-net-stencil></g>
|
||||
</g>
|
||||
</g> <!-- end stencils -->
|
||||
|
||||
<g> <!-- layers -->
|
||||
<g ng-repeat="layer in layers"
|
||||
ng-attr-transform="translate({{layer.x}},{{layer.y}})"
|
||||
class="button">
|
||||
<g awx-net-layer> </g>
|
||||
</g>
|
||||
</g> <!-- end layers -->
|
||||
</g>
|
||||
<g awx-net-debug></g>
|
||||
<g awx-net-cursor></g>
|
||||
<g ng-repeat="touch in touches">
|
||||
<g awx-net-touch></g>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* ngTouch.js v1.0.2
|
||||
* (c) 2015 Mark Topper
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
angular.module("ngTouch", [])
|
||||
.directive("ngTouchstart", function () {
|
||||
return {
|
||||
controller: ["$scope", "$element", function ($scope, $element) {
|
||||
|
||||
$element.bind("touchstart", onTouchStart);
|
||||
function onTouchStart(event) {
|
||||
var method = $element.attr("ng-touchstart");
|
||||
$scope.$event = event;
|
||||
$scope.$apply(method);
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
})
|
||||
.directive("ngTouchmove", function () {
|
||||
return {
|
||||
controller: ["$scope", "$element", function ($scope, $element) {
|
||||
|
||||
$element.bind("touchstart", onTouchStart);
|
||||
function onTouchStart(event) {
|
||||
event.preventDefault();
|
||||
$element.bind("touchmove", onTouchMove);
|
||||
$element.bind("touchend", onTouchEnd);
|
||||
}
|
||||
function onTouchMove(event) {
|
||||
var method = $element.attr("ng-touchmove");
|
||||
$scope.$event = event;
|
||||
$scope.$apply(method);
|
||||
}
|
||||
function onTouchEnd(event) {
|
||||
event.preventDefault();
|
||||
$element.unbind("touchmove", onTouchMove);
|
||||
$element.unbind("touchend", onTouchEnd);
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
})
|
||||
.directive("ngTouchend", function () {
|
||||
return {
|
||||
controller: ["$scope", "$element", function ($scope, $element) {
|
||||
|
||||
$element.bind("touchend", onTouchEnd);
|
||||
function onTouchEnd(event) {
|
||||
var method = $element.attr("ng-touchend");
|
||||
$scope.$event = event;
|
||||
$scope.$apply(method);
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
})
|
||||
.directive("ngTap", function () {
|
||||
return {
|
||||
controller: ["$scope", "$element", function ($scope, $element) {
|
||||
|
||||
var moved = false;
|
||||
$element.bind("touchstart", onTouchStart);
|
||||
function onTouchStart() {
|
||||
$element.bind("touchmove", onTouchMove);
|
||||
$element.bind("touchend", onTouchEnd);
|
||||
}
|
||||
function onTouchMove() {
|
||||
moved = true;
|
||||
}
|
||||
function onTouchEnd() {
|
||||
$element.unbind("touchmove", onTouchMove);
|
||||
$element.unbind("touchend", onTouchEnd);
|
||||
if (!moved) {
|
||||
var method = $element.attr("ng-tap");
|
||||
$scope.$apply(method);
|
||||
}
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
});
|
||||
@@ -510,5 +510,3 @@ _Move.prototype.onMouseMove = function (controller) {
|
||||
controller.scope.pressedScaledY = controller.scope.scaledY;
|
||||
|
||||
};
|
||||
|
||||
_Move.prototype.onTouchMove = _Move.prototype.onMouseMove;
|
||||
|
||||
@@ -614,5 +614,3 @@ _Move.prototype.onMouseMove = function (controller) {
|
||||
controller.scope.pressedScaledY = controller.scope.scaledY;
|
||||
|
||||
};
|
||||
|
||||
_Move.prototype.onTouchMove = _Move.prototype.onMouseMove;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/stencil.partial.svg');
|
||||
|
||||
function stencil () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.stencil = stencil;
|
||||
@@ -1,14 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
|
||||
|
||||
<rect ng-attr-class="{{stencil.is_pressed ? 'NetworkUI__stencil--button-pressed' : stencil.mouse_over ? 'NetworkUI__stencil--button-hover' : 'NetworkUI__stencil'}}"
|
||||
x=0
|
||||
y=0
|
||||
ng-attr-width={{stencil.width}}
|
||||
ng-attr-height={{stencil.height}}
|
||||
rx=5></rect>
|
||||
<text ng-attr-class="{{stencil.is_pressed ? 'NetworkUI__stencil-text--button-pressed' : stencil.mouse_over ? 'NetworkUI__stencil-text--button-hover' : 'NetworkUI__stencil-text'}}"
|
||||
ng-attr-x="{{stencil.width/2}}"
|
||||
ng-attr-y="{{stencil.height/2}}"
|
||||
dy=".3em"
|
||||
text-anchor="middle">{{stencil.name}}</text>
|
||||
@@ -347,78 +347,6 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__layer {
|
||||
fill: @button-body;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__layer-text {
|
||||
fill: @button-text;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__layer--button-pressed {
|
||||
fill: @button-body-pressed;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__layer-text--button-pressed {
|
||||
fill: @button-text-pressed;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__layer--button-hover {
|
||||
fill: @button-body-hover;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__layer-text--button-hover {
|
||||
fill: @button-text;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil {
|
||||
fill: @button-body;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil-text {
|
||||
fill: @button-text;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil--button-pressed {
|
||||
fill: @button-body-pressed;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil-text--button-pressed {
|
||||
fill: @button-text-pressed;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil--button-hover {
|
||||
fill: @button-body-hover;
|
||||
stroke: @button-outline;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.NetworkUI__stencil-text--button-hover {
|
||||
fill: @button-text;
|
||||
font-family: 'Open Sans';
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.NetworkUI__host {
|
||||
fill: @host-green;
|
||||
}
|
||||
@@ -567,13 +495,6 @@
|
||||
font-family: 'Open Sans';
|
||||
}
|
||||
|
||||
.NetworkUI__touch {
|
||||
stroke: @debug-copynot;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.NetworkUI__group--selected {
|
||||
stroke: @selected-blue;
|
||||
stroke-width: 6;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
//console.log = function () { };
|
||||
var angular = require('angular');
|
||||
var TablesUIController = require('./tables.ui.controller.js');
|
||||
var awxTablesUI = require('./tables.ui.directive.js');
|
||||
|
||||
var tablesUI = angular.module('tablesUI', ['xeditable'])
|
||||
.controller('TablesUIController', TablesUIController.TablesUIController)
|
||||
.directive('awxTablesUi', awxTablesUI.awxTablesUI)
|
||||
.run(function(editableOptions) {
|
||||
editableOptions.theme = 'bs3';
|
||||
editableOptions.activate = 'select';
|
||||
});
|
||||
|
||||
exports.tablesUI = tablesUI;
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/tables_ui.partial.svg');
|
||||
|
||||
function awxTablesUI () {
|
||||
return { restrict: 'E', templateUrl};
|
||||
}
|
||||
exports.awxTablesUI = awxTablesUI;
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/task_status.partial.svg');
|
||||
|
||||
function taskStatus () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.taskStatus = taskStatus;
|
||||
@@ -1,16 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
<g ng-attr-transform="translate({{-item.width}}, {{-item.height}})">
|
||||
<g ng-repeat="task in item.tasks | limitTo: -7">
|
||||
<g ng-if="task.working && current_scale > 0.5">
|
||||
<path ng-attr-transform="translate({{$index * 12 + 17}}, -5 ) rotate({{frame/3}})" class="NetworkUI__status-path" ng-attr-d="{{task.describeArc(0, 0, 5, 0, 270)}}"/>
|
||||
</g>
|
||||
<g ng-if="!task.working && current_scale > 0.5">
|
||||
<circle ng-attr-cx="{{$index * 12 + 17}}"
|
||||
ng-attr-cy="-5"
|
||||
r=5
|
||||
ng-attr-class="{{task.status === null ? 'NetworkUI--hidden' : task.status ? 'NetworkUI__status--pass': 'NetworkUI__status--fail'}}"
|
||||
|
||||
</circle>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
@@ -1,6 +1,6 @@
|
||||
<g ng-if="test_results.length > 0">
|
||||
<g ng-attr-transform="translate({{graph.width - 300}}, {{graph.height-500}})">
|
||||
<rect class="NetworkUI__test_results" width="280" height="480" x="0" y="0">
|
||||
<g ng-attr-transform="translate({{graph.width - 300}}, {{graph.height-(20 * tests.length + 60)}})">
|
||||
<rect class="NetworkUI__test_results" width="280" ng-attr-height="{{(20 * tests.length + 40)}}" x="0" y="0">
|
||||
</rect>
|
||||
<g transform="translate(20, 20)">
|
||||
<text class="NetworkUI__text">Test Results {{version}}</text>
|
||||
|
||||
@@ -38,7 +38,6 @@ _Past.prototype.start = function (controller) {
|
||||
|
||||
_Past.prototype.onMessage = function(controller, msg_type, message) {
|
||||
|
||||
//console.log(message.data);
|
||||
var type_data = JSON.parse(message.data);
|
||||
var type = type_data[0];
|
||||
var data = type_data[1];
|
||||
@@ -68,7 +67,6 @@ _Past.prototype.onMessage = function(controller, msg_type, message) {
|
||||
|
||||
_Past.prototype.onMultipleMessage = function(controller, msg_type, message) {
|
||||
var i = 0;
|
||||
console.log(['MultipleMessage', message]);
|
||||
if (message.sender !== controller.scope.client_id) {
|
||||
for (i=0; i< message.messages.length; i++) {
|
||||
controller.handle_message(message.messages[i].msg_type, message.messages[i]);
|
||||
@@ -126,27 +124,11 @@ _Past.prototype.onViewPort = function(controller, msg_type, message) {
|
||||
controller.scope.updateScaledXY();
|
||||
controller.scope.updatePanAndScale();
|
||||
};
|
||||
_Past.prototype.onTouchEvent = function(controller, msg_type, message) {
|
||||
if (message.sender === controller.scope.client_id) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
if (message.type === "touchstart") {
|
||||
controller.scope.onTouchStart(message);
|
||||
}
|
||||
if (message.type === "touchend") {
|
||||
controller.scope.onTouchEnd(message);
|
||||
}
|
||||
if (message.type === "touchmove") {
|
||||
controller.scope.onTouchMove(message);
|
||||
}
|
||||
};
|
||||
_Past.prototype.onMouseEvent = function(controller, msg_type, message) {
|
||||
if (message.sender === controller.scope.client_id) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
//console.log(message);
|
||||
if (message.type === "mousemove") {
|
||||
controller.scope.onMouseMove(message);
|
||||
}
|
||||
@@ -164,7 +146,6 @@ _Past.prototype.onMouseEvent = function(controller, msg_type, message) {
|
||||
}
|
||||
};
|
||||
_Past.prototype.onMouseWheelEvent = function(controller, msg_type, message) {
|
||||
console.log(message);
|
||||
if (message.sender === controller.scope.client_id) {
|
||||
return;
|
||||
}
|
||||
@@ -177,7 +158,6 @@ _Past.prototype.onKeyEvent = function(controller, msg_type, message) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
//console.log(message);
|
||||
if (message.type === "keydown") {
|
||||
controller.scope.onKeyDown(message);
|
||||
}
|
||||
@@ -189,7 +169,6 @@ _Past.prototype.onMouseWheel = function (controller, msg_type, message) {
|
||||
var delta = message[1];
|
||||
|
||||
if ($event.originalEvent.metaKey) {
|
||||
//console.log(delta);
|
||||
if (delta < 0) {
|
||||
this.undo(controller);
|
||||
} else if (delta > 0) {
|
||||
@@ -204,7 +183,6 @@ _Past.prototype.onMouseWheel.transitions = ['Present'];
|
||||
|
||||
_Past.prototype.onKeyDown = function(controller, msg_type, $event) {
|
||||
|
||||
//console.log($event);
|
||||
|
||||
if ($event.key === 'z' && $event.metaKey && ! $event.shiftKey) {
|
||||
this.undo(controller);
|
||||
@@ -266,7 +244,6 @@ _Start.prototype.start.transitions = ['Present'];
|
||||
|
||||
_Present.prototype.onMessage = function(controller, msg_type, message) {
|
||||
|
||||
//console.log(message.data);
|
||||
var type_data = JSON.parse(message.data);
|
||||
var type = type_data[0];
|
||||
var data = type_data[1];
|
||||
@@ -293,7 +270,6 @@ _Present.prototype.onMessage = function(controller, msg_type, message) {
|
||||
_Present.prototype.onMultipleMessage = function(controller, msg_type, message) {
|
||||
|
||||
var i = 0;
|
||||
console.log(['MultipleMessage', message]);
|
||||
if (message.sender !== controller.scope.client_id) {
|
||||
for (i = 0; i< message.messages.length; i++) {
|
||||
controller.handle_message(message.messages[i].msg_type, message.messages[i]);
|
||||
@@ -305,10 +281,6 @@ _Present.prototype.onDeviceStatus = function(controller, msg_type, message) {
|
||||
controller.scope.onDeviceStatus(message);
|
||||
};
|
||||
|
||||
_Present.prototype.onTaskStatus = function(controller, msg_type, message) {
|
||||
controller.scope.onTaskStatus(message);
|
||||
};
|
||||
|
||||
_Present.prototype.onFacts = function(controller, msg_type, message) {
|
||||
controller.scope.onFacts(message);
|
||||
};
|
||||
@@ -428,24 +400,6 @@ _Present.prototype.onViewPort = function(controller, msg_type, message) {
|
||||
controller.scope.updateScaledXY();
|
||||
controller.scope.updatePanAndScale();
|
||||
};
|
||||
_Present.prototype.onTouchEvent = function(controller, msg_type, message) {
|
||||
if (!controller.scope.replay) {
|
||||
return;
|
||||
}
|
||||
if (message.sender === controller.scope.client_id) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
if (message.type === "touchstart") {
|
||||
controller.scope.onTouchStart(message);
|
||||
}
|
||||
if (message.type === "touchend") {
|
||||
controller.scope.onTouchEnd(message);
|
||||
}
|
||||
if (message.type === "touchmove") {
|
||||
controller.scope.onTouchMove(message);
|
||||
}
|
||||
};
|
||||
_Present.prototype.onMouseEvent = function(controller, msg_type, message) {
|
||||
if (!controller.scope.replay) {
|
||||
return;
|
||||
@@ -454,7 +408,6 @@ _Present.prototype.onMouseEvent = function(controller, msg_type, message) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
//console.log(message);
|
||||
if (message.type === "mousemove") {
|
||||
controller.scope.onMouseMove(message);
|
||||
}
|
||||
@@ -472,7 +425,6 @@ _Present.prototype.onMouseWheelEvent = function(controller, msg_type, message) {
|
||||
if (!controller.scope.replay) {
|
||||
return;
|
||||
}
|
||||
console.log(message);
|
||||
if (message.sender === controller.scope.client_id) {
|
||||
return;
|
||||
}
|
||||
@@ -488,7 +440,6 @@ _Present.prototype.onMouseWheelEvent = function(controller, msg_type, message) {
|
||||
return;
|
||||
}
|
||||
message.preventDefault = util.noop;
|
||||
//console.log(message);
|
||||
if (message.type === "keydown") {
|
||||
controller.scope.onKeyDown(message);
|
||||
}
|
||||
@@ -500,7 +451,6 @@ _Present.prototype.onMouseWheel = function (controller, msg_type, message) {
|
||||
var delta = message[1];
|
||||
|
||||
if ($event.originalEvent.metaKey) {
|
||||
//console.log(delta);
|
||||
if (delta < 0) {
|
||||
this.undo(controller);
|
||||
}
|
||||
@@ -513,7 +463,6 @@ _Present.prototype.onMouseWheel.transitions = ['Past'];
|
||||
|
||||
_Present.prototype.onKeyDown = function(controller, msg_type, $event) {
|
||||
|
||||
//console.log($event);
|
||||
|
||||
if ($event.key === 'z' && $event.metaKey && ! $event.shiftKey) {
|
||||
this.undo(controller);
|
||||
@@ -543,7 +492,6 @@ _Present.prototype.undo = function(controller) {
|
||||
|
||||
|
||||
_Present.prototype.onTestCase = function(controller, msg_type, message) {
|
||||
console.log([msg_type, message]);
|
||||
if ('runnable' in message[1]) {
|
||||
if (!message[1].runnable) {
|
||||
return;
|
||||
@@ -557,6 +505,5 @@ _Present.prototype.onTestCase = function(controller, msg_type, message) {
|
||||
};
|
||||
|
||||
_Present.prototype.onError = function(controller, msg_type, message) {
|
||||
console.log(["onError", msg_type, message]);
|
||||
throw new Error("ServerError: " + message);
|
||||
};
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* Copyright (c) 2017 Red Hat, Inc. */
|
||||
|
||||
const templateUrl = require('~network-ui/touch.partial.svg');
|
||||
|
||||
function touch () {
|
||||
return { restrict: 'A', templateUrl};
|
||||
}
|
||||
exports.touch = touch;
|
||||
@@ -1,4 +0,0 @@
|
||||
<!-- Copyright (c) 2017 Red Hat, Inc. -->
|
||||
<g ng-attr-transform="translate({{touch.screenX}},{{touch.screenY}})">
|
||||
<circle ng-attr-class="{{touch.hidden && 'NetworkUI--hidden' || 'NetworkUI__touch'}}" cx=0 cy=0 r=40></circle>
|
||||
</g>
|
||||
@@ -21,13 +21,6 @@ tower.config(function($stateProvider, $urlRouterProvider) {
|
||||
url: '/topology',
|
||||
template: "<awx-network-ui></awx-network-ui>"
|
||||
});
|
||||
|
||||
$stateProvider
|
||||
.state({
|
||||
name: 'tables',
|
||||
url: '/tables',
|
||||
template: "<awx-tables-ui></awx-tables-ui>"
|
||||
});
|
||||
});
|
||||
|
||||
exports.tower = tower;
|
||||
|
||||
@@ -56,34 +56,6 @@ _Ready.prototype.onMouseDown = function (controller) {
|
||||
};
|
||||
_Ready.prototype.onMouseDown.transitions = ['Pressed'];
|
||||
|
||||
_Ready.prototype.onTouchStart = function (controller, msg_type, event) {
|
||||
|
||||
if (event.touches.length === 2) {
|
||||
|
||||
controller.scope.lastPanX = controller.scope.panX;
|
||||
controller.scope.lastPanY = controller.scope.panY;
|
||||
controller.scope.lastScale = controller.scope.current_scale;
|
||||
|
||||
var x1 = event.touches[0].screenX;
|
||||
var y1 = event.touches[0].screenY;
|
||||
var x2 = event.touches[1].screenX;
|
||||
var y2 = event.touches[1].screenY;
|
||||
var d = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
||||
var xb = (x2 + x1) / 2;
|
||||
var yb = (y2 + y1) / 2;
|
||||
|
||||
controller.scope.touch_data = {x1: x1,
|
||||
y1: y1,
|
||||
x2: x2,
|
||||
y2: y2,
|
||||
d: d,
|
||||
xb: xb,
|
||||
yb: yb};
|
||||
controller.changeState(Pressed);
|
||||
}
|
||||
};
|
||||
_Ready.prototype.onTouchStart.transitions = ['Pressed'];
|
||||
|
||||
_Ready.prototype.onMouseWheel = function (controller, msg_type, $event) {
|
||||
|
||||
controller.changeState(Scale);
|
||||
@@ -121,8 +93,6 @@ _Pressed.prototype.onMouseUp = function (controller) {
|
||||
};
|
||||
_Pressed.prototype.onMouseUp.transitions = ['Ready'];
|
||||
|
||||
_Pressed.prototype.onTouchEnd = _Pressed.prototype.onMouseUp;
|
||||
|
||||
_Pressed.prototype.onMouseMove = function (controller, msg_type, $event) {
|
||||
|
||||
controller.changeState(Pan);
|
||||
@@ -130,8 +100,6 @@ _Pressed.prototype.onMouseMove = function (controller, msg_type, $event) {
|
||||
};
|
||||
_Pressed.prototype.onMouseMove.transitions = ['Pan'];
|
||||
|
||||
_Pressed.prototype.onTouchMove = _Pressed.prototype.onMouseMove;
|
||||
|
||||
_Pan.prototype.onMouseMove = function (controller) {
|
||||
|
||||
controller.scope.panX = (controller.scope.mouseX - controller.scope.pressedX) + controller.scope.lastPanX;
|
||||
@@ -140,39 +108,9 @@ _Pan.prototype.onMouseMove = function (controller) {
|
||||
controller.scope.updatePanAndScale();
|
||||
};
|
||||
|
||||
_Pan.prototype.onTouchMove = function (controller, msg_type, event) {
|
||||
|
||||
|
||||
if (event.touches.length === 2) {
|
||||
var x1 = event.touches[0].screenX;
|
||||
var y1 = event.touches[0].screenY;
|
||||
var x2 = event.touches[1].screenX;
|
||||
var y2 = event.touches[1].screenY;
|
||||
var d = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
||||
var xb = (x2 + x1) / 2;
|
||||
var yb = (y2 + y1) / 2;
|
||||
var delta = d - controller.scope.touch_data.d;
|
||||
|
||||
controller.scope.panX = (xb - controller.scope.touch_data.xb) + controller.scope.lastPanX;
|
||||
controller.scope.panY = (yb - controller.scope.touch_data.yb) + controller.scope.lastPanY;
|
||||
controller.scope.updateScaledXY();
|
||||
|
||||
var new_scale = Math.max(0.1, Math.min(10, (controller.scope.lastScale + delta / 100)));
|
||||
var new_panX = xb - new_scale * ((xb - controller.scope.panX) / controller.scope.lastScale);
|
||||
var new_panY = yb - new_scale * ((yb - controller.scope.panY) / controller.scope.lastScale);
|
||||
controller.scope.current_scale = new_scale;
|
||||
controller.scope.panX = new_panX;
|
||||
controller.scope.panY = new_panY;
|
||||
controller.scope.updatePanAndScale();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
_Pan.prototype.onMouseUp = function (controller) {
|
||||
|
||||
controller.changeState(Ready);
|
||||
|
||||
};
|
||||
_Pan.prototype.onMouseUp.transitions = ['Ready'];
|
||||
|
||||
_Pan.prototype.onTouchEnd = _Pan.prototype.onMouseUp;
|
||||
|
||||
Reference in New Issue
Block a user