16566 Commits

Author SHA1 Message Date
Ben Thomasson
00a9283e32
Adds an API for network UI, action plugins, and API client
* Adds a simple DRF API for network-ui
* Moves network_ui api to v1_api
* Uses BaseSerializer for networking v1 api
* Adds v2 of the network API
* Uses standard AWX base classes for the network UI API
* Adds canvas prefix to network UI api URL names
* Adds ansible action plugins for automating network UI workflows
* Adds python client for the networking visualization API
2018-03-23 17:00:22 -04:00
Ben Thomasson
2736aecfb2
Adds context menus for group, racks, and sites
* Adds context menu for a rack, and adding more error handling for
    items that don't exist in Tower
* Adds context menu for sites
* Adds handler for showing details for links and interfaces
* Fixes the removed "watchCollection" in order to update details panel
* Removes the context menu when changing the scale of the canvas
* Adds delete context menu button, as well as refactoring the delete
    functionality to the network.ui.controller.js
* Updates delete functionality to delete nested groups/devices
    if the current_scale is set to site or rack icons
* Adds context menu to a group
* Hides rack/site title in top left of group, as well as centering
    labels on all icons
* Moves the context menu off screen when disabling it
* Adds unique name to hosts, routers, switches, and groups
* Makes the names of host/switch/router/group SVG elements so they update when
    the user updates the name of the SVG element
* Removing svg buttons and adding new html toolbar
* Adds panel for Jump To feature, along with basic functionality
* Adds Key dropdown for hotkeys and adding browser refresh hotkey
* Adds breadcrumb bar and making adjustments after feedback with UX
* Rearrages panels and adding some resize logic
* Fixes z-index of key-panel  and jump-to panel
* Adds white background to text underneath icons
* Makes all icons blue
* Changes sizes and colors of icons. Also made icon text background white
* Adjusts sizes of rack and site icons within group boundary
2018-03-23 17:00:21 -04:00
Ben Thomasson
7f0b23c357
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
2018-03-23 17:00:21 -04:00
Ben Thomasson
bf7f4ee1e1
Adds network UI test framework
This adds a test framework to drive UI tests from the client
instead of injecting events from the websocket.  Tests consist
of a pair of snapshots (before and after the test) and
a list of UI events to process.  Tests are run using a FSM
in the client that controls the resetting of state to the snapshot,
injecting the events into the UI, recording test coverage,
and reporting tests to the server.

* Adds design for event trace table
* Adds design for a coverage tracking table
* Adds models for EventTrace and Coverage
* Adds trace_id to recording messages
* Adds design for TopologySnapshot table
* Adds order to TopologySnapshot table
* Adds TopologySnapshot table
* Adds Snapshot message when recordings are started and stoppped
* Adds models for tracking test cases and test results
* Adds designs for a test runner FSM
* Updates test management commands with new schema
* Adds download recording button
* Adds models to track tests
* Adds ui test runner
* Adds id and client to TestResult design
* Adds id and client to TestResult
* Update message types
* Stores test results and code coverage from the test runner
* Adds tool to generate a test coverage report
* Adds APIs for tests and code coverage
* Adds per-test-case coverage reports
* Breaks out coverage for loading the modules from the tests
* Re-raises server-side errors
* Captures errors during tests
* Adds defaults for host name and host type
* Disables test FSM trace storage
* Adds support for sending server error message to the client
* Resets the UI flags, history, and toolbox contents between tests
* Adds istanbul instrumentation to network-ui
2018-03-23 17:00:21 -04:00
Ben Thomasson
eeaf7c257c
Fixes #945 by removing the network_ui plugin 2018-03-23 17:00:20 -04:00
Jared Tabor
050f43e3bf
Improves host details panel UI
* Hooks up the first two context menu buttons
* Makes the rename and details menu show up
    wherever the user's cursor's location
* Adds TopologyInventory and DeviceHost tables
* Adds design for host_id on the Device table
* Adds migrations for TopologyInventory
* Adds host_id to Device table
* Adds inventory_id and host_id tracking
* Auto-closes the right hand panel if focus is directed to the canvas.
* Retrieves the host details on inventory load.
* Adds back support for inventory and host_id tracking
* Adds host icon
* Changes rack icon to new icon
* Site icon replacement
* Fixes host icon "hitbox", and adding debug and construction
* Adds construction and debug lines for switch, router, rack, and site
* Adds some error handling for REST calls, as well as alert on
    host detail panel.
2018-03-23 17:00:20 -04:00
Ben Thomasson
1c1844d889
Reorganizes the network-ui code under awx/client/src/network-ui
* Moves network UI source to awx/client/src/network-ui
* Moves network ui partials to awx/ui/client/network-ui
* Renames widgets with suffix partial.svg
* Updates directives to use bundled partials
* Uses ~network-ui for loading UI component
2018-03-23 17:00:20 -04:00
Ben Thomasson
f6eecad25e
Adds explicit channels between FSMs to add in tracing message flows.
* Adds channels between FSMs
* Adds FSMTrace model
* Adds FSMTrace storage and download

Channels between FSMs make the processing pipeline delegation explicit
and allow for better instrumentation to trace the state of the entire
pipeline including FSM state transitions and message flow through
the pipeline.  This feature is not turned on by default and is
only necessary for debugging or certain kinds of testing.
2018-03-23 17:00:19 -04:00
Jared Tabor
a1f639bc8f
Adds host detail panel UI and improves toolbox UI
* Changes Layers' panel's default setting to not expanded
* Adds OffScreen2 state to handle the case where a toolbox is both offscreen and disabled
* Adds a collapsed view of the toolbox, as well as a model for ActionIcons
    which is a model whose purpose is to connect the button FSM with the
    chevron icons that are used on the toolbox.
* Adds action-icon directive
* Enables/disables the icons if they're not shown
* Fixes initial state of the toolboxes
* Creates context menu and context menu buttons in the network UI
* Adds extra vars to details panel on left hand side
2018-03-23 17:00:19 -04:00
Ben Thomasson
519983308a
Adds content to CONTRIBUTING.md
* Adds SVG intro to CONTRIBUTING.md
* Add FSM intro
* Add rendered images of the FSM designs
* Adding example
* Adding links
* Adds details about the FSM design workflows
* Adds FSM state docs
* Adds event handler docs
* Adds details about FSMController
* Adds example of making an FSMController
* Adds details about messages, models, and message passing
* Adds models and messages to CONTRIBUTING.md
* Adds example to widget development
* Adds detail to the widget development example
* Add message type definitions
2018-03-23 17:00:19 -04:00
Ben Thomasson
809eafe9a9
Adds devserver support
* Adds support for webpack devserver
* Enable istanbul on network UI
* Enable capture and replay tests on the network ui
* Normalize mouse wheel events
* Fix missing trailing slash on hosts API
* Add Export YAML button
2018-03-23 17:00:18 -04:00
Ben Thomasson
2713ec2dd5
Adds Red Hat copyright notice 2018-03-23 17:00:18 -04:00
Jared Tabor
2a8ced5a5d
Adds network UI shell wrapper
* Adds networking icons, state, and shell
* Adds network UI to the network UI shell.
* Removes jquery as a dependency of network-ui
* Fills the entire viewport with the network canvas and
    makes header panel and the right panel overlay on
    top of it
2018-03-23 17:00:18 -04:00
Ben Thomasson
09d461b1d0
Improves FSM design and adds tools to diff design and implementation.
* Resolves conflicts between designs and implementation
* Adding fsm_diff to network_ui/tools
* Add extract.js for FSM toolchain to network_ui
2018-03-23 17:00:17 -04:00
Ben Thomasson
56991552d2
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.
2018-03-23 17:00:17 -04:00
Ben Thomasson
3f84ef69eb
Adds facts processing for ansible_net_neighbors
* Adds logic for consuming ansible_net_neighbors facts

This consumes facts emitted from Ansible over a websocket to
Tower.  This allows consumers in network to process the facts and
emit messges to the network UI.  This requires a special callback
plugin to run in Tower to emit the messages into the websocket using
the python websocket-client library.
2018-03-23 17:00:17 -04:00
Ben Thomasson
6f1000cd94
Adds toolbox to network UI
* Calls API to get inventory
* Adds CopySite message
* Adds Toolbox and ToolboxItem model design
* Add Toolbox and ToolboxItem tables
* Sends toolbox items to client from server on connect
2018-03-23 17:00:17 -04:00
Ben Thomasson
c79ef60d8b
Adds streams and processes for application design
Adds application level streams and process widgets to
model applications that run on networking devices or hosts.

* Changes Application to Process
* Adds StreamCreate and ProcessCreate messages
* Adds process id sequence to device
* Add serializers for streams and processes
2018-03-23 17:00:16 -04:00
Ben Thomasson
d153d5f907
Adds a type field to group to support racks and sites
* Add type support to Group
2018-03-23 17:00:16 -04:00
Ben Thomasson
9dc4e22fe6
Adds support for multiple view modes
Adds mulitple view modes based on zoom-level.  This allows for easy
drilling into a device for more detail or zooming-out for a overview.

* Adds support for multi-site and device modes
* Adds icons to remote device in device detail
* Adds site widget
* Adds link between sites
* Adds toolboxes for inventory, site, and applications
* Adds rack mode
* Adds UI for adding processes to devices
* Adds copy and paste support
* Adds streams
2018-03-23 17:00:16 -04:00
Ben Thomasson
8fb54efa8e
Adds a tabular view of the topology data
The traditional network engineer workflow includes a diagram, a
spreadsheet, and the CLI.  This adds an experimental view of the
network topology data in a spreadsheet like table view.

* Adds angular-xeditable dependency for tables view.
* Add data binding models
* Add message transformations from table to topology formats
* Adding dependencies for tables view
2018-03-23 17:00:15 -04:00
Ben Thomasson
d0e402c39a
Begins network-ui prototype integration into Tower UI.
* Moves network ui into a directive
* Adds awxNet prefix to network ui directives
* Adds a module to integrate the stand alone network UI with
    Tower UI.
* Adds reconnectingwebsocket to webpack bundle
* Adds configuration for webpack
* Moves ngTouch and hamsterjs to webpack vendor bundle
* Moves angular to network UI vendor bundle
* Adds ui-router dependency
* Changes CSS to BEM style
* Adds unique id sequences for devices and links on Topology and interfaces on Device
* Adds group widget with move, resize, delete, and edit label support
2018-03-23 17:00:15 -04:00
Ben Thomasson
640e687f3e
Adds JSON and YAML export of the network topology.
Adds views that export the entire network topology as JSON and YAML.
2018-03-23 17:00:15 -04:00
Ben Thomasson
257cf6a7d7
Adds callback plugin for network_ui
The callback plugin for the network UI adds real-time
event streaming to the canvas from Ansible events.
2018-03-23 17:00:14 -04:00
Ben Thomasson
701150bd1a
Adds configuration for the network-ui websocket
* Configures NGINX for the network-ui websocket.
* Configures supervisor.conf for network_ui websocket.
2018-03-23 17:00:14 -04:00
Ben Thomasson
48d801271c
Imports prototype from ansible-network-ui
The ansible-network-ui prototype project builds a standalone Network UI
outside of Tower as its own Django application. The original prototype
code is located here:
https://github.com/benthomasson/ansible-network-ui.

The prototype provides a virtual canvas that supports placing
networking devices onto 2D plane and connecting those devices together
with connections called links.  The point where the link connects
to the network device is called an interface.  The devices, interfaces,
and links may all have their respective names.  This models physical
networking devices is a simple fashion.

The prototype implements a pannable and zoomable 2D canvas in using SVG
elements and AngularJS directives.   This is done by adding event
listeners for mouse and keyboard events to an SVG element that fills the
entire browser window.

Mouse and keyboard events are handled in a processing pipeline where
the processing units are implemented as finite state machines that
provide deterministic behavior to the UI.

The finite state machines are built in a visual way that makes
the states and transitions clearly evident.  The visual tool for
building FSM is located here:
https://github.com/benthomasson/fsm-designer-svg.   This tool
is a fork of this project where the canvas is the same.  The elements
on the page are FSM states and the directional connections are called
transitions.   The bootstrapping of the FSM designer tool and
network-ui happen in parallel.  It was useful to try experiemental
code in FSM designer and then import it into network-ui.

The FSM designer tool provides a YAML description of the design
which can be used to generate skeleton code and check the implementation
against the design for discrepancies.

Events supported:

* Mouse click
* Mouse scroll-wheel
* Keyboard events
* Touch events

Interactions supported:

* Pan canvas by clicking-and-dragging on the background
* Zooming canvas by scrolling mousewheel
* Adding devices and links by using hotkeys
* Selecting devices, interaces, and links by clicking on their icon
* Editing labels on devices, interfaces, and links by double-clicking on
  their icon
* Moving devices around the canvas by clicking-and-dragging on their
  icon

Device types supported:

* router
* switch
* host
* racks

The database schema for the prototype is also developed with a visual
tool that makes the relationships in the snowflake schema for the models
quickly evident.  This tool makes it very easy to build queries across
multiple tables using Django's query builder.

See: https://github.com/benthomasson/db-designer-svg

The client and the server communicate asynchronously over a websocket.
This allows the UI to be very responsive to user interaction since
the full request/response cycle is not needed for every user
interaction.

The server provides persistence of the UI state in the database
using event handlers for events generated in the UI.  The UI
processes mouse and keyboard events, updates the UI, and
generates new types of events that are then sent to the server
to be persisted in the database.

UI elements are tracked by unique ids generated on the client
when an element is first created.  This allows the elements to
be correctly tracked before they are stored in the database.

The history of the UI is stored in the TopologyHistory model
which is useful for tracking which client made which change
and is useful for implementing undo/redo.

Each message is given a unique id per client and has
a known message type.  Message types are pre-populated
in the MessageType model using a database migration.

A History message containing all the change messages for a topology is
sent when the websocket is connected.  This allows for undo/redo work
across sessions.

This prototype provides a server-side test runner for driving
tests in the user interface.  Events are emitted on the server
to drive the UI.  Test code coverage is measured using the
istanbul library which produces instrumented client code.
Code coverage for the server is is measured by the coverage library.

The test code coverage for the Python code is 100%.
2018-03-23 17:00:14 -04:00
Shane McDonald
1595947ae2
Merge pull request #1663 from jakemcdermott/fix-docker-installer-paths
update reference to role file path to work with installer roles dir
2018-03-23 12:43:54 -04:00
Jake McDermott
4a8f24becc
update reference to role file path to work with roles dir 2018-03-23 12:43:13 -04:00
Ryan Petrello
07680dd7c0
Merge pull request #1652 from ryanpetrello/fix-500
send job notification templates _after_ all events have been processed
2018-03-23 10:51:06 -04:00
Michael Abashian
e7cfe1e0b6
Merge pull request #1640 from mabashian/1561-survey-multi-select
Fixed bug on non-required multiple choice survey questions
2018-03-23 09:31:56 -04:00
Michael Abashian
224d996b9c
Merge pull request #1622 from mabashian/169-prompt-cleanup
Propagate new launch/relaunch logic across the app
2018-03-23 09:31:33 -04:00
mabashian
7a4bc233f6 Pass job into the relaunch component rather than pull it from the parent. Added launch template component, use it on the templates lists. 2018-03-22 16:14:54 -04:00
Shane McDonald
caf576cac0
Merge pull request #1655 from shanemcd/devel
Move installer roles into roles directory
2018-03-22 14:39:03 -04:00
Shane McDonald
84cd933702 Move installer roles into roles directory
Signed-off-by: Shane McDonald <me@shanemcd.com>
2018-03-22 14:34:03 -04:00
mabashian
c3b32e2a73 Cleaned up awRequireMultiple and fixed broken survey question error messaging 2018-03-22 11:58:47 -04:00
Ryan Petrello
f59f47435b send job notification templates _after_ all events have been processed
see: https://github.com/ansible/awx/issues/500
2018-03-22 09:30:41 -04:00
Chris Meyers
ddf000e8e7
Merge pull request #1643 from chrismeyersfsu/fix-tower_special_group
do not allow tower group delete or name change
2018-03-22 08:06:03 -04:00
chris meyers
305ef6fa7e do not allow tower group delete or name change
* DO allow policy changes and other attribute changes
2018-03-22 08:05:06 -04:00
Chris Meyers
3446134501
Merge pull request #1646 from chrismeyersfsu/fix-kombu_unicode
use non-unicode queue names
2018-03-21 21:59:05 -04:00
Bill Nottingham
eae85e803e
Merge pull request #1644 from wenottingham/botbotbot
update team map
2018-03-21 19:35:58 -04:00
mabashian
8d04be0fc8 Fixed unit test failures 2018-03-21 19:22:08 -04:00
chris meyers
e0803b9f08 use non-unicode queue names
* Use unicode InstanceGroup and queue names up until the point we
actually create the queue
* kombu add_consumers returns a dict with a value that contians the
passed in queue name. Trouble is, the returned dict value is a string
and not a unicode string and this results in an error.
2018-03-21 16:50:07 -04:00
Chris Meyers
724812e87c
Merge pull request #1637 from chrismeyersfsu/fix-instance_removed_from_group
handle instance group names unicode
2018-03-21 15:47:00 -04:00
Bill Nottingham
45240a6bf0 update team map 2018-03-21 15:46:50 -04:00
mabashian
0cadea1cb5
Fixed bug preventing the user from ignoring a non-required multi-select survey question on launch 2018-03-21 14:55:38 -04:00
Alan Rominger
b3e15f70cb
Merge pull request #1612 from AlanCoding/token_no
Make user_capabilities False for read tokens
2018-03-21 14:45:19 -04:00
Ryan Petrello
a13ddff81a
Merge pull request #1627 from aperigault/fix_deprecation
Replace deprecated -U option by --become-user
2018-03-21 14:32:13 -04:00
Bill Nottingham
88ef889cf1
Merge pull request #1634 from wenottingham/winrm-rf
Cherry-pick fix for WinRM listener to AzureRM inventory script.
2018-03-21 14:13:08 -04:00
chris meyers
91bfed3d50 handle instance group names unicode 2018-03-21 13:41:48 -04:00
AlanCoding
4f1f578fde
make user_capabilities False for read tokens 2018-03-21 13:14:14 -04:00