Skip to content

Commit

Permalink
Make quota_url configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Oct 20, 2020
1 parent 7030758 commit b628309
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/layout/masthead.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class MastheadState {
// add quota meter to masthead
Galaxy.quotaMeter = this.quotaMeter = new QuotaMeter.UserQuotaMeter({
model: Galaxy.user,
quotaUrl: Galaxy.config.quota_url,
});

// loop through beforeunload functions if the user attempts to unload the page
Expand Down
4 changes: 3 additions & 1 deletion client/src/mvc/user/user-quotameter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var UserQuotaMeter = Backbone.View.extend(baseMVC.LoggableMixin).extend(
options: {
warnAtPercent: 85,
errorAtPercent: 100,
quotaUrl: "https://galaxyproject.org/support/account-quotas/",
},

/** Set up, accept options, and bind events */
Expand Down Expand Up @@ -133,10 +134,11 @@ var UserQuotaMeter = Backbone.View.extend(baseMVC.LoggableMixin).extend(
? `title="Using ${data.nice_total_disk_usage}. Click for details."`
: "";
const using = `${_l("Using")} ${data.quota_percent}%`;
const quotaUrl = this.options.quotaUrl;
return `<div id="quota-meter" class="quota-meter progress">
<div class="progress-bar" style="width: ${data.quota_percent}%"></div>
<div class="quota-meter-text" data-placement="left" ${title}>
<a href="https://galaxyproject.org/support/account-quotas/" target="_blank">${using}</a>
<a href="${quotaUrl}" target="_blank">${using}</a>
</div>
</div>`;
},
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/managers/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def _use_config(config, key, **context):
'screencasts_url' : _use_config,
'citation_url' : _use_config,
'support_url' : _use_config,
'quota_url' : _use_config,
'helpsite_url' : _use_config,
'lims_doc_url' : _defaults_to("https://usegalaxy.org/u/rkchak/p/sts"),
'default_locale' : _use_config,
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy/webapps/galaxy/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,13 @@ mapping:
desc: |
The URL linked by the "Wiki" link in the "Help" menu.
quota_url:
type: str
default: https://galaxyproject.org/support/account-quotas/
required: false
desc: |
The URL linked for quota information in the UI.
support_url:
type: str
default: https://galaxyproject.org/support/
Expand Down

0 comments on commit b628309

Please sign in to comment.