diff --git a/src/sunstone/etc/sunstone-views/cloud.yaml b/src/sunstone/etc/sunstone-views/cloud.yaml index e63ae24135..5e505a19d3 100644 --- a/src/sunstone/etc/sunstone-views/cloud.yaml +++ b/src/sunstone/etc/sunstone-views/cloud.yaml @@ -18,7 +18,6 @@ tabs: vm_template_tab: false vm_log_tab: false provision_tabs: - users: false flows: true templates: true actions: &provisionactions @@ -51,7 +50,6 @@ tabs: vms: true vdcquotas: false vdcvms: false - users: false create_vm: capacity_select: true network_select: true diff --git a/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml b/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml index f995deea4f..67cf19dde0 100644 --- a/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml @@ -18,7 +18,6 @@ tabs: vm_template_tab: false vm_log_tab: false provision_tabs: - users: false flows: true templates: false actions: &provisionactions @@ -51,7 +50,6 @@ tabs: vms: true vdcquotas: false vdcvms: false - users: false create_vm: capacity_select: false network_select: true diff --git a/src/sunstone/etc/sunstone-views/groupadmin_legacy.yaml b/src/sunstone/etc/sunstone-views/groupadmin_legacy.yaml deleted file mode 100644 index 8f58047a27..0000000000 --- a/src/sunstone/etc/sunstone-views/groupadmin_legacy.yaml +++ /dev/null @@ -1,97 +0,0 @@ -provision_logo: images/one_small_logo.png -enabled_tabs: - - provision-tab - - users-tab - - settings-tab -features: - showback: true -tabs: - provision-tab: - panel_tabs: - vm_info_tab: false - vm_capacity_tab: false - vm_hotplugging_tab: false - vm_network_tab: false - vm_snapshot_tab: false - vm_placement_tab: false - vm_actions_tab: false - vm_template_tab: false - vm_log_tab: false - provision_tabs: - users: true - flows: true - templates: true - actions: &provisionactions - Template.chmod: true - Template.delete: true - VM.rename: true - VM.resume: true - VM.reboot: true - VM.reboot_hard: true - VM.poweroff: true - VM.poweroff_hard: true - VM.undeploy: false - VM.undeploy_hard: false - VM.shutdown_hard: true - VM.delete: true - VM.resize: false - VM.attachdisk: false - VM.detachdisk: false - VM.disk_saveas: false - VM.attachnic: false - VM.detachnic: false - VM.snapshot_create: false - VM.snapshot_revert: false - VM.snapshot_delete: false - VM.disk_snapshot_create: false - VM.disk_snapshot_revert: false - VM.disk_snapshot_delete: false - dashboard: - quotas: false - vms: false - vdcquotas: true - vdcvms: true - users: true - create_vm: - capacity_select: true - network_select: true - disk_resize: true - settings-tab: - panel_tabs: - user_info_tab: false - user_config_tab: true - user_quotas_tab: true - user_accounting_tab: true - user_showback_tab: true - actions: - User.quotas_dialog: false - vms-tab: - actions: *provisionactions - images-tab: - table_columns: - - 0 # Checkbox - - 1 # ID - - 2 # Owner - - 3 # Group - - 4 # Name - - 5 # Datastore - #- 6 # Size - - 7 # Type - #- 8 # Registration time - #- 9 # Persistent - - 10 # Status - - 11 # #VMs - #- 12 # Target - vnets-tab: - table_columns: - - 0 # Checkbox - - 1 # ID - - 2 # Owner - - 3 # Group - - 4 # Name - - 5 # Reservation - - 6 # Cluster - #- 7 # Bridge - - 8 # Leases - #- 9 # VLAN ID - diff --git a/src/sunstone/etc/sunstone-views/groupadmin_vcenter_legacy.yaml b/src/sunstone/etc/sunstone-views/groupadmin_vcenter_legacy.yaml deleted file mode 100644 index 04627e18fe..0000000000 --- a/src/sunstone/etc/sunstone-views/groupadmin_vcenter_legacy.yaml +++ /dev/null @@ -1,96 +0,0 @@ -provision_logo: images/one_small_logo.png -enabled_tabs: - - provision-tab - - users-tab - - settings-tab -features: - showback: true -tabs: - provision-tab: - panel_tabs: - vm_info_tab: false - vm_capacity_tab: false - vm_hotplugging_tab: false - vm_network_tab: false - vm_snapshot_tab: false - vm_placement_tab: false - vm_actions_tab: false - vm_template_tab: false - vm_log_tab: false - provision_tabs: - users: true - flows: true - templates: false - actions: &provisionactions - Template.chmod: false - Template.delete: true - VM.rename: false - VM.resume: true - VM.reboot: true - VM.reboot_hard: true - VM.poweroff: true - VM.poweroff_hard: true - VM.undeploy: false - VM.undeploy_hard: false - VM.shutdown_hard: true - VM.delete: true - VM.resize: false - VM.attachdisk: false - VM.detachdisk: false - VM.disk_saveas: false - VM.attachnic: false - VM.detachnic: false - VM.snapshot_create: false - VM.snapshot_revert: false - VM.snapshot_delete: false - VM.disk_snapshot_create: false - VM.disk_snapshot_revert: false - VM.disk_snapshot_delete: false - dashboard: - quotas: false - vms: false - vdcquotas: true - vdcvms: true - users: true - create_vm: - capacity_select: false - network_select: true - settings-tab: - panel_tabs: - user_info_tab: false - user_config_tab: true - user_quotas_tab: true - user_accounting_tab: true - user_showback_tab: true - actions: - User.quotas_dialog: false - vms-tab: - actions: *provisionactions - images-tab: - table_columns: - - 0 # Checkbox - - 1 # ID - - 2 # Owner - - 3 # Group - - 4 # Name - - 5 # Datastore - #- 6 # Size - - 7 # Type - #- 8 # Registration time - #- 9 # Persistent - - 10 # Status - - 11 # #VMs - #- 12 # Target - vnets-tab: - table_columns: - - 0 # Checkbox - - 1 # ID - - 2 # Owner - - 3 # Group - - 4 # Name - - 5 # Reservation - - 6 # Cluster - #- 7 # Bridge - - 8 # Leases - #- 9 # VLAN ID - diff --git a/src/sunstone/public/app/tabs/provision-tab.js b/src/sunstone/public/app/tabs/provision-tab.js index 346bf43889..843f17024f 100644 --- a/src/sunstone/public/app/tabs/provision-tab.js +++ b/src/sunstone/public/app/tabs/provision-tab.js @@ -39,11 +39,8 @@ define(function(require) { var UserInputs = require('utils/user-inputs'); var CapacityInputs = require('tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs'); - var ProvisionQuotaWidget = require('./provision-tab/users/quota-widget'); - var ProvisionVmsList = require('./provision-tab/vms/list'); var ProvisionTemplatesList = require('./provision-tab/templates/list'); - var ProvisionUsersList = require('./provision-tab/users/list'); var ProvisionFlowsList = require('./provision-tab/flows/list'); // Templates @@ -54,48 +51,11 @@ define(function(require) { var TemplateDashboardVdcQuotas = require('hbs!./provision-tab/dashboard/vdc-quotas'); var TemplateDashboardVms = require('hbs!./provision-tab/dashboard/vms'); var TemplateDashboardVdcVms = require('hbs!./provision-tab/dashboard/vdc-vms'); - var TemplateDashboardUsers = require('hbs!./provision-tab/dashboard/users'); - - var TemplateGroupInfo = require('hbs!./provision-tab/group/info'); var TAB_ID = require('./provision-tab/tabId'); var TEMPLATE_LABELS_COLUMN = 4; var povision_actions = { - "Provision.User.create" : { - type: "create", - call: OpenNebula.User.create, - callback: function(request, response) { - if ( $("div#provision_create_user_manual_quota", - $("#provision_create_user")).hasClass("active") ){ - - quota_json = ProvisionQuotaWidget.retrieve($("#provision_create_user")); - - Sunstone.runAction("Provision.User.set_quota", - [response.USER.ID], quota_json); - } else { - clear_provision_create_user(); - } - }, - error: Notifier.onError - }, - - "Provision.User.set_quota" : { - type: "multiple", - call: OpenNebula.User.set_quota, - callback: function(request) { - clear_provision_create_user(); - }, - error: Notifier.onError - }, - - "Provision.Group.show" : { - type: "single", - call: OpenNebula.Group.show, - callback: show_provision_group_info_callback, - error: Notifier.onError - }, - "Provision.Flow.instantiate" : { type: "single", call: OpenNebula.ServiceTemplate.instantiate, @@ -546,46 +506,6 @@ define(function(require) { }); } - if (Config.provision.dashboard.isEnabled("users")) { - $("#provision_dashboard").append(TemplateDashboardUsers()); - - var start_time = Math.floor(new Date().getTime() / 1000); - // ms to s - - // 604800 = 7 days = 7*24*60*60 - start_time = start_time - 604800; - - // today - var end_time = -1; - - var options = { - "start_time": start_time, - "end_time": end_time, - "group": config["user_gid"] - } - - var no_table = true; - - OpenNebula.VM.accounting({ - success: function(req, response){ - Accounting.fillAccounting($("#dashboard_vdc_user_accounting"), req, response, no_table); - }, - error: Notifier.onError, - data: options - }); - - OpenNebula.User.list({ - timeout: true, - success: function (request, item_list){ - var total = item_list.length || 0; - - var context = $("#provision_users_dashboard"); - $("#provision_dashboard_users_total", context).html(total); - }, - error: Notifier.onError - }); - } - if (Config.provision.dashboard.isEnabled("quotas")) { $("#provision_dashboard").append(TemplateDashboardQuotas()); @@ -687,49 +607,6 @@ define(function(require) { } } - - function show_provision_user_info() { - Sunstone.runAction("Provision.User.show", "-1"); - $(".section_content").hide(); - $("#provision_user_info").fadeIn(); - $("dd.active a", $("#provision_user_info")).trigger("click"); - } - - - - function show_provision_group_info_callback(request, response) { - var info = response.GROUP; - - var context = $("#provision_manage_vdc"); - - var default_group_quotas = QuotaDefaults.default_quotas(info.DEFAULT_GROUP_QUOTAS); - - var quotas_tab_html = QuotaWidgets.initQuotasPanel(info, default_group_quotas, - "#provision_vdc_quotas_div", false); - - $("#provision_vdc_quotas_div").html(quotas_tab_html); - - QuotaWidgets.setupQuotasPanel(info, - "#provision_vdc_quotas_div", - false, - "Group"); - - $("#provision_info_vdc_group_acct", context).html(Accounting.html()); - Accounting.setup( - $("#provision_info_vdc_group_acct", context), - { fixed_group: info.ID, - init_group_by: "user" }); - - if (Config.isFeatureEnabled("showback")) { - $("#provision_info_vdc_group_showback", context).html(Showback.html()); - Showback.setup( - $("#provision_info_vdc_group_showback", context), - { fixed_user: "", fixed_group: info.ID }); - } - - $("#acct_placeholder", context).hide(); - } - function show_provision_create_vm() { OpenNebula.Action.clear_cache("VMTEMPLATE"); @@ -773,19 +650,6 @@ define(function(require) { $("#provision_create_flow").fadeIn(); } - function show_provision_create_user() { - $(".section_content").hide(); - $("#provision_create_user").fadeIn(); - $(document).foundation(); - } - - function show_provision_vdc_info() { - $(".section_content").hide(); - $("#provision_manage_vdc").fadeIn(); - - Sunstone.runAction('Provision.Group.show', "-1"); - } - function update_provision_flow_templates_datatable(datatable, timeout) { datatable.html('
'+ ''+ @@ -824,22 +688,6 @@ define(function(require) { }, timeout); } - // Closes and resets the create user wizard - function clear_provision_create_user(){ - OpenNebula.Action.clear_cache("USER"); - ProvisionUsersList.show(0); - - var context = $("#provision_create_user"); - $("#username", context).val(''); - $("#password", context).val(''); - $("#repeat_password", context).val(''); - - ProvisionQuotaWidget.reset(context); - - $(".alert-box-error", context).hide(); - $(".alert-box-error", context).html(""); - } - var _panels = [ require('./vms-tab/panels/info'), require('./vms-tab/panels/capacity'), @@ -901,7 +749,6 @@ define(function(require) { // TODO check if active ProvisionFlowsList.generate($(".provision_flows_list_section"), {active: true}); - ProvisionUsersList.generate($(".provision_users_list_section"), {active: true}); // // Dashboard @@ -940,11 +787,6 @@ define(function(require) { ProvisionFlowsList.show(0); }); - $(document).on("click", ".provision_users_list_button", function(){ - OpenNebula.Action.clear_cache("USER"); - ProvisionUsersList.show(0); - }); - // // Create VM // @@ -1504,95 +1346,6 @@ define(function(require) { $(".provision_create_flow_button").on("click", function(){ show_provision_create_flow(); }); - - // - // Group Info - // - - - $("#provision_vdc_info_button").on("click", function(){ - OpenNebula.Action.clear_cache("GROUP"); - show_provision_vdc_info(); - }); - - // - // Create User - // - - var context = $("#provision_create_user"); - - ProvisionQuotaWidget.setup(context); - - // Workaround to fix sliders. Apparently the setup fails while they are hidden - context.on('click', 'a[href="#provision_create_user_manual_quota"]', function(){ - $(".provision_rvms_quota_input", context).change(); - $(".provision_memory_quota_input", context).change(); - $(".provision_memory_quota_tmp_input", context).change(); - $(".provision_cpu_quota_input", context).change(); - - // Workaround until hidden Foundation.slider can be initialized - var intervalCounter = 0; - var intervalId = setInterval(function() { - - if ($("#provision_create_user_manual_quota", context).is(":visible") || - intervalCounter > 5){ - - context.foundation('slider', 'reflow'); - clearInterval(intervalId); - } - - intervalCounter += 1; - }, 500); - - }); - - $("#provision_create_user").submit(function(){ - var context = $(this); - - var username = $("#username", context).val(); - var password = $("#password", context).val(); - var repeat_password = $("#repeat_password", context).val(); - - // TODO driver - var driver = 'core'; - - if (!username.length || !password.length){ - $(".alert-box-error", context).fadeOut(); - $(".alert-box-error", context).fadeIn().html(Locale.tr("You have to provide a username and password")); - return false; - } - - if (password !== repeat_password){ - $(".alert-box-error", context).fadeOut(); - $(".alert-box-error", context).fadeIn().html(Locale.tr("Passwords do not match")); - return false; - } - - var user_json = { "user" : - { "name" : username, - "password" : password, - "auth_driver" : driver - } - }; - - Sunstone.runAction("Provision.User.create",user_json); - $(".alert-box-error", context).html('
'+ - ''+ - ''+ - ''+ - ''+ - '
'+ - '
'+ - ''+ - ''+ - '
'); - - return false; - }); - - $(document).on("click", ".provision_create_user_button", function(){ - show_provision_create_user(); - }); } }); } diff --git a/src/sunstone/public/app/tabs/provision-tab/content.hbs b/src/sunstone/public/app/tabs/provision-tab/content.hbs index 8b29b59cb9..3e09b9dcbb 100644 --- a/src/sunstone/public/app/tabs/provision-tab/content.hbs +++ b/src/sunstone/public/app/tabs/provision-tab/content.hbs @@ -24,12 +24,6 @@ {{/isProvisionTabEnabled}} -{{#isProvisionTabEnabled "provision-tab" "users"}} -{{> tabs/provision-tab/group/info}} -{{> tabs/provision-tab/users/create}} - -{{/isProvisionTabEnabled}} - {{#isProvisionTabEnabled "provision-tab" "flows"}} {{> tabs/provision-tab/flows/create}} diff --git a/src/sunstone/public/app/tabs/provision-tab/dashboard/users.hbs b/src/sunstone/public/app/tabs/provision-tab/dashboard/users.hbs deleted file mode 100644 index 90e2a45f67..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/dashboard/users.hbs +++ /dev/null @@ -1,90 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - -
-
-

- {{tr "Users"}} -

-
-
-
-
-
-
-
-
-
-
- - - -
- {{tr "TOTAL"}} -
-
-
-
-
-
- - -
-
-
-
-
-
-
-
-
- -
-
-

{{tr "CPU hours"}}

-
-
-
- {{> ./empty-graphs}} -
-
-
-
-
-

{{tr "Memory GB hours"}}

-
-
-
- {{> ./empty-graphs}} -
-
-
-
-
-

{{tr "Disk MB hours"}}

-
-
-
- {{> ./empty-graphs}} -
-
-
-
-
-
-
-
-
diff --git a/src/sunstone/public/app/tabs/provision-tab/group/info.hbs b/src/sunstone/public/app/tabs/provision-tab/group/info.hbs deleted file mode 100644 index f5cdb69a32..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/group/info.hbs +++ /dev/null @@ -1,55 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - - diff --git a/src/sunstone/public/app/tabs/provision-tab/header.hbs b/src/sunstone/public/app/tabs/provision-tab/header.hbs index 1ccdc4a385..0225ed1844 100644 --- a/src/sunstone/public/app/tabs/provision-tab/header.hbs +++ b/src/sunstone/public/app/tabs/provision-tab/header.hbs @@ -18,20 +18,6 @@
    - {{#isProvisionTabEnabled "provision-tab" "users"}} -
  • - - - {{tr "Group Info"}} - -
  • -
  • - - - {{tr "Users"}} - -
  • - {{/isProvisionTabEnabled}}
  • diff --git a/src/sunstone/public/app/tabs/provision-tab/users/create.hbs b/src/sunstone/public/app/tabs/provision-tab/users/create.hbs deleted file mode 100644 index 0d0e4835db..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/users/create.hbs +++ /dev/null @@ -1,83 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - - diff --git a/src/sunstone/public/app/tabs/provision-tab/users/empty-graphs.hbs b/src/sunstone/public/app/tabs/provision-tab/users/empty-graphs.hbs deleted file mode 100644 index ffead2c24a..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/users/empty-graphs.hbs +++ /dev/null @@ -1,20 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - - - -
    -{{tr "There is no information available"}} diff --git a/src/sunstone/public/app/tabs/provision-tab/users/info.hbs b/src/sunstone/public/app/tabs/provision-tab/users/info.hbs deleted file mode 100644 index fcc5f05cde..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/users/info.hbs +++ /dev/null @@ -1,102 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - -
    - - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - {{tr "Disk MB hours"}} -
    -
    -
    -
    -
    -
    -
    - -
    -
    - {{tr "CPU hours"}} -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - {{tr "Memory GB hours"}} -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    {{> ./empty-graphs}}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    diff --git a/src/sunstone/public/app/tabs/provision-tab/users/list.hbs b/src/sunstone/public/app/tabs/provision-tab/users/list.hbs deleted file mode 100644 index 21b8e9f7fb..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/users/list.hbs +++ /dev/null @@ -1,56 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - -
    -
    - - - - -

    - {{!tr "Users"}} - - - - - - - - - - -

    -
    -
    -
    - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    {{> tabs/provision-tab/users/info}}
    -
    -
    diff --git a/src/sunstone/public/app/tabs/provision-tab/users/list.js b/src/sunstone/public/app/tabs/provision-tab/users/list.js deleted file mode 100644 index 01919d118e..0000000000 --- a/src/sunstone/public/app/tabs/provision-tab/users/list.js +++ /dev/null @@ -1,713 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - require('foundation.alert'); - var OpenNebula = require('opennebula'); - var Locale = require('utils/locale'); - var Config = require('sunstone-config'); - var Notifier = require('utils/notifier'); - var QuotaWidgets = require('utils/quotas/quota-widgets'); - var QuotaLimits = require('utils/quotas/quota-limits'); - var QuotaDefaults = require('utils/quotas/quota-defaults'); - var Accounting = require('utils/accounting'); - var Showback = require('utils/showback'); - - var ProvisionQuotaWidget = require('./quota-widget'); - var ProvisionVmsList = require('tabs/provision-tab/vms/list'); - var ProvisionTemplatesList = require('tabs/provision-tab/templates/list'); - var ProvisionFlowsList = require('tabs/provision-tab/flows/list'); - - var TemplateProvisionQuotaWidget = require('hbs!./quota-widget/html'); - var TemplateUsersList = require('hbs!./list'); - - var _accordionId = 0; - - return { - 'generate': generate_provision_users_list, - 'show': show_provision_user_list - }; - - function show_provision_user_list(timeout) { - $(".section_content").hide(); - $(".provision_users_list_section").fadeIn(); - - $("dd:not(.active) .provision_back", $(".provision_users_list_section")).trigger("click"); - $(".provision_users_list_refresh_button", $(".provision_users_list_section")).trigger("click"); - } - - function generate_provision_users_list(context, opts) { - context.off(); - context.html(html(opts)); - setup_provision_users_list(context); - setup_provision_user_info(context); - } - - function html(opts_arg) { - _accordionId += 1; - return TemplateUsersList({'accordionId': _accordionId}); - } - - function update_provision_users_datatable(datatable, timeout) { - datatable.html('
    ' + - '' + - '' + - '' + - '' + - '
    ' + - '
    ' + - '' + - '' + - '
    '); - - setTimeout(function() { - OpenNebula.User.list({ - timeout: true, - success: function (request, item_list, quotas_list) { - datatable.fnClearTable(true); - if (item_list.length == 0) { - datatable.html('
    ' + - '' + - '' + - '' + - '' + - '
    ' + - '
    ' + - '' + - Locale.tr("The list of users is empty") + - '' + - '
    '); - } else { - provision_quotas_list = quotas_list; - datatable.fnAddData(item_list); - } - }, - error: Notifier.onError - }) - }, timeout); - } - - function setup_provision_users_list(context) { - var provision_users_datatable = $('.provision_users_table', context).dataTable({ - "iDisplayLength": 6, - "sDom" : '<"H">t<"F"lp>', - "aLengthMenu": [[6, 12, 36, 72], [6, 12, 36, 72]], - "aaSorting" : [[0, "desc"]], - "aoColumnDefs": [ - {"bVisible": false, "aTargets": ["all"]} - ], - "aoColumns": [ - {"mDataProp": "USER.ID"}, - {"mDataProp": "USER.NAME"} - ], - "fnPreDrawCallback": function (oSettings) { - // create a thumbs container if it doesn't exist. put it in the dataTables_scrollbody div - if (this.$('tr', {"filter": "applied"}).length == 0) { - this.html('
    ' + - '' + - '' + - '' + - '' + - '
    ' + - '
    ' + - '' + - Locale.tr("The list of users is empty") + - '' + - '
    '); - } else { - $(".provision_users_table", context).html('
      '); - } - - return true; - }, - "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { - var data = aData.USER; - //var state = get_provision_vm_state(data); - var vms = ""; - var memory = ""; - var cpu = ""; - - var quotas_html; - QuotaWidgets.initEmptyQuotas(data); - - if (!$.isEmptyObject(data.VM_QUOTA)) { - var default_user_quotas = QuotaDefaults.getDefaultUserQuotas(); - - quotas = QuotaWidgets.quotaFloatInfo( - data.VM_QUOTA.VM.VMS_USED, - data.VM_QUOTA.VM.VMS, - default_user_quotas.VM_QUOTA.VM.VMS, - true); - - quotas_html = ""; - quotas_html += '
    • ' + - ' '+ Locale.tr("VMs") + - '' + quotas.str + "" + - '
    • '; - - quotas = QuotaWidgets.quotaFloatInfo( - data.VM_QUOTA.VM.CPU_USED, - data.VM_QUOTA.VM.CPU, - default_user_quotas.VM_QUOTA.VM.CPU, - true); - - quotas_html += '
    • ' + - ' '+ Locale.tr("CPU") + - '' + quotas.str + "" + - '
    • '; - - quotas = QuotaWidgets.quotaMBInfo( - data.VM_QUOTA.VM.MEMORY_USED, - data.VM_QUOTA.VM.MEMORY, - default_user_quotas.VM_QUOTA.VM.MEMORY, - true); - - quotas_html += '
    • ' + - ' '+ Locale.tr("Memory") + - '' + quotas.str + "" + - '
    • '; - } else { - quotas = QuotaWidgets.quotaFloatInfo(0, 0, null, true); - - quotas_html = ""; - quotas_html += '
    • ' + - ' '+ Locale.tr("VMs") + - '' + quotas.str + "" + - '
    • '; - - quotas = QuotaWidgets.quotaFloatInfo(0, 0, null, true); - - quotas_html += '
    • ' + - ' '+ Locale.tr("CPU") + - '' + quotas.str + "" + - '
    • '; - - quotas = QuotaWidgets.quotaMBInfo(0, 0, null, true); - - quotas_html += '
    • ' + - ' '+ Locale.tr("Memory") + - '' + quotas.str + "" + - '
    • '; - } - - $(".provision_users_ul", context).append('
    • ' + - '