Feature #3748: Group quotas panel

This commit is contained in:
Carlos Martín committed 2015-05-21 12:27:53 +02:00
1 parent c969b087a6
commit bcf4bf9639
6 files changed
+77 -72

No files matched your search

+2 -1
View File
@@ -11,7 +11,8 @@ define(function(require) {
];
var _panels = [
require('./groups-tab/panels/info')
require('./groups-tab/panels/info'),
require('./groups-tab/panels/quotas')
];
var Tab = {
@@ -121,17 +121,20 @@ define(function(require) {
type: "custom",
call: popUpGroupQuotasDialog
},
*/
"Group.set_quota" : {
type: "multiple",
call: OpenNebula.Group.set_quota,
elements: groupElements,
callback: function(request,response) {
Sunstone.runAction('Group.show',request.request.data[0]);
},
error: onError
call: OpenNebulaGroup.set_quota,
elements: function() {
return Sunstone.getDataTable(TAB_ID).elements();
},
callback: function(request) {
Sunstone.runAction('Group.show',request.request.data[0]);
},
error: Notifier.onError
},
/* TODO
"Group.accounting" : {
type: "monitor",
call: OpenNebula.Group.accounting,
@@ -0,0 +1,59 @@
define(function(require) {
/*
DEPENDENCIES
*/
var Locale = require('utils/locale');
var Config = require('sunstone-config');
var QuotaDefaults = require('utils/quotas/quota-defaults');
var QuotaWidgets = require('utils/quotas/quota-widgets');
/*
CONSTANTS
*/
var TAB_ID = require('../tabId');
var PANEL_ID = require('./quotas/panelId');
var RESOURCE = "Group";
var XML_ROOT = "GROUP";
/*
CONSTRUCTOR
*/
function Panel(info) {
this.title = Locale.tr("Quotas");
this.icon = "fa-align-left";
this.element = info[XML_ROOT];
return this;
}
Panel.PANEL_ID = PANEL_ID;
Panel.prototype.html = _html;
Panel.prototype.setup = _setup;
return Panel;
/*
FUNCTION DEFINITIONS
*/
function _html() {
return QuotaWidgets.initQuotasPanel(
this.element,
QuotaDefaults.getDefaultQuotas(RESOURCE),
Config.isTabActionEnabled(TAB_ID, RESOURCE+".quotas_dialog"));
}
function _setup(context) {
QuotaWidgets.setupQuotasPanel(
this.element,
context,
Config.isTabActionEnabled(TAB_ID, RESOURCE+".quotas_dialog"),
RESOURCE);
return false;
}
});
@@ -0,0 +1,3 @@
define(function(require){
return 'group_quotas_tab';
})
@@ -43,15 +43,15 @@ define(function(require) {
function _html() {
return QuotaWidgets.initQuotasPanel(
this.element,
QuotaDefaults.getDefaultUserQuotas(),
Config.isTabActionEnabled(TAB_ID, "User.quotas_dialog"));
QuotaDefaults.getDefaultQuotas(RESOURCE),
Config.isTabActionEnabled(TAB_ID, RESOURCE+".quotas_dialog"));
}
function _setup(context) {
QuotaWidgets.setupQuotasPanel(
this.element,
context,
Config.isTabActionEnabled(TAB_ID, "User.quotas_dialog"),
Config.isTabActionEnabled(TAB_ID, RESOURCE+".quotas_dialog"),
RESOURCE);
return false;
@@ -1,61 +0,0 @@
<div class="row">
<div class="large-6 columns">
<table id="info_user_table" class="dataTable extended_table" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th colspan="3">{{tr "Information"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="key_td">{{tr "ID"}}</td>
<td class="value_td">{{element.ID}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Name"}}</td>
<td class="value_td">{{element.NAME}}</td>
<td></td>
</tr>
{{{groupTrHTML}}}
<tr>
<td class="key_td">{{tr "Secondary groups"}}</td>
<td class="value_td">{{secondaryGroups}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Authentication driver"}}</td>
<td class="value_td">{{element.AUTH_DRIVER}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="large-6 columns">
<table class="dataTable extended_table" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th>{{tr "Public SSH Key"}}</th>
<th>
<a class="user_ssh_public_key_edit right" href="#"><i class="fa fa-pencil-square-o"></i></a>
</th>
</tr>
</thead>
</table>
<textarea rows="6" type="text" id="user_ssh_public_key_textarea" name="ssh_public_key" class="hidden">
{{~element.TEMPLATE.SSH_PUBLIC_KEY~}}
</textarea>
<p id="user_ssh_public_key_text" name="ssh_public_key">
{{#if element.TEMPLATE.SSH_PUBLIC_KEY}}
{{element.TEMPLATE.SSH_PUBLIC_KEY}}
{{else}}
{{tr "You can provide a SSH Key for this User clicking on the edit button"}}
{{/if}}
</p>
</div>
</div>
<div class="row">
<div class="large-9 columns">
{{{templateTableHTML}}}
</div>
</div>