From 1f1d0fcf01bf754dda6af008b50545de0aacf2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 12 Feb 2016 10:51:03 +0100 Subject: [PATCH] Feature #4317: Add new user-input types, make capacity user-inputs New types: number, range, list. The capacity definition creates user inputs for the CPU, MEMORY and VCPU --- .../form-panels/create/wizard-tabs/context.js | 120 ++++++-- .../create/wizard-tabs/context/html.hbs | 9 +- .../form-panels/create/wizard-tabs/general.js | 10 +- .../wizard-tabs/general/capacity-create.js | 246 ++++++++++++++++ .../general/capacity-create/html.hbs | 148 ++++++++++ .../wizard-tabs/general/capacity-inputs.js | 197 +++++-------- .../general/capacity-inputs/html.hbs | 93 +++--- .../create/wizard-tabs/general/html.hbs | 12 +- .../templates-tab/form-panels/instantiate.js | 23 +- .../public/app/tabs/vms-tab/dialogs/resize.js | 2 +- src/sunstone/public/app/utils/user-inputs.js | 277 +++++++++++++++--- src/sunstone/public/scss/app.scss | 10 + 12 files changed, 884 insertions(+), 263 deletions(-) create mode 100644 src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js create mode 100644 src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create/html.hbs diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js index 3b38b13a43..77f50662bf 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js @@ -27,6 +27,7 @@ define(function(require) { var CustomTagsTable = require('utils/custom-tags-table'); var FilesTable = require('tabs/files-tab/datatable') var OpenNebulaHost = require('opennebula/host'); + var UserInputs = require('utils/user-inputs'); /* TEMPLATES @@ -161,28 +162,76 @@ define(function(require) { that.contextFilesTable.initialize(selectOptions); that.contextFilesTable.refreshResourceTableSelect(); + // TODO: bug, user_input_name pattern is ignored + context.on("click", ".add_service_custom_attr", function() { - $(".service_custom_attrs tbody").append( + $(".service_custom_attrs tbody", context).append( '' + '' + - '' + - '' + Locale.tr("Only word characters are allowed") + '' + + '' + '' + '' + - '' + + '' + '' + '' + - '