Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "Disabled" to "Quotas Disabled" in Web-UI #2810

Closed
phillxnet opened this issue Mar 19, 2024 · 4 comments
Closed

Change "Disabled" to "Quotas Disabled" in Web-UI #2810

phillxnet opened this issue Mar 19, 2024 · 4 comments

Comments

@phillxnet
Copy link
Member

We have the following header & example content in shares overview:

Pool (Active mount options / Status) Quotas
pool-name (rw,relatime,space_cache,subvolid=5,subvol=/) Enabled

Which is meant to indicate the 3 infomational items: Pool (name), mount options/status, Quota status.

However when the RED Disabled appears in the 'Quotas' position:

Pool (Active mount options / Status) Quotas
pool-name (rw,relatime,space_cache,subvolid=5,subvol=/) Disabled

it can too easily lead to an inaccurate/misleading inference that the Share itself is disabled.

It is proposed that we instead specify that it is the Quotas that are disabled by the explicit use of Quotas Disabled in this warning message text.

@Hooverdan96
Copy link
Member

If this should only be done on the Shares Screen, then the change would have to be done here:

{{#each shares}}
<tr>
<td><a href="#shares/{{this.id}}"><i class="glyphicon glyphicon-folder-open"></i>&nbsp;&nbsp;{{this.name}}</a></td>
<td>{{humanize_size this.size}}</td>
<td>{{humanize_size this.rusage}}</td>
<td>{{humanize_size this.pqgroup_rusage}} {{checkUsage this.size this.pqgroup_rusage}}</td>
<td>
{{#if this.is_mounted}}
{{this.mount_status}}
{{else}}
<strong><span style="color:red">{{this.mount_status}}</span></strong>
{{/if}}
</td>
<td><a href="#pools/{{this.pool.id}}">{{this.pool.name}}</a>
{{#if this.pool.is_mounted}}
({{this.pool.mount_status}})
{{else}}
(<strong><span style="color:red">{{this.pool.mount_status}}</span></strong>)
{{/if}}
{{# if this.pool.quotas_enabled}}
Enabled
{{else}}
<strong><span style="color:red">Disabled</span></strong>
{{/if}}
</td>
<td>
{{displayCompressionAlgo this.compression_algo this.id}}
</td>
<td>{{#if (isSystemShare this.id this.pool.role)}}
N/A
{{else}}
<a id="delete_share_{{this.name}}" data-id="{{this.id}}" data-name="{{this.name}}" data-action="delete"
data-pool="{{this.pool.name}}" data-size="{{humanize_size this.size}}" data-usage="{{humanize_size this.eusage}}" rel="tooltip" title="Delete share"><i class="glyphicon glyphicon-trash"></i></a>
{{/if}}
</td>
</tr>

changing the text from Disabled to Quotas Disabled in Line 46

I tested the change, and that seems to do it:

image

For consistency, once could also change the wording from Enabled to Quotas Enabled in Line 44.

If you wanted to influence this also in the Pool page, it will be slightly more involved.

Probably here:

$('.editQuotaOverview').editable({
// emptyclass: 'editable-empty-custom',
source: [
{value: 'Enabled', text: 'Enabled'},
{value: 'Disabled', text: 'Disabled'}
],
success: function(response, quotasEditVal) {
var pid = $(this).data('pid');
$.ajax({
url: '/api/pools/' + pid + '/quotas',
type: 'PUT',
dataType: 'json',
data: {
'quotas': quotasEditVal
},
});
}
});
// Attempt to colour "Disabled" red. Non functional currently.
// https://vitalets.github.io/bootstrap-editable/
$('.editQuotaOverview').on('render', function (e, editable) {
// colour #EB6841 is our default for links.
var colors = {'Enabled': '#EB6841', 'Disabled': 'red'};
$(this).css("color", colors[editable.value]);
});

change the text in line 139 and 158 (even though that seems to be non-functional at the moment).

And here in Line 299:

// Simple Boolean to Text converter for use with Pool.quotas_enabled.
Handlebars.registerHelper('isEnabledDisabled', function (q_enabled) {
if (q_enabled) {
return 'Enabled';
}
return 'Disabled'
});

image

Do affect the drop-down, the text values also have to be changed over here:

But on the pool page it might not matter all that much, since there is a dedicated column for quotas, so that should be self-explanatory.

@phillxnet
Copy link
Member Author

@Hooverdan96 Thanks for looking into this one. Much appreciated.

changing the text from Disabled to Quotas Disabled in Line 46

That was my thinking also. I just created the issue quickly as was focused elsewhere and wasn't sure if we did it like this or used a model value. So yes this would do it nicely I think.

For consistency, once could also change the wording from Enabled to Quotas Enabled in Line 44.

Agreeed.

If you wanted to influence this also in the Pool page, it will be slightly more involved.

I think it is less critical there: as quotas has it's very own column: so is far less subject to miss-interpretation.

But on the pool page it might not matter all that much, since there is a dedicated column for quotas, so that should be self-explanatory.

Exactly.

Since you've basically fix this issue (Shares side), do you fancy presenting a PR. It's a safe/simple change after-all. And we could then get this into the next testing release: and consequently our pending Stable.

@Hooverdan96
Copy link
Member

PR submitted.

phillxnet added a commit that referenced this issue Mar 26, 2024
@phillxnet
Copy link
Member Author

Closing as:
Fixed by #2818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants