mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_15.05' into dev
This commit is contained in:
@@ -55,6 +55,8 @@ var FolderListView = Backbone.View.extend({
|
||||
// start to listen if someone modifies the collection
|
||||
this.listenTo( this.collection, 'add', this.renderOne );
|
||||
this.listenTo( this.collection, 'remove', this.removeOne );
|
||||
this.listenTo( this.collection, 'sort', this.rePaint );
|
||||
this.listenTo( this.collection, 'reset', this.rePaint );
|
||||
|
||||
this.fetchFolder();
|
||||
},
|
||||
@@ -85,7 +87,7 @@ var FolderListView = Backbone.View.extend({
|
||||
});
|
||||
},
|
||||
|
||||
render: function ( options ){
|
||||
render: function( options ){
|
||||
this.options = _.extend( this.options, options );
|
||||
var template = this.templateFolder();
|
||||
$(".tooltip").hide();
|
||||
@@ -142,8 +144,14 @@ var FolderListView = Backbone.View.extend({
|
||||
items_to_render = [];
|
||||
}
|
||||
Galaxy.libraries.folderToolbarView.renderPaginator( this.options );
|
||||
this.collection.reset();
|
||||
this.addAll( items_to_render )
|
||||
this.collection.reset( items_to_render );
|
||||
},
|
||||
|
||||
rePaint: function( options ){
|
||||
this.options = _.extend( this.options, options );
|
||||
this.removeAllRows();
|
||||
this.renderAll();
|
||||
this.checkEmptiness();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -153,7 +161,7 @@ var FolderListView = Backbone.View.extend({
|
||||
*/
|
||||
addAll: function( models ){
|
||||
_.each(models, function( model ) {
|
||||
Galaxy.libraries.folderListView.collection.add( model );
|
||||
Galaxy.libraries.folderListView.collection.add( model, { sort: false } );
|
||||
});
|
||||
$( "#center [data-toggle]" ).tooltip();
|
||||
this.checkEmptiness();
|
||||
@@ -213,13 +221,20 @@ var FolderListView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
/**
|
||||
* removes the view of the given model from the DOM
|
||||
* Remove the view of the given model from the DOM.
|
||||
* @param {Item or FolderAsModel} model of the view that will be removed
|
||||
*/
|
||||
removeOne: function( model ){
|
||||
this.$el.find( '#' + model.id ).remove();
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all dataset and folder row elements from the DOM.
|
||||
*/
|
||||
removeAllRows: function(){
|
||||
$('.library-row').remove();
|
||||
},
|
||||
|
||||
/** Checks whether the list is empty and adds/removes the message */
|
||||
checkEmptiness : function(){
|
||||
if ((this.$el.find('.dataset_row').length === 0) && (this.$el.find('.folder_row').length === 0)){
|
||||
@@ -239,9 +254,7 @@ var FolderListView = Backbone.View.extend({
|
||||
this.sortFolder('name','asc');
|
||||
this.sort = 'asc';
|
||||
}
|
||||
this.render();
|
||||
this.renderAll();
|
||||
this.checkEmptiness();
|
||||
this.renderSortIcon();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -324,6 +337,14 @@ var FolderListView = Backbone.View.extend({
|
||||
$row.find('.fa-file').removeClass('fa-file').addClass('fa-file-o');
|
||||
},
|
||||
|
||||
renderSortIcon: function(){
|
||||
if (this.sort === 'asc'){
|
||||
$('.sort-icon').removeClass('fa-sort-alpha-desc').addClass('fa-sort-alpha-asc');
|
||||
} else {
|
||||
$('.sort-icon').removeClass('fa-sort-alpha-asc').addClass('fa-sort-alpha-desc');
|
||||
}
|
||||
},
|
||||
|
||||
templateFolder : function (){
|
||||
var tmpl_array = [];
|
||||
|
||||
@@ -344,7 +365,7 @@ var FolderListView = Backbone.View.extend({
|
||||
tmpl_array.push(' <thead>');
|
||||
tmpl_array.push(' <th class="button_heading"></th>');
|
||||
tmpl_array.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');
|
||||
tmpl_array.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');
|
||||
tmpl_array.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="sort-icon fa fa-sort-alpha-<%- order %>"></span></th>');
|
||||
tmpl_array.push(' <th style="width:5%;">data type</th>');
|
||||
tmpl_array.push(' <th style="width:10%;">size</th>');
|
||||
tmpl_array.push(' <th style="width:160px;">time updated (UTC)</th>');
|
||||
|
||||
@@ -79,17 +79,19 @@ var View = Backbone.View.extend({
|
||||
// value
|
||||
value : function (new_val) {
|
||||
if (new_val !== undefined) {
|
||||
// check if its a number
|
||||
if (isNaN(new_val)) {
|
||||
new_val = 0;
|
||||
}
|
||||
if (new_val !== null && new_val !== '') {
|
||||
// check if its a number
|
||||
if (isNaN(new_val)) {
|
||||
new_val = 0;
|
||||
}
|
||||
|
||||
// apply limit
|
||||
if (this.options.max !== null) {
|
||||
new_val = Math.min(new_val, this.options.max);
|
||||
}
|
||||
if (this.options.min !== null) {
|
||||
new_val = Math.max(new_val, this.options.min);
|
||||
// apply limit
|
||||
if (this.options.max !== null) {
|
||||
new_val = Math.min(new_val, this.options.max);
|
||||
}
|
||||
if (this.options.min !== null) {
|
||||
new_val = Math.max(new_val, this.options.min);
|
||||
}
|
||||
}
|
||||
|
||||
// set values
|
||||
|
||||
@@ -680,7 +680,10 @@ class JobHandlerStopQueue( object ):
|
||||
except Empty:
|
||||
pass
|
||||
for job, error_msg in jobs_to_check:
|
||||
if job.state != job.states.DELETED_NEW and job.finished:
|
||||
if ( job.state not in ( job.states.DELETED_NEW,
|
||||
job.states.DELETED )
|
||||
and job.finished ):
|
||||
# terminated before it got here
|
||||
log.debug('Job %s already finished, not deleting or stopping', job.id)
|
||||
continue
|
||||
final_state = job.states.DELETED
|
||||
@@ -695,7 +698,8 @@ class JobHandlerStopQueue( object ):
|
||||
self.dispatcher.stop( job )
|
||||
|
||||
def put( self, job_id, error_msg=None ):
|
||||
self.queue.put( ( job_id, error_msg ) )
|
||||
if not self.app.config.track_jobs_in_database:
|
||||
self.queue.put( ( job_id, error_msg ) )
|
||||
|
||||
def shutdown( self ):
|
||||
"""Attempts to gracefully shut down the worker thread"""
|
||||
|
||||
@@ -134,9 +134,11 @@ class LocalJobRunner( BaseJobRunner ):
|
||||
def stop_job( self, job ):
|
||||
#if our local job has JobExternalOutputMetadata associated, then our primary job has to have already finished
|
||||
job_ext_output_metadata = job.get_external_output_metadata()
|
||||
if job_ext_output_metadata:
|
||||
try:
|
||||
pid = job_ext_output_metadata[0].job_runner_external_pid # every JobExternalOutputMetadata has a pid set, we just need to take from one of them
|
||||
else:
|
||||
assert pid not in [ None, '' ]
|
||||
except Exception:
|
||||
# metadata internal or job not complete yet
|
||||
pid = job.get_job_runner_external_id()
|
||||
if pid in [ None, '' ]:
|
||||
log.warning( "stop_job(): %s: no PID in database for job, unable to stop" % job.get_id() )
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"ui-slider.js","sources":["../../../src/mvc/ui/ui-slider.js"],"names":["define","Utils","View","Backbone","extend","optionsDefault","id","uid","min","max","step","precise","split","initialize","options","self","this","merge","setElement","_template","useslider","$slider","$el","find","slider","on","event","ui","value","css","$text","undefined","$","val","pressed","e","which","v","indexOf","preventDefault","new_val","isNaN","Math","onchange"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,gBACIC,GAAUL,EAAMM,MAChBC,IAAU,KACVC,IAAU,KACVC,KAAU,KACVC,SAAU,EACVC,MAAU,KAIdC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKF,QAAUb,EAAMgB,MAAMH,EAASE,KAAKX,gBAGzCW,KAAKE,WAAWF,KAAKG,UAAUH,KAAKF,UAGpCE,KAAKI,UAAiC,OAArBJ,KAAKF,QAAQL,KAAqC,OAArBO,KAAKF,QAAQN,KAAgBQ,KAAKF,QAAQL,IAAMO,KAAKF,QAAQN,IAGjF,OAAtBQ,KAAKF,QAAQJ,OACbM,KAAKF,QAAQJ,KAAO,EAChBM,KAAKF,QAAQH,SAAWK,KAAKI,YAC7BJ,KAAKF,QAAQJ,MAAQM,KAAKF,QAAQL,IAAMO,KAAKF,QAAQN,K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3B,KAAKF,QAAQ6B,SAASH,IAKvBxB,KAAKc,MAAMG,OAItBd,UAAW,SAASL,GAChB,MAAQ,YAAcA,EAAQR,GAAK,+IAO3C,QACIJ,KAAOA"}
|
||||
{"version":3,"file":"ui-slider.js","sources":["../../../src/mvc/ui/ui-slider.js"],"names":["define","Utils","View","Backbone","extend","optionsDefault","id","uid","min","max","step","precise","split","initialize","options","self","this","merge","setElement","_template","useslider","$slider","$el","find","slider","on","event","ui","value","css","$text","undefined","$","val","pressed","e","which","v","indexOf","preventDefault","new_val","isNaN","Math","onchange"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,gBACIC,GAAUL,EAAMM,MAChBC,IAAU,KACVC,IAAU,KACVC,KAAU,KACVC,SAAU,EACVC,MAAU,KAIdC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKF,QAAUb,EAAMgB,MAAMH,EAASE,KAAKX,gBAGzCW,KAAKE,WAAWF,KAAKG,UAAUH,KAAKF,UAGpCE,KAAKI,UAAiC,OAArBJ,KAAKF,QAAQL,KAAqC,OAArBO,KAAKF,QAAQN,KAAgBQ,KAAKF,QAAQL,IAAMO,KAAKF,QAAQN,IAGjF,OAAtBQ,KAAKF,QAAQJ,OACbM,KAAKF,QAAQJ,KAAO,EAChBM,KAAKF,QAAQH,SAAWK,KAAKI,YAC7BJ,KAAKF,QAAQJ,MAAQM,KAAKF,QAAQL,IAAMO,KAAKF,QAAQN,KAAOQ,KAAKF,QAAQF,QAK7EI,KAAKI,WACLJ,KAAKK,QAAUL,KAAKM,IAAIC,KAAK,WAC7BP,KAAKK,QAAQG,OAAOR,KAAKF,SACzBE,KAAKK,QAAQI,GAAG,QAAS,SAAUC,EAAOC,GACtCZ,EAAKa,MAAMD,EAAGC,UAGlBZ,KAAKM,IAAIC,KAAK,wBAAwBM,IAAI,QAAS,QAIvDb,KAAKc,MAAQd,KAAKM,IAAIC,KAAK,SAGAQ,SAAvBf,KAAKF,QAAQc,OACbZ,KAAKY,MAAMZ,KAAKF,QAAQc,OAI5BZ,KAAKc,MAAML,GAAG,SAAU,WACpBV,EAAKa,MAAMI,EAAEhB,MAAMiB,QAIvB,IAAIC,KACJlB,MAAKc,MAAML,GAAG,QAAS,SAASU,GAC5BD,EAAQC,EAAEC,QAAS,IAEvBpB,KAAKc,MAAML,GAAG,UAAW,SAAUU,GAC/B,GAAIE,GAAIF,EAAEC,KACVF,GAAQG,IAAK,EACF,GAALA,GAAe,GAALA,GAAe,IAALA,GAAgB,IAALA,GAAgB,IAALA,GAAYA,GAAK,IAAW,IAALA,GAC1D,KAALA,GAA0C,IAA9BL,EAAEhB,MAAMiB,MAAMK,QAAQ,MAAcvB,EAAKD,QAAQH,SACxD,KAAL0B,GAA0C,IAA9BL,EAAEhB,MAAMiB,MAAMK,QAAQ,MACnCJ,EAAQ,KAAOA,EAAQ,KAC1BR,MAAMa,oBAMlBX,MAAQ,SAAUY,GA4Bd,MA3BgBT,UAAZS,IACgB,OAAZA,GAAgC,KAAZA,IAEhBC,MAAMD,KACNA,EAAU,GAIW,OAArBxB,KAAKF,QAAQL,MACb+B,EAAUE,KAAKlC,IAAIgC,EAASxB,KAAKF,QAAQL,MAEpB,OAArBO,KAAKF,QAAQN,MACbgC,EAAUE,KAAKjC,IAAI+B,EAASxB,KAAKF,QAAQN,OAKjDQ,KAAKK,SAAWL,KAAKK,QAAQG,OAAO,QAASgB,GAC7CxB,KAAKc,MAAMG,IAAIO,GAGXxB,KAAKF,QAAQ6B,UACb3B,KAAKF,QAAQ6B,SAASH,IAKvBxB,KAAKc,MAAMG,OAItBd,UAAW,SAASL,GAChB,MAAQ,YAAcA,EAAQR,GAAK,+IAO3C,QACIJ,KAAOA"}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:a.uid(),min:null,max:null,step:null,precise:!1,split:1e4},initialize:function(b){var c=this;this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.useslider=null!==this.options.max&&null!==this.options.min&&this.options.max>this.options.min,null===this.options.step&&(this.options.step=1,this.options.precise&&this.useslider&&(this.options.step=(this.options.max-this.options.min)/this.options.split)),this.useslider?(this.$slider=this.$el.find("#slider"),this.$slider.slider(this.options),this.$slider.on("slide",function(a,b){c.value(b.value)})):this.$el.find(".ui-form-slider-text").css("width","100%"),this.$text=this.$el.find("#text"),void 0!==this.options.value&&this.value(this.options.value),this.$text.on("change",function(){c.value($(this).val())});var d=[];this.$text.on("keyup",function(a){d[a.which]=!1}),this.$text.on("keydown",function(a){var b=a.which;d[b]=!0,8==b||9==b||13==b||37==b||39==b||b>=48&&57>=b||190==b&&-1==$(this).val().indexOf(".")&&c.options.precise||189==b&&-1==$(this).val().indexOf("-")||d[91]||d[17]||event.preventDefault()})},value:function(a){return void 0!==a&&(isNaN(a)&&(a=0),null!==this.options.max&&(a=Math.min(a,this.options.max)),null!==this.options.min&&(a=Math.max(a,this.options.min)),this.$slider&&this.$slider.slider("value",a),this.$text.val(a),this.options.onchange&&this.options.onchange(a)),this.$text.val()},_template:function(a){return'<div id="'+a.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
|
||||
define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:a.uid(),min:null,max:null,step:null,precise:!1,split:1e4},initialize:function(b){var c=this;this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.useslider=null!==this.options.max&&null!==this.options.min&&this.options.max>this.options.min,null===this.options.step&&(this.options.step=1,this.options.precise&&this.useslider&&(this.options.step=(this.options.max-this.options.min)/this.options.split)),this.useslider?(this.$slider=this.$el.find("#slider"),this.$slider.slider(this.options),this.$slider.on("slide",function(a,b){c.value(b.value)})):this.$el.find(".ui-form-slider-text").css("width","100%"),this.$text=this.$el.find("#text"),void 0!==this.options.value&&this.value(this.options.value),this.$text.on("change",function(){c.value($(this).val())});var d=[];this.$text.on("keyup",function(a){d[a.which]=!1}),this.$text.on("keydown",function(a){var b=a.which;d[b]=!0,8==b||9==b||13==b||37==b||39==b||b>=48&&57>=b||190==b&&-1==$(this).val().indexOf(".")&&c.options.precise||189==b&&-1==$(this).val().indexOf("-")||d[91]||d[17]||event.preventDefault()})},value:function(a){return void 0!==a&&(null!==a&&""!==a&&(isNaN(a)&&(a=0),null!==this.options.max&&(a=Math.min(a,this.options.max)),null!==this.options.min&&(a=Math.max(a,this.options.min))),this.$slider&&this.$slider.slider("value",a),this.$text.val(a),this.options.onchange&&this.options.onchange(a)),this.$text.val()},_template:function(a){return'<div id="'+a.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
|
||||
//# sourceMappingURL=../../../maps/mvc/ui/ui-slider.js.map
|
||||
Reference in New Issue
Block a user