mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #5984 from sebgie/issue#5941
Move Public API behind labs flag
This commit is contained in:
commit
f3f4488c23
3 changed files with 29 additions and 0 deletions
|
@ -25,5 +25,9 @@ export default Ember.Controller.extend(Ember.PromiseProxyMixin, {
|
|||
}
|
||||
|
||||
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'),
|
||||
notifications: Ember.inject.service(),
|
||||
session: Ember.inject.service(),
|
||||
feature: Ember.inject.controller(),
|
||||
|
||||
labsJSON: Ember.computed('model.labs', function () {
|
||||
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: {
|
||||
onUpload: function (file) {
|
||||
var self = this,
|
||||
|
|
|
@ -42,5 +42,19 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</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>
|
||||
|
|
Loading…
Add table
Reference in a new issue