mirror of https://github.com/rancher/api-ui.git
Option to disable logout button
This commit is contained in:
parent
fa2d3e4110
commit
8bb88cbf63
|
|
@ -12,8 +12,9 @@ function HTMLApi(opt, cb)
|
||||||
this._docsJson = opt.docsJson;
|
this._docsJson = opt.docsJson;
|
||||||
this._user = opt.user;
|
this._user = opt.user;
|
||||||
this._curlUser = opt.curlUser || '${GDAPI_ACCESS_KEY}:${GDAPI_SECRET_KEY}';
|
this._curlUser = opt.curlUser || '${GDAPI_ACCESS_KEY}:${GDAPI_SECRET_KEY}';
|
||||||
this._filterId = 0;
|
this._logout = opt.logout !== false;
|
||||||
|
|
||||||
|
this._filterId = 0;
|
||||||
this._reqModal = null;
|
this._reqModal = null;
|
||||||
this._editSchema = null;
|
this._editSchema = null;
|
||||||
this._editData = null;
|
this._editData = null;
|
||||||
|
|
@ -315,6 +316,7 @@ HTMLApi.prototype.render = function(cb)
|
||||||
data: this._data,
|
data: this._data,
|
||||||
docsPage: this._docsPage,
|
docsPage: this._docsPage,
|
||||||
user: this._user,
|
user: this._user,
|
||||||
|
logout: this._logout,
|
||||||
error: this._error,
|
error: this._error,
|
||||||
explorer: Cookie.get('debug') || false
|
explorer: Cookie.get('debug') || false
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,10 @@ var explorer;
|
||||||
data: window.data,
|
data: window.data,
|
||||||
schemasUrl: window.schemas,
|
schemasUrl: window.schemas,
|
||||||
docsPage: window.docsPage || window.docs,
|
docsPage: window.docsPage || window.docs,
|
||||||
docsJson: window.docJson || window.docsJson,
|
docsJson: window.docsJson || window.docJson,
|
||||||
user: window.user,
|
user: window.user,
|
||||||
curlUser: window.curlUser
|
curlUser: window.curlUser,
|
||||||
|
logout: window.logout
|
||||||
}, apiReady);
|
}, apiReady);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@
|
||||||
{{#if user}}
|
{{#if user}}
|
||||||
<span class="user">{{user}}</span>
|
<span class="user">{{user}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if logout}}
|
||||||
<a href="#" onclick="htmlapi.logout(); return false">Log Out</a><br/>
|
<a href="#" onclick="htmlapi.logout(); return false">Log Out</a><br/>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if explorer}}
|
{{#if explorer}}
|
||||||
<a href="#" onclick="Cookie.set('apiview','explorer'); explorer.show(); return false">Explorer View</a><br/>
|
<a href="#" onclick="Cookie.set('apiview','explorer'); explorer.show(); return false">Explorer View</a><br/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue