1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 19:08:21 +00:00
Files
seahub/media/assets/frontend/static/js/sharedFileViewSpreadsheet.f8a1d57a.js

1 line
2.0 KiB
JavaScript

"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[6477],{34466:function(e,t,n){var r=n(23029),o=n(92901),s=n(39874),i=n(85501),a=n(9950),c=n(17119),u=n(97011),f=n(40326),d=n(88204),h=n(15167),g=n(81446),l=(n(44259),n(44414)),m=window.shared.pageOptions,v=m.repoID,p=m.filePath,A=m.err,k=m.commitID,w=m.fileType,x=m.fileName,L=m.sharedToken,b=function(e){function t(){return(0,r.A)(this,t),(0,s.A)(this,t,arguments)}return(0,i.A)(t,e),(0,o.A)(t,[{key:"render",value:function(){return(0,l.jsx)(d.A,{content:(0,l.jsx)(j,{})})}}])}(a.Component),j=function(e){function t(e){var n;return(0,r.A)(this,t),(n=(0,s.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,i.A)(t,e),(0,o.A)(t,[{key:"componentDidMount",value:function(){var e=this;if(!A){var t=function(){u.e.queryOfficeFileConvertStatus(v,k,p,w.toLowerCase(),L).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,l.jsx)(h.A,{}):t?(0,l.jsx)(g.A,{}):n?(0,l.jsx)(h.A,{errorMsg:n}):(0,l.jsx)("div",{className:"shared-file-view-body spreadsheet-file-view",children:(0,l.jsx)("iframe",{id:"spreadsheet-container",title:x,src:"".concat(f.Yc,"office-convert/static/").concat(v,"/").concat(k).concat(encodeURIComponent(p),"/index.html?token=").concat(L),onLoad:this.setIframeHeight})})}}])}(a.Component);c.render((0,l.jsx)(b,{}),document.getElementById("wrapper"))},44259:function(){}},function(e){e.O(0,[4223],(function(){return t=34466,e(e.s=t);var t}));e.O()}]);