mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Move Public API behind labs flag
closes #5941 - added UI to labs page - added method to determine if full authentication is required - updated public_api tests to enable public api first
This commit is contained in:
parent
2c7a4f9328
commit
618d36c394
3 changed files with 29 additions and 0 deletions
|
@ -25,5 +25,9 @@ export default Ember.Controller.extend(Ember.PromiseProxyMixin, {
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
}),
|
||||||
|
|
||||||
|
publicAPI: Ember.computed('config.publicAPI', 'labs.publicAPI', function () {
|
||||||
|
return this.get('config.publicAPI') || this.get('labs.publicAPI');
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,7 @@ export default Ember.Controller.extend({
|
||||||
ghostPaths: Ember.inject.service('ghost-paths'),
|
ghostPaths: Ember.inject.service('ghost-paths'),
|
||||||
notifications: Ember.inject.service(),
|
notifications: Ember.inject.service(),
|
||||||
session: Ember.inject.service(),
|
session: Ember.inject.service(),
|
||||||
|
feature: Ember.inject.controller(),
|
||||||
|
|
||||||
labsJSON: Ember.computed('model.labs', function () {
|
labsJSON: Ember.computed('model.labs', function () {
|
||||||
return JSON.parse(this.get('model.labs') || {});
|
return JSON.parse(this.get('model.labs') || {});
|
||||||
|
@ -29,6 +30,16 @@ export default Ember.Controller.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
usePublicAPI: Ember.computed('feature.publicAPI', {
|
||||||
|
get: function () {
|
||||||
|
return this.get('feature.publicAPI');
|
||||||
|
},
|
||||||
|
set: function (key, value) {
|
||||||
|
this.saveLabs('publicAPI', value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onUpload: function (file) {
|
onUpload: function (file) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
|
|
@ -42,5 +42,19 @@
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
<hr>
|
||||||
|
<form>
|
||||||
|
<fieldset>
|
||||||
|
<div class="form-group for-checkbox">
|
||||||
|
<label for="labs-publicAPI">Public API</label>
|
||||||
|
<label class="checkbox" for="labs-publicAPI">
|
||||||
|
{{input id="labs-publicAPI" name="labs[publicAPI]" type="checkbox" checked=usePublicAPI}}
|
||||||
|
<span class="input-toggle-component"></span>
|
||||||
|
<p>Enable public API access.</p>
|
||||||
|
</label>
|
||||||
|
<p>Allow access to the publicly available Ghost API using JavaScript.</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Add table
Reference in a new issue