mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
1 line
2.0 KiB
JavaScript
1 line
2.0 KiB
JavaScript
![]() |
"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[5848],{70252:function(e,t,n){var r=n(23029),o=n(92901),i=n(39874),s=n(85501),a=n(9950),c=n(17119),u=n(97011),f=n(40326),d=n(27831),h=n(44513),l=n(81446),g=(n(44259),n(44414)),m=window.app.pageOptions,p=m.repoID,v=m.filePath,A=m.err,k=m.commitID,w=m.fileType,x=m.fileName,L=function(e){function t(){return(0,r.A)(this,t),(0,i.A)(this,t,arguments)}return(0,s.A)(t,e),(0,o.A)(t,[{key:"render",value:function(){return(0,g.jsx)(d.A,{content:(0,g.jsx)(j,{})})}}])}(a.Component),j=function(e){function t(e){var n;return(0,r.A)(this,t),(n=(0,i.A)(this,t,[e])).setIframeHeight=function(e){var t=e.currentTarget;t.height=t.contentDocument.body.scrollHeight},n.state={isLoading:!A,errorMsg:""},n}return(0,s.A)(t,e),(0,o.A)(t,[{key:"componentDidMount",value:function(){var e=this;if(!A){var t=function(){u.e.queryOfficeFileConvertStatus(p,k,v,w.toLowerCase()).then((function(n){switch(n.data.status){case"QUEUED":case"PROCESSING":e.setState({isLoading:!0}),setTimeout(t,2e3);break;case"ERROR":e.setState({isLoading:!1,errorMsg:(0,f.AP)("Document convertion failed.")});break;case"DONE":e.setState({isLoading:!1,errorMsg:""})}})).catch((function(t){t.response?e.setState({isLoading:!1,errorMsg:(0,f.AP)("Document convertion failed.")}):e.setState({isLoading:!1,errorMsg:(0,f.AP)("Please check the network.")})}))};t()}}},{key:"render",value:function(){var e=this.state,t=e.isLoading,n=e.errorMsg;return A?(0,g.jsx)(h.A,{}):t?(0,g.jsx)(l.A,{}):n?(0,g.jsx)(h.A,{errorMsg:n}):(0,g.jsx)("div",{className:"file-view-content flex-1 spreadsheet-file-view",children:(0,g.jsx)("iframe",{id:"spreadsheet-container",title:x,src:"".concat(f.Yc,"office-convert/static/").concat(p,"/").concat(k).concat(encodeURIComponent(v),"/index.html"),onLoad:this.setIframeHeight})})}}])}(a.Component);c.render((0,g.jsx)(L,{}),document.getElementById("wrapper"))},44259:function(){}},function(e){e.O(0,[4223],(function(){return t=70252,e(e.s=t);var t}));e.O()}]);
|