UNPKG

@weave-js/dashboard

Version:

A landscape monitor for Weave microservice framework.

2 lines 10.2 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["about"],{"0a49":function(t,e,n){var i=n("9b43"),s=n("626a"),a=n("4bf8"),c=n("9def"),r=n("cd1c");t.exports=function(t,e){var n=1==t,o=2==t,u=3==t,d=4==t,l=6==t,f=5==t||l,v=e||r;return function(e,r,m){for(var h,_,p=a(e),b=s(p),g=i(r,m,3),A=c(b.length),S=0,y=n?v(e,A):o?v(e,0):void 0;A>S;S++)if((f||S in b)&&(h=b[S],_=g(h,S,p),t))if(n)y[S]=_;else if(_)switch(t){case 3:return!0;case 5:return h;case 6:return S;case 2:y.push(h)}else if(d)return!1;return l?-1:u||d?d:y}}},1169:function(t,e,n){var i=n("2d95");t.exports=Array.isArray||function(t){return"Array"==i(t)}},"2f21":function(t,e,n){"use strict";var i=n("79e5");t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},"456d":function(t,e,n){var i=n("4bf8"),s=n("0d58");n("5eda")("keys",function(){return function(t){return s(i(t))}})},"48ca":function(t,e,n){"use strict";var i=n("c2a5"),s=n.n(i);s.a},"4c0f":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home"},[n("p",[t._v("\n Connected nodes: "+t._s(t.nodes.filter(function(t){return t.isAvailable}).length)+"\n ")]),n("p",[t._v("\n Disconnected nodes: "+t._s(t.nodes.filter(function(t){return!t.isAvailable}).length)+"\n ")]),n("div",{staticClass:"card-container"},t._l(t.nodes,function(e){return n("div",{key:e.id,staticClass:"card",class:{up:e.isAvailable,down:!e.isAvailable}},[n("div",{staticClass:"header"},[n("div",{staticClass:"caption"},[t._v("\n "+t._s(e.id)+"\n ")])]),n("div",{staticClass:"body"},[t._v("\n Services: "+t._s(e.serviceCount)+"\n "),null!==e.offlineTime?n("span",[t._v("\n "+t._s(e.offlineTime)+"\n ")]):t._e()])])}))])},s=[],a=(n("55dd"),n("cadf"),n("551c"),n("097d"),{name:"nodes",sockets:{"$node.connected":function(t){this.getNodes()},"$node.disconnected":function(t){this.getNodes()}},data:function(){return{nodes:[]}},methods:{getNodes:function(){var t=this;this.$socket.emit("call",{actionName:"weave-dashboard.getNodes"},function(e,n){t.nodes=n.sort(function(t,e){return t.id>e.id?1:t.id<e.id?-1:0})})}},mounted:function(){this.getNodes()}}),c=a,r=(n("48ca"),n("2877")),o=Object(r["a"])(c,i,s,!1,null,null,null);o.options.__file="Nodes.vue";e["default"]=o.exports},"513c":function(t,e,n){"use strict";var i=n("c13b"),s=n.n(i);s.a},"55dd":function(t,e,n){"use strict";var i=n("5ca1"),s=n("d8e8"),a=n("4bf8"),c=n("79e5"),r=[].sort,o=[1,2,3];i(i.P+i.F*(c(function(){o.sort(void 0)})||!c(function(){o.sort(null)})||!n("2f21")(r)),"Array",{sort:function(t){return void 0===t?r.call(a(this)):r.call(a(this),s(t))}})},"5eda":function(t,e,n){var i=n("5ca1"),s=n("8378"),a=n("79e5");t.exports=function(t,e){var n=(s.Object||{})[t]||Object[t],c={};c[t]=e(n),i(i.S+i.F*a(function(){n(1)}),"Object",c)}},"727f":function(t,e,n){},7514:function(t,e,n){"use strict";var i=n("5ca1"),s=n("0a49")(5),a="find",c=!0;a in[]&&Array(1)[a](function(){c=!1}),i(i.P+i.F*c,"Array",{find:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(a)},"79cd":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home"},[t.metrics.length>0?n("metrics-List",{attrs:{metrics:t.metrics}}):n("p",[t._v("Waiting for metrics...")])],1)},s=[],a=(n("55dd"),n("7514"),n("7f7f"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"metrics-container"},t._l(t.metrics,function(e){return n("div",{key:e.id,staticClass:"metrics",class:{"is-pending":e.isPending}},[n("div",{staticClass:"header"},[n("div",{staticClass:"caption"},[t._v("\n "+t._s(e.name)+" @ "+t._s(e.nodeId)+"\n ")]),n("div",{staticClass:"execution-time"},[e.stopTime?n("span",[t._v(t._s(Math.floor(e.stopTime-e.startTime))+"ms")]):t._e()])]),e.subRequests?n("metrics-list",{attrs:{metrics:e.subRequests}}):t._e()],1)}))}),c=[],r={name:"MetricsList",props:{metrics:Array}},o=r,u=(n("917e"),n("2877")),d=Object(u["a"])(o,a,c,!1,null,"2f5da01c",null);d.options.__file="MetricsList.vue";var l=d.exports,f={name:"metrics",components:{MetricsList:l},sockets:{"metrics.trace.span.started":function(t){this.running.push(t)},"metrics.trace.span.finished":function(t){this.stopped.push(t)}},computed:{metrics:function(){var t=this,e=function(t){return{id:t.data.id,requestId:t.data.requestId,startTime:t.data.startTime,name:t.data.action.name,nodeId:t.data.nodeId,level:t.data.level,subRequests:t.subRequests,stopTime:t.stopTime,isPending:t.isPending}},n=function n(i,s){var a=t.stopped.find(function(t){return t.data.id===i.data.id});console.log(a),a?(i.stopTime=a.data.stopTime,i.isPending=!1):i.isPending=!0;var c=t.running.filter(function(t){return t.data.parentId===i.data.id&&t.data.level===s}).sort(function(t,e){return t.data.startTime>e.data.startTime?1:t.data.startTime<e.data.startTime?-1:0});return c.length>0?(i.subRequests=c.map(function(t){return n(t,t.data.level+1)}).map(function(t){return e(t)}),i):(i.subRequests=null,i)},i=this.running.filter(function(t){return 0===t.data.level}).map(function(t){return n(t,t.data.level+1)}).map(function(t){return e(t)});return i}},data:function(){return{running:[],stopped:[]}},methods:{getNodes:function(){var t=this;this.$socket.emit("call",{actionName:"weave-dashboard.getNodes"},function(e,n){t.nodes=n.sort(function(t,e){return t.id>e.id?1:t.id<e.id?-1:0})})}},mounted:function(){}},v=f,m=(n("513c"),Object(u["a"])(v,i,s,!1,null,null,null));m.options.__file="Metrics.vue";e["default"]=m.exports},"7f7f":function(t,e,n){var i=n("86cc").f,s=Function.prototype,a=/^\s*function ([^ (]*)/,c="name";c in s||n("9e1e")&&i(s,c,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(t){return""}}})},"917e":function(t,e,n){"use strict";var i=n("727f"),s=n.n(i);s.a},a71b:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"about"},[n("table",[t._m(0),n("tbody",t._l(t.actions,function(e){return n("tr",{key:e.name},[n("td",[t._v(t._s(e.name))]),n("td",[t._v(t._s(e.endpoints.length))]),n("td",[t._v(t._s(e.hasAvailable))]),n("td",[t._v(t._s(e.action.cache))]),n("td",[t._v(t._s(e.action&&e.action.params?Object.keys(e.action.params).join(", "):""))])])}))])])},s=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("th",[t._v("Action name")]),n("th",[t._v("Nodes")]),n("th",[t._v("State")]),n("th",[t._v("Cached fields")]),n("th",[t._v("Params")])])}],a=(n("7f7f"),n("55dd"),n("cadf"),n("551c"),n("097d"),{name:"actions",sockets:{"$services.changed":function(t){this.getActions()},"$node.connected":function(t){this.getActions()},"$node.disconnected":function(t){this.getActions()}},data:function(){return{actions:[]}},methods:{getActions:function(){var t=this;this.$socket.emit("call",{actionName:"weave-dashboard.getActions"},function(e,n){t.actions=n.sort(function(t,e){return t.name>e.name?1:t.name<e.name?-1:0})})}},mounted:function(){this.getActions()}}),c=a,r=n("2877"),o=Object(r["a"])(c,i,s,!1,null,null,null);o.options.__file="Actions.vue";e["default"]=o.exports},ac6a:function(t,e,n){for(var i=n("cadf"),s=n("0d58"),a=n("2aba"),c=n("7726"),r=n("32e9"),o=n("84f2"),u=n("2b4c"),d=u("iterator"),l=u("toStringTag"),f=o.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=s(v),h=0;h<m.length;h++){var _,p=m[h],b=v[p],g=c[p],A=g&&g.prototype;if(A&&(A[d]||r(A,d,f),A[l]||r(A,l,p),o[p]=f,b))for(_ in i)A[_]||a(A,_,i[_],!0)}},c13b:function(t,e,n){},c2a5:function(t,e,n){},cd1c:function(t,e,n){var i=n("e853");t.exports=function(t,e){return new(i(t))(e)}},e853:function(t,e,n){var i=n("d3f4"),s=n("1169"),a=n("2b4c")("species");t.exports=function(t){var e;return s(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!s(e.prototype)||(e=void 0),i(e)&&(e=e[a],null===e&&(e=void 0))),void 0===e?Array:e}},f23e:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"about"},[n("table",[t._m(0),n("tbody",t._l(t.services,function(e){return n("tr",{key:e.name},[n("td",[t._v(t._s(e.name))]),n("td",[t._v(t._s(e.version))]),n("td",[t._v(t._s(e.actions))]),n("td",[t._v(t._s(e.events))]),n("td",[t._v(t._s(e.nodes.length))]),n("td",[t._v(t._s(e.isAvailable))])])}))])])},s=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("th",[t._v("Service name")]),n("th",[t._v("Version")]),n("th",[t._v("Actions")]),n("th",[t._v("Events")]),n("th",[t._v("Nodes")]),n("th",[t._v("Available")])])}],a=(n("55dd"),n("ac6a"),n("456d"),n("7f7f"),n("7514"),n("cadf"),n("551c"),n("097d"),{name:"services",sockets:{"$services.changed":function(t){this.getServices()},"$node.connected":function(t){this.getServices()},"$node.disconnected":function(t){this.getServices()}},data:function(){return{services:[]}},methods:{getServices:function(){var t=this;this.$socket.emit("call",{actionName:"weave-dashboard.getServices"},function(e,n){var i=[];n.map(function(t){var e=i.find(function(e){return e.name===t.name});e?e.nodes.push({nodeId:t.nodeId,isAvailable:t.isAvailable}):(e=Object.create(null),e.name=t.name,e.version=t.version?t.version:1,e.isAvailable=t.isAvailable,e.actions=t.actions?Object.keys(t.actions).length:0,e.events=t.events?Object.keys(t.events).length:0,e.nodes=[{nodeId:t.nodeId,isAvailable:t.isAvailable}],i.push(e))}),t.services=i.sort(function(t,e){return t.name>e.name?1:t.name<e.name?-1:0})})}},mounted:function(){this.getServices()}}),c=a,r=n("2877"),o=Object(r["a"])(c,i,s,!1,null,null,null);o.options.__file="Services.vue";e["default"]=o.exports}}]); //# sourceMappingURL=about.fa09fa4c.js.map