Added netjsongraph.js visualization to admin site#36
Added netjsongraph.js visualization to admin site#36nemesifier merged 1 commit intoopenwisp:masterfrom
Conversation
There was a problem hiding this comment.
Great progress!
CSS / style issues
- labels are not visible (black foreground on black background)
- when the overlay is open there's an unnecessary scrollbar, you should hide it by putting
overflow:hiddenon the body element but you should remove this CSS once the overlay is closed - spacing from page broders look wrong, check CSS margins of the element, but do it after you solve the previous scrollbar issue
- as agreed on IRC, move the node/link metadata panel to the bottom, but only in the admin overlay
Test
As you know, visualize_view is not executed during tests, so fix that when you can.
| $('#content-main form').trigger('submit'); | ||
| } | ||
| else { | ||
| var message = 'Error while generating preview'; |
| if (e.altKey && e.which == 80) { | ||
| // unfocus any active input before proceeding | ||
| $(document.activeElement).trigger('blur'); | ||
| // wait for JSON editor to update the |
There was a problem hiding this comment.
remove comments mentioning JSON editor
There was a problem hiding this comment.
Yeah. Will do it
1 similar comment
f898322 to
3e49480
Compare
nemesifier
left a comment
There was a problem hiding this comment.
@rohithasrk almost there, more details need to be taken care of, see my inline comments.
Also rebase on master.
| inner = overlay.find('.inner'), | ||
| visualize_url = $('.visualizelink').attr('data-url'); | ||
|
|
||
| var openPreview = function() { |
| $(document).keydown(disableArrowKeys); | ||
| }; | ||
|
|
||
| var closePreview = function () { |
| <p><span class="link up"> </span>link up</p> | ||
| <p><span class="link down"> </span>link down</p> | ||
| </div> | ||
| {% block script %} |
There was a problem hiding this comment.
we are duplicating information here, try to convert this part in a fragment which can be shared with the frontend template (and included with {% include '../netjsongraph/netjsongraph-script.html' %}) and overridden in accordance with the overriding templates instructions in the README
There was a problem hiding this comment.
This has been fixed.
|
|
||
| def test_topology_visualize_button(self): | ||
| t = Topology.objects.first() | ||
| t.save() |
There was a problem hiding this comment.
is this line necessary? Try to remove it
|
|
||
| def test_topology_visualize_view(self): | ||
| t = Topology.objects.first() | ||
| t.save() |
| data-url="{{ visualize_url }}" | ||
| class="visualizelink" | ||
| value="{% trans "Visualize Topology" %}" | ||
| title="{% trans "Visualize Topology" %} (ALT+P)"> |
| .djnjg-overlay .close:focus, | ||
| .djnjg-overlay .close:active{ | ||
| position: absolute; | ||
| right: 3%; |
| .djnjg-overlay .close:active{ | ||
| position: absolute; | ||
| right: 3%; | ||
| top: 1.5%; |
| z-index: 11; | ||
| width: 100%; | ||
| height: 100%; | ||
| background: rgba(0, 0, 0, 0.91); |
There was a problem hiding this comment.
use rgba(0, 0, 0, 0.95);, it's less distracting in this case
django_netjsongraph/base/admin.py
Outdated
| css = {'all': [static('netjsongraph/admin.css')]} | ||
| js = [static('netjsongraph/receive-url.js'), | ||
| static('netjsongraph/strategy-switcher.js')] | ||
| css = {'all': [static('netjsongraph/css/style.css'), |
There was a problem hiding this comment.
netjsongraph/css/style.css must be moved after netjsongraph/css/src/netjsongraph.css because it's an override
3e49480 to
a4cbb40
Compare
a4cbb40 to
a0c4cc7
Compare
This PR aims to add a feature which allows to visualize network topology in admin site. @nemesisdesign Please review.