mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
2 lines
3.2 MiB
JavaScript
2 lines
3.2 MiB
JavaScript
![]() |
/*! For license information please see commons.3855ec58.js.LICENSE.txt */
|
||
|
(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[4223],{97499:function(e,t,n){"use strict";var r=n(94449),o=n(35740),a=n(64062),i=n.n(a),s=n(28321),u=n(40326),l=window.app.config.lang,c=void 0===l?"en":l;r.A.use(o.A).use(i()).use(s.initReactI18next).init({lng:c,fallbackLng:"en",ns:["sdoc-editor","seafile-editor"],defaultNS:"sdoc-editor",whitelist:["en","zh-CN","fr","de","cs","es","es-AR","es-MX","ru"],backend:{loadPath:u.SG+"{{ ns }}/locales/{{ lng }}/{{ ns }}.json"},debug:!1,interpolation:{escapeValue:!1},load:"currentOnly",react:{wait:!0}}),t.A=r.A},51925:function(e,t,n){"use strict";var r=n(23029),o=n(92901),a=n(39874),i=n(85501),s=n(9950),u=n(17119),l=n(65604),c=n(97011),d=n(40326),f=n(4086),p=n(44414),h=window.app.pageOptions.isOrgContext,m=function(e){function t(e){var n;return(0,r.A)(this,t),(n=(0,a.A)(this,t,[e])).getContainer=function(){return u.findDOMNode(n)},n.handleProps=function(){n.state.showInfo?n.addEvents():n.removeEvents()},n.addEvents=function(){["click","touchstart","keyup"].forEach((function(e){return document.addEventListener(e,n.handleDocumentClick,!0)}))},n.removeEvents=function(){["click","touchstart","keyup"].forEach((function(e){return document.removeEventListener(e,n.handleDocumentClick,!0)}))},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===l.Aq.keyCodes.tab)){var t=n.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==l.Aq.keyCodes.tab)&&n.setState({showInfo:!n.state.showInfo})}},n.onClickAccount=function(e){e.preventDefault(),n.isFirstMounted?(c.e.getAccountInfo().then((function(e){n.setState({userName:e.data.name,contactEmail:e.data.email,usageRate:e.data.space_usage,quotaUsage:l.Aq.bytesToSize(e.data.usage),quotaTotal:l.Aq.bytesToSize(e.data.total),isStaff:e.data.is_staff,isInstAdmin:e.data.is_inst_admin,isOrgStaff:1===e.data.is_org_staff,showInfo:!n.state.showInfo,enableSubscription:e.data.enable_subscription})})).catch((function(e){var t=l.Aq.getErrorMsg(e);f.A.danger(t)})),n.isFirstMounted=!1):n.setState({showInfo:!n.state.showInfo})},n.renderMenu=function(){var e,t=n.state,r=t.isStaff,o=t.isOrgStaff,a=t.isInstAdmin;return n.props.isAdminPanel?r?e={url:d.Yc,text:(0,d.AP)("Exit System Admin")}:o?e={url:d.Yc,text:(0,d.AP)("Exit Organization Admin")}:a&&(e={url:d.Yc,text:(0,d.AP)("Exit Institution Admin")}):r?e={url:"".concat(d.Yc,"sys/info/"),text:(0,d.AP)("System Admin")}:o?e={url:"".concat(d.Yc,"org/info/"),text:(0,d.AP)("Organization Admin")}:d.am&&a&&(e={url:"".concat(d.Yc,"inst/useradmin/"),text:(0,d.AP)("Institution Admin")}),e&&(0,p.jsx)("a",{href:e.url,title:e.text,className:"item",children:e.text})},n.renderAvatar=function(){return(0,p.jsx)("img",{src:d.wg,width:"36",height:"36",className:"avatar",alt:(0,d.AP)("Avatar")})},n.state={showInfo:!1,userName:"",contactEmail:"",quotaUsage:"",quotaTotal:"",isStaff:!1,isOrgStaff:!1,usageRate:"",enableSubscription:!1},n.isFirstMounted=!0,n}return(0,i.A)(t,e),(0,o.A)(t,[{key:"componentDidUpdate",value:function(e){this.handleProps()}},{key:"render",value:function(){return(0,p.jsxs)("div",{id:"account",children:[(0,p.jsx)("a",{id:"my-info",href:"#",onClick:this.onClickAccount,className:"account-toggle no-deco d-none d-md-block","aria-label":(0,d.AP)("View profile and more"),children:this.renderAvatar()}),(0,p.jsx)("span",{className:"account-toggle sf2-icon-more mobile-icon d-md-none","aria-label":(0,d.AP)("View profile and more"),onClick:this.onClickAccount}),(0,p.jsxs)("div",{id:"user-info-popup",className:"account-popup sf-popover ".concat(this.state.showInfo?"":"hide"),children:[(0,p.jsx)("div",{className:"outer-caret up-outer-caret",children:(0,p.jsx)("div",{className:"inner-caret"})}),(0,p.jsxs)("div",{className:"sf-popover-con",children:[(0,p.jsxs)("div",{className:"item o-hidden",children:[this.renderAvatar(),(0,p.jsx)("div",{className:"txt",children:this.state.userName})]}),(0,p.jsx)("div",{id:"space-traffic",children:(0,p.jsxs)("div",{className:"item",children:[(0,p.jsxs)("p",{children:[(0,d.AP)("Used:")," ",this.state.quotaUsage," / ",th
|