X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Ffilter_status%2Fstatic%2Fjs%2Ffilter_status.js;h=d5a13be619b5f48ced7caabe0b56711d4315559f;hb=1d7b0fb8b69c6eca9880a3966acf0352341882bb;hp=9c3fe4fe4673aaf6f81bda144b9c577b35877cb4;hpb=6eb1d8c9d03d2b10b514c317b6fff11172097346;p=myslice.git diff --git a/plugins/filter_status/static/js/filter_status.js b/plugins/filter_status/static/js/filter_status.js index 9c3fe4fe..d5a13be6 100644 --- a/plugins/filter_status/static/js/filter_status.js +++ b/plugins/filter_status/static/js/filter_status.js @@ -33,6 +33,10 @@ this.elts('list-group-item').click({'instance': this}, this._on_click); this.prev_filter_status = null; + + /* Initialize tooltips */ + $("[rel='tooltip']").tooltip(); + }, /************************************************************************** @@ -52,14 +56,44 @@ // These functions are here to react on external filters, which we don't // use at the moment - on_filter_added: function(filter) { + on_filter_added: function(filter) + { // XXX }, - on_filter_removed: function(filter) { + on_filter_removed: function(filter) + { // XXX }, + on_field_state_changed: function(data) + { + var query_ext; + + switch (data.status) { + case STATE_SET: + /* Get the number of pending / unconfigured resources */ + /* Let's store it in query_ext */ + query_ext = manifold.query_store.find_analyzed_query_ext(this.options.query_uuid); + + $('#badge-pending').text(query_ext.num_pending); + if (query_ext.num_pending > 0) { + $('#badge-pending').show(); + } else { + $('#badge-pending').hide(); + } + + $('#badge-unconfigured').text(query_ext.num_unconfigured); + if (query_ext.num_unconfigured > 0) { + $('#badge-unconfigured').show(); + } else { + $('#badge-unconfigured').hide(); + } + default: + break; + } + }, + /************************************************************************** * PRIVATE METHODS * **************************************************************************/