Unverified Commit b6dc37b6 authored by Ryan Wang's avatar Ryan Wang Committed by GitHub
Browse files

release: 1.5.0-alpha.2 (#1703)

Signed-off-by: default avatarRyan Wang <i@ryanc.cc>
Showing with 52 additions and 15 deletions
+52 -15
# CHANGELOG
# 1.5.0-alpha.2
## Features
- Admin API 提供批量删除图库图片的接口。 halo-dev/halo#1680 @ruibaby
- Admin API 提供批量更新图库图片的接口。 halo-dev/halo#1679 @ruibaby
- 后台评论管理提供日志评论管理的界面。 halo-dev/halo-admin#480 @cetr
## Improvements
- 优化文章加密和分类加密的逻辑。 halo-dev/halo#1678 @guqing
- 优化后台登录页面样式。 halo-dev/halo-admin#456 @ruibaby
- 后台主题详情中的链接打开方式修改为打开新窗口。 halo-dev/halo-admin#461 @cetr
- 重构后台文章评论列表弹窗。 halo-dev/halo-admin#463 @ruibaby
- 优化后台文章/自定义页面设置弹窗中缩略图的样式。 halo-dev/halo-admin#470 halo-dev/halo-admin#471 @ruibaby
- 重构后台图库管理页面,支持批量操作图片以及批量从附件库添加图片。 halo-dev/halo-admin#468 @ruibaby
- 重构后台文章管理页面,文章列表将不再展示回收站状态的文章,提供单独的回收站入口。 halo-dev/halo-admin#475 @ruibaby
- 优化后台文章/自定义页面设置的保存逻辑,提供转为发布/草稿的按钮。保存按钮不再影响到文章状态。 halo-dev/halo-admin#476 @ruibaby
## Bug Fixes
- 更新默认主题的 submodule 提交,修复模板中部分因为数字中带逗号导致的渲染异常。 halo-dev/halo#1682 @ruibaby
- 修复 Content API 的 post 和 sheet 详情接口中内容为空的问题。 halo-dev/halo#1686 @fuzui
- 修复评论默认头像因为修改了默认类型但 options 接口没有返回字段导致评论头像无法显示的问题。 halo-dev/halo#1692 @lan-yonghui
- 修复使用 leveldb 的情况下,解析错误而没有清空缓存导致无法正常使用系统的问题。 halo-dev/halo#1695 @guqing
- 修复 1.5.0-alpha.1 中修改了表结构但是没有修改备份数据和导入数据结构的问题。 halo-dev/halo#1669 @guqing
- 修复后台在文章编辑页面切换左侧菜单收缩的时候出现的样式异常。 halo-dev/halo-admin#465 @ruibaby
- 修复后台在 1.5.0-alpha.1 版本中,附件图片链接中包含特殊字符导致图片无法显示的问题。 halo-dev/halo-admin#474 @ruibaby
## Dependencies
- 修复因为 1.5.0-alpha.1 版本中更新 minio sdk 依赖导致无法正常上传文件的问题。 halo-dev/halo#1666 @JarvisPongSky
- 升级 Spring Boot 版本到 2.5.10。 halo-dev/halo#1677 @ruibaby
- 升级 Gradle 版本到 7.4。 halo-dev/halo#1697 @guqing
- `halo-dev/halo-admin` 常规依赖升级。 halo-dev/halo-admin#453 @ruibaby
- `halo-dev/halo-admin` 修改用于切换后台样式的 less 依赖 CDN 为 unpkg。
# 1.5.0-alpha.1
## Breaking changes
......
.chosen[data-v-93ae2cf2],.ghost[data-v-93ae2cf2]{opacity:.8;--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.chosen[data-v-93ae2cf2]{padding:0 5px}.drag[data-v-93ae2cf2]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));padding:0 5px}[data-v-93ae2cf2] .ant-list-item-action{display:none}[data-v-93ae2cf2] .menu-item:hover .ant-list-item-action{display:block}
\ No newline at end of file
.chosen[data-v-56da7354],.ghost[data-v-56da7354]{opacity:.8;--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.chosen[data-v-56da7354]{padding:0 5px}.drag[data-v-56da7354]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));padding:0 5px}[data-v-56da7354] .ant-list-item-action{display:none}[data-v-56da7354] .menu-item:hover .ant-list-item-action{display:block}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="renderer" content="webkit"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/><meta name="robots" content="noindex,nofollow"/><meta name="generator" content="Halo 1.5.0-alpha.1"/><link rel="icon" href="/favicon.ico"/><title>Halo</title><style>body {height: 100%;background-color: #f5f5f5;}#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><script defer="defer" type="module" src="/js/chunk-vendors.a52c4796.js"></script><script defer="defer" type="module" src="/js/app.a9cfc629.js"></script><link href="/css/chunk-vendors.e6958125.css" rel="stylesheet"><link href="/css/app.a20b4354.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.b555b0d7.js" nomodule></script><script defer="defer" src="/js/app-legacy.a4fb4ede.js" nomodule></script></head><body><noscript><strong>We're sorry but halo admin client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loader"></div></div></body></html>
\ No newline at end of file
<!doctype html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="renderer" content="webkit"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/><meta name="robots" content="noindex,nofollow"/><meta name="generator" content="Halo 1.5.0-alpha.2"/><link rel="icon" href="/favicon.ico"/><title>Halo</title><style>body {height: 100%;background-color: #f5f5f5;}#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><script defer="defer" src="/js/chunk-vendors.9a0d13f5.js"></script><script defer="defer" src="/js/app.b0a3a24c.js"></script><link href="/css/chunk-vendors.e6958125.css" rel="stylesheet"><link href="/css/app.fefc29f9.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but halo admin client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loader"></div></div></body></html>
\ No newline at end of file
(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[122],{24122:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("page-view",{attrs:{title:e.activatedTheme?e.activatedTheme.name:"",affix:"",subTitle:"当前启用"}},[l("template",{slot:"extra"},[l("a-button",{attrs:{loading:e.list.loading,icon:"reload"},on:{click:e.handleRefreshThemesCache}},[e._v(" 刷新")]),l("a-button",{attrs:{icon:"plus",type:"primary"},on:{click:function(t){e.installModal.visible=!0}}},[e._v(" 安装")])],1),l("a-row",{attrs:{gutter:12,align:"middle",type:"flex"}},[l("a-col",{attrs:{span:24}},[l("a-list",{attrs:{dataSource:e.sortedThemes,grid:{gutter:12,xs:1,sm:1,md:2,lg:4,xl:4,xxl:4},loading:e.list.loading},scopedSlots:e._u([{key:"renderItem",fn:function(t,a){return l("a-list-item",{key:a},[l("a-card",{attrs:{bodyStyle:{padding:0},title:t.name,hoverable:""}},[l("div",{staticClass:"theme-screenshot"},[l("img",{attrs:{alt:t.name,src:t.screenshots||"/images/placeholder.jpg",loading:"lazy"}})]),l("template",{slot:"actions"},[t.activated?l("div",[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{theme:"twoTone",type:"unlock"}}),e._v(" 已启用 ")],1):l("div",{on:{click:function(l){return e.handleActiveTheme(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"lock"}}),e._v(" 启用 ")],1),l("div",{on:{click:function(l){return e.handleRouteToThemeSetting(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"setting"}}),e._v(" 设置 ")],1),l("a-dropdown",{attrs:{trigger:["click"],placement:"topCenter"}},[l("a",{staticClass:"ant-dropdown-link",attrs:{href:"#"}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"ellipsis"}}),e._v(" 更多 ")],1),l("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[l("a-menu-item",{key:1,attrs:{disabled:t.activated},on:{click:function(l){return e.handleOpenThemeDeleteModal(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"delete"}}),e._v(" 删除 ")],1),t.repo?l("a-menu-item",{key:2,on:{click:function(l){return e.handleConfirmRemoteUpdate(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"cloud"}}),e._v(" 在线更新 ")],1):e._e(),l("a-menu-item",{key:3,on:{click:function(l){return e.handleOpenLocalUpdateModal(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"file"}}),e._v(" 本地更新 ")],1)],1)],1)],1)],2)],1)}}])})],1)],1),l("ThemeDeleteConfirmModal",{attrs:{theme:e.themeDeleteModal.selected,visible:e.themeDeleteModal.visible},on:{"update:visible":function(t){return e.$set(e.themeDeleteModal,"visible",t)},onAfterClose:function(t){e.themeDeleteModal.selected={}},success:e.handleListThemes}}),l("ThemeLocalUpgradeModal",{attrs:{theme:e.localUpgradeModel.selected,visible:e.localUpgradeModel.visible},on:{"update:visible":function(t){return e.$set(e.localUpgradeModel,"visible",t)},onAfterClose:function(t){e.localUpgradeModel.selected={}},success:e.handleListThemes}}),l("ThemeInstallModal",{attrs:{visible:e.installModal.visible},on:{"update:visible":function(t){return e.$set(e.installModal,"visible",t)},onAfterClose:e.handleListThemes}})],2)},n=[],i=l(91057),r=(l(70315),l(96153),l(19003),l(31875),l(21082),l(43348)),o=l(59464),s=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onModalClose,bodyStyle:{padding:"0 24px 24px"},footer:null,destroyOnClose:"",title:"安装主题"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("div",{staticClass:"custom-tab-wrapper"},[l("a-tabs",{attrs:{animated:{inkBar:!0,tabPane:!1}}},[l("a-tab-pane",{key:"1",attrs:{tab:"本地上传"}},[l("FilePondUpload",{ref:"upload",attrs:{accepts:["application/x-zip","application/x-zip-compressed","application/zip"],uploadHandler:e.local.uploadHandler,label:"点击选择主题包或将主题包拖拽到此处<br>仅支持 ZIP 格式的文件",name:"file"},on:{success:e.onUploadSucceed}}),l("div",{staticClass:"mt-5"},[l("a-alert",{attrs:{closable:"",type:"info"}},[l("template",{slot:"message"},[e._v(" 更多主题请访问: "),l("a",{attrs:{href:"https://halo.run/themes.html",target:"_blank"}},[e._v("https://halo.run/themes")])])],2)],1)],1),l("a-tab-pane",{key:"2",attrs:{tab:"远程下载"}},[l("a-form-model",{ref:"remoteInstallForm",attrs:{model:e.remote,rules:e.remote.rules,layout:"vertical"}},[l("a-form-model-item",{attrs:{help:"* 支持 Git 仓库地址,ZIP 链接。",label:"远程地址:",prop:"url"}},[l("a-input",{model:{value:e.remote.url,callback:function(t){e.$set(e.remote,"url",t)},expression:"remote.url"}})],1),l("a-form-model-item",[l("ReactiveButton",{attrs:{errored:e.remote.fetchErrored,loading:e.remote.fetching,erroredText:"下载失败",loadedText:"下载成功",text:"下载",type:"primary"},on:{callback:e.handleRemoteFetchCallback,click:e.handleRemoteFetching}})],1)],1),l("div",{staticClass:"mt-5"},[l("a-alert",{attrs:{closable:"",type:"info"}},[l("template",{slot:"message"},[e._v(" 目前仅支持远程 Git 仓库和 ZIP 下载链接。更多主题请访问: "),l("a",{attrs:{href:"https://halo.run/themes.html",target:"_blank"}},[e._v("https://halo.run/themes")])])],2)],1)],1)],1)],1)])},c=[],d=l(1540),u={name:"ThemeInstallModal",props:{visible:{type:Boolean,default:!1}},data:function(){return{local:{uploadHandler:function(e,t){return d.Z.theme.upload(e,t)}},remote:{url:null,fetching:!1,fetchErrored:!1,rules:{url:[{required:!0,message:"* 远程地址不能为空",trigger:["change"]}]}}}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},methods:{onModalClose:function(){this.$refs.upload.handleClearFileList(),this.remote.url=null,this.$emit("onAfterClose")},onUploadSucceed:function(){this.modalVisible=!1,this.$emit("upload-succeed")},handleRemoteFetching:function(){var e=this;this.$refs.remoteInstallForm.validate(function(){var t=(0,i.Z)(regeneratorRuntime.mark((function t(l){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!l){t.next=14;break}return t.prev=1,e.remote.fetching=!0,t.next=5,d.Z.theme.fetchTheme(e.remote.url);case 5:t.next=11;break;case 7:t.prev=7,t.t0=t["catch"](1),e.remote.fetchErrored=!0,e.$log.error("Fetch remote theme failed: ",t.t0);case 11:return t.prev=11,setTimeout((function(){e.remote.fetching=!1}),400),t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[1,7,11,14]])})));return function(e){return t.apply(this,arguments)}}())},handleRemoteFetchCallback:function(){this.remote.fetchErrored?this.remote.fetchErrored=!1:this.modalVisible=!1}}},h=u,m=l(18156),f=(0,m.Z)(h,s,c,!1,null,null,null),p=f.exports,v=l(50990),g={components:{PageView:v.B4,ThemeDeleteConfirmModal:r.Z,ThemeLocalUpgradeModal:o.Z,ThemeInstallModal:p},data:function(){return{list:{loading:!1,data:[]},installModal:{visible:!1},localUpgradeModel:{visible:!1,selected:{}},themeDeleteModal:{visible:!1,selected:{}}}},computed:{sortedThemes:function(){var e=this.list.data.slice(0);return e.sort((function(e,t){return t.activated-e.activated}))},activatedTheme:function(){return this.sortedThemes.length>0?this.sortedThemes[0]:null}},beforeMount:function(){this.handleListThemes()},methods:{handleListThemes:function(){var e=this;this.list.loading=!0,d.Z.theme.list().then((function(t){e.list.data=t.data})).finally((function(){e.list.loading=!1}))},handleRefreshThemesCache:function(){var e=this;d.Z.theme.reload().finally((function(){e.handleListThemes()}))},handleActiveTheme:function(e){var t=this;d.Z.theme.active(e.id).finally((function(){t.handleListThemes()}))},handleOpenLocalUpdateModal:function(e){this.localUpgradeModel.selected=e,this.localUpgradeModel.visible=!0},handleRouteToThemeSetting:function(e){this.$router.push({name:"ThemeSetting",query:{themeId:e.id}})},handleOpenThemeDeleteModal:function(e){this.themeDeleteModal.visible=!0,this.themeDeleteModal.selected=e},handleConfirmRemoteUpdate:function(e){var t=this;t.$confirm({title:"提示",maskClosable:!0,content:"确定更新【"+e.name+"】主题?",onOk:function(){return(0,i.Z)(regeneratorRuntime.mark((function l(){var a;return regeneratorRuntime.wrap((function(l){while(1)switch(l.prev=l.next){case 0:return a=t.$message.loading("更新中...",0),l.prev=1,l.next=4,d.Z.theme.updateThemeByFetching(e.id);case 4:t.$message.success("更新成功!"),l.next=10;break;case 7:l.prev=7,l.t0=l["catch"](1),t.$log.error("Failed to update theme: ",l.t0);case 10:return l.prev=10,a(),t.handleListThemes(),l.finish(10);case 14:case"end":return l.stop()}}),l,null,[[1,7,10,14]])})))()}})}}},b=g,y=(0,m.Z)(b,a,n,!1,null,null,null),k=y.exports},43348:function(e,t,l){"use strict";l.d(t,{Z:function(){return u}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onAfterClose,closable:!1,width:416,destroyOnClose:"",title:"提示"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("template",{slot:"footer"},[l("a-button",{on:{click:function(t){e.modalVisible=!1}}},[e._v(" 取消 ")]),l("ReactiveButton",{attrs:{errored:e.deleteErrored,loading:e.deleting,erroredText:"删除失败",loadedText:"删除成功",text:"确定"},on:{callback:e.handleDeleteCallback,click:function(t){return e.handleDelete()}}})],1),l("p",[e._v("确定删除【"+e._s(e.theme.name)+"】主题?")]),l("a-checkbox",{model:{value:e.deleteSettings,callback:function(t){e.deleteSettings=t},expression:"deleteSettings"}},[e._v(" 同时删除主题配置 ")])],2)},n=[],i=l(91057),r=(l(70315),l(1540)),o={name:"ThemeDeleteConfirmModal",props:{visible:{type:Boolean,default:!1},theme:{type:Object,default:function(){return{}}}},data:function(){return{deleteErrored:!1,deleting:!1,deleteSettings:!1}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},methods:{handleDelete:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.deleting=!0,t.next=4,r.Z.theme["delete"](e.theme.id,e.deleteSettings);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t["catch"](0),e.deleteErrored=!1,e.$log.error("Delete theme failed",t.t0);case 10:return t.prev=10,setTimeout((function(){e.deleting=!1}),400),t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[0,6,10,13]])})))()},handleDeleteCallback:function(){this.deleteErrored?this.deleteErrored=!1:(this.modalVisible=!1,this.$emit("success"))},onAfterClose:function(){this.deleteErrored=!1,this.deleting=!1,this.deleteSettings=!1,this.$emit("onAfterClose")}}},s=o,c=l(18156),d=(0,c.Z)(s,a,n,!1,null,null,null),u=d.exports},59464:function(e,t,l){"use strict";l.d(t,{Z:function(){return d}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onModalClose,footer:null,destroyOnClose:"",title:"更新主题"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("FilePondUpload",{ref:"updateByFile",attrs:{accepts:["application/x-zip","application/x-zip-compressed","application/zip"],field:e.theme.id,multiple:!1,uploadHandler:e.uploadHandler,label:"点击选择主题更新包或将主题更新包拖拽到此处<br>仅支持 ZIP 格式的文件",name:"file"},on:{success:e.onThemeUploadSuccess}})],1)},n=[],i=l(1540),r={name:"ThemeLocalUpgradeModal",props:{visible:{type:Boolean,default:!1},theme:{type:Object,default:function(){return{}}}},data:function(){return{uploadHandler:function(e,t,l){return i.Z.theme.updateByUpload(e,t,l)}}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},methods:{onModalClose:function(){this.$refs.updateByFile.handleClearFileList(),this.$emit("onAfterClose")},onThemeUploadSuccess:function(){this.modalVisible=!1,this.$emit("success")}}},o=r,s=l(18156),c=(0,s.Z)(o,a,n,!1,null,null,null),d=c.exports},53303:function(e,t,l){var a=l(15820),n=Math.floor,i=function(e,t){var l=e.length,s=n(l/2);return l<8?r(e,t):o(e,i(a(e,0,s),t),i(a(e,s),t),t)},r=function(e,t){var l,a,n=e.length,i=1;while(i<n){a=i,l=e[i];while(a&&t(e[a-1],l)>0)e[a]=e[--a];a!==i++&&(e[a]=l)}return e},o=function(e,t,l,a){var n=t.length,i=l.length,r=0,o=0;while(r<n||o<i)e[r+o]=r<n&&o<i?a(t[r],l[o])<=0?t[r++]:l[o++]:r<n?t[r++]:l[o++];return e};e.exports=i},52103:function(e,t,l){var a=l(82678),n=a.match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},76044:function(e,t,l){var a=l(82678);e.exports=/MSIE|Trident/.test(a)},97551:function(e,t,l){var a=l(82678),n=a.match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},19003:function(e,t,l){"use strict";var a=l(79644),n=l(33691),i=l(77925),r=l(43207),o=l(71768),s=l(43150),c=l(32640),d=l(53303),u=l(29415),h=l(52103),m=l(76044),f=l(3718),p=l(97551),v=[],g=n(v.sort),b=n(v.push),y=c((function(){v.sort(void 0)})),k=c((function(){v.sort(null)})),x=u("sort"),T=!c((function(){if(f)return f<70;if(!(h&&h>3)){if(m)return!0;if(p)return p<603;var e,t,l,a,n="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:l=3;break;case 68:case 71:l=4;break;default:l=2}for(a=0;a<47;a++)v.push({k:t+a,v:l})}for(v.sort((function(e,t){return t.v-e.v})),a=0;a<v.length;a++)t=v[a].k.charAt(0),n.charAt(n.length-1)!==t&&(n+=t);return"DGBEFHACIJK"!==n}})),C=y||!k||!x||!T,M=function(e){return function(t,l){return void 0===l?-1:void 0===t?1:void 0!==e?+e(t,l)||0:s(t)>s(l)?1:-1}};a({target:"Array",proto:!0,forced:C},{sort:function(e){void 0!==e&&i(e);var t=r(this);if(T)return void 0===e?g(t):g(t,e);var l,a,n=[],s=o(t);for(a=0;a<s;a++)a in t&&b(n,t[a]);d(n,M(e)),l=n.length,a=0;while(a<l)t[a]=n[a++];while(a<s)delete t[a++];return t}})}}]);
\ No newline at end of file
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[122],{24122:function(e,t,l){l.r(t),l.d(t,{default:function(){return y}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("page-view",{attrs:{title:e.activatedTheme?e.activatedTheme.name:"",affix:"",subTitle:"当前启用"}},[l("template",{slot:"extra"},[l("a-button",{attrs:{loading:e.list.loading,icon:"reload"},on:{click:e.handleRefreshThemesCache}},[e._v(" 刷新")]),l("a-button",{attrs:{icon:"plus",type:"primary"},on:{click:function(t){e.installModal.visible=!0}}},[e._v(" 安装")])],1),l("a-row",{attrs:{gutter:12,align:"middle",type:"flex"}},[l("a-col",{attrs:{span:24}},[l("a-list",{attrs:{dataSource:e.sortedThemes,grid:{gutter:12,xs:1,sm:1,md:2,lg:4,xl:4,xxl:4},loading:e.list.loading},scopedSlots:e._u([{key:"renderItem",fn:function(t,a){return l("a-list-item",{key:a},[l("a-card",{attrs:{bodyStyle:{padding:0},title:t.name,hoverable:""}},[l("div",{staticClass:"theme-screenshot"},[l("img",{attrs:{alt:t.name,src:t.screenshots||"/images/placeholder.jpg",loading:"lazy"}})]),l("template",{slot:"actions"},[t.activated?l("div",[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{theme:"twoTone",type:"unlock"}}),e._v(" 已启用 ")],1):l("div",{on:{click:function(l){return e.handleActiveTheme(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"lock"}}),e._v(" 启用 ")],1),l("div",{on:{click:function(l){return e.handleRouteToThemeSetting(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"setting"}}),e._v(" 设置 ")],1),l("a-dropdown",{attrs:{trigger:["click"],placement:"topCenter"}},[l("a",{staticClass:"ant-dropdown-link",attrs:{href:"#"}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"ellipsis"}}),e._v(" 更多 ")],1),l("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[l("a-menu-item",{key:1,attrs:{disabled:t.activated},on:{click:function(l){return e.handleOpenThemeDeleteModal(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"delete"}}),e._v(" 删除 ")],1),t.repo?l("a-menu-item",{key:2,on:{click:function(l){return e.handleConfirmRemoteUpdate(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"cloud"}}),e._v(" 在线更新 ")],1):e._e(),l("a-menu-item",{key:3,on:{click:function(l){return e.handleOpenLocalUpdateModal(t)}}},[l("a-icon",{staticStyle:{"margin-right":"3px"},attrs:{type:"file"}}),e._v(" 本地更新 ")],1)],1)],1)],1)],2)],1)}}])})],1)],1),l("ThemeDeleteConfirmModal",{attrs:{theme:e.themeDeleteModal.selected,visible:e.themeDeleteModal.visible},on:{"update:visible":function(t){return e.$set(e.themeDeleteModal,"visible",t)},onAfterClose:function(t){e.themeDeleteModal.selected={}},success:e.handleListThemes}}),l("ThemeLocalUpgradeModal",{attrs:{theme:e.localUpgradeModel.selected,visible:e.localUpgradeModel.visible},on:{"update:visible":function(t){return e.$set(e.localUpgradeModel,"visible",t)},onAfterClose:function(t){e.localUpgradeModel.selected={}},success:e.handleListThemes}}),l("ThemeInstallModal",{attrs:{visible:e.installModal.visible},on:{"update:visible":function(t){return e.$set(e.installModal,"visible",t)},onAfterClose:e.handleListThemes}})],2)},i=[],s=l(43348),o=l(59464),n=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onModalClose,bodyStyle:{padding:"0 24px 24px"},footer:null,destroyOnClose:"",title:"安装主题"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("div",{staticClass:"custom-tab-wrapper"},[l("a-tabs",{attrs:{animated:{inkBar:!0,tabPane:!1}}},[l("a-tab-pane",{key:"1",attrs:{tab:"本地上传"}},[l("FilePondUpload",{ref:"upload",attrs:{accepts:["application/x-zip","application/x-zip-compressed","application/zip"],uploadHandler:e.local.uploadHandler,label:"点击选择主题包或将主题包拖拽到此处<br>仅支持 ZIP 格式的文件",name:"file"},on:{success:e.onUploadSucceed}}),l("div",{staticClass:"mt-5"},[l("a-alert",{attrs:{closable:"",type:"info"}},[l("template",{slot:"message"},[e._v(" 更多主题请访问: "),l("a",{attrs:{href:"https://halo.run/themes.html",target:"_blank"}},[e._v("https://halo.run/themes")])])],2)],1)],1),l("a-tab-pane",{key:"2",attrs:{tab:"远程下载"}},[l("a-form-model",{ref:"remoteInstallForm",attrs:{model:e.remote,rules:e.remote.rules,layout:"vertical"}},[l("a-form-model-item",{attrs:{help:"* 支持 Git 仓库地址,ZIP 链接。",label:"远程地址:",prop:"url"}},[l("a-input",{model:{value:e.remote.url,callback:function(t){e.$set(e.remote,"url",t)},expression:"remote.url"}})],1),l("a-form-model-item",[l("ReactiveButton",{attrs:{errored:e.remote.fetchErrored,loading:e.remote.fetching,erroredText:"下载失败",loadedText:"下载成功",text:"下载",type:"primary"},on:{callback:e.handleRemoteFetchCallback,click:e.handleRemoteFetching}})],1)],1),l("div",{staticClass:"mt-5"},[l("a-alert",{attrs:{closable:"",type:"info"}},[l("template",{slot:"message"},[e._v(" 目前仅支持远程 Git 仓库和 ZIP 下载链接。更多主题请访问: "),l("a",{attrs:{href:"https://halo.run/themes.html",target:"_blank"}},[e._v("https://halo.run/themes")])])],2)],1)],1)],1)],1)])},r=[],d=l(1540),c={name:"ThemeInstallModal",props:{visible:{type:Boolean,default:!1}},data(){return{local:{uploadHandler:(e,t)=>d.Z.theme.upload(e,t)},remote:{url:null,fetching:!1,fetchErrored:!1,rules:{url:[{required:!0,message:"* 远程地址不能为空",trigger:["change"]}]}}}},computed:{modalVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}}},methods:{onModalClose(){this.$refs.upload.handleClearFileList(),this.remote.url=null,this.$emit("onAfterClose")},onUploadSucceed(){this.modalVisible=!1,this.$emit("upload-succeed")},handleRemoteFetching(){this.$refs.remoteInstallForm.validate((async e=>{if(e)try{this.remote.fetching=!0,await d.Z.theme.fetchTheme(this.remote.url)}catch(t){this.remote.fetchErrored=!0,this.$log.error("Fetch remote theme failed: ",t)}finally{setTimeout((()=>{this.remote.fetching=!1}),400)}}))},handleRemoteFetchCallback(){this.remote.fetchErrored?this.remote.fetchErrored=!1:this.modalVisible=!1}}},h=c,m=l(18156),u=(0,m.Z)(h,n,r,!1,null,null,null),p=u.exports,f=l(50990),g={components:{PageView:f.B4,ThemeDeleteConfirmModal:s.Z,ThemeLocalUpgradeModal:o.Z,ThemeInstallModal:p},data(){return{list:{loading:!1,data:[]},installModal:{visible:!1},localUpgradeModel:{visible:!1,selected:{}},themeDeleteModal:{visible:!1,selected:{}}}},computed:{sortedThemes(){const e=this.list.data.slice(0);return e.sort(((e,t)=>t.activated-e.activated))},activatedTheme(){return this.sortedThemes.length>0?this.sortedThemes[0]:null}},beforeMount(){this.handleListThemes()},methods:{handleListThemes(){this.list.loading=!0,d.Z.theme.list().then((e=>{this.list.data=e.data})).finally((()=>{this.list.loading=!1}))},handleRefreshThemesCache(){d.Z.theme.reload().finally((()=>{this.handleListThemes()}))},handleActiveTheme(e){d.Z.theme.active(e.id).finally((()=>{this.handleListThemes()}))},handleOpenLocalUpdateModal(e){this.localUpgradeModel.selected=e,this.localUpgradeModel.visible=!0},handleRouteToThemeSetting(e){this.$router.push({name:"ThemeSetting",query:{themeId:e.id}})},handleOpenThemeDeleteModal(e){this.themeDeleteModal.visible=!0,this.themeDeleteModal.selected=e},handleConfirmRemoteUpdate(e){const t=this;t.$confirm({title:"提示",maskClosable:!0,content:"确定更新【"+e.name+"】主题?",async onOk(){const l=t.$message.loading("更新中...",0);try{await d.Z.theme.updateThemeByFetching(e.id),t.$message.success("更新成功!")}catch(a){t.$log.error("Failed to update theme: ",a)}finally{l(),t.handleListThemes()}}})}}},b=g,v=(0,m.Z)(b,a,i,!1,null,null,null),y=v.exports},43348:function(e,t,l){l.d(t,{Z:function(){return c}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onAfterClose,closable:!1,width:416,destroyOnClose:"",title:"提示"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("template",{slot:"footer"},[l("a-button",{on:{click:function(t){e.modalVisible=!1}}},[e._v(" 取消 ")]),l("ReactiveButton",{attrs:{errored:e.deleteErrored,loading:e.deleting,erroredText:"删除失败",loadedText:"删除成功",text:"确定"},on:{callback:e.handleDeleteCallback,click:function(t){return e.handleDelete()}}})],1),l("p",[e._v("确定删除【"+e._s(e.theme.name)+"】主题?")]),l("a-checkbox",{model:{value:e.deleteSettings,callback:function(t){e.deleteSettings=t},expression:"deleteSettings"}},[e._v(" 同时删除主题配置 ")])],2)},i=[],s=l(1540),o={name:"ThemeDeleteConfirmModal",props:{visible:{type:Boolean,default:!1},theme:{type:Object,default:()=>({})}},data(){return{deleteErrored:!1,deleting:!1,deleteSettings:!1}},computed:{modalVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}}},methods:{async handleDelete(){try{this.deleting=!0,await s.Z.theme["delete"](this.theme.id,this.deleteSettings)}catch(e){this.deleteErrored=!1,this.$log.error("Delete theme failed",e)}finally{setTimeout((()=>{this.deleting=!1}),400)}},handleDeleteCallback(){this.deleteErrored?this.deleteErrored=!1:(this.modalVisible=!1,this.$emit("success"))},onAfterClose(){this.deleteErrored=!1,this.deleting=!1,this.deleteSettings=!1,this.$emit("onAfterClose")}}},n=o,r=l(18156),d=(0,r.Z)(n,a,i,!1,null,null,null),c=d.exports},59464:function(e,t,l){l.d(t,{Z:function(){return c}});var a=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("a-modal",{attrs:{afterClose:e.onModalClose,footer:null,destroyOnClose:"",title:"更新主题"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[l("FilePondUpload",{ref:"updateByFile",attrs:{accepts:["application/x-zip","application/x-zip-compressed","application/zip"],field:e.theme.id,multiple:!1,uploadHandler:e.uploadHandler,label:"点击选择主题更新包或将主题更新包拖拽到此处<br>仅支持 ZIP 格式的文件",name:"file"},on:{success:e.onThemeUploadSuccess}})],1)},i=[],s=l(1540),o={name:"ThemeLocalUpgradeModal",props:{visible:{type:Boolean,default:!1},theme:{type:Object,default:()=>({})}},data(){return{uploadHandler:(e,t,l)=>s.Z.theme.updateByUpload(e,t,l)}},computed:{modalVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}}},methods:{onModalClose(){this.$refs.updateByFile.handleClearFileList(),this.$emit("onAfterClose")},onThemeUploadSuccess(){this.modalVisible=!1,this.$emit("success")}}},n=o,r=l(18156),d=(0,r.Z)(n,a,i,!1,null,null,null),c=d.exports}}]);
\ No newline at end of file
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[122],{43122:function(e,t,a){a.d(t,{Z:function(){return V}});var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-modal",{attrs:{afterClose:e.onClosed,bodyStyle:{padding:0},maskClosable:!1,width:680,destroyOnClose:""},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.modalTitle)+" "),e.loading?a("a-icon",{attrs:{type:"loading"}}):e._e()]},proxy:!0},{key:"footer",fn:function(){return[e._t("extraFooter"),e.draftSaveVisible?a("ReactiveButton",{attrs:{errored:e.form.draftSaveErrored,loading:e.form.draftSaving,text:(e.hasId?"转为":"保存")+"草稿",erroredText:"保存失败",loadedText:"保存成功",type:"danger"},on:{callback:function(t){return e.handleSavedCallback()},click:function(t){return e.handleSaveDraft()}}}):e._e(),e.publishVisible?a("ReactiveButton",{attrs:{errored:e.form.publishErrored,loading:e.form.publishing,erroredText:"发布失败",loadedText:"发布成功",text:"转为发布"},on:{callback:function(t){return e.handleSavedCallback()},click:function(t){return e.handlePublish()}}}):e._e(),a("ReactiveButton",{attrs:{errored:e.form.saveErrored,erroredText:(e.hasId?"保存":"发布")+"失败",loadedText:(e.hasId?"保存":"发布")+"成功",loading:e.form.saving,text:e.hasId?"保存":"发布"},on:{callback:function(t){return e.handleSavedCallback()},click:function(t){return e.handleSave()}}}),a("a-button",{attrs:{disabled:e.loading},on:{click:function(t){e.modalVisible=!1}}},[e._v("关闭")])]},proxy:!0}],null,!0),model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[a("div",{staticClass:"card-container"},[a("a-tabs",{attrs:{type:"card"}},[a("a-tab-pane",{key:"normal",attrs:{tab:"常规"}},[a("a-form",{attrs:{"label-col":{span:4},"wrapper-col":{span:20},labelAlign:"left"}},[a("a-form-item",{attrs:{label:"文章标题"}},[a("a-input",{model:{value:e.form.model.title,callback:function(t){e.$set(e.form.model,"title",t)},expression:"form.model.title"}})],1),a("a-form-item",{attrs:{help:e.fullPath,label:"文章别名"}},[a("a-input",{scopedSlots:e._u([{key:"addonAfter",fn:function(){return[a("a-popconfirm",{attrs:{"cancel-text":"取消","ok-text":"确定",placement:"left",title:"是否确定根据标题重新生成别名?"},on:{confirm:e.handleGenerateSlug}},[a("a-icon",{staticClass:"cursor-pointer",attrs:{type:"sync"}})],1)]},proxy:!0}]),model:{value:e.form.model.slug,callback:function(t){e.$set(e.form.model,"slug",t)},expression:"form.model.slug"}})],1),a("a-form-item",{attrs:{label:"分类目录"}},[a("category-tree",{model:{value:e.form.model.categoryIds,callback:function(t){e.$set(e.form.model,"categoryIds",t)},expression:"form.model.categoryIds"}})],1),a("a-form-item",{attrs:{label:"标签"}},[a("TagSelect",{model:{value:e.form.model.tagIds,callback:function(t){e.$set(e.form.model,"tagIds",t)},expression:"form.model.tagIds"}})],1),a("a-form-item",{attrs:{label:"摘要"}},[a("a-input",{attrs:{autoSize:{minRows:5},placeholder:"如不填写,会从文章中自动截取",type:"textarea"},model:{value:e.form.model.summary,callback:function(t){e.$set(e.form.model,"summary",t)},expression:"form.model.summary"}})],1)],1)],1),a("a-tab-pane",{key:"advanced",attrs:{tab:"高级"}},[a("a-form",{attrs:{"label-col":{span:4},"wrapper-col":{span:20},labelAlign:"left"}},[a("a-form-item",{attrs:{label:"禁止评论"}},[a("a-switch",{model:{value:e.form.model.disallowComment,callback:function(t){e.$set(e.form.model,"disallowComment",t)},expression:"form.model.disallowComment"}})],1),a("a-form-item",{attrs:{label:"是否置顶"}},[a("a-switch",{model:{value:e.topPriority,callback:function(t){e.topPriority=t},expression:"topPriority"}})],1),a("a-form-item",{attrs:{label:"发表时间:"}},[a("a-date-picker",{attrs:{defaultValue:e.createTimeDefaultValue,format:"YYYY-MM-DD HH:mm:ss",placeholder:"选择文章发表时间",showTime:""},on:{change:e.onCreateTimeSelect,ok:e.onCreateTimeSelect}})],1),a("a-form-item",{attrs:{label:"自定义模板:"}},[a("a-select",{model:{value:e.form.model.template,callback:function(t){e.$set(e.form.model,"template",t)},expression:"form.model.template"}},[a("a-select-option",{key:"",attrs:{value:""}},[e._v("")]),e._l(e.templates,(function(t){return a("a-select-option",{key:t,attrs:{value:t}},[e._v(" "+e._s(t)+" ")])}))],2)],1),a("a-form-item",{attrs:{label:"访问密码:"}},[a("a-input-password",{attrs:{autocomplete:"new-password"},model:{value:e.form.model.password,callback:function(t){e.$set(e.form.model,"password",t)},expression:"form.model.password"}})],1),a("a-form-item",{attrs:{label:"封面图:"}},[a("a-space",{attrs:{direction:"vertical"}},[a("img",{staticClass:"w-1/2 cursor-pointer",staticStyle:{"border-radius":"4px"},attrs:{src:e.form.model.thumbnail||"/images/placeholder.jpg",alt:"Post cover thumbnail"},on:{click:function(t){e.attachmentSelectVisible=!0}}}),a("a-input",{attrs:{"allow-clear":"",placeholder:"点击封面图选择图片,或者输入外部链接"},model:{value:e.form.model.thumbnail,callback:function(t){e.$set(e.form.model,"thumbnail",t)},expression:"form.model.thumbnail"}})],1)],1)],1)],1),a("a-tab-pane",{key:"seo",attrs:{tab:"SEO"}},[a("a-form",{attrs:{"label-col":{span:4},"wrapper-col":{span:20},labelAlign:"left"}},[a("a-form-item",{attrs:{label:"自定义关键词"}},[a("a-input",{attrs:{autoSize:{minRows:5},placeholder:"多个关键词以英文逗号隔开,如不填写,将自动使用标签作为关键词",type:"textarea"},model:{value:e.form.model.metaKeywords,callback:function(t){e.$set(e.form.model,"metaKeywords",t)},expression:"form.model.metaKeywords"}})],1),a("a-form-item",{attrs:{label:"自定义描述"}},[a("a-input",{attrs:{autoSize:{minRows:5},placeholder:"如不填写,会从文章中自动截取",type:"textarea"},model:{value:e.form.model.metaDescription,callback:function(t){e.$set(e.form.model,"metaDescription",t)},expression:"form.model.metaDescription"}})],1)],1)],1),a("a-tab-pane",{key:"meta",attrs:{tab:"元数据"}},[a("MetaEditor",{attrs:{metas:e.form.model.metas,targetId:e.form.model.id,target:"post"},on:{"update:metas":function(t){return e.$set(e.form.model,"metas",t)}}})],1)],1)],1),a("AttachmentSelectModal",{attrs:{multiSelect:!1,visible:e.attachmentSelectVisible},on:{"update:visible":function(t){e.attachmentSelectVisible=t},confirm:e.handleSelectPostThumbnail}})],1)},o=[],n=a(47458),s=a(86475),l=(a(70315),a(41479),a(87591),a(30535),a(85018),a(31875),a(18482),a(86381),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-tree",{attrs:{checkedKeys:e.categoryIds,treeData:e.categoryTree,checkStrictly:"",checkable:"",defaultExpandAll:"",showLine:""},on:{check:e.onCheck}})}),i=[],c=(a(21082),a(17132));function m(e,t){t.forEach((function(t){e.key===t.parentId&&(e.children||(e.children=[]),e.children.push({key:t.id,title:t.name,isLeaf:!1}))})),e.children?e.children.forEach((function(e){return m(e,t)})):e.isLeaf=!0}function d(e){var t={key:0,title:"top",children:[]};return m(t,e),t.children}var u={name:"CategoryTree",model:{prop:"categoryIds",event:"check"},props:{categoryIds:{type:Array,required:!1,default:function(){return[]}}},data:function(){return{categories:{data:[],loading:!1}}},computed:{categoryTree:function(){return this.categories.data.length?d(this.categories.data):[]}},created:function(){this.handleListCategories()},methods:{handleListCategories:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.categories.loading=!0,t.next=4,c.Z.category.list({sort:[],more:!1});case 4:a=t.sent,r=a.data,e.categories.data=r,t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),e.$log.error(t.t0);case 12:return t.prev=12,e.categories.loading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},onCheck:function(e,t){this.$log.debug("Chekced keys",e),this.$log.debug("e",t),this.$emit("check",e.checked)}}},f=u,h=a(42177),p=(0,h.Z)(f,l,i,!1,null,null,null),g=p.exports,v=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-select",{staticClass:"w-full",attrs:{"token-separators":[",","|"],allowClear:"",mode:"tags",placeholder:"选择或输入标签"},on:{change:e.handleChange},model:{value:e.selectedTagNames,callback:function(t){e.selectedTagNames=t},expression:"selectedTagNames"}},e._l(e.tags,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.name}},[e._v(e._s(t.name))])})),1)},b=[],k=(a(82395),a(90195),a(10299)),y=a.n(k),x={name:"TagSelect",model:{prop:"tagIds",event:"change"},props:{tagIds:{type:Array,required:!1,default:function(){return[]}}},data:function(){return{tags:[],selectedTagNames:[]}},created:function(){this.handleListTags()},watch:{tags:function(e){var t=this;e&&(this.selectedTagNames=this.tagIds.map((function(e){return t.tagIdMap[e].name})))},tagIds:{handler:function(e){var t=this;this.tags.length&&(this.selectedTagNames=e.map((function(e){return t.tagIdMap[e].name})))},deep:!0}},computed:{tagIdMap:function(){var e={};return this.tags.forEach((function(t){e[t.id]=t})),e},tagNameMap:function(){var e={};return this.tags.forEach((function(t){e[t.name]=t})),e}},methods:{handleListTags:function(e){var t=this;c.Z.tag.list({sort:"name,asc",more:!0}).then((function(a){t.tags=a.data,e&&e()}))},handleChange:function(){var e=this,t=this.selectedTagNames.filter((function(t){return!e.tagNameMap[t]}));if(this.$log.debug("Tag names to create",t),t.length){var a=t.map((function(e){return c.Z.tag.create({name:e})}));y().all(a).then(y().spread((function(){e.handleListTags((function(){e.$log.debug("Tag name map",e.tagNameMap);var t=e.selectedTagNames.map((function(t){return e.tagNameMap[t].id}));e.$emit("change",t)}))})))}else{var r=this.selectedTagNames.map((function(t){return e.tagNameMap[t].id}));this.$emit("change",r)}}}},w=x,S=(0,h.Z)(w,v,b,!1,null,null,null),T=S.exports,C=a(99421),_=a(91411),E=a(38487),$=a(73511),I=a.n($),D=a(98906),Y=a(94671),R={name:"PostSettingModal",mixins:[_.jB,_.KT],components:{CategoryTree:g,TagSelect:T,MetaEditor:C.Z},props:{visible:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},post:{type:Object,default:function(){return{}}},savedCallback:{type:Function,default:null}},data:function(){return{postStatuses:Y.JQ,form:{model:{},saving:!1,saveErrored:!1,draftSaving:!1,draftSaveErrored:!1,publishing:!1,publishErrored:!1},templates:[],attachmentSelectVisible:!1}},computed:(0,s.Z)((0,s.Z)({},(0,D.Se)(["options"])),{},{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}},modalTitle:function(){return this.form.model.id?"文章设置":"文章发布"},createTimeDefaultValue:function(){if(this.form.model.createTime){var e=new Date(this.form.model.createTime);return(0,E._)(e,"YYYY-MM-DD HH:mm:ss")}return(0,E._)(new Date,"YYYY-MM-DD HH:mm:ss")},topPriority:{get:function(){return 0!==this.form.model.topPriority},set:function(e){this.form.model.topPriority=e?1:0}},fullPath:function(){var e=this.options,t=e.post_permalink_type,a=e.archives_prefix,r=e.blog_url,o=e.path_suffix,n=void 0===o?"":o,s=this.form.model,l=s.slug,i=void 0===l?"{slug}":l,c=s.createTime,m=void 0===c?new Date:c,d=s.id,u=void 0===d?"{id}":d;switch(t){case"DEFAULT":return"".concat(r,"/").concat(a,"/").concat(i).concat(n);case"YEAR":return"".concat(r).concat((0,E._)(m,"/YYYY/")).concat(i).concat(n);case"DATE":return"".concat(r).concat((0,E._)(m,"/YYYY/MM/")).concat(i).concat(n);case"DAY":return"".concat(r).concat((0,E._)(m,"/YYYY/MM/DD/")).concat(i).concat(n);case"ID":return"".concat(r,"/?p=").concat(u);case"ID_SLUG":return"".concat(r,"/").concat(a,"/").concat(u).concat(n);default:return""}},hasId:function(){return!!this.form.model.id},draftSaveVisible:function(){var e=this.form,t=e.draftSaving,a=e.publishing;return(this.form.model.status!==Y.JQ.DRAFT.value||!this.hasId||t)&&!a},publishVisible:function(){var e=this.form,t=e.draftSaving,a=e.publishing;return(this.form.model.status===Y.JQ.DRAFT.value&&this.hasId||a)&&!t}}),watch:{modalVisible:function(e){e&&(this.form.model=Object.assign({},this.post),this.form.model.slug||this.form.model.id||this.handleGenerateSlug())},post:{deep:!0,handler:function(e){this.form.model=Object.assign({},e)}}},created:function(){this.handleListCustomTemplates()},methods:{handleCreateOrUpdate:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.form.model.title){t.next=3;break}throw e.$notification["error"]({message:"提示",description:"文章标题不能为空!"}),new Error("文章标题不能为空!");case 3:if(e.form.model.keepRaw=!0,t.prev=4,!e.hasId){t.next=10;break}return t.next=8,c.Z.post.update(e.form.model.id,e.form.model);case 8:t.next=12;break;case 10:return t.next=12,c.Z.post.create(e.form.model);case 12:t.next=18;break;case 14:throw t.prev=14,t.t0=t["catch"](4),e.$log.error(t.t0),new Error(t.t0);case 18:case"end":return t.stop()}}),t,null,[[4,14]])})))()},handleSave:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.form.saving=!0,a=e.form.model.status,a||(e.form.model.status=e.postStatuses.PUBLISHED.value),t.next=6,e.handleCreateOrUpdate();case 6:t.next=12;break;case 8:t.prev=8,t.t0=t["catch"](0),e.form.saveErrored=!0,e.$log.error("Failed to save post",t.t0);case 12:return t.prev=12,setTimeout((function(){e.form.saving=!1}),400),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,8,12,15]])})))()},handlePublish:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.form.publishing=!0,e.form.model.status=e.postStatuses.PUBLISHED.value,t.next=5,e.handleCreateOrUpdate();case 5:t.next=11;break;case 7:t.prev=7,t.t0=t["catch"](0),e.form.publishErrored=!0,e.$log.error("Failed to publish post",t.t0);case 11:return t.prev=11,setTimeout((function(){e.form.publishing=!1}),400),t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[0,7,11,14]])})))()},handleSaveDraft:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.form.draftSaving=!0,e.form.model.status=e.postStatuses.DRAFT.value,t.next=5,e.handleCreateOrUpdate();case 5:t.next=11;break;case 7:t.prev=7,t.t0=t["catch"](0),e.form.draftSaveErrored=!0,e.$log.error("Failed to save draft post",t.t0);case 11:return t.prev=11,setTimeout((function(){e.form.draftSaving=!1}),400),t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[0,7,11,14]])})))()},handleSavedCallback:function(){this.form.saveErrored||this.form.draftSaveErrored||this.form.publishErrored?(this.form.saveErrored=!1,this.form.draftSaveErrored=!1,this.form.publishErrored=!1):this.savedCallback&&this.savedCallback()},handleListCustomTemplates:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,c.Z.theme.listCustomPostTemplates();case 3:a=t.sent,e.templates=a.data,t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](0),e.$log.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},onCreateTimeSelect:function(e){this.form.model.createTime=e.valueOf()},handleGenerateSlug:function(){if(this.form.model.title&&I().isSupported()){var e,t="",a=I().parse(this.form.model.title.replace(/\s+/g,"").toLowerCase());a.forEach((function(a){if(2===a.type){var r=a.target?a.target.toLowerCase():"";t+=t&&!/\n|\s/.test(e.target)?"-"+r:r}else t+=(e&&2===e.type?"-":"")+a.target;e=a})),this.$set(this.form.model,"slug",t)}},handleSelectPostThumbnail:function(e){var t=e.raw;t.length&&(this.form.model.thumbnail=encodeURI(t[0].path)),this.attachmentSelectVisible=!1},onClosed:function(){this.$emit("onClose"),this.$emit("onUpdate",this.form.model)}}},M=R,Z=(0,h.Z)(M,r,o,!1,null,null,null),V=Z.exports}}]);
\ No newline at end of file
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[13],{75013:function(t,e,a){a.r(e),a.d(e,{default:function(){return g}});var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("page-view",[a("a-row",{attrs:{gutter:12,align:"middle",type:"flex"}},[a("a-col",{staticClass:"pb-3",attrs:{span:24}},[a("a-card",{attrs:{bodyStyle:{padding:"16px"},bordered:!1}},[a("div",{staticClass:"table-page-search-wrapper"},[a("a-form",{attrs:{layout:"inline"}},[a("a-row",{attrs:{gutter:48}},[a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"关键词:"}},[a("a-input",{on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery()}},model:{value:t.list.params.keyword,callback:function(e){t.$set(t.list.params,"keyword",e)},expression:"list.params.keyword"}})],1)],1),a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"存储位置:"}},[a("a-select",{attrs:{loading:t.types.loading,allowClear:""},on:{change:function(e){return t.handleQuery()}},model:{value:t.list.params.attachmentType,callback:function(e){t.$set(t.list.params,"attachmentType",e)},expression:"list.params.attachmentType"}},t._l(t.types.data,(function(e){return a("a-select-option",{key:e,attrs:{value:e}},[t._v(" "+t._s(t._f("typeText")(e))+" ")])})),1)],1)],1),a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"文件类型:"}},[a("a-select",{attrs:{loading:t.mediaTypes.loading,allowClear:""},on:{change:function(e){return t.handleQuery()}},model:{value:t.list.params.mediaType,callback:function(e){t.$set(t.list.params,"mediaType",e)},expression:"list.params.mediaType"}},t._l(t.mediaTypes.data,(function(e,n){return a("a-select-option",{key:n,attrs:{value:e}},[t._v(t._s(e)+" ")])})),1)],1)],1),a("a-col",{attrs:{md:6,sm:24}},[a("span",{staticClass:"table-page-search-submitButtons"},[a("a-space",[a("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleQuery()}}},[t._v("查询")]),a("a-button",{on:{click:function(e){return t.handleResetParam()}}},[t._v("重置")])],1)],1)])],1)],1)],1),a("div",{staticClass:"mb-0 table-operator"},[a("a-button",{attrs:{icon:"cloud-upload",type:"primary"},on:{click:function(e){t.upload.visible=!0}}},[t._v("上传")]),a("a-button",{directives:[{name:"show",rawName:"v-show",value:t.list.selected.length,expression:"list.selected.length"}],attrs:{icon:"check-circle",type:"primary"},on:{click:t.handleSelectAll}},[t._v(" 全选 ")]),a("a-button",{directives:[{name:"show",rawName:"v-show",value:t.list.selected.length,expression:"list.selected.length"}],attrs:{icon:"delete",type:"danger"},on:{click:t.handleDeleteAttachmentInBatch}},[t._v(" 删除 ")]),a("a-button",{directives:[{name:"show",rawName:"v-show",value:t.list.selected.length,expression:"list.selected.length"}],attrs:{icon:"close"},on:{click:function(e){t.list.selected=[]}}},[t._v(" 取消")])],1)])],1),a("a-col",{attrs:{span:24}},[a("a-list",{staticClass:"attachments-group",attrs:{dataSource:t.list.data,grid:{gutter:6,xs:2,sm:2,md:4,lg:6,xl:6,xxl:6},loading:t.list.loading},scopedSlots:t._u([{key:"renderItem",fn:function(e,n){return[a("a-list-item",{key:n,on:{mouseenter:function(a){return t.$set(e,"hover",!0)},mouseleave:function(a){return t.$set(e,"hover",!1)},click:function(a){return t.handleItemClick(e)},contextmenu:function(a){return a.preventDefault(),t.handleContextMenu(a,e)}}},[a("div",{staticClass:"border border-solid",class:t.isItemSelect(e)?"border-blue-600":"border-slate-200"},[a("div",{staticClass:"attach-thumb attachments-group-item"},[t.isImage(e)?a("span",{staticClass:"attachments-group-item-img",style:"background-image:url("+encodeURI(e.thumbPath)+")",attrs:{loading:"lazy"}}):a("span",{staticClass:"attachments-group-item-type"},[t._v(t._s(e.suffix))])]),a("a-card-meta",{staticClass:"p-2 cursor-pointer",scopedSlots:t._u([{key:"description",fn:function(){return[a("a-tooltip",{attrs:{title:e.name}},[a("div",{staticClass:"truncate"},[t._v(t._s(e.name))])])]},proxy:!0}],null,!0)}),a("a-icon",{directives:[{name:"show",rawName:"v-show",value:!t.isItemSelect(e)&&e.hover,expression:"!isItemSelect(item) && item.hover"}],staticClass:"absolute top-1 right-2 font-bold cursor-pointer transition-all",style:{fontSize:"18px",color:"rgb(37 99 235)"},attrs:{type:"plus-circle",theme:"twoTone"},on:{click:function(a){return a.stopPropagation(),t.handleSelect(e)}}}),a("a-icon",{directives:[{name:"show",rawName:"v-show",value:t.isItemSelect(e),expression:"isItemSelect(item)"}],staticClass:"absolute top-1 right-2 font-bold cursor-pointer transition-all",style:{fontSize:"18px",color:"rgb(37 99 235)"},attrs:{type:"check-circle",theme:"twoTone"}}),a("a-icon",{directives:[{name:"show",rawName:"v-show",value:e.hover&&t.list.selected.length>0,expression:"item.hover && list.selected.length > 0"}],staticClass:"absolute top-1 left-2 font-bold cursor-pointer transition-all",style:{fontSize:"18px"},attrs:{type:"profile",theme:"twoTone"},on:{click:function(a){return a.stopPropagation(),t.handleOpenDetail(e)}}})],1)])]}}])})],1)],1),a("div",{staticClass:"page-wrapper"},[a("a-pagination",{staticClass:"pagination",attrs:{current:t.pagination.page,defaultPageSize:t.pagination.size,pageSizeOptions:["18","36","54","72","90","108"],total:t.pagination.total,showLessItems:"",showSizeChanger:""},on:{change:t.handlePageChange,showSizeChange:t.handlePageSizeChange}})],1),a("AttachmentUploadModal",{attrs:{visible:t.upload.visible},on:{"update:visible":function(e){return t.$set(t.upload,"visible",e)},close:t.onUploadClose}}),a("AttachmentDetailModal",{attrs:{addToPhoto:!0,attachment:t.list.current,visible:t.detailVisible},on:{"update:visible":function(e){t.detailVisible=e},delete:function(e){return t.handleListAttachments()}},scopedSlots:t._u([{key:"extraFooter",fn:function(){return[a("a-button",{attrs:{disabled:t.selectPreviousButtonDisabled},on:{click:t.handleSelectPrevious}},[t._v("上一项")]),a("a-button",{attrs:{disabled:t.selectNextButtonDisabled},on:{click:t.handleSelectNext}},[t._v("下一项")])]},proxy:!0}])})],1)},s=[],i=a(75725),r=a(47458),l=(a(70315),a(3662),a(15928),a(41479),a(90195),a(31875),a(21082),a(82395),a(91411)),o=a(26278),c=a(17132),u=a(94671),d={components:{PageView:o.B4},mixins:[l.jB,l.KT],filters:{typeText:function(t){return u.k[t].text}},data:function(){return{list:{data:[],loading:!1,total:0,hasNext:!1,hasPrevious:!1,params:{page:0,size:18,keyword:void 0,mediaType:void 0,attachmentType:void 0},selected:[],current:{}},mediaTypes:{data:[],loading:!1},types:{data:[],loading:!1},upload:{visible:!1},detailVisible:!1}},computed:{isImage:function(){return function(t){return!(!t||!t.mediaType)&&t.mediaType.startsWith("image")}},isItemSelect:function(){return function(t){return this.list.selected.findIndex((function(e){return e.id===t.id}))>-1}},pagination:function(){return{page:this.list.params.page+1,size:this.list.params.size,total:this.list.total}},selectPreviousButtonDisabled:function(){var t=this,e=this.list.data.findIndex((function(e){return e.id===t.list.current.id}));return 0===e&&!this.list.hasPrevious},selectNextButtonDisabled:function(){var t=this,e=this.list.data.findIndex((function(e){return e.id===t.list.current.id}));return e===this.list.data.length-1&&!this.list.hasNext}},created:function(){this.handleListAttachments(),this.handleListMediaTypes(),this.handleListTypes()},methods:{handleListAttachments:function(){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.list.loading=!0,e.next=4,c.Z.attachment.list(t.list.params);case 4:a=e.sent,t.list.data=a.data.content,t.list.total=a.data.total,t.list.hasNext=a.data.hasNext,t.list.hasPrevious=a.data.hasPrevious,e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](0),t.$log.error(e.t0);case 14:return e.prev=14,t.list.loading=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,11,14,17]])})))()},handleListMediaTypes:function(){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.mediaTypes.loading=!0,e.next=4,c.Z.attachment.listMediaTypes();case 4:a=e.sent,t.mediaTypes.data=a.data,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$log.error(e.t0);case 11:return e.prev=11,t.mediaTypes.loading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})))()},handleListTypes:function(){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.types.loading=!0,e.next=4,c.Z.attachment.listTypes();case 4:a=e.sent,t.types.data=a.data,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$log.error(e.t0);case 11:return e.prev=11,t.types.loading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})))()},handleOpenDetail:function(t){this.list.current=t,this.detailVisible=!0},handleItemClick:function(t){this.list.selected.length<=0?this.handleOpenDetail(t):this.isItemSelect(t)?this.handleUnselect(t):this.handleSelect(t)},handleSelect:function(t){this.list.selected=[].concat((0,i.Z)(this.list.selected),[t])},handleUnselect:function(t){this.list.selected=this.list.selected.filter((function(e){return e.id!==t.id}))},handleSelectAll:function(){this.list.selected=this.list.data},handleContextMenu:function(t,e){var a=this;return this.$contextmenu({items:[{label:"复制".concat(this.isImage(e)?"图片":"文件","链接"),onClick:function(){var t="".concat(encodeURI(e.path));a.$copyText(t).then((function(t){a.$log.debug("copy",t),a.$message.success("复制成功!")})).catch((function(t){a.$log.debug("copy.err",t),a.$message.error("复制失败!")}))},divided:!0},{disabled:!this.isImage(e),label:"复制 Markdown 格式链接",onClick:function(){var t="![".concat(e.name,"](").concat(encodeURI(e.path),")");a.$copyText(t).then((function(t){a.$log.debug("copy",t),a.$message.success("复制成功!")})).catch((function(t){a.$log.debug("copy.err",t),a.$message.error("复制失败!")}))},divided:!0},{label:"删除",onClick:function(){a.$confirm({title:"提示",content:"确定删除该附件?",okText:"确定",cancelText:"取消",onOk:function(){var t=(0,r.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c.Z.attachment["delete"](e.id);case 2:return t.next=4,a.handleListAttachments();case 4:a.handleUnselect(e);case 5:case"end":return t.stop()}}),t)})));function n(){return t.apply(this,arguments)}return n}()})}}],event:t,minWidth:210}),!1},handlePageChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.list.params.page=t-1,this.handleListAttachments()},handlePageSizeChange:function(t,e){this.$log.debug("Current: ".concat(t,", PageSize: ").concat(e)),this.list.params.page=0,this.list.params.size=e,this.handleListAttachments()},handleResetParam:function(){this.list.params.keyword=void 0,this.list.params.mediaType=void 0,this.list.params.attachmentType=void 0,this.handlePageChange(),this.handleListMediaTypes(),this.handleListTypes()},handleQuery:function(){this.handlePageChange()},onUploadClose:function(){this.handlePageChange(),this.handleListMediaTypes(),this.handleListTypes()},handleDeleteAttachmentInBatch:function(){var t=this;this.list.selected.length<=0?this.$message.warn("你还未选择任何附件,请至少选择一个!"):this.$confirm({title:"确定要批量删除选中的附件吗?",content:"一旦删除不可恢复,请谨慎操作",onOk:function(){return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,a=t.list.selected.map((function(t){return t.id})),e.next=4,c.Z.attachment.deleteInBatch(a);case 4:t.list.selected=[],t.$message.success("删除成功"),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$log.error("Failed to delete selected attachments",e.t0);case 11:return e.prev=11,e.next=14,t.handleListAttachments();case 14:return e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[0,8,11,15]])})))()}})},handleSelectPrevious:function(){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=t.list.data.findIndex((function(e){return e.id===t.list.current.id})),!(a>0)){e.next=4;break}return t.list.current=t.list.data[a-1],e.abrupt("return");case 4:if(0!==a||!t.list.hasPrevious){e.next=9;break}return t.list.params.page--,e.next=8,t.handleListAttachments();case 8:t.list.current=t.list.data[t.list.data.length-1];case 9:case"end":return e.stop()}}),e)})))()},handleSelectNext:function(){var t=this;return(0,r.Z)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=t.list.data.findIndex((function(e){return e.id===t.list.current.id})),!(a<t.list.data.length-1)){e.next=4;break}return t.list.current=t.list.data[a+1],e.abrupt("return");case 4:if(a!==t.list.data.length-1||!t.list.hasNext){e.next=9;break}return t.list.params.page++,e.next=8,t.handleListAttachments();case 8:t.list.current=t.list.data[0];case 9:case"end":return e.stop()}}),e)})))()}}},h=d,p=a(42177),m=(0,p.Z)(h,n,s,!1,null,null,null),g=m.exports}}]);
\ No newline at end of file
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[132],{10966:function(e,t,s){s.r(t),s.d(t,{default:function(){return m}});var n=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"container-wrapper animated fadeIn"},[e._m(0),s("div",{staticClass:"login-form"},[s("LoginForm",{on:{success:e.onLoginSucceed}}),e.resetPasswordButtonVisible?s("router-link",{staticClass:"tip",attrs:{to:{name:"ResetPassword"}}},[e._v(" 找回密码 ")]):e._e()],1)])},r=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"halo-logo"},[s("img",{attrs:{alt:"Halo Logo",src:"/images/logo.svg"}})])}],o=s(47458),a=s(86475),i=(s(70315),s(98906)),u=s(63618),c=s(17132),l={components:{LoginForm:u.Z},data:function(){return{resetPasswordButtonVisible:!1}},beforeMount:function(){this.handleVerifyIsInstall(),document.addEventListener("keydown",this.onRegisterResetPasswordKeydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.onRegisterResetPasswordKeydown)},methods:(0,a.Z)((0,a.Z)({},(0,i.nv)(["refreshUserCache","refreshOptionsCache"])),{},{onRegisterResetPasswordKeydown:function(e){72===e.keyCode&&(e.altKey||e.metaKey)&&e.shiftKey&&(e.preventDefault(),this.resetPasswordButtonVisible=!this.resetPasswordButtonVisible)},handleVerifyIsInstall:function(){var e=this;return(0,o.Z)(regeneratorRuntime.mark((function t(){var s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c.Z.isInstalled();case 2:if(s=t.sent,s.data){t.next=6;break}return t.next=6,e.$router.push({name:"Install"});case 6:case"end":return t.stop()}}),t)})))()},onLoginSucceed:function(){this.refreshUserCache(),this.refreshOptionsCache(),this.$route.query.redirect?this.$router.push(this.$route.query.redirect):this.$router.push({name:"Dashboard"})}})},d=l,h=s(42177),f=(0,h.Z)(d,n,r,!1,null,null,null),m=f.exports}}]);
\ No newline at end of file
(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[134],{53303:function(e,t,o){var n=o(15820),r=Math.floor,i=function(e,t){var o=e.length,s=r(o/2);return o<8?a(e,t):l(e,i(n(e,0,s),t),i(n(e,s),t),t)},a=function(e,t){var o,n,r=e.length,i=1;while(i<r){n=i,o=e[i];while(n&&t(e[n-1],o)>0)e[n]=e[--n];n!==i++&&(e[n]=o)}return e},l=function(e,t,o,n){var r=t.length,i=o.length,a=0,l=0;while(a<r||l<i)e[a+l]=a<r&&l<i?n(t[a],o[l])<=0?t[a++]:o[l++]:a<r?t[a++]:o[l++];return e};e.exports=i},52103:function(e,t,o){var n=o(82678),r=n.match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},76044:function(e,t,o){var n=o(82678);e.exports=/MSIE|Trident/.test(n)},97551:function(e,t,o){var n=o(82678),r=n.match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},19003:function(e,t,o){"use strict";var n=o(79644),r=o(33691),i=o(77925),a=o(43207),l=o(71768),s=o(43150),d=o(32640),c=o(53303),m=o(29415),u=o(52103),h=o(76044),f=o(3718),v=o(97551),p=[],F=r(p.sort),y=r(p.push),C=d((function(){p.sort(void 0)})),b=d((function(){p.sort(null)})),g=m("sort"),k=!d((function(){if(f)return f<70;if(!(u&&u>3)){if(h)return!0;if(v)return v<603;var e,t,o,n,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:o=3;break;case 68:case 71:o=4;break;default:o=2}for(n=0;n<47;n++)p.push({k:t+n,v:o})}for(p.sort((function(e,t){return t.v-e.v})),n=0;n<p.length;n++)t=p[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}})),x=C||!b||!g||!k,S=function(e){return function(t,o){return void 0===o?-1:void 0===t?1:void 0!==e?+e(t,o)||0:s(t)>s(o)?1:-1}};n({target:"Array",proto:!0,forced:x},{sort:function(e){void 0!==e&&i(e);var t=a(this);if(k)return void 0===e?F(t):F(t,e);var o,n,r=[],s=l(t);for(n=0;n<s;n++)n in t&&y(r,t[n]);c(r,S(e)),o=r.length,n=0;while(n<o)t[n]=r[n++];while(n<s)delete t[n++];return t}})},27134:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return v}});var n=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"option-tab-wrapper"},[o("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1}},[o("div",{staticClass:"table-operator"},[o("a-button",{attrs:{icon:"cloud-upload",type:"primary"},on:{click:function(t){e.uploadModal.visible=!0}}},[e._v("上传")]),o("a-button",{attrs:{icon:"plus"},on:{click:function(t){return e.handleOpenCreateDirectoryModal({})}}},[e._v(" 新建文件夹")]),o("a-button",{attrs:{loading:e.list.loading,icon:"sync"},on:{click:e.handleListStatics}},[e._v(" 刷新")])],1),o("div",{staticClass:"mt-4"},[o("a-table",{attrs:{columns:e.list.columns,dataSource:e.sortedStatics,loading:e.list.loading,pagination:!1,rowKey:function(e){return e.id},size:"middle"},scopedSlots:e._u([{key:"name",fn:function(t){return o("span",{},[o("ellipsis",{attrs:{length:64,tooltip:""}},[e._v(" "+e._s(t)+" ")])],1)}},{key:"createTime",fn:function(t){return o("span",{},[e._v(" "+e._s(e._f("moment")(t))+" ")])}},{key:"action",fn:function(t,n){return o("span",{},[n.isFile?o("a",{attrs:{href:e.options.blog_url+n.relativePath,target:"_blank"}},[e._v("访问")]):o("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:function(t){return e.handleUpload(n)}}},[e._v("上传")]),o("a-divider",{attrs:{type:"vertical"}}),o("a-dropdown",{attrs:{trigger:["click"]}},[o("a-button",{staticClass:"!p-0",attrs:{type:"link"}},[e._v("更多")]),o("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[n.isFile?e._e():o("a-menu-item",{key:"1",on:{click:function(t){return e.handleOpenCreateDirectoryModal(n)}}},[e._v(" 创建文件夹 ")]),o("a-menu-item",{key:"2"},[o("a-popconfirm",{attrs:{title:n.isFile?"你确定要删除该文件?":"你确定要删除该文件夹?",cancelText:"取消",okText:"确定"},on:{confirm:function(t){return e.handleDelete(n.relativePath)}}},[e._v(" 删除 ")])],1),o("a-menu-item",{key:"3",on:{click:function(t){return e.handleOpenRenameModal(n)}}},[e._v("重命名")]),n.isFile?o("a-menu-item",{key:"4",on:{click:function(t){return e.handleOpenEditContentModal(n)}}},[e._v(" 编辑 ")]):e._e()],1)],1)],1)}}])})],1)]),o("a-modal",{attrs:{afterClose:e.onUploadModalClose,footer:null,destroyOnClose:"",title:"上传文件"},model:{value:e.uploadModal.visible,callback:function(t){e.$set(e.uploadModal,"visible",t)},expression:"uploadModal.visible"}},[o("FilePondUpload",{ref:"upload",attrs:{field:e.list.selected.relativePath,uploadHandler:e.uploadModal.uploadHandler,name:"file"}})],1),o("a-modal",{attrs:{afterClose:e.onDirectoryFormModalClose,title:"创建文件夹"},model:{value:e.directoryForm.visible,callback:function(t){e.$set(e.directoryForm,"visible",t)},expression:"directoryForm.visible"}},[o("template",{slot:"footer"},[o("ReactiveButton",{attrs:{errored:e.directoryForm.saveErrored,loading:e.directoryForm.saving,erroredText:"创建失败",loadedText:"创建成功",text:"创建"},on:{callback:e.handleCreateDirectoryCallback,click:e.handleCreateDirectory}})],1),o("a-form-model",{ref:"directoryForm",attrs:{model:e.directoryForm.model,rules:e.directoryForm.rules,layout:"vertical"}},[o("a-form-model-item",{attrs:{label:"文件夹名:",prop:"name"}},[o("a-input",{ref:"createDirectoryInput",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleCreateDirectory.apply(null,arguments)}},model:{value:e.directoryForm.model.name,callback:function(t){e.$set(e.directoryForm.model,"name",t)},expression:"directoryForm.model.name"}})],1)],1)],2),o("a-modal",{attrs:{afterClose:e.onRenameModalClose,title:"重命名"},model:{value:e.renameForm.visible,callback:function(t){e.$set(e.renameForm,"visible",t)},expression:"renameForm.visible"}},[o("template",{slot:"footer"},[o("ReactiveButton",{attrs:{errored:e.renameForm.saveErrored,loading:e.renameForm.saving,erroredText:"重命名失败",loadedText:"重命名成功",text:"重命名"},on:{callback:e.handleRenameDirectoryOrFileCallback,click:e.handleRenameDirectoryOrFile}})],1),o("a-form-model",{ref:"renameForm",attrs:{model:e.renameForm.model,rules:e.renameForm.rules,layout:"vertical"}},[o("a-form-model-item",{attrs:{label:e.list.selected.isFile?"文件名:":"文件夹名:",prop:"name"}},[o("a-input",{ref:"renameModalInput",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleRenameDirectoryOrFile.apply(null,arguments)}},model:{value:e.renameForm.model.name,callback:function(t){e.$set(e.renameForm.model,"name",t)},expression:"renameForm.model.name"}})],1)],1)],2),o("a-modal",{staticStyle:{"max-width":"1000px"},attrs:{closable:!1,keyboard:!1,maskClosable:!1,title:"编辑文件",width:"80%"},model:{value:e.editContentForm.visible,callback:function(t){e.$set(e.editContentForm,"visible",t)},expression:"editContentForm.visible"}},[o("template",{slot:"footer"},[o("a-popconfirm",{attrs:{cancelText:"取消",okText:"确定",title:"未保存的内容将会丢失,确定要退出吗?"},on:{confirm:e.handleEditContentModalClose}},[o("a-button",[e._v("取消")])],1),o("ReactiveButton",{attrs:{errored:e.editContentForm.saveErrored,loading:e.editContentForm.saving,erroredText:"保存失败",loadedText:"保存成功",text:"保存"},on:{callback:e.handleContentEditCallback,click:e.handleContentEdit}})],1),o("a-form",{attrs:{layout:"vertical"}},[o("a-form-item",[o("Codemirror",{ref:"editor",attrs:{height:"600px"},model:{value:e.editContentForm.model.content,callback:function(t){e.$set(e.editContentForm.model,"content",t)},expression:"editContentForm.model.content"}})],1)],1)],2)],1)},r=[],i=o(86475),a=(o(96153),o(19003),o(31875),o(21082),o(30535),o(96339),o(98906)),l=o(17132),s=o(7961),d=o(40889),c=[{title:"文件名",dataIndex:"name",scopedSlots:{customRender:"name"}},{title:"文件类型",dataIndex:"mimeType",scopedSlots:{customRender:"mimeType"}},{title:"上传时间",dataIndex:"createTime",width:"200px",scopedSlots:{customRender:"createTime"}},{title:"操作",dataIndex:"action",width:"120px",scopedSlots:{customRender:"action"}}],m={components:{Codemirror:s.Z},name:"StaticStorage",data:function(){return{list:{columns:c,data:[],loading:!1,selected:{}},uploadModal:{visible:!1,uploadHandler:function(e,t,o){return l.Z.staticStorage.upload(e,t,o)}},directoryForm:{model:{name:null},visible:!1,saving:!1,saveErrored:!1,rules:{name:[{required:!0,message:"* 文件夹名不能为空",trigger:["change"]}]}},renameForm:{model:{name:null},visible:!1,saving:!1,saveErrored:!1,rules:{name:[{required:!0,message:"* 文件夹名不能为空",trigger:["change"]}]}},editContentForm:{model:{content:null},visible:!1,saving:!1,saveErrored:!1}}},beforeMount:function(){this.handleListStatics()},computed:(0,i.Z)((0,i.Z)({},(0,a.Se)(["options"])),{},{sortedStatics:function(){var e=this.list.data.slice(0);return e.sort((function(e,t){return e.isFile-t.isFile}))}}),methods:{handleListStatics:function(){var e=this;this.list.loading=!0,l.Z.staticStorage.list().then((function(t){e.list.data=t.data})).finally((function(){e.list.loading=!1}))},handleDelete:function(e){var t=this;l.Z.staticStorage["delete"](e).then((function(){t.$message.success("删除成功!")})).finally((function(){t.handleListStatics()}))},handleUpload:function(e){this.list.selected=e,this.uploadModal.visible=!0},handleOpenCreateDirectoryModal:function(e){var t=this;this.list.selected=e,this.directoryForm.visible=!0,this.$nextTick((function(){t.$refs.createDirectoryInput.focus()}))},handleCreateDirectory:function(){var e=this;this.$refs.directoryForm.validate((function(t){if(t){e.directoryForm.saving=!0;var o=e.list.selected.relativePath||"/";l.Z.staticStorage.createFolder(o,e.directoryForm.model.name).catch((function(){e.directoryForm.saveErrored=!0})).finally((function(){setTimeout((function(){e.directoryForm.saving=!1}),400)}))}}))},handleCreateDirectoryCallback:function(){this.directoryForm.saveErrored?this.directoryForm.saveErrored=!1:(this.directoryForm.model={},this.directoryForm.visible=!1,this.handleListStatics())},handleOpenRenameModal:function(e){var t=this;this.list.selected=e,this.$set(this.renameForm.model,"name",e.name),this.renameForm.visible=!0,this.$nextTick((function(){var e=t.$refs.renameModalInput,o=e.value.split(".");e.focus(),o.length<=1?e.$el.setSelectionRange(0,e.value.length):e.$el.setSelectionRange(0,e.value.length-o.pop().length-1)}))},handleRenameDirectoryOrFile:function(){var e=this;this.$refs.renameForm.validate((function(t){t&&(e.renameForm.saving=!0,l.Z.staticStorage.rename(e.list.selected.relativePath,e.renameForm.model.name).catch((function(){e.renameForm.saveErrored=!0})).finally((function(){setTimeout((function(){e.renameForm.saving=!1}),400)})))}))},handleRenameDirectoryOrFileCallback:function(){this.renameForm.saveErrored?this.renameForm.saveErrored=!1:(this.renameForm.model={},this.renameForm.visible=!1,this.handleListStatics())},handleOpenEditContentModal:function(e){var t=this;this.list.selected=e,d.Axios.get(this.options.blog_url+e.relativePath).then((function(e){t.editContentForm.model.content=e.data+"",t.editContentForm.visible=!0,t.$nextTick((function(){t.$refs.editor.handleInitCodemirror()}))}))},handleContentEdit:function(){var e=this;this.editContentForm.saving=!0,l.Z.staticStorage.saveContent({path:this.list.selected.relativePath,content:this.editContentForm.model.content}).catch((function(){e.editContentForm.saveErrored=!0})).finally((function(){setTimeout((function(){e.editContentForm.saving=!1}),400)}))},handleContentEditCallback:function(){this.editContentForm.saveErrored?this.editContentForm.saveErrored=!1:(this.editContentForm.model={},this.editContentForm.visible=!1,this.handleListStatics())},onDirectoryFormModalClose:function(){this.list.selected={},this.$set(this.directoryForm.model,"name",null)},onRenameModalClose:function(){this.list.selected={},this.$set(this.renameForm.model,"name",null)},onUploadModalClose:function(){this.$refs.upload.handleClearFileList(),this.list.selected={},this.handleListStatics()},handleEditContentModalClose:function(){this.editContentForm.visible=!1,this.list.selected={},this.editContentForm.model.content=""}}},u=m,h=o(42177),f=(0,h.Z)(u,n,r,!1,null,null,null),v=f.exports}}]);
\ No newline at end of file
(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[139],{82139:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return f}});var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"option-tab-wrapper"},[a("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1}},[a("div",{staticClass:"table-page-search-wrapper"},[a("a-form",{attrs:{layout:"inline"}},[a("a-row",{attrs:{gutter:48}},[a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"关键词:"}},[a("a-input",{on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery()}},model:{value:t.queryParam.keyword,callback:function(e){t.$set(t.queryParam,"keyword",e)},expression:"queryParam.keyword"}})],1)],1),a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"类型:"}},[a("a-select",{attrs:{allowClear:"",placeholder:"请选择类型"},on:{change:function(e){return t.handleQuery()}},model:{value:t.queryParam.type,callback:function(e){t.$set(t.queryParam,"type",e)},expression:"queryParam.type"}},t._l(Object.keys(t.optionType),(function(e){return a("a-select-option",{key:e,attrs:{value:e}},[t._v(t._s(t.optionType[e].text)+" ")])})),1)],1)],1),a("a-col",{attrs:{md:12,sm:24}},[a("span",{staticClass:"table-page-search-submitButtons"},[a("a-space",[a("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleQuery()}}},[t._v("查询")]),a("a-button",{on:{click:function(e){return t.handleResetParam()}}},[t._v("重置")])],1)],1)])],1)],1)],1),a("div",{staticClass:"table-operator"},[a("a-button",{attrs:{icon:"plus",type:"primary"},on:{click:t.handleOpenFormModal}},[t._v("新增")])],1),a("div",{staticClass:"mt-4"},[a("a-table",{attrs:{columns:t.columns,dataSource:t.formattedData,loading:t.loading,pagination:!1,rowKey:function(t){return t.id},scrollToFirstRowOnChange:!0},scopedSlots:t._u([{key:"type",fn:function(e){return a("span",{},[t._v(" "+t._s(e.text)+" ")])}},{key:"createTime",fn:function(e){return a("span",{},[a("a-tooltip",{attrs:{placement:"top"}},[a("template",{slot:"title"},[t._v(" "+t._s(t._f("moment")(e))+" ")]),t._v(" "+t._s(t._f("timeAgo")(e))+" ")],2)],1)}},{key:"updateTime",fn:function(e){return a("span",{},[a("a-tooltip",{attrs:{placement:"top"}},[a("template",{slot:"title"},[t._v(" "+t._s(t._f("moment")(e))+" ")]),t._v(" "+t._s(t._f("timeAgo")(e))+" ")],2)],1)}},{key:"action",fn:function(e,n){return a("span",{},[a("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:function(e){return t.handleOpenEditFormModal(n)}}},[t._v("编辑")]),a("a-divider",{attrs:{type:"vertical"}}),a("a-popconfirm",{attrs:{title:"你确定要永久删除该变量?",cancelText:"取消",okText:"确定"},on:{confirm:function(e){return t.handleDeleteOption(n.id)}}},[a("a-button",{staticClass:"!p-0",attrs:{type:"link"}},[t._v("删除")])],1)],1)}}])}),a("div",{staticClass:"page-wrapper"},[a("a-pagination",{staticClass:"pagination",attrs:{current:t.pagination.page,defaultPageSize:t.pagination.size,pageSizeOptions:["10","20","50","100"],total:t.pagination.total,showLessItems:"",showSizeChanger:""},on:{change:t.handlePaginationChange,showSizeChange:t.handlePaginationChange}})],1)],1)]),a("a-modal",{attrs:{afterClose:t.onFormClose,title:t.formTitle},model:{value:t.form.visible,callback:function(e){t.$set(t.form,"visible",e)},expression:"form.visible"}},[a("template",{slot:"footer"},[a("ReactiveButton",{attrs:{errored:t.form.saveErrored,loading:t.form.saving,erroredText:"保存失败",loadedText:"保存成功",text:"保存"},on:{callback:t.handleSaveOrUpdateCallback,click:t.handleSaveOrUpdate}})],1),t.form.model.type===t.optionType.INTERNAL.value?a("a-alert",{attrs:{banner:"",closable:"",message:"注意:在不知道系统变量的具体用途时,请不要随意修改!"}}):t._e(),a("a-form-model",{ref:"optionForm",attrs:{model:t.form.model,rules:t.form.rules,layout:"vertical"}},[a("a-form-model-item",{attrs:{label:"Key:",prop:"key"}},[a("a-input",{ref:"keyInput",model:{value:t.form.model.key,callback:function(e){t.$set(t.form.model,"key",e)},expression:"form.model.key"}})],1),a("a-form-model-item",{attrs:{label:"Value:",prop:"value"}},[a("a-input",{attrs:{autoSize:{minRows:5},type:"textarea"},model:{value:t.form.model.value,callback:function(e){t.$set(t.form.model,"value",e)},expression:"form.model.value"}})],1)],1)],2)],1)},o=[],i=a(76381),r=(a(82395),a(19003),a(31875),a(41479),a(1540)),s=a(98906),l=[{title:"Key",dataIndex:"key",ellipsis:!0,scopedSlots:{customRender:"key"}},{title:"Value",dataIndex:"value",ellipsis:!0,scopedSlots:{customRender:"value"}},{title:"类型",dataIndex:"typeProperty",width:"100px",scopedSlots:{customRender:"type"}},{title:"创建时间",dataIndex:"createTime",width:"200px",scopedSlots:{customRender:"createTime"}},{title:"更新时间",dataIndex:"updateTime",width:"200px",scopedSlots:{customRender:"updateTime"}},{title:"操作",dataIndex:"action",width:"120px",scopedSlots:{customRender:"action"}}],u={name:"OptionsList",data:function(){return{optionType:{INTERNAL:{value:"INTERNAL",text:"系统"},CUSTOM:{value:"CUSTOM",text:"自定义"}},columns:l,pagination:{page:1,size:10,sort:null,total:1},queryParam:{page:0,size:10,sort:null,keyword:null,type:null},loading:!1,options:[],form:{visible:!1,model:{},rules:{key:[{required:!0,message:"* Key 不能为空",trigger:["change"]}],value:[{required:!0,message:"* Value 不能为空",trigger:["change"]}]},saving:!1,saveErrored:!1}}},computed:{formattedData:function(){var t=this;return this.options.map((function(e){return e.typeProperty=t.optionType[e.type],e}))},formTitle:function(){return this.form.model.id?"编辑":"新增"}},beforeMount:function(){this.handleListOptions()},methods:(0,i.Z)((0,i.Z)({},(0,s.nv)(["refreshOptionsCache"])),{},{handleListOptions:function(){var t=this;this.loading=!0,this.queryParam.page=this.pagination.page-1,this.queryParam.size=this.pagination.size,this.queryParam.sort=this.pagination.sort,r.Z.option.listAsView(this.queryParam).then((function(e){t.options=e.data.content,t.pagination.total=e.data.total})).finally((function(){t.loading=!1}))},handleQuery:function(){this.handlePaginationChange(1,this.pagination.size)},handleDeleteOption:function(t){var e=this;r.Z.option["delete"](t).then((function(){e.$message.success("删除成功!")})).finally((function(){e.handleListOptions(),e.refreshOptionsCache()}))},handleOpenFormModal:function(){var t=this;this.form.visible=!0,this.$nextTick((function(){t.$refs.keyInput.focus()}))},handleOpenEditFormModal:function(t){var e=this;this.form.model=t,this.form.visible=!0,this.$nextTick((function(){e.$refs.keyInput.focus()}))},handlePaginationChange:function(t,e){this.$log.debug("Current: ".concat(t,", PageSize: ").concat(e)),this.pagination.page=t,this.pagination.size=e,this.handleListOptions()},handleResetParam:function(){this.queryParam.keyword=null,this.queryParam.type=null,this.handlePaginationChange(1,this.pagination.size)},onFormClose:function(){this.form.visible=!1,this.form.model={}},handleSaveOrUpdate:function(){var t=this;t.$refs.optionForm.validate((function(e){e&&(t.form.saving=!0,t.form.model.id?r.Z.option.update(t.form.model.id,t.form.model).catch((function(){t.form.saveErrored=!0})).finally((function(){setTimeout((function(){t.form.saving=!1}),400)})):(t.form.model.type=t.optionType.CUSTOM.value,r.Z.option.create(t.form.model).catch((function(){t.form.saveErrored=!0})).finally((function(){setTimeout((function(){t.form.saving=!1}),400)}))))}))},handleSaveOrUpdateCallback:function(){this.form.saveErrored?this.form.saveErrored=!1:(this.form.model={},this.form.visible=!1,this.handleListOptions(),this.refreshOptionsCache())}})},c=u,d=a(18156),p=(0,d.Z)(c,n,o,!1,null,null,null),f=p.exports},53303:function(t,e,a){var n=a(15820),o=Math.floor,i=function(t,e){var a=t.length,l=o(a/2);return a<8?r(t,e):s(t,i(n(t,0,l),e),i(n(t,l),e),e)},r=function(t,e){var a,n,o=t.length,i=1;while(i<o){n=i,a=t[i];while(n&&e(t[n-1],a)>0)t[n]=t[--n];n!==i++&&(t[n]=a)}return t},s=function(t,e,a,n){var o=e.length,i=a.length,r=0,s=0;while(r<o||s<i)t[r+s]=r<o&&s<i?n(e[r],a[s])<=0?e[r++]:a[s++]:r<o?e[r++]:a[s++];return t};t.exports=i},52103:function(t,e,a){var n=a(82678),o=n.match(/firefox\/(\d+)/i);t.exports=!!o&&+o[1]},76044:function(t,e,a){var n=a(82678);t.exports=/MSIE|Trident/.test(n)},97551:function(t,e,a){var n=a(82678),o=n.match(/AppleWebKit\/(\d+)\./);t.exports=!!o&&+o[1]},19003:function(t,e,a){"use strict";var n=a(79644),o=a(33691),i=a(77925),r=a(43207),s=a(71768),l=a(43150),u=a(32640),c=a(53303),d=a(29415),p=a(52103),f=a(76044),m=a(3718),h=a(97551),v=[],y=o(v.sort),g=o(v.push),k=u((function(){v.sort(void 0)})),b=u((function(){v.sort(null)})),C=d("sort"),x=!u((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(h)return h<603;var t,e,a,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(n=0;n<47;n++)v.push({k:e+n,v:a})}for(v.sort((function(t,e){return e.v-t.v})),n=0;n<v.length;n++)e=v[n].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return"DGBEFHACIJK"!==o}})),T=k||!b||!C||!x,w=function(t){return function(e,a){return void 0===a?-1:void 0===e?1:void 0!==t?+t(e,a)||0:l(e)>l(a)?1:-1}};n({target:"Array",proto:!0,forced:T},{sort:function(t){void 0!==t&&i(t);var e=r(this);if(x)return void 0===t?y(e):y(e,t);var a,n,o=[],l=s(e);for(n=0;n<l;n++)n in e&&g(o,e[n]);c(o,w(t)),a=o.length,n=0;while(n<a)e[n]=o[n++];while(n<l)delete e[n++];return e}})}}]);
\ No newline at end of file
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[139],{82139:function(e,t,a){a.r(t),a.d(t,{default:function(){return u}});var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"option-tab-wrapper"},[a("a-card",{attrs:{bodyStyle:{padding:0},bordered:!1}},[a("div",{staticClass:"table-page-search-wrapper"},[a("a-form",{attrs:{layout:"inline"}},[a("a-row",{attrs:{gutter:48}},[a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"关键词:"}},[a("a-input",{on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery()}},model:{value:e.queryParam.keyword,callback:function(t){e.$set(e.queryParam,"keyword",t)},expression:"queryParam.keyword"}})],1)],1),a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"类型:"}},[a("a-select",{attrs:{allowClear:"",placeholder:"请选择类型"},on:{change:function(t){return e.handleQuery()}},model:{value:e.queryParam.type,callback:function(t){e.$set(e.queryParam,"type",t)},expression:"queryParam.type"}},e._l(Object.keys(e.optionType),(function(t){return a("a-select-option",{key:t,attrs:{value:t}},[e._v(e._s(e.optionType[t].text)+" ")])})),1)],1)],1),a("a-col",{attrs:{md:12,sm:24}},[a("span",{staticClass:"table-page-search-submitButtons"},[a("a-space",[a("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleQuery()}}},[e._v("查询")]),a("a-button",{on:{click:function(t){return e.handleResetParam()}}},[e._v("重置")])],1)],1)])],1)],1)],1),a("div",{staticClass:"table-operator"},[a("a-button",{attrs:{icon:"plus",type:"primary"},on:{click:e.handleOpenFormModal}},[e._v("新增")])],1),a("div",{staticClass:"mt-4"},[a("a-table",{attrs:{columns:e.columns,dataSource:e.formattedData,loading:e.loading,pagination:!1,rowKey:function(e){return e.id},scrollToFirstRowOnChange:!0},scopedSlots:e._u([{key:"type",fn:function(t){return a("span",{},[e._v(" "+e._s(t.text)+" ")])}},{key:"createTime",fn:function(t){return a("span",{},[a("a-tooltip",{attrs:{placement:"top"}},[a("template",{slot:"title"},[e._v(" "+e._s(e._f("moment")(t))+" ")]),e._v(" "+e._s(e._f("timeAgo")(t))+" ")],2)],1)}},{key:"updateTime",fn:function(t){return a("span",{},[a("a-tooltip",{attrs:{placement:"top"}},[a("template",{slot:"title"},[e._v(" "+e._s(e._f("moment")(t))+" ")]),e._v(" "+e._s(e._f("timeAgo")(t))+" ")],2)],1)}},{key:"action",fn:function(t,o){return a("span",{},[a("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:function(t){return e.handleOpenEditFormModal(o)}}},[e._v("编辑")]),a("a-divider",{attrs:{type:"vertical"}}),a("a-popconfirm",{attrs:{title:"你确定要永久删除该变量?",cancelText:"取消",okText:"确定"},on:{confirm:function(t){return e.handleDeleteOption(o.id)}}},[a("a-button",{staticClass:"!p-0",attrs:{type:"link"}},[e._v("删除")])],1)],1)}}])}),a("div",{staticClass:"page-wrapper"},[a("a-pagination",{staticClass:"pagination",attrs:{current:e.pagination.page,defaultPageSize:e.pagination.size,pageSizeOptions:["10","20","50","100"],total:e.pagination.total,showLessItems:"",showSizeChanger:""},on:{change:e.handlePaginationChange,showSizeChange:e.handlePaginationChange}})],1)],1)]),a("a-modal",{attrs:{afterClose:e.onFormClose,title:e.formTitle},model:{value:e.form.visible,callback:function(t){e.$set(e.form,"visible",t)},expression:"form.visible"}},[a("template",{slot:"footer"},[a("ReactiveButton",{attrs:{errored:e.form.saveErrored,loading:e.form.saving,erroredText:"保存失败",loadedText:"保存成功",text:"保存"},on:{callback:e.handleSaveOrUpdateCallback,click:e.handleSaveOrUpdate}})],1),e.form.model.type===e.optionType.INTERNAL.value?a("a-alert",{attrs:{banner:"",closable:"",message:"注意:在不知道系统变量的具体用途时,请不要随意修改!"}}):e._e(),a("a-form-model",{ref:"optionForm",attrs:{model:e.form.model,rules:e.form.rules,layout:"vertical"}},[a("a-form-model-item",{attrs:{label:"Key:",prop:"key"}},[a("a-input",{ref:"keyInput",model:{value:e.form.model.key,callback:function(t){e.$set(e.form.model,"key",t)},expression:"form.model.key"}})],1),a("a-form-model-item",{attrs:{label:"Value:",prop:"value"}},[a("a-input",{attrs:{autoSize:{minRows:5},type:"textarea"},model:{value:e.form.model.value,callback:function(t){e.$set(e.form.model,"value",t)},expression:"form.model.value"}})],1)],1)],2)],1)},i=[],n=a(1540),r=a(98906);const s=[{title:"Key",dataIndex:"key",ellipsis:!0,scopedSlots:{customRender:"key"}},{title:"Value",dataIndex:"value",ellipsis:!0,scopedSlots:{customRender:"value"}},{title:"类型",dataIndex:"typeProperty",width:"100px",scopedSlots:{customRender:"type"}},{title:"创建时间",dataIndex:"createTime",width:"200px",scopedSlots:{customRender:"createTime"}},{title:"更新时间",dataIndex:"updateTime",width:"200px",scopedSlots:{customRender:"updateTime"}},{title:"操作",dataIndex:"action",width:"120px",scopedSlots:{customRender:"action"}}];var l={name:"OptionsList",data(){return{optionType:{INTERNAL:{value:"INTERNAL",text:"系统"},CUSTOM:{value:"CUSTOM",text:"自定义"}},columns:s,pagination:{page:1,size:10,sort:null,total:1},queryParam:{page:0,size:10,sort:null,keyword:null,type:null},loading:!1,options:[],form:{visible:!1,model:{},rules:{key:[{required:!0,message:"* Key 不能为空",trigger:["change"]}],value:[{required:!0,message:"* Value 不能为空",trigger:["change"]}]},saving:!1,saveErrored:!1}}},computed:{formattedData(){return this.options.map((e=>(e.typeProperty=this.optionType[e.type],e)))},formTitle(){return this.form.model.id?"编辑":"新增"}},beforeMount(){this.handleListOptions()},methods:{...(0,r.nv)(["refreshOptionsCache"]),handleListOptions(){this.loading=!0,this.queryParam.page=this.pagination.page-1,this.queryParam.size=this.pagination.size,this.queryParam.sort=this.pagination.sort,n.Z.option.listAsView(this.queryParam).then((e=>{this.options=e.data.content,this.pagination.total=e.data.total})).finally((()=>{this.loading=!1}))},handleQuery(){this.handlePaginationChange(1,this.pagination.size)},handleDeleteOption(e){n.Z.option["delete"](e).then((()=>{this.$message.success("删除成功!")})).finally((()=>{this.handleListOptions(),this.refreshOptionsCache()}))},handleOpenFormModal(){this.form.visible=!0,this.$nextTick((()=>{this.$refs.keyInput.focus()}))},handleOpenEditFormModal(e){this.form.model=e,this.form.visible=!0,this.$nextTick((()=>{this.$refs.keyInput.focus()}))},handlePaginationChange(e,t){this.$log.debug(`Current: ${e}, PageSize: ${t}`),this.pagination.page=e,this.pagination.size=t,this.handleListOptions()},handleResetParam(){this.queryParam.keyword=null,this.queryParam.type=null,this.handlePaginationChange(1,this.pagination.size)},onFormClose(){this.form.visible=!1,this.form.model={}},handleSaveOrUpdate(){const e=this;e.$refs.optionForm.validate((t=>{t&&(e.form.saving=!0,e.form.model.id?n.Z.option.update(e.form.model.id,e.form.model).catch((()=>{e.form.saveErrored=!0})).finally((()=>{setTimeout((()=>{e.form.saving=!1}),400)})):(e.form.model.type=e.optionType.CUSTOM.value,n.Z.option.create(e.form.model).catch((()=>{e.form.saveErrored=!0})).finally((()=>{setTimeout((()=>{e.form.saving=!1}),400)}))))}))},handleSaveOrUpdateCallback(){this.form.saveErrored?this.form.saveErrored=!1:(this.form.model={},this.form.visible=!1,this.handleListOptions(),this.refreshOptionsCache())}}},d=l,p=a(18156),m=(0,p.Z)(d,o,i,!1,null,null,null),u=m.exports}}]);
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment