Files
zfile/src/main/resources/static/js/siteSetting.2fa65c09.js
T
zhaojun1998 aec73f5cc7 💄 更新页面
2020-01-02 14:45:21 +08:00

1 line
11 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["siteSetting"],{"121e":function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-row",[r("el-col",{attrs:{span:16}},[r("el-form",{ref:"form",attrs:{id:"siteForm",rules:e.rules,model:e.form,"label-width":"auto","status-icon":!0}},[r("el-form-item",{attrs:{label:"站点名称",prop:"siteName"}},[r("el-input",{model:{value:e.form.siteName,callback:function(t){e.$set(e.form,"siteName",t)},expression:"form.siteName"}})],1),r("el-form-item",{attrs:{label:"站点域名",prop:"domain"}},[r("el-input",{model:{value:e.form.domain,callback:function(t){e.$set(e.form,"domain",t)},expression:"form.domain"}})],1),r("el-form-item",{attrs:{label:"右侧信息框"}},[r("el-switch",{model:{value:e.form.infoEnable,callback:function(t){e.$set(e.form,"infoEnable",t)},expression:"form.infoEnable"}}),r("span",{staticClass:"zfile-word-aux"},[e._v("开启会影响浏览性能")])],1),r("el-form-item",{attrs:{label:"开启缓存"}},[r("el-switch",{on:{change:function(t){e.form.searchEnable=!1}},model:{value:e.form.enableCache,callback:function(t){e.$set(e.form,"enableCache",t)},expression:"form.enableCache"}}),r("span",{staticClass:"zfile-word-aux"},[e._v("默认缓存 60 分钟,每隔 30 分钟自动刷新一次. 暂不支持修改时间.")])],1),e.form.enableCache?r("el-form-item",{attrs:{label:"搜索"}},[r("el-switch",{model:{value:e.form.searchEnable,callback:function(t){e.$set(e.form,"searchEnable",t)},expression:"form.searchEnable"}}),r("span",{staticClass:"zfile-word-aux"},[e._v("从缓存中搜索文件, 可能会存在数据不一致的情况")])],1):e._e(),e.form.enableCache&&e.form.searchEnable?r("el-form-item",{attrs:{label:"区分大小写"}},[r("el-switch",{model:{value:e.form.searchIgnoreCase,callback:function(t){e.$set(e.form,"searchIgnoreCase",t)},expression:"form.searchIgnoreCase"}})],1):e._e(),r("el-form-item",{attrs:{label:"存储策略"}},[r("el-select",{attrs:{placeholder:"请选择存储策略"},model:{value:e.form.storageStrategy,callback:function(t){e.$set(e.form,"storageStrategy",t)},expression:"form.storageStrategy"}},[r("el-option",{attrs:{label:"阿里云 OSS",value:"aliyun"}}),r("el-option",{attrs:{label:"腾讯云 COS",value:"tencent"}}),r("el-option",{attrs:{label:"华为云 OBS",value:"huawei"}}),r("el-option",{attrs:{label:"七牛云 KODO",value:"qiniu"}}),r("el-option",{attrs:{label:"又拍云 USS",value:"upyun"}}),r("el-option",{attrs:{label:"FTP",value:"ftp"}}),r("el-option",{attrs:{label:"本地存储",value:"local"}}),r("el-option",{attrs:{label:"minio",value:"minio"}})],1)],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",round:""},on:{click:function(t){return e.submitForm("form")}}},[e._v("保存设置")]),r("el-button",{attrs:{type:"danger",round:""},on:{click:e.clearCache}},[e._v("清理缓存")])],1)],1)],1)],1)},n=[],a=r("4328"),i=r.n(a),l={name:"SiteSetting",data:function(){return{form:{siteName:"",storageStrategy:"",domain:"",infoEnable:!1,searchEnable:!1,searchIgnoreCase:!1,enableCache:!1},rules:{siteName:[{required:!0,message:"请输入站点名称",trigger:"change"}],domain:[{required:!0,type:"url",message:"请输入正确的域名, 需以 http:// 或 https:// 开头",trigger:"change"}]}}},methods:{submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;t.$http.post("admin/config",i.a.stringify(t.form)).then((function(){t.$message({message:"保存成功",type:"success"})}))}))},clearCache:function(){var e=this;this.$http.get("admin/clear-cache").then((function(){e.$message({message:"操作成功",type:"success"})}))}},mounted:function(){var e=this;this.$http.get("admin/config").then((function(t){e.form=t.data.data}))}},c=l,s=(r("468c"),r("2877")),f=Object(s["a"])(c,o,n,!1,null,"5ab4a46c",null);t["default"]=f.exports},4127:function(e,t,r){"use strict";var o=r("d233"),n=r("b313"),a={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},i=Date.prototype.toISOString,l={delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,serializeDate:function(e){return i.call(e)},skipNulls:!1,strictNullHandling:!1},c=function e(t,r,n,a,i,c,s,f,u,p,d,m){var y=t;if("function"===typeof s)y=s(r,y);else if(y instanceof Date)y=p(y);else if(null===y){if(a)return c&&!m?c(r,l.encoder):r;y=""}if("string"===typeof y||"number"===typeof y||"boolean"===typeof y||o.isBuffer(y)){if(c){var b=m?r:c(r,l.encoder);return[d(b)+"="+d(c(y,l.encoder))]}return[d(r)+"="+d(String(y))]}var h,g=[];if("undefined"===typeof y)return g;if(Array.isArray(s))h=s;else{var v=Object.keys(y);h=f?v.sort(f):v}for(var O=0;O<h.length;++O){var j=h[O];i&&null===y[j]||(g=Array.isArray(y)?g.concat(e(y[j],n(r,j),n,a,i,c,s,f,u,p,d,m)):g.concat(e(y[j],r+(u?"."+j:"["+j+"]"),n,a,i,c,s,f,u,p,d,m)))}return g};e.exports=function(e,t){var r=e,i=t?o.assign({},t):{};if(null!==i.encoder&&void 0!==i.encoder&&"function"!==typeof i.encoder)throw new TypeError("Encoder has to be a function.");var s="undefined"===typeof i.delimiter?l.delimiter:i.delimiter,f="boolean"===typeof i.strictNullHandling?i.strictNullHandling:l.strictNullHandling,u="boolean"===typeof i.skipNulls?i.skipNulls:l.skipNulls,p="boolean"===typeof i.encode?i.encode:l.encode,d="function"===typeof i.encoder?i.encoder:l.encoder,m="function"===typeof i.sort?i.sort:null,y="undefined"!==typeof i.allowDots&&i.allowDots,b="function"===typeof i.serializeDate?i.serializeDate:l.serializeDate,h="boolean"===typeof i.encodeValuesOnly?i.encodeValuesOnly:l.encodeValuesOnly;if("undefined"===typeof i.format)i.format=n["default"];else if(!Object.prototype.hasOwnProperty.call(n.formatters,i.format))throw new TypeError("Unknown format option provided.");var g,v,O=n.formatters[i.format];"function"===typeof i.filter?(v=i.filter,r=v("",r)):Array.isArray(i.filter)&&(v=i.filter,g=v);var j,w=[];if("object"!==typeof r||null===r)return"";j=i.arrayFormat in a?i.arrayFormat:"indices"in i?i.indices?"indices":"repeat":"indices";var x=a[j];g||(g=Object.keys(r)),m&&g.sort(m);for(var C=0;C<g.length;++C){var A=g[C];u&&null===r[A]||(w=w.concat(c(r[A],A,x,f,u,p?d:null,v,m,y,b,O,h)))}var k=w.join(s),N=!0===i.addQueryPrefix?"?":"";return k.length>0?N+k:""}},4328:function(e,t,r){"use strict";var o=r("4127"),n=r("9e6a"),a=r("b313");e.exports={formats:a,parse:n,stringify:o}},"468c":function(e,t,r){"use strict";var o=r("f04d"),n=r.n(o);n.a},"9e6a":function(e,t,r){"use strict";var o=r("d233"),n=Object.prototype.hasOwnProperty,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:o.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},i=function(e,t){for(var r={},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,l=o.split(t.delimiter,i),c=0;c<l.length;++c){var s,f,u=l[c],p=u.indexOf("]="),d=-1===p?u.indexOf("="):p+1;-1===d?(s=t.decoder(u,a.decoder),f=t.strictNullHandling?null:""):(s=t.decoder(u.slice(0,d),a.decoder),f=t.decoder(u.slice(d+1),a.decoder)),n.call(r,s)?r[s]=[].concat(r[s]).concat(f):r[s]=f}return r},l=function(e,t,r){for(var o=t,n=e.length-1;n>=0;--n){var a,i=e[n];if("[]"===i)a=[],a=a.concat(o);else{a=r.plainObjects?Object.create(null):{};var l="["===i.charAt(0)&&"]"===i.charAt(i.length-1)?i.slice(1,-1):i,c=parseInt(l,10);!isNaN(c)&&i!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[],a[c]=o):a[l]=o}o=a}return o},c=function(e,t,r){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,c=a.exec(o),s=c?o.slice(0,c.index):o,f=[];if(s){if(!r.plainObjects&&n.call(Object.prototype,s)&&!r.allowPrototypes)return;f.push(s)}var u=0;while(null!==(c=i.exec(o))&&u<r.depth){if(u+=1,!r.plainObjects&&n.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(c[1])}return c&&f.push("["+o.slice(c.index)+"]"),l(f,t,r)}};e.exports=function(e,t){var r=t?o.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!==typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"===typeof r.delimiter||o.isRegExp(r.delimiter)?r.delimiter:a.delimiter,r.depth="number"===typeof r.depth?r.depth:a.depth,r.arrayLimit="number"===typeof r.arrayLimit?r.arrayLimit:a.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"===typeof r.decoder?r.decoder:a.decoder,r.allowDots="boolean"===typeof r.allowDots?r.allowDots:a.allowDots,r.plainObjects="boolean"===typeof r.plainObjects?r.plainObjects:a.plainObjects,r.allowPrototypes="boolean"===typeof r.allowPrototypes?r.allowPrototypes:a.allowPrototypes,r.parameterLimit="number"===typeof r.parameterLimit?r.parameterLimit:a.parameterLimit,r.strictNullHandling="boolean"===typeof r.strictNullHandling?r.strictNullHandling:a.strictNullHandling,""===e||null===e||"undefined"===typeof e)return r.plainObjects?Object.create(null):{};for(var n="string"===typeof e?i(e,r):e,l=r.plainObjects?Object.create(null):{},s=Object.keys(n),f=0;f<s.length;++f){var u=s[f],p=c(u,n[u],r);l=o.merge(l,p,r)}return o.compact(l)}},b313:function(e,t,r){"use strict";var o=String.prototype.replace,n=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return o.call(e,n,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},d233:function(e,t,r){"use strict";var o=Object.prototype.hasOwnProperty,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e){var t;while(e.length){var r=e.pop();if(t=r.obj[r.prop],Array.isArray(t)){for(var o=[],n=0;n<t.length;++n)"undefined"!==typeof t[n]&&o.push(t[n]);r.obj[r.prop]=o}}return t},i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)"undefined"!==typeof e[o]&&(r[o]=e[o]);return r},l=function e(t,r,n){if(!r)return t;if("object"!==typeof r){if(Array.isArray(t))t.push(r);else{if("object"!==typeof t)return[t,r];(n.plainObjects||n.allowPrototypes||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if("object"!==typeof t)return[t].concat(r);var a=t;return Array.isArray(t)&&!Array.isArray(r)&&(a=i(t,n)),Array.isArray(t)&&Array.isArray(r)?(r.forEach((function(r,a){o.call(t,a)?t[a]&&"object"===typeof t[a]?t[a]=e(t[a],r,n):t.push(r):t[a]=r})),t):Object.keys(r).reduce((function(t,a){var i=r[a];return o.call(t,a)?t[a]=e(t[a],i,n):t[a]=i,t}),a)},c=function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},s=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},f=function(e){if(0===e.length)return e;for(var t="string"===typeof e?e:String(e),r="",o=0;o<t.length;++o){var a=t.charCodeAt(o);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?r+=t.charAt(o):a<128?r+=n[a]:a<2048?r+=n[192|a>>6]+n[128|63&a]:a<55296||a>=57344?r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&t.charCodeAt(o)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a])}return r},u=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],o=0;o<t.length;++o)for(var n=t[o],i=n.obj[n.prop],l=Object.keys(i),c=0;c<l.length;++c){var s=l[c],f=i[s];"object"===typeof f&&null!==f&&-1===r.indexOf(f)&&(t.push({obj:i,prop:s}),r.push(f))}return a(t)},p=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},d=function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};e.exports={arrayToObject:i,assign:c,compact:u,decode:s,encode:f,isBuffer:d,isRegExp:p,merge:l}},f04d:function(e,t,r){}}]);