mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
![]() |
"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[9370],{17015:function(e,t,i){var n=i(60436),a=i(23029),r=i(92901),s=i(39874),o=i(85501),d=i(9950),c=i(17119),l=i(18849),h=i(65604),u=i(97011),m=i(40326),f=i(75511),p=i(81446),g=i(49403),v=i(27288),x=i(4159),y=i.n(x),A=i(57354),R=i(19260),k=i(6030),w=i(33151),j=i(68879),_=i(44414);y().locale(window.app.config.lang);var I=function(e){function t(e){var i;return(0,a.A)(this,t),(i=(0,s.A)(this,t,[e])).onMouseEnter=function(){i.setState({active:!0})},i.onMouseLeave=function(){i.setState({active:!1})},i.onItemRestore=function(e){e.preventDefault(),i.props.onItemRestore(i.props.item)},i.state={active:!1},i}return(0,o.A)(t,e),(0,r.A)(t,[{key:"render",value:function(){var e=this.props.item,t=A.A.getUrl({type:"download_historic_file",filePath:m.s$,objID:e.rev_file_id}),i="".concat(m.Yc,"profile/").concat(encodeURIComponent(e.creator_email),"/"),n="".concat(m.Yc,"repo/").concat(m.II,"/history/files/?obj_id=").concat(e.rev_file_id,"&commit_id=").concat(e.commit_id,"&p=").concat(h.Aq.encodePath(m.s$)),a="".concat(m.Yc,"repo/text_diff/").concat(m.II,"/?commit=").concat(e.commit_id,"&p=").concat(h.Aq.encodePath(m.s$)),r="".concat(m.Yc,"repo/").concat(m.II,"/snapshot/?commit_id=").concat(e.commit_id);return(0,_.jsx)(d.Fragment,{children:(0,_.jsxs)("tr",{onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,className:this.state.active?"tr-highlight":"",children:[(0,_.jsxs)("td",{children:[(0,_.jsx)("span",{children:y()(e.ctime).format("YYYY-MM-DD HH:mm:ss")}),0===this.props.index&&(0,_.jsx)("span",{className:"ml-1",children:(0,m.AP)("(current version)")})]}),(0,_.jsxs)("td",{children:[(0,_.jsx)("img",{className:"avatar",src:e.creator_avatar_url,alt:""})," ",(0,_.jsx)("a",{href:i,target:"_blank",className:"username",rel:"noreferrer",children:e.creator_name})]}),(0,_.jsx)("td",{children:h.Aq.bytesToSize(e.size)}),(0,_.jsx)("td",{children:this.state.active&&(0,_.jsx)(C,{index:this.props.index,downloadUrl:t,viewUrl:n,diffUrl:a,snapshotURL:r,onItemRestore:this.onItemRestore,canDownload:this.props.canDownload,canCompare:this.props.canCompare})})]})})}}])}(d.Component),C=function(e){function t(e){var i;return(0,a.A)(this,t),(i=(0,s.A)(this,t,[e])).dropdownToggle=function(){i.setState({dropdownOpen:!i.state.dropdownOpen})},i.state={dropdownOpen:!1},i}return(0,o.A)(t,e),(0,r.A)(t,[{key:"render",value:function(){var e=this.props,t=e.index,i=e.downloadUrl,n=e.viewUrl,a=e.snapshotURL,r=e.onItemRestore,s=e.canDownload;return(0,_.jsxs)(R.A,{isOpen:this.state.dropdownOpen,toggle:this.dropdownToggle,direction:"down",className:"mx-1 old-history-more-operation",children:[(0,_.jsx)(k.A,{tag:"i",className:"sf3-font sf3-font-more-vertical",title:(0,m.AP)("More operations"),"aria-label":(0,m.AP)("More operations"),"data-toggle":"dropdown","aria-expanded":this.state.dropdownOpen}),(0,_.jsxs)(w.A,{className:"drop-list",right:!0,children:[0!==t&&(0,_.jsx)("a",{href:"#",onClick:r,children:(0,_.jsx)(j.A,{children:(0,m.AP)("Restore")})}),s&&(0,_.jsx)("a",{href:i,children:(0,_.jsx)(j.A,{children:(0,m.AP)("Download")})}),(0,_.jsx)("a",{href:n,children:(0,_.jsx)(j.A,{children:(0,m.AP)("View")})}),0!=t&&(0,_.jsx)(j.A,{tag:"a",href:a,target:"_blank",children:(0,m.AP)("View Related Snapshot")})]})]})}}])}(d.PureComponent),F=I,P=(i(16322),i(18291),i(81848),function(e){function t(e){var i;return(0,a.A)(this,t),(i=(0,s.A)(this,t,[e])).listNewHistoryRecords=function(e,t){f.A.listFileHistoryRecords(e,1,t).then((function(e){if(!e.data)throw i.setState({isLoading:!1}),Error("There is an error in server.");i.initNewRecords(e.data)}))},i.listOldHistoryRecords=function(e,t){u.e.listOldFileHistoryRecords(e,t).then((function(e){if(!e.data)throw i.setState({isLoading:!1}),Error("There is an error in server.");i.initOldRecords(e.data)}))},i.onScrollHandler=function(e){var t=e.target.clientHeight,n=e.target.scrollHeight,a=t+e.target.scrollTop+1>=n,r=i.state.hasMore;a&&r&&i.reloadMore()},i.reloadMore=function(){if(!i.state.isReloadingData)if(m.EU){var e=i.state.currentPage+1;i.setState({c
|