blob: a0024c7653a3d8bcbd91606f35b45071e9b03272 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4cf90b49"],{"14c9":function(e,t,r){"use strict";var n=r("9435"),a=r.n(n);a.a},"504c":function(e,t,r){var n=r("9e1e"),a=r("0d58"),c=r("6821"),i=r("52a7").f;e.exports=function(e){return function(t){var r,o=c(t),s=a(o),u=s.length,f=0,l=[];while(u>f)r=s[f++],n&&!i.call(o,r)||l.push(e?[r,o[r]]:o[r]);return l}}},5313:function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"e",(function(){return c})),r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"a",(function(){return s}));var n=r("b32d"),a=function(){return Object(n["a"])({url:"/ssl",method:"GET"})},c=function(e,t){return Object(n["a"])({url:"/ssl/".concat(e),method:"PUT",data:t})},i=function(e){return Object(n["a"])({url:"/ssl/".concat(e),method:"GET"})},o=function(e){return Object(n["a"])({url:"/ssl/".concat(e),method:"DELETE"})},s=function(e){return Object(n["a"])({url:"/ssl",method:"POST",data:e})}},7097:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"container"},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px","show-message":!1}},[r("el-form-item",{attrs:{label:"SNI",prop:"sni"}},[r("el-input",{attrs:{placeholder:"SNI"},model:{value:e.form.sni,callback:function(t){e.$set(e.form,"sni",t)},expression:"form.sni"}})],1),r("el-form-item",{attrs:{label:"CERT",prop:"cert"}},[r("el-input",{attrs:{placeholder:"CERT",type:"textarea",rows:7},model:{value:e.form.cert,callback:function(t){e.$set(e.form,"cert",t)},expression:"form.cert"}})],1),r("el-form-item",{attrs:{label:"KEY",prop:"key"}},[r("el-input",{attrs:{placeholder:"KEY",type:"textarea",rows:7},model:{value:e.form.key,callback:function(t){e.$set(e.form,"key",t)},expression:"form.key"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("\n "+e._s(e.$t("button.save"))+"\n ")]),r("el-button",{on:{click:e.toPreviousPage}},[e._v("\n "+e._s(e.$t("button.cancel"))+"\n ")])],1)],1)],1)},a=[],c=r("768b"),i=(r("ffc1"),r("ac6a"),r("96cf"),r("3b8d")),o=(r("7f7f"),r("d225")),s=r("b0b4"),u=r("308d"),f=r("6bb5"),l=r("4e2b"),d=r("9ab4"),m=r("60a3"),b=r("e741"),p=r("5313"),h=function(e){function t(){var e;return Object(o["a"])(this,t),e=Object(u["a"])(this,Object(f["a"])(t).apply(this,arguments)),e.form={sni:"",cert:"",key:""},e.rules={sni:{required:!0},cert:{required:!0},key:{required:!0}},e.isEditMode=!1,e}return Object(l["a"])(t,e),Object(s["a"])(t,[{key:"created",value:function(){this.isEditMode=-1===this.$route.name.indexOf("Create"),this.isEditMode&&this.getData()}},{key:"getData",value:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r,n,a,c,i,o,s,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this.$route.params.id,e.next=3,Object(p["b"])(t);case 3:r=e.sent,n=r.node.value,a=n.sni,c=void 0===a?"":a,i=n.cert,o=void 0===i?"":i,s=n.key,u=void 0===s?"":s,this.form={sni:c,cert:o,key:u};case 12:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"onSubmit",value:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs.form.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(r){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log("onSubmit",t.form),!r){e.next=15;break}if(n=Object.assign({},t.form),Object.entries(n).forEach((function(e){var t=Object(c["a"])(e,2),r=t[0],a=t[1];""===a&&delete n[r]})),!t.isEditMode){e.next=9;break}return e.next=7,Object(p["e"])(t.$route.params.id,n);case 7:e.next=11;break;case 9:return e.next=11,Object(p["a"])(n);case 11:t.$message.success("".concat(t.isEditMode?"Update the":"Create a"," ssl successfully!")),t.isEditMode||(b["a"].delView(t.$route),t.$nextTick((function(){t.$router.push({name:"SchemaSSLList"})}))),e.next=16;break;case 15:return e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"toPreviousPage",value:function(){this.$router.go(-1)}}]),t}(m["c"]);h=d["a"]([Object(m["a"])({name:"RouterEdit"})],h);var v=h,k=v,j=(r("14c9"),r("2877")),O=Object(j["a"])(k,n,a,!1,null,null,null);t["default"]=O.exports},9435:function(e,t,r){e.exports={menuBg:"#304156",menuText:"#bfcbd9",menuActiveText:"#409eff"}},b32d:function(e,t,r){"use strict";var n=r("bc3a"),a=r.n(n),c=r("5c96"),i=a.a.create({baseURL:"/apisix/admin/",timeout:5e3});i.interceptors.request.use((function(e){return e}),(function(e){Promise.reject(e)})),i.interceptors.response.use((function(e){return e.data}),(function(e){return Object(c["Message"])({message:e.response.data.error_msg||e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=i},ffc1:function(e,t,r){var n=r("5ca1"),a=r("504c")(!0);n(n.S,"Object",{entries:function(e){return a(e)}})}}]);