Commit Graph

41 Commits

Author SHA1 Message Date
Kenji Ishii 295175826b Move js files into openstack_dashboard folder.
hozoin doc says that the horizon directory holds the generic
libraries and components that can be used in any Django project.

So, this patch move js files related with Openstack components into
openstack_dashboard folder.

Change-Id: Ib4ed05e1136ee3f70a201139e456d4c3b93519f3
Closes-bug: #1635519
2016-12-18 15:27:42 +09:00
Cao Xuan Hoang b01c028673 Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.

[1] http://docs.openstack.org/developer/hacking/#openstack-licensing

Change-Id: If9ae2195d23ee8ed4bfe3da136e647f4e291a415
2016-12-02 17:40:28 +07:00
woodm1979 7cbd3b7019 No more space-in-parens eslint errors
Running eslint is effectively useless nowdays because of the
overwhelming number of warnings returned.

This patch fixes the existing "space-in-parens" errors.

I've decided to only fix those errors here to keep the patch small, and
not destroy any chance of success by needing to rebase every 5 minutes.
Other fixes will be incoming.

Change-Id: Ie9292da293eea6a93751e6c17d24068b66c5d62a
Partial-Bug: #1554824
2016-07-22 15:27:22 -06:00
Itxaka 48ba05e75a Prevent duplicated ips on network topology
Do a check to see if the ip is already on the device
ip_addresses list before pushing it to prevent having
duplicated ips when the ports status changes.

Change-Id: I0a526f37faa2ef757cd5474c43264795d6b758ae
Closes-Bug: 1543312
2016-06-06 08:25:40 +00:00
David Lyle dd80909edf Adding old topology to compliment new
There has been user/operator feedback that the new network topology
satisfies different needs than the old did. The two are actually
complimentary rather than mutually exclusive. This patch allows for both
topologies to be visible on separate tabs. Both views share the same
data model, but renders that data differently.

One interesting inclusion is triggering a resize event if an HTML
element with the d3-container CSS class is present. The reason for this
is that the svg content in a non-visible tab is rendered into a container
with 0 height and width. This causes the contents to all sit in the top
left corner of the container. Without the resize event which is used to
trigger a redo of the force layout. The plus side is now this d3 based
network topology handles window resize events. I am open to suggestions
so that a resize event is not necessary on the tab show event.

An additional area for improvement is the inline CSS in
_svg_element.html

Implements blueprint: restore-old-net-topology
Change-Id: Iba6e6ad07b9ff7705f62cdb0281904880df6e4ba
2016-05-11 13:49:46 -06:00
Itxaka 58b905bf1c Allow deleting gateway interfaces on network topology
We didn't allow to delete a router_gateway interface from a router
in the network topology due to the checking being done
working only on normal interfaces.

Change-Id: I35f7fc7c0050e1441a740a110fb6f45ddec9371d
Closes-Bug: 1548224
2016-02-24 12:06:10 +01:00
Itxaka 031aed50a3 Translate status in network topology
Enables the translation of the status on
network topology.
Provides a json decoder that will resolve
lazy objects like translations.
Moves STATUS_DISPLAY_CHOICES and
ADMIN_STATE_DISPLAY_CHOICES out of the RoutersTable
for easy access to their status from other parts
of the code.
All network objects have their status translated
and a new item called original_status which provides
the untranslated status so the javascript code
is able to display the proper image (green/red)
based on the original status instead of doing it
on the translation.

Change-Id: Ic8cebafe7fbc291fa8933e8d1c2a244be20128e3
Closes-Bug: #1323599
Closes-Bug: #1484113
2016-01-18 13:19:20 +00:00
Steve McLellan 08609e6851 Set autodismissAlert on each alert
Alerts that are spawned from javascript aren't auto-dismissed because
horizon.autoDismissAlerts is only called once on page load (the network
topology JS calls it explictly to work around this). This patch sets the
autodismiss on each alert as it's created if applicable so that alerts
created by JS are also auto-dismissed, and calls the function on any
alerts created statically (i.e. in django code) at page load.

Change-Id: I7d42ba4fbc7565fb43fb0cc894154100e8fe0fe9
Closes-Bug: #1442288
2015-12-14 22:50:51 +00:00
Akihiro Motoki 5fc26b0a11 Replace "Terminate Instance" with "Delete Instance"
"Delete" is being used almost everywhere in OpenStack Dashboard
except the instance panel. Using "Delete" looks more consistent.
In addition, "Delete" tells non-native English speakers that
deleted instances will be no longer usable again compared to
"Terminate".

DocImpact
Closes-Bug: #1502773
Change-Id: Idccaf3c45566f20f11d02ada64c1d3934a6f3002
2015-11-30 03:55:19 +09:00
Michael Krotscheck 2aa78ad0b7 Enable no-unused-vars
This enables the no-unused-vars rule from the upstream
eslint-config-openstack, and corrects all linting errors found.

Change-Id: I9f5fb29cd9b2429698819ecf556ced933378b081
2015-11-18 10:14:28 -08:00
Michael Krotscheck 1dd3a7fd5b Enable no-multi-spaces
Enable the no-multi-spaces rule, and correct linting errors
where found.

Change-Id: Ia7ed2a35d69b455e92849df2ccde9d9cf8e7a104
2015-11-16 18:04:16 -08:00
Rajat Vig 7971f1a941 Fix lint errors for horizon.networktopology.js
Change-Id: Ia1e710504433d5f87134dcf4a550a9afc4095cc5
Partially-Implements: blueprint jscs-cleanup
2015-09-17 14:59:48 -07:00
Bradley Jones e0ac95be33 Add Curvature topology
Replace the current network topology with the visualisation from the Curvature
user interface

Implements: blueprint curvature-network-topology

Change-Id: I4435ab9b54ce51540c3346aa709f0fa8bbcb87b4
2015-09-11 16:35:22 +01:00
Thai Tran b4e92f7273 Jshint removing Hogan and static_url
Hogan and STATIC_URL are only use in a few files. Hence, we do not really
need them enabled globally. Removing them from jshint global config.

Change-Id: I0881ab0e6668a47bf795e422e17f9f025a010d31
Closes-bug: #1452464
2015-05-06 14:34:08 -07:00
Thai Tran 1ff3a4c03d Jshint unused and undef cleanup for networktopology JS
Removing unused and undefined variables in networktopology javascript.
This ensures that once we enable it globally, the gate will not barf.

Change-Id: Ia071199aef0f65fb56fe70475e8a47f89d8f9084
Partial-Bug: #1438620
2015-04-26 03:48:24 +00:00
Toshi Hayashi 004db117f2 Fix broken network topology css
Fixes toggle button, puts icon and changes bgcolor.
Changes the position of "Add interface" button in balloon.
Remove networktopology css from horizon.scss

Co-Authored-By: Lin Hua Cheng <os.lcheng@gmail.com>

Change-Id: I7c917ed6cd12481fde961320dcfa76e409c51e4c
Closes-Bug: 1351395
Partially-Implements: blueprint css-breakdown
2015-01-19 15:59:25 -08:00
Timur Sufiev 06fe25cba6 Add a graphical distinction for external networks at Topology page
Use font-awesome 'globe' glyph to indicate that network is
external. Also show a tooltip 'External Network' on hovering the
glyph.

Change-Id: I597e10a11e956a01874732bb0e9827262ebdad5d
Closes-Bug: #1381531
2014-12-22 12:49:42 -08:00
Doug Fish 863fa95250 add missing semicolon in networktopology
Add in the missing semicolon identified by jshint.

Change-Id: I0ee2a8c80347ba0026b2dd9cf2f1797e02a580c1
Closes-Bug: #1382825
2014-10-18 11:43:27 -05:00
Doug Fish 707f3f3ab7 Make labels in Network Topology translatable
Fix the button and object labels in the network topology pop ups to be
translatable and concatenation-free.  Use "None" as the not found value to be
consistent with the network ports detail screen.  This patch excludes
fixing the status values.

Partial-Bug: #1323599
Change-Id: Ia0c92842703109401d758d5ac3ccefab9ccf6971
2014-10-17 14:12:18 -05:00
Jenkins 6a08a25113 Merge "Added button Add Interface on Network Topology tab" 2014-07-02 05:23:57 +00:00
liuqing 78f8ba2321 Do not render port template if device has no port
Change-Id: Iacefbba64ee0cc534c3129a1c4b28025294c6b08
Closes-Bug: #1321974
2014-05-22 01:57:58 +00:00
facundo Farias 72fe47e413 Added button Add Interface on Network Topology tab
On the Network Topology tab, when a router is selected a new
button was added to allow it connect with different networks.
This change was made following the most simple mechanism that
I could find, please check if it is the correct behavior.

Change-Id: Ia08c5f22e3237fc4e90767a8becfe6413d754b04
Closes-Bug: #1288779
2014-04-23 08:30:12 +00:00
Maxime Vidori cd36d16d8b Replace Horizon cookies by the angular one
This change allow us to use the ngCookies module in the angular
app of Horizon, it also provide this service outside through the
horizon.cookies object.

Change-Id: I12d85efdff32ce4d7d6a9d3a65e1e93ec0bbc9a7
Implements: blueprint horizon-angular
Co-Authored-By: miziel-r <robert.mizielski@cloudwatt.com>
2014-04-14 17:53:19 +02:00
Kirill Izotov c109e9d993 Move Network topology init call to template
This will prevent Network topology init function from being called on every page

Change-Id: Ia1005e592b82c7a1641ba8b45362084829fc62da
Closes-Bug: #1195471
2014-02-05 11:30:17 +07:00
Maxime Vidori 6870eb605d Javascript prohibits the use of bitwise operators
Bitwise operators are very rare in JavaScript programs and
quite often & is simply a mistyped &&.

Implements: blueprint jshint-codestyle

Change-Id: Ib176d811f022782ab68ca97a42946f1aa9fec6cc
2014-01-29 10:10:34 +01:00
Juan Manuel Olle abff5a7a10 Translating entity types in network topology
Change-Id: I4f4e2898f18e994e7fdd29fdb1a478d461313e83
Partial-bug: #1226159
2014-01-22 13:39:08 -03:00
Maxime Vidori ae5730e255 Javascript force use of the identity operator
In order to reduce possible bugs in our scripts the use of identity
operator must be mandatory over the equality operator. This rule force
developers to use the '===' and '!==' instead of '==' and '!='.

Change-Id: I1069ed2baed7bce305fce80d688a5a2c10249148
Implements: blueprint jshint-codestyle
2014-01-02 15:58:43 +01:00
Maxime Vidori ce66bd8320 Javascript coding style indent 2
In order to improve the javascript coding style an indentation of
two spaces must be used in the whole project.
    A jshint option has been added, and all the files which violate
this rule have been corrected.
    In addition, some code style corrections have been made.

Implements: blueprint jshint-codestyle
Change-Id: Ic6428e77a06fd33b1c1298569fc01860c3e28690
2014-01-02 15:49:49 +01:00
Maxime Vidori 2a39926999 Removal of json2.js
As long as Horizon does not support any browser lower than IE8,
json2.js library is no longer needed, browsers have a native
implementation of JSON.stringify and JSON.parse.
    Removing this script allow us to reduce the javascript footprint
of Horizon.
    jQuery $.parseJSON will replace all parsing of JSON in order to
standardize the use of this functionnality.

Change-Id: Ifaf027e2adc462ee7b3d9587b28583ade376ccfc
2013-12-06 11:37:55 +01:00
Jenkins c77ef11a0f Merge "Change Network Topology panel so it stops polling ajax on error" 2013-12-03 09:32:12 +00:00
Radomir Dopieralski 27c72bd857 Fix bad line breaking and radix in JavaScript
Fix code that makes JSHint issue warnings about bad
line breaking and missing radix parameter to parseInt.

Change-Id: I3a7cd1b56921a70a5b393df05b30b71332c471ef
Implements: blueprint js-coding-style-checks
2013-12-02 13:16:30 +01:00
Radomir Dopieralski cc4577d89d Fix duplicate keys in JavaScript
Fix code that makes JSHint issue duplicate key warnings.

Change-Id: Ie5bb7e70753e0c1e72f110707e275077977fe71d
Implements: blueprint js-coding-style-checks
2013-11-29 08:52:26 +01:00
Radomir Dopieralski 6fe9cb8e7c Fix semicolons in JavaScript
Fix the code that makes JSHint issue warnings about missing
semicolons.

Change-Id: Id76ee094ae32cbb00f24b06b303a73fd258e5666
Implements: blueprint js-coding-style-checks
2013-11-27 14:58:42 +01:00
Rob Raymond 7f38e5486b Change Network Topology panel so it stops polling ajax on error
Change javascript so that we don't use interval that will always call
AJAX, instead only schedule next AJAX poll when we have successfully
finished the previous AJAX request.
This avoids many calls with errors if token times out.

Fixes bug #1253768

Change-Id: I74c4bf8cb931655ce64783ae11467183275386ab
2013-11-21 13:49:43 -07:00
liyingjun b643e430c8 Fixes inconsistent console problem
The `open console` link in `Network Topology` page is inconsistent with
console in `Instance Detail` page.

Fixes bug 1228990

Change-Id: I845a9fa4cc17a296bde5da624d3b8833fef9ade6
2013-09-23 11:04:44 +08:00
Toshi Hayashi 88b9335910 Delete and launch devices on the topology view
This feature enables to delete and launch a instance or router on the network
topology view. So you can do basic actions on this view.
Also it enables to change view small or normal. You can see more networks and
devices in the small view.

implements bp editable-network-topology-view

fixes bug #1215683

Change-Id: Ie65d50d2a99f72696c8f10223f8430ad5f90b144
2013-08-29 00:07:27 -07:00
Ryan Petrello 16d12aebf9 Fix a few visual issues on the network topology diagram.
This commit separates CIDR labels with a comma and adjusts the vertical
positioning of port labels for improved readability.

Change-Id: I57510033fcc309b5d570d7ee6a9369a97775719b
Fixes: bug #1199086
2013-07-08 17:34:53 -04:00
Toshiyuki Hayashi 9fcbbe39bd Display port link between router and extra network
A port link between router and extra network was not displayed
with demo account. This commit fixed the bug. Also remove dead
link when port has no link.

fixes bug 1131082

Change-Id: I50c469e55e0b8435b95f03b191a04e27017fc37e
2013-03-12 20:09:49 -07:00
Toshiyuki Hayashi 1cb3dc768e Improve style of network topology
fixes bug 1129190
- display a message when there is no router, network or instance to show
- remove link from not owned network
- improve layout algorithm
- improve css to change router icon
- fix auto update layout

Change-Id: Ibbbf55a53939ab1446f3cb36165a5cf45c27c28c
2013-03-05 10:37:31 -08:00
David Lyle b5f4d63c7c Fix errant XHR request happening on every page
The check of the jquery selector by name will always return a
non-null object even if the object does not exist on the page,
the check needs to make sure the object returned doesn't
contain any items.

Change-Id: I51367547a37a2ee72ed300853d35d3cc6d89df7d
Fixes: bug #1132588
2013-02-27 11:44:10 -07:00
Nachi Ueno 250d21a562 Adding network-topology view for quantum
Implements bp quantum-network-topology

- network-topology pane shows the topology of quantum network
- supports network, router , instances now
- support of load balancer is future work

Change-Id: Idb1bf2d3add43cf51ed23ebaac3ee740b03498aa
2013-02-18 08:13:59 -08:00