updated vis-network and fixed dragevent update
This commit is contained in:
1 parent
33d7157b12
commit
44e82c0286
6 files changed
+7
-9
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ var jsVendorFiles = [
|
||||
];
|
||||
|
||||
var cssVendorFiles = [
|
||||
'node_modules/vis-network/styles/vis-network.min.css',
|
||||
'node_modules/vis-network/dist/dist/vis-network.min.css',
|
||||
];
|
||||
var sassFiles = './netbox_topology_views/static_dev/css/*.scss',
|
||||
cssDest = './netbox_topology_views/static/netbox_topology_views/css/';
|
||||
|
||||
@@ -1 +1 @@
|
||||
.vis-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+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AgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAABphJREFUeNqcV2twU9cR/nbPlVTHxpKRbNnBLyEbPyJisLEcPwgwUMKQtjNJAzNJZkgNNJOmJaZAaDKlxaXDTIBAcJtOOzSYKSkdiimhAdIMjyT4bYgBYxA2BgcUQPLrCiGDR4qt2x+yXTASFt1/957d7zt3z3d39xDCMQWUfgAz/RI/T4pSTAJpAGL8rECAXX7QFQGq9wOHOxYO1oCgjAdJj1wtB095Giv9TFuZAIWHAziATMPhTAwiHgUkYPXFJu92lMP/2MTpB1AKUCVEgNAcleUo1M+2F8TO6crSTncb1QleAOj2OTSX3Ge1p+Va42m5JrnzbnsCE8Ov+EHgpa0LPLvCJjZ/whuIlN8wAcXG+e1LUn9hm238QU84p1Ld83nsXvuO7Lq+LzKYGAT6/dn58m/HJTYf4O3EShkT8Irpzab1Uz9sGevT5+tWn+j6NB4A5hp/5NSr43xjfd5rW5tT9e3OAhCBiCua5/WsDEls/hdvYklZSwDefmrT8eXmtzuDkb5YZ33p9ndylICAVjWxf39xw/5g5Luv/9H84ZWNcwNLine truncated
|
||||
.vis-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:transparent;width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:0 0 3px 0 #aaa;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);box-shadow:0 0 1px 0 #111927;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%)}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:0 0 3px 0 #aaa;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-coLine truncated
|
||||
@@ -1 +1 @@
|
||||
var graph=null,container=null,csrftoken=null,nodes=new vis.DataSet,edges=new vis.DataSet,options={interaction:{hover:!0,hoverConnectedEdges:!0,multiselect:!0},nodes:{shape:"image",brokenImage:"../../static/netbox_topology_views/img/role-unknown.png",size:35,font:{multi:"md",face:"helvetica"}},edges:{length:100,width:2,font:{face:"helvetica"}},physics:{solver:"forceAtlas2Based"}};function iniPlotboxIndex(){document.addEventListener("DOMContentLoaded",function(){container=document.getElementById("visgraph"),csrftoken=jQuery("[name=csrfmiddlewaretoken]").val(),startLoadSearchBar(),handleButtonPress()},!1)}function startLoadSearchBar(){$("#device-roles").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/dcim/device-roles/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}}),$("#sites").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/dcim/sites/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}}),$("#tags").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/extras/tags/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}});var s=$("#device-roles");$.ajax({type:"GET",url:"../../api/plugins/topology-views/preselectdeviceroles/"}).then(function(e){$.each(e.results,function(e,t){var a=new Option(t.name,t.id,!0,!0);s.append(a).trigger("change"),s.trigger({type:"select2:select",params:{data:t}})})});var n=$("#tags");$.ajax({type:"GET",url:"../../api/plugins/topology-views/preselecttags/"}).then(function(e){$.each(e.results,function(e,t){var a=new Option(t.name,t.id,!0,!0);n.append(a).trigger("change"),n.trigger({type:"select2:select",params:{data:t}})})})}function handleButtonPress(){$("#search-form").submit(function(e){$("#status").html('<span class="label label-info">Loading data</span>'),e.preventDefault();var t=$("#name").val(),a=$("#device-roles").val(),s=$("#sites").val(),n=$("#tags").val();$.ajax({type:"POST",url:"../../api/plugins/topology-views/search/search/",data:JSON.stringify({name:t,devicerole:a,sites:s,tags:n}),headers:{"X-CSRFToken":csrftoken},contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){$("#status").html('<span class="label label-info">Drawing network</span>'),graph=null,nodes=new vis.DataSet,edges=new vis.DataSet,graph=new vis.Network(container,{nodes:nodes,edges:edges},options),$.each(e.nodes,function(e,t){nodes.add(t)}),$.each(e.edges,function(e,t){edges.add(t)}),graph.fit(),graph.on("afterDrawing",function(){$("#status").html('<span class="label label-success">Ready</span>')}),graph.on("dragEnd",function(e){dragged=this.getPositions(e.nodes),$.each(dragged,function(e,t){$("#coordstatus").html(""),$("#checkSaveCoordinates").is(":checked")&&(nodes.update({id:e,physics:!1}),$.ajax({url:"../../api/plugins/topology-views/save-coords/save_coords/",type:"POST",dataType:"json",headers:{"X-CSRFToken":csrftoken},contentType:"application/json; charset=utf-8",data:JSON.stringify({node_id:e,x:t.x,y:t.y}),error:function(e){$("#coordstatus").html('<span class="label label-warning">Failed to update coordinates</span>')},success:function(e){$("#coordstatus").html('<span class="label label-success">Updated coordinates</span>')}}))})})},error:function(e){$("#status").html('<span class="label label-warning">Something went wrong</span>')}})})}
|
||||
var graph=null,container=null,csrftoken=null,nodes=new vis.DataSet,edges=new vis.DataSet,options={interaction:{hover:!0,hoverConnectedEdges:!0,multiselect:!1},nodes:{shape:"image",brokenImage:"../../static/netbox_topology_views/img/role-unknown.png",size:35,font:{multi:"md",face:"helvetica"}},edges:{length:100,width:2,font:{face:"helvetica"}},physics:{solver:"forceAtlas2Based"}};function iniPlotboxIndex(){document.addEventListener("DOMContentLoaded",function(){container=document.getElementById("visgraph"),csrftoken=jQuery("[name=csrfmiddlewaretoken]").val(),startLoadSearchBar(),handleButtonPress()},!1)}function startLoadSearchBar(){$("#device-roles").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/dcim/device-roles/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}}),$("#sites").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/dcim/sites/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}}),$("#tags").select2({allowClear:!0,placeholder:"---------",theme:"bootstrap",multiple:!0,ajax:{url:"../../api/extras/tags/?brief=true",dataType:"json",type:"GET",data:function(e){return{term:e.term}},processResults:function(e){return{results:$.map(e.results,function(e){return{text:e.name,id:e.id}})}}}});var s=$("#device-roles");$.ajax({type:"GET",url:"../../api/plugins/topology-views/preselectdeviceroles/"}).then(function(e){$.each(e.results,function(e,t){var a=new Option(t.name,t.id,!0,!0);s.append(a).trigger("change"),s.trigger({type:"select2:select",params:{data:t}})})});var n=$("#tags");$.ajax({type:"GET",url:"../../api/plugins/topology-views/preselecttags/"}).then(function(e){$.each(e.results,function(e,t){var a=new Option(t.name,t.id,!0,!0);n.append(a).trigger("change"),n.trigger({type:"select2:select",params:{data:t}})})})}function handleButtonPress(){$("#search-form").submit(function(e){$("#status").html('<span class="label label-info">Loading data</span>'),e.preventDefault();var t=$("#name").val(),a=$("#device-roles").val(),s=$("#sites").val(),n=$("#tags").val();$.ajax({type:"POST",url:"../../api/plugins/topology-views/search/search/",data:JSON.stringify({name:t,devicerole:a,sites:s,tags:n}),headers:{"X-CSRFToken":csrftoken},contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){$("#status").html('<span class="label label-info">Drawing network</span>'),graph=null,nodes=new vis.DataSet,edges=new vis.DataSet,graph=new vis.Network(container,{nodes:nodes,edges:edges},options),$.each(e.nodes,function(e,t){nodes.add(t)}),$.each(e.edges,function(e,t){edges.add(t)}),graph.fit(),graph.on("afterDrawing",function(){$("#status").html('<span class="label label-success">Ready</span>')}),graph.on("dragEnd",function(e){dragged=this.getPositions(e.nodes),$.each(dragged,function(e,t){$("#coordstatus").html(""),$("#checkSaveCoordinates").is(":checked")&&$.ajax({url:"../../api/plugins/topology-views/save-coords/save_coords/",type:"POST",dataType:"json",headers:{"X-CSRFToken":csrftoken},contentType:"application/json; charset=utf-8",data:JSON.stringify({node_id:e,x:t.x,y:t.y}),error:function(e){$("#coordstatus").html('<span class="label label-warning">Failed to update coordinates</span>')},success:function(e){$("#coordstatus").html('<span class="label label-success">Updated coordinates</span>')}})})})},error:function(e){$("#status").html('<span class="label label-warning">Something went wrong</span>')}})})}
|
||||
@@ -1 +1 @@
|
||||
!function(t,g){"object"==typeof exports&&"undefined"!=typeof module?g(exports):"function"==typeof define&&define.amd?define(["exports"],g):g((t=t||self).vis=t.vis||{})}(this,function(t){"use strict";var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,g){return t(g={exports:{}},g.exports),g.exports}function A(t){return t&&t.default||t}function I(t){return t&&t.Math==Math&&t}function a(t){try{return!!t()}catch(t){return!0}}function v(t,g){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:g}}function C(t){return k.call(t).slice(8,-1)}function o(t){if(null==t)throw TypeError("Can't call method on "+t);return t}function r(t){return O(o(t))}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function i(t,g){if(!d(t))return t;var e,A;if(g&&"function"==typeof(e=t.toString)&&!d(A=e.call(t)))return A;if("function"==typeof(e=t.valueOf)&&!d(A=e.call(t)))return A;if(!g&&"function"==typeof(e=t.toString)&&!d(A=e.call(t)))return A;throw TypeError("Can't convert object to primitive value")}function p(t,g){return N.call(t,g)}function n(t){return Z?E.createElement(t):{}}function s(t,g){var e=S[R(t)];return e==L||e!=F&&("function"==typeof g?a(g):!!g)}function l(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}function y(A,I,t){if(l(A),void 0===I)return A;switch(t){case 0:return function(){return A.call(I)};case 1:return function(t){return A.call(I,t)};case 2:return function(t,g){return A.call(I,t,g)};case 3:return function(t,g,e){return A.call(I,t,g,e)}}return function(){return A.apply(I,arguments)}}function c(t){if(!d(t))throw TypeError(String(t)+" is not an object");return t}function f(A){function t(t,g,e){if(this instanceof A){switch(arguments.length){case 0:return new A;case 1:return new A(t);case 2:return new A(t,g)}return new A(t,g,e)}return A.apply(this,arguments)}return t.prototype=A.prototype,t}function m(t,g){var e,A,I,C,i,n,o,r,s=t.target,a=t.global,d=t.stat,l=t.proto,c=a?b:d?b[s]:(b[s]||{}).prototype,h=a?Y:Y[s]||(Y[s]={}),u=h.prototype;for(I in g)e=!Q(a?I:s+(d?".":"#")+I,t.forced)&&c&&p(c,I),i=h[I],e&&(n=t.noTargetGet?(r=P(c,I))&&r.value:c[I]),C=e&&n?n:g[I],e&&typeof i==typeof C||(o=t.bind&&e?y(C,b):t.wrap&&e?f(C):l&&"function"==typeof C?y(Function.call,C):C,(t.sham||C&&C.sham||i&&i.sham)&&j(o,"sham",!0),h[I]=o,l&&(p(Y,A=s+"Prototype")||j(Y,A,{}),Y[A][I]=C,t.real&&u&&!u[I]&&j(u,I,C)))}var b=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof g&&g)||Function("return this")(),h=!a(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),u={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,x={f:w&&!u.call({1:2},1)?function(t){var g=w(this,t);return!!g&&g.enumerable}:u},k={}.toString,D="".split,O=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==C(t)?D.call(t,""):Object(t)}:Object,N={}.hasOwnProperty,E=b.document,Z=d(E)&&d(E.createElement),M=!h&&!a(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}),T=Object.getOwnPropertyDescriptor,G={f:h?T:function(t,g){if(t=r(t),g=i(g,!0),M)try{return T(t,g)}catch(t){}if(p(t,g))return v(!x.f.call(t,g),t[g])}},B=/#|\.prototype\./,R=s.normalize=function(t){return String(t).replace(B,".").toLowerCase()},S=s.data={},F=s.NATIVE="N",L=s.POLYFILL="P",Q=s,Y={},W=Object.defineProperty,z={f:h?W:function(t,g,e){if(c(t),g=i(g,!0),c(e),M)try{return W(t,g,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[g]=e.value),t}},j=h?function(t,g,e){return z.f(t,g,v(1,e))}:function(t,g,e){return t[g]=e,t},P=G.f,V=[].slice,X={},U=Function.bind||function(g){var e=l(this),A=V.call(arguments,1),I=function(){var t=A.concat(V.call(arguments));return this instanceof I?function(t,g,e){if(!(g in X)){for(var A=[],I=0;I<g;I++)A[I]="a["+I+"]";X[g]=Function("C,a","return new C("+A.join(",")+")")}return X[g](t,e)}(e,t.length,t):e.apply(g,t)};return d(e.prototype)&&(I.prototype=e.prototype),I};m({target:"Function",proto:!0},{bind:U});function _(t){return Y[t+"Prototype"]}var H=_("Function").bind,J=Function.prototype,K=function(t){var g=t.bind;return t===J||t instanceof Function&&g===J.bind?H:g};function q(t,g,e,A){t.beginPath(),t.arc(g,e,A,0,2*Math.PI,!1),t.closePath()}function $(t,g,e,A,I,C){var i=Math.PI/180;A-2*C<0&&(C=A/2),I-2*C<0&&(C=I/2),t.beginPath(),t.moveTo(g+C,e),t.lineTo(g+A-C,e),t.arc(g+A-C,e+C,C,270*i,360*i,!1),t.lineTo(g+A,e+I-C),t.arc(g+A-C,e+I-C,C,0,90*i,!1),t.lineTo(g+C,e+I),t.arc(g+C,e+I-C,C,90*i,180*i,!1),t.lineTo(g,e+C),t.arc(g+C,e+C,C,180*i,270*i,!1),t.closePath()}function tt(t,g,e,A,I){var C=A/2*.5522848,i=I/2*.5522848,n=g+A,o=e+I,r=g+A/2,s=e+I/2;t.beginPath(),t.moveTo(g,s),t.bezierCurveTo(g,s-i,r-C,e,r,e),t.bezierCurveTo(r+C,e,n,s-i,n,s),t.bezierCurveTo(n,s+i,r+C,o,r,o),t.bezierCurveTo(r-C,o,Line truncated
|
||||
!function(g,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((g=g||self).vis=g.vis||{})}(this,function(g){"use strict";var eC="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}function e(g,t){return g(t={exports:{}},t.exports),t.exports}function A(g){return g&&g.default||g}function I(g){return g&&g.Math==Math&&g}function a(g){try{return!!g()}catch(g){return!0}}function v(g,t){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:t}}function C(g){return k.call(g).slice(8,-1)}function o(g){if(null==g)throw TypeError("Can't call method on "+g);return g}function r(g){return O(o(g))}function d(g){return"object"==typeof g?null!==g:"function"==typeof g}function i(g,t){if(!d(g))return g;var e,A;if(t&&"function"==typeof(e=g.toString)&&!d(A=e.call(g)))return A;if("function"==typeof(e=g.valueOf)&&!d(A=e.call(g)))return A;if(!t&&"function"==typeof(e=g.toString)&&!d(A=e.call(g)))return A;throw TypeError("Can't convert object to primitive value")}function p(g,t){return N.call(g,t)}function n(g){return M?Z.createElement(g):{}}function s(g,t){var e=F[R(g)];return e==L||e!=S&&("function"==typeof t?a(t):!!t)}function l(g){if("function"!=typeof g)throw TypeError(String(g)+" is not a function");return g}function y(A,I,g){if(l(A),void 0===I)return A;switch(g){case 0:return function(){return A.call(I)};case 1:return function(g){return A.call(I,g)};case 2:return function(g,t){return A.call(I,g,t)};case 3:return function(g,t,e){return A.call(I,g,t,e)}}return function(){return A.apply(I,arguments)}}function h(g){if(!d(g))throw TypeError(String(g)+" is not an object");return g}function f(A){function g(g,t,e){if(this instanceof A){switch(arguments.length){case 0:return new A;case 1:return new A(g);case 2:return new A(g,t)}return new A(g,t,e)}return A.apply(this,arguments)}return g.prototype=A.prototype,g}function m(g,t){var e,A,I,C,i,n,o,r,s=g.target,a=g.global,d=g.stat,l=g.proto,h=a?b:d?b[s]:(b[s]||{}).prototype,c=a?Y:Y[s]||(Y[s]={}),u=c.prototype;for(I in t)e=!Q(a?I:s+(d?".":"#")+I,g.forced)&&h&&p(h,I),i=c[I],e&&(n=g.noTargetGet?(r=j(h,I))&&r.value:h[I]),C=e&&n?n:t[I],e&&typeof i==typeof C||(o=g.bind&&e?y(C,b):g.wrap&&e?f(C):l&&"function"==typeof C?y(Function.call,C):C,(g.sham||C&&C.sham||i&&i.sham)&&P(o,"sham",!0),c[I]=o,l&&(p(Y,A=s+"Prototype")||P(Y,A,{}),Y[A][I]=C,g.real&&u&&!u[I]&&P(u,I,C)))}var b=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof eC&&eC)||Function("return this")(),c=!a(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),u={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,x={f:w&&!u.call({1:2},1)?function(g){var t=w(this,g);return!!t&&t.enumerable}:u},k={}.toString,D="".split,O=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(g){return"String"==C(g)?D.call(g,""):Object(g)}:Object,N={}.hasOwnProperty,Z=b.document,M=d(Z)&&d(Z.createElement),E=!c&&!a(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}),G=Object.getOwnPropertyDescriptor,T={f:c?G:function(g,t){if(g=r(g),t=i(t,!0),E)try{return G(g,t)}catch(g){}if(p(g,t))return v(!x.f.call(g,t),g[t])}},B=/#|\.prototype\./,R=s.normalize=function(g){return String(g).replace(B,".").toLowerCase()},F=s.data={},S=s.NATIVE="N",L=s.POLYFILL="P",Q=s,Y={},W=Object.defineProperty,z={f:c?W:function(g,t,e){if(h(g),t=i(t,!0),h(e),E)try{return W(g,t,e)}catch(g){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(g[t]=e.value),g}},P=c?function(g,t,e){return z.f(g,t,v(1,e))}:function(g,t,e){return g[t]=e,g},j=T.f,V=[].slice,X={},U=Function.bind||function(t){var e=l(this),A=V.call(arguments,1),I=function(){var g=A.concat(V.call(arguments));return this instanceof I?function(g,t,e){if(!(t in X)){for(var A=[],I=0;I<t;I++)A[I]="a["+I+"]";X[t]=Function("C,a","return new C("+A.join(",")+")")}return X[t](g,e)}(e,g.length,g):e.apply(t,g)};return d(e.prototype)&&(I.prototype=e.prototype),I};m({target:"Function",proto:!0},{bind:U});function _(g){return Y[g+"Prototype"]}var H=_("Function").bind,J=Function.prototype,K=function(g){var t=g.bind;return g===J||g instanceof Function&&t===J.bind?H:t};function q(g,t,e,A){g.beginPath(),g.arc(t,e,A,0,2*Math.PI,!1),g.closePath()}function $(g,t,e,A,I,C){var i=Math.PI/180;A-2*C<0&&(C=A/2),I-2*C<0&&(C=I/2),g.beginPath(),g.moveTo(t+C,e),g.lineTo(t+A-C,e),g.arc(t+A-C,e+C,C,270*i,360*i,!1),g.lineTo(t+A,e+I-C),g.arc(t+A-C,e+I-C,C,0,90*i,!1),g.lineTo(t+C,e+I),g.arc(t+C,e+I-C,C,90*i,180*i,!1),g.lineTo(t,e+C),g.arc(t+C,e+C,C,180*i,270*i,!1),g.closePath()}function gg(g,t,e,A,I){var C=A/2*.5522848,i=I/2*.5522848,n=t+A,o=e+I,r=t+A/2,s=e+I/2;g.beginPath(),g.moveTo(t,s),g.bezierCurveTo(t,Line truncated
|
||||
@@ -7,7 +7,7 @@ var options = {
|
||||
interaction: {
|
||||
hover: true,
|
||||
hoverConnectedEdges: true,
|
||||
multiselect: true
|
||||
multiselect: false
|
||||
},
|
||||
nodes: {
|
||||
shape: 'image',
|
||||
@@ -201,7 +201,7 @@ function handleButtonPress() {
|
||||
$.each(dragged, function (node_id, coordinates) {
|
||||
$("#coordstatus").html('');
|
||||
if ($('#checkSaveCoordinates').is(":checked")) {
|
||||
nodes.update({ id: node_id, physics: false });
|
||||
//nodes.update({ id: node_id, physics: false });
|
||||
$.ajax({
|
||||
url: "../../api/plugins/topology-views/save-coords/save_coords/",
|
||||
type: 'POST',
|
||||
|
||||
+1
-3
@@ -13,8 +13,6 @@
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-sass": "^4.0.2",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"vis-data": "^6.2.3",
|
||||
"vis-util": "^1.1.8",
|
||||
"vis-network": "^6.4.4"
|
||||
"vis-network": "^7.6.4"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user