You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2015/01/19 20:36:02 UTC

[1/2] git commit: updated refs/heads/volume-upload to e4d1049

Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload ad6b7b30c -> e4d104909


Allow passing custom data in POST request


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e4d10490
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e4d10490
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e4d10490

Branch: refs/heads/volume-upload
Commit: e4d1049096152cb9fcd4b937666c8dfe8a035392
Parents: 8641de8
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jan 19 11:35:17 2015 -0800
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jan 19 11:35:42 2015 -0800

----------------------------------------------------------------------
 ui/scripts/templates.js |  6 +++++-
 ui/scripts/ui/dialog.js | 11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e4d10490/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 1b6400a..faf0403 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -110,7 +110,11 @@
                                 fileUpload: {
                                     getURL: function(args) {
                                         args.response.success({
-                                            url: 'http://10.223.183.3/test-upload.php'
+                                            url: 'http://10.223.183.3/test-upload.php',
+                                            data: {
+                                                testData1: '1',
+                                                testData2: '2'
+                                            }
                                         });
                                     },
                                     postUpload: function(args) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e4d10490/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 1c7904a..00d2303 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -701,6 +701,17 @@
                                 var $file = $form.find('input[type=file]');
                                 var $field = $file.closest('.form-item .value');
 
+                                // Add additional passed data
+                                $.map(successArgs.data, function(v, k) {
+                                    var $hidden = $('<input>').attr({
+                                        type: 'hidden',
+                                        name: k,
+                                        value: v
+                                    });
+
+                                    $hidden.appendTo($frameForm);
+                                });
+
                                 $uploadFrame.css({ width: $field.outerWidth(), height: $field.height() }).show();
                                 $frameForm.append($file);
                                 $field.append($uploadFrame);


[2/2] git commit: updated refs/heads/volume-upload to e4d1049

Posted by bf...@apache.org.
Add to storage->upload volume dialog


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8641de85
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8641de85
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8641de85

Branch: refs/heads/volume-upload
Commit: 8641de85d2da4d755cfe966ea5c6c3aaf4abc2b5
Parents: ad6b7b3
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jan 19 11:33:59 2015 -0800
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jan 19 11:35:42 2015 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8641de85/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 6585e1a..663fb9f 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -265,6 +265,22 @@
                                 }
                             },
                             createForm: {
+                                fileUpload: {
+                                    getURL: function(args) {
+                                        args.response.success({
+                                            url: 'http://10.223.183.3/test-upload.php'
+                                        });
+                                    },
+                                    postUpload: function(args) {
+                                        // Called when upload is done to do 
+                                        // verification checks;
+                                        // i.e., poll the server to verify successful upload
+                                        //
+                                        // success() will close the dialog and call standard action
+                                        // error() will keep dialog open if user wants to re-submit
+                                        args.response.success();
+                                    }
+                                },
                                 title: 'label.upload.volume',
                                 fields: {
                                     name: {
@@ -274,6 +290,10 @@
                                         },
                                         docID: 'helpUploadVolumeName'
                                     },
+                                    templateFileUpload: {
+                                        label: 'Select a file',
+                                        isFileUpload: true
+                                    },
                                     availabilityZone: {
                                         label: 'label.availability.zone',
                                         docID: 'helpUploadVolumeZone',