(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d813313c"],{"00bc":function(i,t,n){"use strict";n.r(t);n("afbc"),n("88ed");var e=n("b99a"),s={data:()=>({activeTabName:"",pluginInfo:null,newPluginInfo:null,isNew:!1,version:"",isLoading:!1,reload:!0,mylist:[],pluginsed:[]}),watch:{"$route.name"(i){this.activeTabName=i},"$route.fullPath":"updateData"},computed:{menuRoutes(){const i=this.findRouteByName(this.$router.options.routes,this.pluginInfo.plugin_name);return i&&i.children?i.children.filter(i=>{var t;return!(null!==(t=i.meta)&&void 0!==t&&t.hidden)}):[]}},methods:{async loadPlugins(){try{const[i,t]=await Promise.all([Object(e.b)(),Object(e.a)()]);this.mylist=i.mylist,this.pluginsed=t.pluginsed,this.updateData()}catch(i){}},updateData(){var i;const t=this.$route.fullPath,n=this.findPlugin(this.mylist,t),e=this.findPlugin(this.pluginsed,t);this.newPluginInfo=(null==n||null===(i=n.versions)||void 0===i?void 0:i[0])||{},this.pluginInfo=e||{},this.isNew=this.pluginInfo.version&&this.newPluginInfo.version&&this.pluginInfo.version!==this.newPluginInfo.version},findPlugin:(i,t)=>Array.isArray(i)?i.find(i=>new RegExp(String.raw`\b${i.plugin_name}\b`,"i").test(t)):null,findRouteByName(i,t){for(const n of i){if(n.name===t)return n;if(n.children){const i=this.findRouteByName(n.children,t);if(i)return i}}return null},handleClick(i){this.$router.push({name:i})},updatePlugin(){this.isLoading=!0,Object(e.c)({download_url:this.newPluginInfo.download_url,plugin_name:this.pluginInfo.plugin_name}).then(i=>{this.$message.success("更新成功!"),this.isLoading=!1,setTimeout(()=>{this.$router.go(0)},1e3)}).catch(i=>{this.isLoading=!1})}},created(){this.activeTabName=this.$route.name,this.loadPlugins(),this.updateData()}},a=(n("9f49"),n("2877")),l=Object(a.a)(s,(function(){var i=this,t=i.$createElement,n=i._self._c||t;return n("div",{staticClass:"pealverify m-b-12"},[null!=i.pluginInfo?n("div",{staticClass:"head ls-card"},[n("div",{staticClass:"tl nr weight-500"},[i._v(i._s(i.pluginInfo.name))]),n("div",{staticClass:"nav"},i._l(i.menuRoutes,(function(t){return n("el-button",{key:t.name,class:i.activeTabName==t.name?"":"no-active",attrs:{type:"primary",size:"mini",plain:i.activeTabName!=t.name},on:{click:function(n){return i.handleClick(t.name)}}},[i._v(i._s(t.meta.title))])})),1),n("div",{staticClass:"info"},[n("el-tag",{attrs:{type:"info",effect:"dark"}},[i._v("版本："+i._s(i.pluginInfo.version))]),i.isNew?n("el-button",{staticClass:"btn",attrs:{type:"success",size:"small",loading:i.isLoading},on:{click:i.updatePlugin}},[i._v(i._s(i.isLoading?"更新中":"更新"))]):i._e()],1)]):i._e(),i.reload?n("router-view",{key:i.$route.fullPath}):i._e()],1)}),[],!1,null,null,null);t.default=l.exports},4907:function(i,t,n){i.exports={primary:"#9cc259",white:"#fff",asideMenuWidth:"150px",headerHeight:"64px",primary2:"#9cc259",colorBlack2:"#333"}},"9f49":function(i,t,n){"use strict";n("4907")}}]);