mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Fixes some bugs from PR feedback
* Fixes bug where new devices on the canvas weren't added to the search dropdown * Fixes bug with closing the details panel * Changes the fill color to white for remote-selected devices * Fixes read-only mode by swapping out move controller for move read-only * Updates range on the zoom widget
This commit is contained in:
parent
8086906a43
commit
883545d4cb
@ -175,6 +175,7 @@ _Ready.prototype.onPasteDevice = function (controller, msg_type, message) {
|
||||
scope.selected_devices.push(device);
|
||||
device.selected = true;
|
||||
console.log(c_messages);
|
||||
scope.$emit('awxNet-addSearchOption', device);
|
||||
scope.send_control_message(new messages.MultipleMessage(controller.scope.client_id, c_messages));
|
||||
controller.changeState(Selected2);
|
||||
};
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
$scope.parseType = 'yaml';
|
||||
$scope.formCancel = function(){
|
||||
$scope.$parent.$$childTail.closeDetailsPanel();
|
||||
$scope.$parent.$broadcast('awxNet-closeDetailsPanel');
|
||||
};
|
||||
|
||||
$scope.formSave = function(){
|
||||
|
||||
@ -115,6 +115,7 @@
|
||||
min-width: 500px;
|
||||
padding-right: 20px;
|
||||
height: 40px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.Networking-actionsDropDownContainer{
|
||||
@ -127,7 +128,6 @@
|
||||
|
||||
.Networking-searchBarContainer{
|
||||
height: 30px;
|
||||
flex: 1 0 auto;
|
||||
display: flex;
|
||||
margin-top:-5px;
|
||||
margin-left: 5px;
|
||||
|
||||
@ -58,7 +58,8 @@ function NetworkingController (models, $state, $scope, strings) {
|
||||
value: device.id,
|
||||
text: device.name,
|
||||
label: device.name,
|
||||
id: device.id
|
||||
id: device.id,
|
||||
type: device.type
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -195,14 +195,14 @@ var NetworkUIController = function($scope,
|
||||
$scope.hotkeys_controller = new fsm.FSMController($scope, "hotkeys_fsm", hotkeys.Start, $scope);
|
||||
$scope.keybindings_controller = new fsm.FSMController($scope, "keybindings_fsm", keybindings.Start, $scope);
|
||||
$scope.view_controller = new fsm.FSMController($scope, "view_fsm", view.Start, $scope);
|
||||
$scope.move_controller = new fsm.FSMController($scope, "move_fsm", $scope.canEdit ? move.Start : move.Disable, $scope);
|
||||
$scope.move_readonly_controller = new fsm.FSMController($scope, "move_readonly_fsm", !$scope.canEdit? move_readonly.Start : move_readonly.Disable, $scope);
|
||||
$scope.move_controller = new fsm.FSMController($scope, "move_fsm", move.Start, $scope);
|
||||
$scope.move_readonly_controller = new fsm.FSMController($scope, "move_readonly_fsm", move_readonly.Start, $scope);
|
||||
$scope.details_panel_controller = new fsm.FSMController($scope, "details_panel_fsm", details_panel_fsm.Start, $scope);
|
||||
$scope.buttons_controller = new fsm.FSMController($scope, "buttons_fsm", buttons.Start, $scope);
|
||||
$scope.time_controller = new fsm.FSMController($scope, "time_fsm", time.Start, $scope);
|
||||
$scope.test_controller = new fsm.FSMController($scope, "test_fsm", test_fsm.Start, $scope);
|
||||
|
||||
$scope.inventory_toolbox_controller = new fsm.FSMController($scope, "toolbox_fsm", !$scope.canEdit ? toolbox_fsm.Disabled : toolbox_fsm.Start, $scope);
|
||||
$scope.inventory_toolbox_controller = new fsm.FSMController($scope, "toolbox_fsm", toolbox_fsm.Start, $scope);
|
||||
|
||||
var toolboxTopMargin = $('.Networking-top').height();
|
||||
var toolboxTitleMargin = toolboxTopMargin + 35;
|
||||
@ -332,21 +332,33 @@ var NetworkUIController = function($scope,
|
||||
$scope.view_controller.delegate_channel = new fsm.Channel($scope.view_controller,
|
||||
$scope.keybindings_controller,
|
||||
$scope);
|
||||
$scope.move_controller.delegate_channel = new fsm.Channel($scope.move_controller,
|
||||
$scope.view_controller,
|
||||
$scope);
|
||||
$scope.move_readonly_controller.delegate_channel = new fsm.Channel($scope.move_readonly_controller,
|
||||
if ($scope.canEdit) {
|
||||
$scope.move_controller.delegate_channel = new fsm.Channel($scope.move_controller,
|
||||
$scope.view_controller,
|
||||
$scope);
|
||||
$scope.details_panel_controller.delegate_channel = new fsm.Channel($scope.details_panel_controller,
|
||||
$scope.move_controller,
|
||||
$scope);
|
||||
$scope.details_panel_controller.delegate_channel = new fsm.Channel($scope.details_panel_controller,
|
||||
$scope.move_readonly_controller,
|
||||
$scope);
|
||||
$scope.inventory_toolbox_controller.delegate_channel = new fsm.Channel($scope.inventory_toolbox_controller,
|
||||
$scope.details_panel_controller,
|
||||
$scope);
|
||||
$scope.buttons_controller.delegate_channel = new fsm.Channel($scope.buttons_controller,
|
||||
$scope.inventory_toolbox_controller,
|
||||
$scope);
|
||||
} else {
|
||||
$scope.move_readonly_controller.delegate_channel = new fsm.Channel($scope.move_readonly_controller,
|
||||
$scope.view_controller,
|
||||
$scope);
|
||||
$scope.details_panel_controller.delegate_channel = new fsm.Channel($scope.details_panel_controller,
|
||||
$scope.move_readonly_controller,
|
||||
$scope);
|
||||
}
|
||||
if ($scope.canEdit) {
|
||||
$scope.inventory_toolbox_controller.delegate_channel = new fsm.Channel($scope.inventory_toolbox_controller,
|
||||
$scope.details_panel_controller,
|
||||
$scope);
|
||||
$scope.buttons_controller.delegate_channel = new fsm.Channel($scope.buttons_controller,
|
||||
$scope.inventory_toolbox_controller,
|
||||
$scope);
|
||||
} else {
|
||||
$scope.buttons_controller.delegate_channel = new fsm.Channel($scope.buttons_controller,
|
||||
$scope.details_panel_controller,
|
||||
$scope);
|
||||
}
|
||||
$scope.time_controller.delegate_channel = new fsm.Channel($scope.time_controller,
|
||||
$scope.buttons_controller,
|
||||
$scope);
|
||||
@ -614,7 +626,6 @@ var NetworkUIController = function($scope,
|
||||
|
||||
// Conext Menu Button Handlers
|
||||
$scope.removeContextMenu = function(){
|
||||
$scope.move_controller.handle_message("Ready", {});
|
||||
let context_menu = $scope.context_menus[0];
|
||||
context_menu.enabled = false;
|
||||
context_menu.x = -100000;
|
||||
@ -630,6 +641,8 @@ var NetworkUIController = function($scope,
|
||||
$scope.first_channel.send('DetailsPanelClose', {});
|
||||
};
|
||||
|
||||
$scope.$on('awxNet-closeDetailsPanel', $scope.closeDetailsPanel);
|
||||
|
||||
$scope.onDetailsContextButton = function () {
|
||||
function emitCallback(item, canAdd){
|
||||
$scope.first_channel.send('DetailsPanel', {});
|
||||
@ -843,7 +856,7 @@ var NetworkUIController = function($scope,
|
||||
|
||||
$scope.$on('awxNet-zoom', (e, zoomPercent) => {
|
||||
let v_center = $scope.to_virtual_coordinates($scope.graph.width/2, $scope.graph.height/2);
|
||||
let scale = Math.pow(10, (zoomPercent - 120) / 40);
|
||||
let scale = Math.pow(10, (zoomPercent - 120) / 120);
|
||||
$scope.jump_to_animation(v_center.x, v_center.y, scale, false);
|
||||
});
|
||||
|
||||
|
||||
@ -135,6 +135,7 @@
|
||||
.NetworkUI__router--remote-selected {
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
fill: @light-background
|
||||
}
|
||||
|
||||
.NetworkUI__router--selected-conflict {
|
||||
@ -170,6 +171,7 @@
|
||||
.NetworkUI__switch--remote-selected {
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
fill: @light-background
|
||||
}
|
||||
|
||||
.NetworkUI__switch--selected-conflict {
|
||||
@ -212,7 +214,7 @@
|
||||
}
|
||||
|
||||
.NetworkUI__rack--remote-selected {
|
||||
fill: @selected-mango;
|
||||
fill: @light-background;
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
}
|
||||
@ -281,7 +283,7 @@
|
||||
}
|
||||
|
||||
.NetworkUI__site--remote-selected {
|
||||
fill: @selected-mango;
|
||||
fill: @light-background;
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
}
|
||||
@ -363,7 +365,7 @@
|
||||
}
|
||||
|
||||
.NetworkUI__host--remote-selected {
|
||||
fill: @selected-mango;
|
||||
fill: @light-background;
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
}
|
||||
@ -414,7 +416,7 @@
|
||||
}
|
||||
|
||||
.NetworkUI__device--remote-selected {
|
||||
fill: @selected-mango;
|
||||
fill: @light-background;
|
||||
stroke: @selected-mango;
|
||||
stroke-width: 10;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ export default [
|
||||
if(scale && updateBoolean){
|
||||
// scale is included, meaning this was triggered by
|
||||
// the view FSM's onMouseWheel transition
|
||||
let sliderPercent = 40 * (Math.log10(scale) + 3);
|
||||
let sliderPercent = 120 * (Math.log10(scale) + 1);
|
||||
scope.zoom = Math.round(sliderPercent / 10) * 10;
|
||||
}
|
||||
$("#networking-slider").slider('value', scope.zoom);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user