~ubuntu-branches/debian/sid/opennebula/sid

« back to all changes in this revision

Viewing changes to src/sunstone/public/js/plugins/dashboard-users-tab.js

  • Committer: Package Import Robot
  • Author(s): Damien Raude-Morvan
  • Date: 2012-05-11 19:27:43 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120511192743-lnz8gog5uxzmx2f3
Tags: 3.4.1-1
* New upstream release:
  - d/patches/default_conf.diff: Drop, transfert manager is now handled
    on a datasatore basis.
  - d/patches/genisoimage.diff: Merged upstream.
  - d/patches/oneacct-system-wide-installation.patch: Merged upstream.
  - Refresh others patches.
  - Update *.install files.
* Improve OCCI Self-Service UI integration:
  - Install into /usr/share/opennebula/occi/.
  - occi_system_jquery.diff: Use system wide jquery/jqueryui.
  - Add Recommends: libjs-jquery, libjs-jquery-ui for opennebula package.
* Add Suggests: ruby-uuidtools for econe-server.
* Install more manpages from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
};
44
44
 
45
45
var dashboard_tab_content =
46
 
'<table id="dashboard_table">\
 
46
'<table class="dashboard_table">\
47
47
<tr>\
48
48
<td style="width:40%">\
49
49
<table id="information_table" style="width:100%;">\
55
55
\
56
56
          <table class="info_table">\
57
57
            <tr>\
58
 
              <td class="key_td">'+tr("VM Templates (total/public)")+'</td>\
59
 
              <td class="value_td"><span id="total_templates"></span><span id="public_templates"></span></td>\
 
58
              <td class="key_td">'+tr("VM Templates")+'</td>\
 
59
              <td class="value_td"><span id="total_templates"></span></td>\
60
60
            </tr>\
61
61
            <tr>\
62
62
              <td class="key_td">'+tr("VM Instances")+' ('+
66
66
              <td class="value_td"><span id="total_vms"></span><span id="running_vms" class="green"></span><span id="failed_vms" class="red"></span></td>\
67
67
            </tr>\
68
68
            <tr>\
69
 
              <td class="key_td">'+tr("Virtual Networks (total/public)")+'</td>\
70
 
              <td class="value_td"><span id="total_vnets"></span><span id="public_vnets"></span></td>\
71
 
            </tr>\
72
 
            <tr>\
73
 
              <td class="key_td">'+tr("Images (total/public)")+'</td>\
74
 
              <td class="value_td"><span id="total_images"></span><span id="public_images"></span></td>\
 
69
              <td class="key_td">'+tr("Virtual Networks")+'</td>\
 
70
              <td class="value_td"><span id="total_vnets"></span></td>\
 
71
            </tr>\
 
72
            <tr>\
 
73
              <td class="key_td">' + tr("Datastores") + '</td>\
 
74
              <td class="value_td"><span id="total_datastores"></span></td>\
 
75
            </tr>\
 
76
            <tr>\
 
77
              <td class="key_td">'+tr("Images")+'</td>\
 
78
              <td class="value_td"><span id="total_images"></span></td>\
75
79
            </tr>\
76
80
          </table>\
77
81
\
83
87
    <td>\
84
88
      <div class="panel">\
85
89
        <h3>'+tr("Quickstart")+'</h3>\
86
 
        <form id="quickstart_form"><fieldset>\
87
 
          <table style="width:100%;"><tr style="vertical-align:middle;"><td style="width:70%">\
88
 
          <label style="font-weight:bold;width:40px;height:4em;">New:</label>\
89
 
          <input type="radio" name="quickstart" value="Template.create_dialog">'+tr("VM Template")+'</input><br />\
90
 
          <input type="radio" name="quickstart" value="VM.create_dialog">'+tr("VM Instance")+'</input><br />\
91
 
          <input type="radio" name="quickstart" value="Network.create_dialog">'+tr("Virtual Network")+'</input><br />\
92
 
          <input type="radio" name="quickstart" value="Image.create_dialog">'+tr("Image")+'</input><br />\
93
 
          </td></tr></table>\
 
90
           <div class="panel_info">\
 
91
              <p><br/>'+tr("Create new")+':<br/>\
 
92
             <span class="ui-icon ui-icon-arrowreturnthick-1-e inline-icon" /><a class="action_button" href="#vms_tab" value="VM.create_dialog">'+tr("VM Instance")+'</a></br>\
 
93
             <span class="ui-icon ui-icon-arrowreturnthick-1-e inline-icon" /><a class="action_button" href="#templates_tab" value="Template.create_dialog">'+tr("VM Template")+'</a></br>\
 
94
             <span class="ui-icon ui-icon-arrowreturnthick-1-e inline-icon" /><a class="action_button" href="#vnets_tab" value="Network.create_dialog">'+tr("Virtual Network")+'</a></br>\
 
95
             <span class="ui-icon ui-icon-arrowreturnthick-1-e inline-icon" /><a class="action_button" href="#images_tab" value="Image.create_dialog">'+tr("Image")+'</a></br>\
 
96
              </p>\
 
97
           </div>\
94
98
      </div>\
95
99
    </td>\
96
100
  </tr>\
127
131
 
128
132
var dashboard_tab = {
129
133
    title: tr("Dashboard"),
130
 
    content: dashboard_tab_content
 
134
    content: dashboard_tab_content,
 
135
    showOnTopMenu: false,
131
136
}
132
137
 
133
138
Sunstone.addMainTab('dashboard_tab',dashboard_tab);
179
184
    $.plot($('#'+id+'_graph',context),series,options);
180
185
}
181
186
 
182
 
function quickstart_setup(){
183
 
 
184
 
    $('#dashboard_table #quickstart_form input',main_tabs_context).click(function(){
185
 
        Sunstone.runAction($(this).val());
186
 
    });
187
 
}
188
 
 
189
187
function graph_autorefresh(){
190
188
    setInterval(function(){
191
189
        refresh_graphs();
201
199
}
202
200
 
203
201
$(document).ready(function(){
204
 
    //Dashboard link listener
205
 
    $("#dashboard_table h3 a",main_tabs_context).live("click", function (){
206
 
        var tab = $(this).attr('href');
207
 
        showTab(tab);
208
 
        return false;
209
 
    });
210
 
 
211
202
    emptyDashboard();
212
203
 
213
 
    quickstart_setup();
214
 
 
215
204
    refresh_graphs();
216
205
    graph_autorefresh();
217
206
 
258
247
        $('#failed_vms',db).html(failed_vms);
259
248
        break;
260
249
    case "vnets":
261
 
        var public_vnets=0;
262
250
        var total_vnets=json_info.length;
263
 
        $.each(json_info,function(){
264
 
            if (parseInt(this.VNET.PUBLIC)){
265
 
                public_vnets++;}
266
 
        });
267
 
        $('#total_vnets',db).html(total_vnets+'&nbsp;/&nbsp;');
268
 
        $('#public_vnets',db).html(public_vnets);
 
251
        $('#total_vnets',db).html(total_vnets);
269
252
        break;
270
253
    case "users":
271
254
        var total_users=json_info.length;
273
256
        break;
274
257
    case "images":
275
258
        var total_images=json_info.length;
276
 
        var public_images=0;
277
 
        $.each(json_info,function(){
278
 
            if (parseInt(this.IMAGE.PUBLIC)){
279
 
                public_images++;}
280
 
        });
281
 
        $('#total_images',db).html(total_images+'&nbsp;/&nbsp;');
282
 
        $('#public_images',db).html(public_images);
 
259
        $('#total_images',db).html(total_images);
283
260
        break;
284
261
    case "templates":
285
262
        var total_templates=json_info.length;
286
 
        var public_templates=0;
287
 
        $.each(json_info,function(){
288
 
            if (parseInt(this.VMTEMPLATE.PUBLIC)){
289
 
                public_templates++;
290
 
            }
291
 
        });
292
 
        $('#total_templates',db).html(total_templates+'&nbsp;/&nbsp;');
293
 
        $('#public_templates',db).html(public_templates);
 
263
        $('#total_templates',db).html(total_templates);
294
264
        break;
295
265
    case "acls":
296
266
        var total_acls=json_info.length;
297
267
        $('#total_acls',db).html(total_acls);
298
268
        break;
 
269
    case "clusters":
 
270
        var total_clusters=json_info.length;
 
271
        $('#total_clusters',db).html(total_clusters);
 
272
        break;
 
273
    case "datastores":
 
274
        var total_datastores=json_info.length;
 
275
        $('#total_datastores',db).html(total_datastores);
 
276
        break;
299
277
    }
300
 
}
 
 
b'\\ No newline at end of file'
 
278
};