2017-07-06 10:02:00 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports = {
|
2017-07-10 11:40:41 +02:00
|
|
|
menu: async ctx => {
|
|
|
|
const Service = strapi.plugins['settings-manager'].services.settingsmanager;
|
2017-07-06 10:02:00 +02:00
|
|
|
|
2017-07-10 11:40:41 +02:00
|
|
|
ctx.send(Service.menu);
|
|
|
|
},
|
2017-07-06 10:02:00 +02:00
|
|
|
|
2017-07-10 11:40:41 +02:00
|
|
|
environments: async ctx => {
|
|
|
|
let envs = _.map(_.keys(strapi.config.environments), env => {
|
|
|
|
return {
|
|
|
|
name: env,
|
|
|
|
active: (strapi.config.environment === env)
|
|
|
|
}
|
|
|
|
});
|
2017-07-06 10:02:00 +02:00
|
|
|
|
|
|
|
ctx.send({
|
2017-07-10 11:40:41 +02:00
|
|
|
environments: envs
|
2017-07-06 10:02:00 +02:00
|
|
|
});
|
2017-07-10 11:40:41 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
form: async ctx => {
|
|
|
|
const Service = strapi.plugins['settings-manager'].services.settingsmanager;
|
|
|
|
const { slug, env } = ctx.params;
|
|
|
|
|
|
|
|
ctx.send(env ? Service[slug](env) : Service[slug]);
|
|
|
|
},
|
2017-07-06 10:02:00 +02:00
|
|
|
};
|