1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

Subscription (#6069)

* subscription api

* subscription page

* subscriptionAPI.js

* buy quota

* add currency icons

---------

Co-authored-by: Michael An <2331806369@qq.com>
This commit is contained in:
欢乐马
2024-05-17 11:14:55 +08:00
committed by GitHub
parent 533bacef1b
commit 6d1bb9039d
30 changed files with 1377 additions and 5 deletions

View File

@@ -6,6 +6,10 @@ import { seafileAPI } from '../../utils/seafile-api';
import { siteRoot, gettext, appAvatarURL, enableSSOToThirdpartWebsite } from '../../utils/constants';
import toaster from '../toast';
const {
isOrgContext,
} = window.app.pageOptions;
const propTypes = {
isAdminPanel: PropTypes.bool,
};
@@ -22,6 +26,7 @@ class Account extends Component {
isStaff: false,
isOrgStaff: false,
usageRate: '',
enableSubscription: false,
};
this.isFirstMounted = true;
}
@@ -81,6 +86,7 @@ class Account extends Component {
isInstAdmin: resp.data.is_inst_admin,
isOrgStaff: resp.data.is_org_staff === 1 ? true : false,
showInfo: !this.state.showInfo,
enableSubscription: resp.data.enable_subscription,
});
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
@@ -163,6 +169,7 @@ class Account extends Component {
</div>
</div>
<a href={siteRoot + 'profile/'} className="item">{gettext('Settings')}</a>
{(this.state.enableSubscription && !isOrgContext) && <a href={siteRoot + 'subscription/'} className="item">{'付费管理'}</a>}
{this.renderMenu()}
{enableSSOToThirdpartWebsite && <a href={siteRoot + 'sso-to-thirdpart/'} className="item">{gettext('Customer Portal')}</a>}
<a href={siteRoot + 'accounts/logout/'} className="item">{gettext('Log out')}</a>