[auth] moved authorizations into the header
This commit is contained in:
@@ -28,8 +28,7 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
||||
}
|
||||
|
||||
this.trigger('update-swagger-ui', {
|
||||
url: $('#input_baseUrl').val(),
|
||||
apiKey: $('#input_apiKey').val()
|
||||
url: $('#input_baseUrl').val()
|
||||
});
|
||||
},
|
||||
|
||||
@@ -40,7 +39,6 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
|
||||
|
||||
$('#input_baseUrl').val(url);
|
||||
|
||||
//$('#input_apiKey').val(apiKey);
|
||||
if (trigger) {
|
||||
this.trigger('update-swagger-ui', {url:url});
|
||||
}
|
||||
|
||||
@@ -83,26 +83,9 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
render: function () {
|
||||
// Render the outer container for resources
|
||||
var authsModel, parsedDefinitions;
|
||||
|
||||
$(this.el).html(Handlebars.templates.main(this.model));
|
||||
this.model.securityDefinitions = this.model.securityDefinitions || {};
|
||||
|
||||
if (!_.isEmpty(this.model.securityDefinitions)) {
|
||||
parsedDefinitions = _.map(this.model.securityDefinitions, function (auth, name) {
|
||||
var result = {};
|
||||
result[name] = auth;
|
||||
return result;
|
||||
});
|
||||
|
||||
authsModel = { auths: parsedDefinitions };
|
||||
|
||||
authsModel.isLogout = !_.isEmpty(window.swaggerUi.api.clientAuthorizations.authz);
|
||||
this.authView = new SwaggerUi.Views.AuthButtonView({model: authsModel, router: this.router});
|
||||
this.$('.authorize-wrapper').append(this.authView.render().el);
|
||||
}
|
||||
|
||||
// Render each resource
|
||||
|
||||
var resources = {};
|
||||
|
||||
Reference in New Issue
Block a user