mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_16.07' into dev
Conflicts: doc/source/admin/conda_faq.rst static/maps/mvc/ui/ui-modal.js.map static/scripts/bundled/libs.bundled.js static/scripts/bundled/libs.bundled.js.map static/scripts/mvc/ui/ui-modal.js
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
define([], function() {
|
||||
var View = Backbone.View.extend({
|
||||
|
||||
className: "ui-modal",
|
||||
|
||||
// defaults
|
||||
optionsDefault : {
|
||||
container : 'body',
|
||||
@@ -19,18 +22,8 @@ var View = Backbone.View.extend({
|
||||
|
||||
// initialize
|
||||
initialize: function( options ) {
|
||||
this.setElement( this._template() );
|
||||
this.options = _.defaults( options || {}, this.optionsDefault );
|
||||
$( this.options.container ).prepend( this.el );
|
||||
|
||||
// link elements
|
||||
this.$header = this.$( '.modal-header' );
|
||||
this.$dialog = this.$( '.modal-dialog' );
|
||||
this.$body = this.$( '.modal-body' );
|
||||
this.$footer = this.$( '.modal-footer' );
|
||||
this.$backdrop = this.$( '.modal-backdrop' );
|
||||
this.$buttons = this.$( '.buttons' );
|
||||
|
||||
// optional render
|
||||
options && this.render();
|
||||
},
|
||||
@@ -70,6 +63,16 @@ var View = Backbone.View.extend({
|
||||
*/
|
||||
render: function() {
|
||||
var self = this;
|
||||
this.$el.html( this._template() );
|
||||
|
||||
// link elements
|
||||
this.$header = this.$( '.modal-header' );
|
||||
this.$dialog = this.$( '.modal-dialog' );
|
||||
this.$body = this.$( '.modal-body' );
|
||||
this.$footer = this.$( '.modal-footer' );
|
||||
this.$backdrop = this.$( '.modal-backdrop' );
|
||||
this.$buttons = this.$( '.buttons' );
|
||||
|
||||
if (this.options.body == 'progress') {
|
||||
this.options.body = $( '<div class="progress progress-striped active">' +
|
||||
'<div class="progress-bar progress-bar-info" style="width:100%"/>' +
|
||||
@@ -164,17 +167,15 @@ var View = Backbone.View.extend({
|
||||
* Returns the modal template
|
||||
*/
|
||||
_template: function() {
|
||||
return '<div class="ui-modal">' +
|
||||
'<div class="modal-backdrop fade"/>' +
|
||||
'<div class="modal-dialog">' +
|
||||
'<div class="modal-content">' +
|
||||
'<div class="modal-header">' +
|
||||
'<h4 class="title"/>' +
|
||||
'</div>' +
|
||||
'<div class="modal-body"/>' +
|
||||
'<div class="modal-footer">' +
|
||||
'<div class="buttons"/>' +
|
||||
'</div>' +
|
||||
return '<div class="modal-backdrop fade"/>' +
|
||||
'<div class="modal-dialog">' +
|
||||
'<div class="modal-content">' +
|
||||
'<div class="modal-header">' +
|
||||
'<h4 class="title"/>' +
|
||||
'</div>' +
|
||||
'<div class="modal-body"/>' +
|
||||
'<div class="modal-footer">' +
|
||||
'<div class="buttons"/>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
@@ -50,13 +50,17 @@ Below we answer some common questions (collected by Lance Parsons):
|
||||
|
||||
Galaxy's dependency job resolution is managed via
|
||||
``dependency_resolvers_conf.xml`` configuration file. Most Galaxy administrators
|
||||
have not set up a dependency resolvers configuration file, which means they are
|
||||
using Galaxy's default ( ``dependency_resolvers_conf.xml.sample`` ). With
|
||||
release 16.04, Galaxy has enabled Conda dependency resolution by default when
|
||||
should be using Galaxy's default dependency resolvers configuration file
|
||||
( ``dependency_resolvers_conf.xml.sample`` ). With
|
||||
release 16.04, Galaxy has enabled Conda dependency resolution by default when
|
||||
Conda was already installed on the system. Having Conda enabled in
|
||||
``dependency_resolvers_conf.xml`` means that Galaxy will look for job
|
||||
``dependency_resolvers_conf.xml`` means that Galaxy can look for job
|
||||
dependencies using the Conda system when it attempts to run tools.
|
||||
|
||||
Note that the order of resolvers in the file matters and the ``<tool_shed_packages />``
|
||||
entry should remain first. This means that tools that have specified Tool Shed packages
|
||||
as their dependencies will work without a change.
|
||||
|
||||
The most common configuration settings related to Conda are listed in Table 1.
|
||||
See `galaxy.ini.sample`_ for the complete list.
|
||||
|
||||
@@ -101,7 +105,7 @@ See `galaxy.ini.sample`_ for the complete list.
|
||||
2. How do Conda dependencies work? Where do things get installed?
|
||||
*********************************************************************************
|
||||
|
||||
In contrast to the old dependency system, which was used exclusively by Galaxy,
|
||||
In contrast to the TS dependency system, which was used exclusively by Galaxy,
|
||||
Conda is a pre-existing, independent project. With Conda, it is possible for an
|
||||
admin to install and manage packages without touching Galaxy at all. Galaxy can
|
||||
handle these dependencies for you, but admins are not required to use Galaxy for
|
||||
@@ -170,19 +174,28 @@ systems newer than 2007.
|
||||
This depends on your ``galaxy.ini`` setting. Starting with release 16.07, Galaxy
|
||||
can automatically install the Conda package manager for you if you have enabled
|
||||
``conda_auto_init``. Galaxy can then install Trinity along with its dependencies
|
||||
using one of the methods listed in question 2 above. Further, if
|
||||
``conda_auto_install`` is enabled, Galaxy will install Trinity via Conda only
|
||||
when a Trinity job is launched and Trinity is not yet installed.
|
||||
using one of the methods listed in question 2 above. In particular, if
|
||||
``conda_auto_install`` is True and Trinity is not installed yet, Galaxy will try
|
||||
to install it via Conda when a Trinity job is launched.
|
||||
|
||||
With release 16.07 you can see which dependencies are being used
|
||||
in the “Manage installed tools” section of the Admin panel and you can select
|
||||
whether or not to install Conda packages or Tool Shed package recipes when you
|
||||
install new tools there, even if ``conda_auto_install`` is disabled.
|
||||
|
||||
More improvements to the UI will be coming in future releases. To see if Galaxy
|
||||
has created a Trinity environment for you have a look at folder under
|
||||
During a tool installation, the Galaxy admin has control over which systems will be used to
|
||||
install the tool requirements. The default settings will trigger installation
|
||||
of both TS and Conda packages (if Conda is present), thus depending on the
|
||||
dependency resolvers configuration with regards to what will actually be used during
|
||||
the tool execution.
|
||||
|
||||
To check if Galaxy has created a Trinity environment, have a look at folders under
|
||||
``<tool_dependency_dir>/_conda/envs/``(or ``<conda_prefix>/envs`` if you have changed `conda_prefix` in your galaxy.ini file).
|
||||
|
||||
We recommend to use Conda on a tool-per-tool basis, by unchecking the checkbox
|
||||
for TS dependencies during the tool installation, and for tools where there
|
||||
are no available TS dependencies.
|
||||
|
||||
|
||||
5. Can I mix traditional Galaxy packages and Conda packages?
|
||||
*********************************************************************************
|
||||
@@ -198,7 +211,8 @@ The order in which resolvers are tried is listed in the
|
||||
- Packages manually installed by administrators
|
||||
- Conda packages
|
||||
|
||||
The first system that satisfies a requirement will be used.
|
||||
The first system that satisfies a requirement will be used. See
|
||||
`resolver docs`_ for detailed documentation.
|
||||
|
||||
|
||||
6. How do I know what system is being used by a given tool?
|
||||
@@ -206,10 +220,7 @@ The first system that satisfies a requirement will be used.
|
||||
|
||||
The Galaxy log will show which dependency resolution system is used
|
||||
to satisfy each tool dependency and you can specify priorities using the
|
||||
``dependency_resolution_conf.xml`` file. If you put Conda on
|
||||
top, Galaxy will first try to use Conda to resolve a tool dependency;
|
||||
if this does not work, the following dependency resolver is used, as
|
||||
listed. See `resolver docs`_ for detailed documentation. Starting from Galaxy
|
||||
``dependency_resolvers_conf.xml`` file (see question 5 above). Starting from Galaxy
|
||||
release 16.07, you can see which dependency will be used (“resolved”) in the
|
||||
Admin panel.
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ EXTRA_CONFIG_KWDS = {
|
||||
'conda_ensure_channels': 'r,bioconda,iuc',
|
||||
'conda_auto_install': False,
|
||||
'conda_auto_init': False,
|
||||
'conda_copy_dependencies': False,
|
||||
}
|
||||
|
||||
CONFIG_VAL_NOT_FOUND = object()
|
||||
|
||||
@@ -322,8 +322,8 @@ class DatasetInterface( BaseUIController, UsesAnnotations, UsesItemRatings, Uses
|
||||
continue
|
||||
optional = params.get("is_" + name, None)
|
||||
other = params.get("or_" + name, None)
|
||||
if optional and optional == 'true':
|
||||
# optional element... == 'true' actually means it is NOT checked (and therefore omitted)
|
||||
if optional and optional == '__NOTHING__':
|
||||
# optional element... == '__NOTHING__' actually means it is NOT checked (and therefore omitted)
|
||||
setattr(data.metadata, name, None)
|
||||
else:
|
||||
if other:
|
||||
|
||||
@@ -521,8 +521,8 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
|
||||
if spec.get("readonly"):
|
||||
continue
|
||||
optional = kwd.get( "is_" + name, None )
|
||||
if optional and optional == 'true':
|
||||
# optional element... == 'true' actually means it is NOT checked (and therefore ommitted)
|
||||
if optional and optional == '__NOTHING__':
|
||||
# optional element... == '__NOTHING__' actually means it is NOT checked (and therefore ommitted)
|
||||
setattr( ldda.metadata, name, None )
|
||||
else:
|
||||
setattr( ldda.metadata, name, spec.unwrap( kwd.get( name, None ) ) )
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"ui-modal.js","sources":["../../../src/mvc/ui/ui-modal.js"],"names":["define","View","Backbone","extend","optionsDefault","container","title","cls","body","backdrop","height","width","closing_events","closing_callback","title_separator","buttonList","initialize","options","this","setElement","_template","_","defaults","$","prepend","el","$header","$dialog","$body","$footer","$backdrop","$buttons","render","show","visible","$el","fadeIn","self","document","on","e","keyCode","hide","canceled","fadeOut","off","removeClass","addClass","find","html","empty","buttons","counter","each","name","callback","$button","attr","text","click","append","removeAttr","css","window","getButton","enableButton","prop","disableButton","showButton","hideButton","scrollTop"],"mappings":"AAAAA,UAAW,WACX,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,gBACIC,UAAmB,OACnBC,MAAmB,WACnBC,IAAmB,WACnBC,KAAmB,GACnBC,UAAmB,EACnBC,OAAmB,KACnBC,MAAmB,KACnBC,gBAAmB,EACnBC,iBAAmB,KACnBC,iBAAmB,GAIvBC,cAGAC,WAAY,SAAUC,GAClBC,KAAKC,WAAYD,KAAKE,aACtBF,KAAKD,QAAUI,EAAEC,SAAUL,MAAeC,KAAKd,gBAC/CmB,EAAGL,KAAKD,QAAQZ,WAAYmB,QAASN,KAAKO,IAG1CP,KAAKQ,QAAaR,KAAKK,EAAG,iBAC1BL,KAAKS,QAAaT,KAAKK,EAAG,iBAC1BL,KAAKU,MAAaV,KAAKK,EAAG,eAC1BL,KAAKW,QAAaX,KAAKK,EAAG,iBAC1BL,KAAKY,UAAaZ,KAAKK,EAAG,mBAC1BL,K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Y,UAAWZ,KAAKD,QAAQR,UAAY,YAAc,eAAiB,MACxES,KAAKQ,SAAUR,KAAKD,QAAQH,iBAAmB,YAAc,eAAiB,gBAI9EI,KAAKU,MAAMiC,WAAY,SAClB3C,KAAKD,QAAQP,QACdQ,KAAKU,MAAMkC,IAAK,SAAU5C,KAAKD,QAAQP,QACvCQ,KAAKU,MAAMkC,IAAK,WAAY,WAE5B5C,KAAKU,MAAMkC,IAAK,aAAcvC,EAAGwC,QAASrD,SAAW,GAEpDQ,KAAKD,QAAQN,OACdO,KAAKS,QAAQmC,IAAK,QAAS5C,KAAKD,QAAQN,QAQhDqD,UAAW,SAAUV,GACjB,MAAOpC,MAAKH,WAAYuC,IAO5BW,aAAc,SAAUX,GACpBpC,KAAK8C,UAAWV,GAAOY,KAAM,YAAY,IAO7CC,cAAe,SAAUb,GACrBpC,KAAK8C,UAAWV,GAAOY,KAAM,YAAY,IAO7CE,WAAY,SAAUd,GAClBpC,KAAK8C,UAAWV,GAAOrB,QAO3BoC,WAAY,SAAUf,GAClBpC,KAAK8C,UAAWV,GAAOZ,QAM3B4B,UAAW,WACP,MAAOpD,MAAKU,MAAM0C,aAMtBlD,UAAW,WACP,MAAQ,sQAiBhB,QACInB,KAAOA"}
|
||||
{"version":3,"file":"ui-modal.js","sources":["../../../src/mvc/ui/ui-modal.js"],"names":["define","View","Backbone","extend","className","optionsDefault","container","title","cls","body","backdrop","height","width","closing_events","closing_callback","title_separator","buttonList","initialize","options","this","_","defaults","$","prepend","el","render","show","visible","$el","fadeIn","self","document","on","e","keyCode","hide","$backdrop","canceled","fadeOut","off","html","_template","$header","$dialog","$body","$footer","$buttons","removeClass","addClass","find","empty","buttons","counter","each","name","callback","$button","attr","text","click","append","removeAttr","css","window","getButton","enableButton","prop","disableButton","showButton","hideButton","scrollTop"],"mappings":"AAAAA,UAAW,WACX,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,UAAW,WAGXC,gBACIC,UAAmB,OACnBC,MAAmB,WACnBC,I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MAAQ,0OAehB,QACIxC,KAAOA"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
define([],function(){var a=Backbone.View.extend({optionsDefault:{container:"body",title:"ui-modal",cls:"ui-modal",body:"",backdrop:!0,height:null,width:null,closing_events:!1,closing_callback:null,title_separator:!0},buttonList:{},initialize:function(a){this.setElement(this._template()),this.options=_.defaults(a||{},this.optionsDefault),$(this.options.container).prepend(this.el),this.$header=this.$(".modal-header"),this.$dialog=this.$(".modal-dialog"),this.$body=this.$(".modal-body"),this.$footer=this.$(".modal-footer"),this.$backdrop=this.$(".modal-backdrop"),this.$buttons=this.$(".buttons"),a&&this.render()},show:function(a){if(a&&(this.options=_.defaults(a,this.optionsDefault),this.render()),!this.visible&&(this.visible=!0,this.$el.fadeIn("fast"),this.options.closing_events)){var b=this;$(document).on("keyup.ui-modal",function(a){27==a.keyCode&&b.hide(!0)}),this.$backdrop.on("click",function(){b.hide(!0)})}},hide:function(a){this.visible=!1,this.$el.fadeOut("fast"),this.options.closing_callback&&this.options.closing_callback(a),$(document).off("keyup.ui-modal"),this.$backdrop.off("click")},render:function(){var a=this;if("progress"==this.options.body&&(this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"/></div>')),this.$el.removeClass().addClass("modal").addClass(this.options.cls),this.$header.find(".title").html(this.options.title),this.$body.html(this.options.body),this.$buttons.empty(),this.buttonList={},this.options.buttons){var b=0;$.each(this.options.buttons,function(c,d){var e=$("<button/>").attr("id","button-"+b++).text(c).click(d);a.$buttons.append(e).append(" "),a.buttonList[c]=e})}else this.$footer.hide();this.$backdrop[this.options.backdrop&&"addClass"||"removeClass"]("in"),this.$header[!this.options.title_separator&&"addClass"||"removeClass"]("no-separator"),this.$body.removeAttr("style"),this.options.height?(this.$body.css("height",this.options.height),this.$body.css("overflow","hidden")):this.$body.css("max-height",$(window).height()/2),this.options.width&&this.$dialog.css("width",this.options.width)},getButton:function(a){return this.buttonList[a]},enableButton:function(a){this.getButton(a).prop("disabled",!1)},disableButton:function(a){this.getButton(a).prop("disabled",!0)},showButton:function(a){this.getButton(a).show()},hideButton:function(a){this.getButton(a).hide()},scrollTop:function(){return this.$body.scrollTop()},_template:function(){return'<div class="ui-modal"><div class="modal-backdrop fade"/><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h4 class="title"/></div><div class="modal-body"/><div class="modal-footer"><div class="buttons"/></div></div></div></div>'}});return{View:a}});
|
||||
define([],function(){var a=Backbone.View.extend({className:"ui-modal",optionsDefault:{container:"body",title:"ui-modal",cls:"ui-modal",body:"",backdrop:!0,height:null,width:null,closing_events:!1,closing_callback:null,title_separator:!0},buttonList:{},initialize:function(a){this.options=_.defaults(a||{},this.optionsDefault),$(this.options.container).prepend(this.el),a&&this.render()},show:function(a){if(a&&(this.options=_.defaults(a,this.optionsDefault),this.render()),!this.visible&&(this.visible=!0,this.$el.fadeIn("fast"),this.options.closing_events)){var b=this;$(document).on("keyup.ui-modal",function(a){27==a.keyCode&&b.hide(!0)}),this.$backdrop.on("click",function(){b.hide(!0)})}},hide:function(a){this.visible=!1,this.$el.fadeOut("fast"),this.options.closing_callback&&this.options.closing_callback(a),$(document).off("keyup.ui-modal"),this.$backdrop.off("click")},render:function(){var a=this;if(this.$el.html(this._template()),this.$header=this.$(".modal-header"),this.$dialog=this.$(".modal-dialog"),this.$body=this.$(".modal-body"),this.$footer=this.$(".modal-footer"),this.$backdrop=this.$(".modal-backdrop"),this.$buttons=this.$(".buttons"),"progress"==this.options.body&&(this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"/></div>')),this.$el.removeClass().addClass("modal").addClass(this.options.cls),this.$header.find(".title").html(this.options.title),this.$body.html(this.options.body),this.$buttons.empty(),this.buttonList={},this.options.buttons){var b=0;$.each(this.options.buttons,function(c,d){var e=$("<button/>").attr("id","button-"+b++).text(c).click(d);a.$buttons.append(e).append(" "),a.buttonList[c]=e})}else this.$footer.hide();this.$backdrop[this.options.backdrop&&"addClass"||"removeClass"]("in"),this.$header[!this.options.title_separator&&"addClass"||"removeClass"]("no-separator"),this.$body.removeAttr("style"),this.options.height?(this.$body.css("height",this.options.height),this.$body.css("overflow","hidden")):this.$body.css("max-height",$(window).height()/2),this.options.width&&this.$dialog.css("width",this.options.width)},getButton:function(a){return this.buttonList[a]},enableButton:function(a){this.getButton(a).prop("disabled",!1)},disableButton:function(a){this.getButton(a).prop("disabled",!0)},showButton:function(a){this.getButton(a).show()},hideButton:function(a){this.getButton(a).hide()},scrollTop:function(){return this.$body.scrollTop()},_template:function(){return'<div class="modal-backdrop fade"/><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h4 class="title"/></div><div class="modal-body"/><div class="modal-footer"><div class="buttons"/></div></div></div>'}});return{View:a}});
|
||||
//# sourceMappingURL=../../../maps/mvc/ui/ui-modal.js.map
|
||||
Reference in New Issue
Block a user