1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
webpackJsonp([5],{"3mlU":function(t,e){},"4WTo":function(t,e,n){var r=n("NWt+");t.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n}},"7Doy":function(t,e,n){var r=n("EqjI"),i=n("7UMu"),o=n("dSzd")("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},"9Bbf":function(t,e,n){"use strict";var r=n("kM2E");t.exports=function(t){r(r.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},"9C8M":function(t,e,n){"use strict";var r=n("evD5").f,i=n("Yobk"),o=n("xH/j"),a=n("+ZMJ"),s=n("2KxR"),l=n("NWt+"),u=n("vIB/"),c=n("EGZi"),f=n("bRrM"),d=n("+E39"),p=n("06OY").fastKey,h=n("LIJb"),v=d?"_s":"size",g=function(t,e){var n,r=p(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,u){var c=t(function(t,r){s(t,c,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,void 0!=r&&l(r,n,t[u],t)});return o(c.prototype,{clear:function(){for(var t=h(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=h(this,e),r=g(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(t){h(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(h(this,e),t)}}),d&&r(c.prototype,"size",{get:function(){return h(this,e)[v]}}),c},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=p(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){u(t,e,function(t,n){this._t=h(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?c(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,c(1))},n?"entries":"values",!n,!0),f(e)}}},ALrJ:function(t,e,n){var r=n("+ZMJ"),i=n("MU5D"),o=n("sB3e"),a=n("QRG4"),s=n("oeOm");t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,f=6==t,d=5==t||f,p=e||s;return function(e,s,h){for(var v,g,_=o(e),m=i(_),b=r(s,h,3),w=a(m.length),y=0,$=n?p(e,w):l?p(e,0):void 0;w>y;y++)if((d||y in m)&&(g=b(v=m[y],y,_),t))if(n)$[y]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return y;case 2:$.push(v)}else if(c)return!1;return f?-1:u||c?c:$}}},BDhv:function(t,e,n){var r=n("kM2E");r(r.P+r.R,"Set",{toJSON:n("m9gC")("Set")})},HpRW:function(t,e,n){"use strict";var r=n("kM2E"),i=n("lOnJ"),o=n("+ZMJ"),a=n("NWt+");t.exports=function(t){r(r.S,t,{from:function(t){var e,n,r,s,l=arguments[1];return i(this),(e=void 0!==l)&&i(l),void 0==t?new this:(n=[],e?(r=0,s=o(l,arguments[2],2),a(t,!1,function(t){n.push(s(t,r++))})):a(t,!1,n.push,n),new this(n))}})}},LIJb:function(t,e,n){var r=n("EqjI");t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},ioQ5:function(t,e,n){n("HpRW")("Set")},lHA8:function(t,e,n){t.exports={default:n("pPW7"),__esModule:!0}},m9gC:function(t,e,n){var r=n("RY/4"),i=n("4WTo");t.exports=function(t){return function(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},oNmr:function(t,e,n){n("9Bbf")("Set")},oeOm:function(t,e,n){var r=n("7Doy");t.exports=function(t,e){return new(r(t))(e)}},pPW7:function(t,e,n){n("M6a0"),n("zQR9"),n("+tPU"),n("ttyz"),n("BDhv"),n("oNmr"),n("ioQ5"),t.exports=n("FeBl").Set},qo66:function(t,e,n){"use strict";var r=n("7KvD"),i=n("kM2E"),o=n("06OY"),a=n("S82l"),s=n("hJx8"),l=n("xH/j"),u=n("NWt+"),c=n("2KxR"),f=n("EqjI"),d=n("e6n0"),p=n("evD5").f,h=n("ALrJ")(0),v=n("+E39");t.exports=function(t,e,n,g,_,m){var b=r[t],w=b,y=_?"set":"add",$=w&&w.prototype,k={};return v&&"function"==typeof w&&(m||$.forEach&&!a(function(){(new w).entries().next()}))?(w=e(function(e,n){c(e,w,t,"_c"),e._c=new b,void 0!=n&&u(n,_,e[y],e)}),h("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in $&&(!m||"clear"!=t)&&s(w.prototype,t,function(n,r){if(c(this,w,t),!e&&m&&!f(n))return"get"==t&&void 0;var i=this._c[t](0===n?0:n,r);return e?this:i})}),m||p(w.prototype,"size",{get:function(){return this._c.size}})):(w=g.getConstructor(e,t,_,y),l(w.prototype,n),o.NEED=!0),d(w,t),k[t]=w,i(i.G+i.W+i.F,k),m||g.setStrong(w,t,_),w}},ttyz:function(t,e,n){"use strict";var r=n("9C8M"),i=n("LIJb");t.exports=n("qo66")("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},yoyQ:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("fZjL"),i=n.n(r),o=n("Dd8w"),a=n.n(o),s=n("lHA8"),l=n.n(s),u=n("zL8q"),c=n("NYxO"),f=n("JaHG"),d={name:"plugins-view",components:{"el-input":u.Input,"el-select":u.Select,"el-option":u.Option,"el-button":u.Button,"el-table":u.Table,"el-table-column":u.TableColumn,"el-form":u.Form,"el-form-item":u.FormItem,"el-row":u.Row,"el-col":u.Col,"el-card":u.Card},data:function(){return{filterSet:new l.a,tableData:[],enableTableData:[],nodeName:"",nodes:[],searchValue:"",searchView:!1}},computed:{iconStatus:function(){return this.searchView?"el-icon-close":"el-icon-search"}},methods:a()({},Object(c.b)(["CURRENT_NODE"]),{loadData:function(){var t=this;this.searchView=!1,this.$httpGet("/nodes").then(function(e){t.nodeName=t.$store.state.nodeName||e.data[0].node,t.nodes=e.data,t.loadPlugins()}).catch(function(e){t.$message.error(e||t.$t("error.networkError"))})},loadPlugins:function(){var t=this;this.CURRENT_NODE(this.nodeName),this.nodeName&&this.$httpGet("/nodes/"+this.nodeName+"/plugins").then(function(e){t.tableData=e.data,t.handleFilter()}).catch(function(e){t.$message.error(e||t.$t("error.networkError"))})},handleFilter:function(){var t=this;this.enableTableData=this.tableData.filter(function(e){return!t.filterSet.has(e.active)})},resetFilter:function(t){var e=this;this.filterSet.clear(),i()(t).forEach(function(n){t[n].forEach(function(t){e.filterSet.add(!t)})}),2===this.filterSet.size&&this.filterSet.clear(),this.handleFilter()},update:function(t){var e=this,n=t.active?"unload":"load";this.$httpPut("/nodes/"+this.nodeName+"/plugins/"+t.name+"/"+n).then(function(){e.$message.success(""+(t.active?e.$t("plugins.stop"):e.$t("plugins.start"))+e.$t("alert.success")),e.loadPlugins()}).catch(function(t){e.$message.error(t||e.$t("error.networkError")),e.loadPlugins()})},getLinks:function(t){return Object(f.b)(t)},openLink:function(t){var e=this.getLinks(t.name);window.open(e).opener=null},searchPlugins:function(){var t=this;this.searchValue?setTimeout(function(){Object(f.e)(t.tableData,"name",t.searchValue).then(function(e){e&&(t.enableTableData=e)}).catch(function(){})},500):this.loadData()},hasManagePage:function(t){return{emqx_auth_clientid:!0,emqx_auth_username:!0,emqx_auth_jwt:!0}[t]},handleManage:function(t){this.$router.push({path:"/plugins/"+t.name})}}),created:function(){this.loadData()}},p={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"plugins-view"},[n("div",{staticClass:"page-title"},[t._v("\n "+t._s(t.$t("leftbar.plugins"))+"\n "),n("div",{staticStyle:{float:"right"}},[n("el-input",{staticClass:"input-radius",staticStyle:{float:"right","padding-left":"20px"},attrs:{size:"large",disabled:t.$store.state.loading,placeholder:t.$t("plugins.searchByName"),clearable:""},on:{input:t.searchPlugins},model:{value:t.searchValue,callback:function(e){t.searchValue=e},expression:"searchValue"}}),t._v(" "),n("el-select",{staticClass:"select-radius",attrs:{placeholder:t.$t("select.placeholder"),disabled:t.$store.state.loading},on:{change:t.loadPlugins},model:{value:t.nodeName,callback:function(e){t.nodeName=e},expression:"nodeName"}},t._l(t.nodes,function(t){return n("el-option",{key:t.node,attrs:{label:t.node,value:t.node}})}),1)],1)]),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.$store.state.loading,expression:"$store.state.loading"}],attrs:{border:"",data:t.enableTableData},on:{"filter-change":t.resetFilter}},[n("el-table-column",{attrs:{prop:"name",width:"230",label:t.$t("plugins.name")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.name)+"\n "),n("el-tooltip",{attrs:{effect:"light",content:t.$t("plugins.tutorial"),"open-delay":500,placement:"top"}},[e.row.name.includes("dashboard")||e.row.name.includes("management")||void 0===t.getLinks(e.row.name)?t._e():n("a",{staticClass:"tutorial",attrs:{href:"javascript:;"},on:{click:function(n){return t.openLink(e.row)}}},[n("i",{staticClass:"iconfont icon-bangzhu"})])])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"description","min-width":"340",label:t.$t("plugins.description")}}),t._v(" "),n("el-table-column",{attrs:{prop:"active",width:"150",label:t.$t("plugins.status"),filters:[{text:t.$t("plugins.stopped"),value:!1},{text:t.$t("plugins.running"),value:!0}]},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",{class:[e.row.active?"running":"","status"]},[t._v("\n "+t._s(e.row.active?t.$t("plugins.running"):t.$t("plugins.stopped"))+"\n ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{width:"160",label:t.$t("oper.oper")},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{staticClass:"oper",attrs:{slot:"reference",size:"mini",disabled:-1!==e.row.name.indexOf("dashboard")||e.row.name.includes("management"),type:e.row.active?"warning":"success",plain:!0},on:{click:function(n){return t.update(e.row)}},slot:"reference"},[t._v("\n "+t._s(e.row.active?t.$t("plugins.stop"):t.$t("plugins.start"))+"\n ")]),t._v(" "),t.hasManagePage(e.row.name)?n("el-button",{staticClass:"oper",attrs:{type:"success",size:"mini",plain:!0,disabled:!e.row.active},on:{click:function(n){return t.handleManage(e.row)}}},[t._v("\n "+t._s(t.$t("plugins.manage"))+"\n ")]):t._e()]}}])})],1)],1)},staticRenderFns:[]};var h=n("VU/8")(d,p,!1,function(t){n("3mlU")},null,null);e.default=h.exports}}); |