mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
33 lines
888 B
JavaScript
33 lines
888 B
JavaScript
import injectService from 'ember-service/inject';
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
|
titleToken: 'About',
|
|
|
|
classNames: ['view-about'],
|
|
|
|
ghostPaths: injectService(),
|
|
ajax: injectService(),
|
|
|
|
cachedConfig: false,
|
|
|
|
model() {
|
|
let cachedConfig = this.get('cachedConfig');
|
|
let configUrl = this.get('ghostPaths.url').api('configuration', 'about');
|
|
|
|
if (cachedConfig) {
|
|
return cachedConfig;
|
|
}
|
|
|
|
return this.get('ajax').request(configUrl)
|
|
.then((configurationResponse) => {
|
|
let [cachedConfig] = configurationResponse.configuration;
|
|
|
|
this.set('cachedConfig', cachedConfig);
|
|
|
|
return cachedConfig;
|
|
});
|
|
}
|
|
});
|