mirror of https://github.com/rancher/api-ui.git
Disable explorer view unless debug cookie is set
This commit is contained in:
parent
f3716d3100
commit
cf93f899dc
|
|
@ -77,5 +77,5 @@ Cookie.getAll = function()
|
|||
|
||||
Cookie.remove = function(name)
|
||||
{
|
||||
document.cookie = name+'=null; expires=Wed, 24 Feb 1982 18:42:00 UTC; path=/';
|
||||
document.cookie = name+'=null; expires=Wed, 24 Feb 1982 18:42:00 UTC';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ HTMLApi.prototype.render = function(cb)
|
|||
|
||||
var tpl = {
|
||||
data: this._data,
|
||||
docs: this._docs
|
||||
docs: this._docs,
|
||||
explorer: Cookie.get('debug')
|
||||
};
|
||||
|
||||
document.body.innerHTML = Handlebars.templates['body'](tpl);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
<th width="200">Sort</th>
|
||||
<th width="150">Pagination</th>
|
||||
<th width="120" rowspan="2" style="vertical-align: top; text-align: right; font-weight: normal;">
|
||||
<a href="#" onclick="Cookie.set('apiview','explorer'); explorer.show(); return false">Explorer View</a><br/>
|
||||
{{#if explorer}}
|
||||
<a href="#" onclick="Cookie.set('apiview','explorer'); explorer.show(); return false">Explorer View</a><br/>
|
||||
{{/if}}
|
||||
{{#if docs}}
|
||||
<a href="{{docs}}" target="cloudapidocs">Documentation</a><br/>
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue