1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #2083 from jaredevantabor/awx-net-zoom-default

Sets default zoom to 100% on network UI
This commit is contained in:
Jared Tabor 2018-06-07 11:42:36 -07:00 committed by GitHub
commit 86f840f220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 8 deletions

View File

@ -241,7 +241,7 @@ def ws_connect(message):
if topology_id is not None:
topology = Topology.objects.get(pk=topology_id)
else:
topology = Topology(name="topology", scale=1.0, panX=0, panY=0)
topology = Topology(name="topology", scale=0.7, panX=0, panY=0)
topology.save()
TopologyInventory(inventory_id=inventory_id, topology_id=topology.pk).save()
topology_id = topology.pk
@ -322,4 +322,3 @@ def ws_message(message):
def ws_disconnect(message):
if 'topology_id' in message.channel_session:
channels.Group("topology-%s" % message.channel_session['topology_id']).discard(message.reply_channel)

View File

@ -196,7 +196,7 @@ def test_ws_connect_new_topology():
mock.patch.object(Inventory, 'objects') as inventory_objects:
client_mock.uuid4 = mock.MagicMock(return_value="777")
topology_mock.return_value = Topology(
name="topology", scale=1.0, panX=0, panY=0, pk=999)
name="topology", scale=0.7, panX=0, panY=0, pk=999)
inventory_objects.get.return_value = mock.Mock(admin_role=[mock_user])
awx.network_ui.consumers.ws_connect(message)
message.reply_channel.send.assert_has_calls([

View File

@ -29,7 +29,7 @@ def test_deletion():
host1 = inv.hosts.create(name='foo')
host2 = inv.hosts.create(name='bar')
topology = Topology.objects.create(
name='inv', scale=1.0, panX=0.0, panY=0.0
name='inv', scale=0.7, panX=0.0, panY=0.0
)
inv.topologyinventory_set.create(topology=topology)
device1 = topology.device_set.create(name='foo', host=host1, x=0.0, y=0.0, cid=1)

View File

@ -62,7 +62,7 @@ _Enabled.prototype.onKeyDown = function(controller, msg_type, $event) {
}
if ($event.key === '0') {
scope.jump_to_animation(0, 0, 1.0);
scope.jump_to_animation(0, 0, 0.7);
}
controller.delegate_channel.send(msg_type, $event);
@ -83,5 +83,3 @@ _Disabled.prototype.onEnable = function (controller) {
};
_Disabled.prototype.onEnable.transitions = ['Enabled'];

View File

@ -81,7 +81,7 @@ var NetworkUIController = function($scope,
$scope.onMouseLeaveResult = "";
$scope.onMouseMoveResult = "";
$scope.onMouseMoveResult = "";
$scope.current_scale = 1.0;
$scope.current_scale = 0.7;
$scope.current_mode = null;
$scope.panX = 0;
$scope.panY = 0;