Skip to content

Commit

Permalink
Subscription (#6069)
Browse files Browse the repository at this point in the history
* subscription api

* subscription page

* subscriptionAPI.js

* buy quota

* add currency icons

---------

Co-authored-by: Michael An <[email protected]>
  • Loading branch information
SkywalkerSpace and Michael18811380328 authored May 17, 2024
1 parent 533bace commit 6d1bb90
Show file tree
Hide file tree
Showing 30 changed files with 1,377 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/config/webpack.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const entryFiles = {
sysAdmin: '/pages/sys-admin',
search: '/pages/search',
uploadLink: '/pages/upload-link',
subscription: '/subscription.js',
};

const getEntries = (isEnvDevelopment) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/icons/currency.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions frontend/src/components/common/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -22,6 +26,7 @@ class Account extends Component {
isStaff: false,
isOrgStaff: false,
usageRate: '',
enableSubscription: false,
};
this.isFirstMounted = true;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>
Expand Down
Loading

0 comments on commit 6d1bb90

Please sign in to comment.