(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41d54ea8"],{"09ed":function(e,t,a){"use strict";a("122f")},"122f":function(e,t,a){},"24a8":function(e,t,a){"use strict";a.r(t);var p=function(){var e=this,t=e._self._c;return t("div",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("appManage.title")))]),t("div",{staticClass:"card-header-right"},[t("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:e.openAddAppModal}},[e._v(" "+e._s(e.$t("appManage.addApp"))+" ")])],1)]),t("div",{staticClass:"card-body"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.appManageInfo.apps,border:"",stripe:""}},[t("el-table-column",{attrs:{prop:"appId",label:e.$t("appManage.appId"),align:"center"}}),t("el-table-column",{attrs:{prop:"name",label:e.$t("appManage.appName"),align:"center"}}),t("el-table-column",{attrs:{prop:"whileListIp",label:e.$t("appManage.whiteList"),align:"center"}}),t("el-table-column",{attrs:{prop:"blackListIp",label:e.$t("appManage.blackList"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("appManage.operations"),align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.openEditAppModal(a.row)}}},[e._v(" "+e._s(e.$t("appManage.edit"))+" ")]),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.openDeleteAppModal(a.row)}}},[e._v(" "+e._s(e.$t("appManage.delete"))+" ")])]}}])})],1),t("el-pagination",{staticClass:"pagination",attrs:{"current-page":e.pagination.currentPage,"page-size":e.pagination.pageSize,layout:"total, prev, pager, next, jumper",total:e.appManageInfo.total},on:{"current-change":e.handleCurrentChange}})],1)])],1)],1),t("add-app",{ref:"addAppModal",on:{success:e.listApps}}),t("edit-app",{ref:"editAppModal",on:{success:e.listApps}}),t("delete-app",{ref:"deleteAppModal",on:{success:e.listApps}})],1)},i=[],s=a("7220"),l=a("fc4e"),r=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("editApp.title"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.resetForm}},[t("el-form",{ref:"editAppForm",attrs:{model:e.editAppInfo,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("editApp.appName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("editApp.appNamePlaceholder")},model:{value:e.editAppInfo.name,callback:function(t){e.$set(e.editAppInfo,"name",t)},expression:"editAppInfo.name"}})],1),t("el-form-item",{attrs:{label:e.$t("editApp.securityCode"),prop:"securityCode"}},[t("el-input",{attrs:{placeholder:e.$t("editApp.securityCodePlaceholder")},model:{value:e.editAppInfo.securityCode,callback:function(t){e.$set(e.editAppInfo,"securityCode",t)},expression:"editAppInfo.securityCode"}})],1),t("el-form-item",{attrs:{label:e.$t("editApp.whiteList"),prop:"whileListIp"}},[t("el-input",{attrs:{placeholder:e.$t("editApp.whiteListPlaceholder")},model:{value:e.editAppInfo.whileListIp,callback:function(t){e.$set(e.editAppInfo,"whileListIp",t)},expression:"editAppInfo.whileListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("editApp.blackList"),prop:"blackListIp"}},[t("el-input",{attrs:{placeholder:e.$t("editApp.blackListPlaceholder")},model:{value:e.editAppInfo.blackListIp,callback:function(t){e.$set(e.editAppInfo,"blackListIp",t)},expression:"editAppInfo.blackListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("editApp.remark"),prop:"remark"}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("editApp.remarkPlaceholder")},model:{value:e.editAppInfo.remark,callback:function(t){e.$set(e.editAppInfo,"remark",t)},expression:"editAppInfo.remark"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:e.editApp}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},o=[],n={name:"EditApp",data(){return{dialogVisible:!1,editAppInfo:{appId:"",name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:""},rules:{name:[{required:!0,message:this.$t("editApp.appNameRequired"),trigger:"blur"},{min:2,max:50,message:this.$t("editApp.appNameLength"),trigger:"blur"}],securityCode:[{max:64,message:this.$t("editApp.securityCodeLength"),trigger:"blur"}],whileListIp:[{max:200,message:this.$t("editApp.whiteListLength"),trigger:"blur"}],blackListIp:[{max:200,message:this.$t("editApp.blackListLength"),trigger:"blur"}],remark:[{max:200,message:this.$t("editApp.remarkLength"),trigger:"blur"}],appId:[{required:!0,message:this.$t("editApp.appIdRequired"),trigger:"blur"}]}}},methods:{open(e){this.editAppInfo={...e},this.dialogVisible=!0},resetForm(){this.$refs.editAppForm.resetFields()},async editApp(){try{await this.$refs.editAppForm.validate(),await Object(s["c"])(this.editAppInfo),this.$message.success(this.$t("editApp.saveSuccess")),this.dialogVisible=!1,this.$emit("success")}catch(e){console.error("修改应用失败:",e)}}}},d=n,c=a("2877"),u=Object(c["a"])(d,r,o,!1,null,null,null),m=u.exports,h=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("deleteApp.title"),visible:e.dialogVisible,width:"30%",center:""},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("div",{staticClass:"text-center"},[t("p",[e._v(e._s(e.$t("deleteApp.confirmDelete")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("deleteApp.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:e.deleteApp}},[e._v(" "+e._s(e.$t("deleteApp.confirm"))+" ")])],1)])},f=[],A={name:"DeleteApp",data(){return{dialogVisible:!1,deleteAppInfo:{}}},methods:{open(e){this.deleteAppInfo={...e},this.dialogVisible=!0},async deleteApp(){try{await Object(s["a"])(this.deleteAppInfo),this.$message.success(this.$t("deleteApp.deleteSuccess")),this.dialogVisible=!1,this.$emit("success")}catch(e){console.error("删除应用失败:",e),this.$message.error(e.message||this.$t("deleteApp.deleteFailed"))}}}},g=A,b=Object(c["a"])(g,h,f,!1,null,null,null),I=b.exports,$={name:"AppManage",components:{AddApp:l["a"],EditApp:m,DeleteApp:I},data(){return{appManageInfo:{apps:[],total:0},pagination:{currentPage:1,pageSize:10}}},created(){this.listApps()},methods:{async listApps(){try{const e={page:this.pagination.currentPage,row:this.pagination.pageSize},t=await Object(s["b"])(e);this.appManageInfo.apps=t.data,this.appManageInfo.total=t.total}catch(e){console.error("获取应用列表失败:",e)}},handleCurrentChange(e){this.pagination.currentPage=e,this.listApps()},openAddAppModal(){this.$refs.addAppModal.open()},openEditAppModal(e){this.$refs.editAppModal.open(e)},openDeleteAppModal(e){this.$refs.deleteAppModal.open(e)}}},k=$,v=(a("09ed"),Object(c["a"])(k,p,i,!1,null,"dd6045ca",null));t["default"]=v.exports},7220:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return l}));var p=a("b775");function i(e){return new Promise((t,a)=>{Object(p["a"])({url:"/app.listApps",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function s(e){return new Promise((t,a)=>{Object(p["a"])({url:"/app.updateApp",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function l(e){return new Promise((t,a)=>{Object(p["a"])({url:"/app.deleteApp",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}},"7e2c":function(e,t,a){},"9d2a":function(e,t,a){"use strict";a.d(t,"c",(function(){return i})),a.d(t,"b",(function(){return s})),a.d(t,"a",(function(){return l}));var p=a("b775");function i(e){return new Promise((t,a)=>{Object(p["a"])({url:"/app.saveApp",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function s(e){return new Promise((t,a)=>{Object(p["a"])({url:"/service.listServices",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function l(e){return new Promise((t,a)=>{Object(p["a"])({url:"/service.bindingService",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}},e9f9:function(e,t,a){"use strict";a("7e2c")},fc4e:function(e,t,a){"use strict";var p=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("addApp.title"),visible:e.dialogVisible,width:"70%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{ref:"addAppForm",attrs:{model:e.addAppInfo,rules:e.rules}},[t("el-form-item",{attrs:{label:e.$t("addApp.appName"),prop:"name"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.appNamePlaceholder")},model:{value:e.addAppInfo.name,callback:function(t){e.$set(e.addAppInfo,"name",t)},expression:"addAppInfo.name"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.securityCode"),prop:"securityCode"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.securityCodePlaceholder")},model:{value:e.addAppInfo.securityCode,callback:function(t){e.$set(e.addAppInfo,"securityCode",t)},expression:"addAppInfo.securityCode"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.whiteList"),prop:"whileListIp"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.whiteListPlaceholder")},model:{value:e.addAppInfo.whileListIp,callback:function(t){e.$set(e.addAppInfo,"whileListIp",t)},expression:"addAppInfo.whileListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.blackList"),prop:"blackListIp"}},[t("el-input",{attrs:{placeholder:e.$t("addApp.blackListPlaceholder")},model:{value:e.addAppInfo.blackListIp,callback:function(t){e.$set(e.addAppInfo,"blackListIp",t)},expression:"addAppInfo.blackListIp"}})],1),t("el-form-item",{attrs:{label:e.$t("addApp.remark"),prop:"remark"}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("addApp.remarkPlaceholder")},model:{value:e.addAppInfo.remark,callback:function(t){e.$set(e.addAppInfo,"remark",t)},expression:"addAppInfo.remark"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveAppInfo}},[e._v(e._s(e.$t("common.save")))])],1)],1)},i=[],s=a("9d2a"),l={name:"AddApp",props:{callBackListener:String,callBackFunction:String},data(){return{dialogVisible:!1,addAppInfo:{appId:"",name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:""},rules:{name:[{required:!0,message:this.$t("addApp.appNameRequired"),trigger:"blur"},{min:2,max:50,message:this.$t("addApp.appNameLength"),trigger:"blur"}],securityCode:[{max:64,message:this.$t("addApp.securityCodeLength"),trigger:"blur"}],whileListIp:[{max:200,message:this.$t("addApp.whiteListLength"),trigger:"blur"}],blackListIp:[{max:200,message:this.$t("addApp.blackListLength"),trigger:"blur"}],remark:[{max:200,message:this.$t("addApp.remarkLength"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0,this.clearAddAppInfo()},handleClose(){this.dialogVisible=!1},clearAddAppInfo(){this.addAppInfo={name:"",securityCode:"",whileListIp:"",blackListIp:"",remark:""},this.$refs.addAppForm&&this.$refs.addAppForm.resetFields()},saveAppInfo(){this.$refs.addAppForm.validate(async e=>{if(e)try{if(this.callBackListener)return this.$emit(this.callBackListener,this.callBackFunction,this.addAppInfo),void this.handleClose();await Object(s["c"])(this.addAppInfo),this.$message.success(this.$t("addApp.saveSuccess")),this.handleClose(),this.$emit("success")}catch(t){this.$message.error(t.message||this.$t("addApp.saveFailed"))}})}}},r=l,o=(a("e9f9"),a("2877")),n=Object(o["a"])(r,p,i,!1,null,"68c9af13",null);t["a"]=n.exports}}]); //# sourceMappingURL=chunk-41d54ea8.da78c6c0.js.map