Revision accf25dc

View differences:

src/sunstone/public/app/opennebula/helper.js
36 36
        }
37 37
      }
38 38
      if (data) {
39
        if (typeof(data) != "array") {
39
        if (!(data instanceof Array)) {
40 40
          data = [data];
41 41
        }
42 42
        r.request.data = data;
src/sunstone/public/app/tabs/clusters-tab/actions.js
74 74
      call : OpenNebulaResource.addhost,
75 75
      callback : function (req) {
76 76
        OpenNebulaAction.clear_cache("HOST");
77
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
77
        Sunstone.runAction('Cluster.show',req.request.data[0]);
78 78
      },
79 79
      error : Notifier.onError
80 80
    },
......
84 84
      call : OpenNebulaResource.delhost,
85 85
      callback : function (req) {
86 86
        OpenNebulaAction.clear_cache("HOST");
87
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
87
        Sunstone.runAction('Cluster.show',req.request.data[0]);
88 88
      },
89 89
      error : Notifier.onError
90 90
    },
......
94 94
      call : OpenNebulaResource.adddatastore,
95 95
      callback : function (req) {
96 96
        OpenNebulaAction.clear_cache("DATASTORE");
97
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
97
        Sunstone.runAction('Cluster.show',req.request.data[0]);
98 98
      },
99 99
      error : Notifier.onError
100 100
    },
......
104 104
      call : OpenNebulaResource.deldatastore,
105 105
      callback : function (req) {
106 106
        OpenNebulaAction.clear_cache("DATASTORE");
107
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
107
        Sunstone.runAction('Cluster.show',req.request.data[0]);
108 108
      },
109 109
      error : Notifier.onError
110 110
    },
......
114 114
      call : OpenNebulaResource.addvnet,
115 115
      callback : function (req) {
116 116
        OpenNebulaAction.clear_cache("VNET");
117
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
117
        Sunstone.runAction('Cluster.show',req.request.data[0]);
118 118
      },
119 119
      error : Notifier.onError
120 120
    },
......
124 124
      call : OpenNebulaResource.delvnet,
125 125
      callback : function (req) {
126 126
        OpenNebulaAction.clear_cache("VNET");
127
        Sunstone.runAction('Cluster.show',req.request.data[0][0]);
127
        Sunstone.runAction('Cluster.show',req.request.data[0]);
128 128
      },
129 129
      error : Notifier.onError
130 130
    }
src/sunstone/public/app/tabs/groups-tab/actions.js
87 87
      callback: function(request) {
88 88
        Sunstone.getDialog(QUOTAS_DIALOG_ID).hide();
89 89

  
90
        Sunstone.runAction(RESOURCE+'.show',request.request.data[0][0]);
90
        Sunstone.runAction(RESOURCE+'.show',request.request.data[0]);
91 91
      },
92 92
      error: Notifier.onError
93 93
    },
......
96 96
      type: "single",
97 97
      call : OpenNebulaResource.add_admin,
98 98
      callback : function (req) {
99
        Sunstone.runAction(RESOURCE+'.show',req.request.data[0][0]);
99
        Sunstone.runAction(RESOURCE+'.show',req.request.data[0]);
100 100
      },
101 101
      error: Notifier.onError
102 102
    },
......
105 105
      type: "single",
106 106
      call : OpenNebulaResource.del_admin,
107 107
      callback : function (req) {
108
        Sunstone.runAction(RESOURCE+'.show',req.request.data[0][0]);
108
        Sunstone.runAction(RESOURCE+'.show',req.request.data[0]);
109 109
      },
110 110
      error: Notifier.onError
111 111
    }
src/sunstone/public/app/tabs/provision-tab/vms/list.js
502 502
          timeout: false,
503 503
          success: function(request, response){
504 504
            OpenNebula.Action.clear_cache("VMTEMPLATE");
505
            Notifier.notifyMessage(Locale.tr("VM Template") + ' ' + request.request.data[0][1].name + ' ' + Locale.tr("saved successfully"))
505
            Notifier.notifyMessage(Locale.tr("VM Template") + ' ' + request.request.data[1].name + ' ' + Locale.tr("saved successfully"))
506 506
            update_provision_vm_info(vm_id, context);
507 507
            button.removeAttr("disabled");
508 508
          },
src/sunstone/public/app/tabs/templates-tab/actions-common.js
80 80
          type: "multiple",
81 81
          call: OpenNebulaResource.delete_recursive,
82 82
          callback : function(request, response) {
83
            var elementId = request.request.data[0][0].toString();
83
            var elementId = request.request.data[0].toString();
84 84
            Sunstone.getDataTable(TAB_ID).deleteElement(elementId);
85 85
          },
86 86
          elements: function(opts) {
......
105 105
            Sunstone.runAction(RESOURCE+".chmod", params.data.id, permissions);
106 106
          },
107 107
          callback : function(request, response) {
108
            Sunstone.runAction(RESOURCE+".show", req.request.data[0][0]);
108
            Sunstone.runAction(RESOURCE+".show", req.request.data[0]);
109 109
          },
110 110
          elements: function(opts) {
111 111
            return Sunstone.getDataTable(TAB_ID).elements(opts);
......
126 126
            Sunstone.runAction(RESOURCE+".chmod", params.data.id, permissions);
127 127
          },
128 128
          callback : function(request, response) {
129
            Sunstone.runAction(RESOURCE+".show", req.request.data[0][0]);
129
            Sunstone.runAction(RESOURCE+".show", req.request.data[0]);
130 130
          },
131 131
          elements: function(opts) {
132 132
            return Sunstone.getDataTable(TAB_ID).elements(opts);
src/sunstone/public/app/tabs/users-tab/actions.js
93 93
      type: "single",
94 94
      call: OpenNebulaResource.update,
95 95
      callback: function(request) {
96
        var reqId = request.request.data[0][0];
96
        var reqId = request.request.data[0];
97 97

  
98 98
        Sunstone.runAction(RESOURCE+'.show',reqId);
99 99

  
......
119 119
      type: "single",
120 120
      call: OpenNebulaResource.append,
121 121
      callback: function(request) {
122
        var reqId = request.request.data[0][0];
122
        var reqId = request.request.data[0];
123 123

  
124 124
        Sunstone.runAction(RESOURCE+'.show',reqId);
125 125

  
......
145 145
      type: "single",
146 146
      call: OpenNebulaResource.append,
147 147
      callback: function(request) {
148
        var reqId = request.request.data[0][0];
148
        var reqId = request.request.data[0];
149 149

  
150 150
        if (reqId == config['user_id'] || reqId == "-1") {
151 151
          $.ajax({
......
251 251
      callback: function(request) {
252 252
        Sunstone.getDialog(QUOTAS_DIALOG_ID).hide();
253 253

  
254
        Sunstone.runAction(RESOURCE+'.show',request.request.data[0][0]);
254
        Sunstone.runAction(RESOURCE+'.show',request.request.data[0]);
255 255
      },
256 256
      error: Notifier.onError
257 257
    }
src/sunstone/public/app/tabs/vnets-tab/actions.js
71 71
        Sunstone.getDialog(ADD_AR_DIALOG_ID).hide();
72 72
        Sunstone.getDialog(ADD_AR_DIALOG_ID).reset();
73 73

  
74
        Sunstone.runAction("Network.show",req.request.data[0][0]);
74
        Sunstone.runAction("Network.show",req.request.data[0]);
75 75
      },
76 76
      error: Notifier.onError
77 77
    },
......
81 81
      call: OpenNebulaResource.rm_ar,
82 82
      callback: function(req) {
83 83
        OpenNebulaAction.clear_cache("VNET");
84
        Sunstone.runAction("Network.show",req.request.data[0][0]);
84
        Sunstone.runAction("Network.show",req.request.data[0]);
85 85
      },
86 86
      error: Notifier.onError
87 87
    },
......
94 94
        Sunstone.getDialog(UPDATE_AR_DIALOG_ID).hide();
95 95
        Sunstone.getDialog(UPDATE_AR_DIALOG_ID).reset();
96 96

  
97
        Sunstone.runAction("Network.show",req.request.data[0][0]);
97
        Sunstone.runAction("Network.show",req.request.data[0]);
98 98
      },
99 99
      error: Notifier.onError
100 100
    },
......
125 125
        Sunstone.getDialog(RESERVE_DIALOG_ID).reset();
126 126

  
127 127
        OpenNebulaAction.clear_cache("VNET");
128
        Sunstone.runAction("Network.show",req.request.data[0][0]);
128
        Sunstone.runAction("Network.show",req.request.data[0]);
129 129
      },
130 130
      error: Notifier.onError
131 131
    },
src/sunstone/public/app/utils/common-actions.js
115 115
      type: "multiple",
116 116
      call: that.openNebulaResource[actionStr],
117 117
      callback: function (req, response) {
118
        Sunstone.runAction(that.resourceStr + ".show", req.request.data[0][0]);
118
        Sunstone.runAction(that.resourceStr + ".show", req.request.data[0]);
119 119
      },
120 120
      elements: function(opts) {
121 121
        return Sunstone.getDataTable(that.tabId).elements(opts);
......
131 131
      type: "single",
132 132
      call: that.openNebulaResource[actionStr],
133 133
      callback: function (req) {
134
        Sunstone.runAction(that.resourceStr + ".show", req.request.data[0][0]);
134
        Sunstone.runAction(that.resourceStr + ".show", req.request.data[0]);
135 135
      },
136 136
      elements: function(opts) {
137 137
        return Sunstone.getDataTable(that.tabId).elements(opts);
......
245 245
      type: "single",
246 246
      call: that.openNebulaResource.update,
247 247
      callback: function(request) {
248
        Sunstone.runAction(that.resourceStr + '.show', request.request.data[0][0]);
248
        Sunstone.runAction(that.resourceStr + '.show', request.request.data[0]);
249 249
      },
250 250
      error: Notifier.onError
251 251
    }
......
257 257
      type: "single",
258 258
      call: that.openNebulaResource.append,
259 259
      callback: function(request) {
260
        Sunstone.runAction(that.resourceStr + '.show', request.request.data[0][0]);
260
        Sunstone.runAction(that.resourceStr + '.show', request.request.data[0]);
261 261
      },
262 262
      error: Notifier.onError
263 263
    }

Also available in: Unified diff