mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
commit
ac00bce56b
@ -335,7 +335,8 @@ Most of the application's configurations are defined by environment. It means th
|
||||
|
||||
- `host` (string): Host name. Default value: `localhost`.
|
||||
- `port` (integer): Port on which the server should be running. Default value: `1337`.
|
||||
- `autoReload` (boolean): Enable or disabled server reload on files update. Default value: depends on the environment.
|
||||
- `autoReload`
|
||||
- `enabled` (boolean): Enable or disabled server reload on files update. Default value: depends on the environment.
|
||||
- [`cron`](https://en.wikipedia.org/wiki/Cron)
|
||||
- `enabled` (boolean): Enable or disable CRON tasks to schedule jobs at specific dates. Default value: `false`.
|
||||
- `admin`
|
||||
|
@ -346,7 +346,7 @@ const send = require('koa-send');
|
||||
|
||||
module.exports = {
|
||||
autoReload: async ctx => {
|
||||
ctx.send({ autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false) });
|
||||
ctx.send({ autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false }) });
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -374,8 +374,8 @@ import request from 'utils/request';
|
||||
const shouldRenderCompo = (plugin) => new Promise((resolve, request) => {
|
||||
request('/my-plugin/autoReload')
|
||||
.then(response => {
|
||||
// If autoReload is enabled the response is `{ autoReload: true }`
|
||||
plugin.preventComponentRendering = !response.autoReload;
|
||||
// If autoReload is enabled the response is `{ autoReload: { enabled: true } }`
|
||||
plugin.preventComponentRendering = !response.autoReload.enabled;
|
||||
// Set the BlockerComponent props
|
||||
plugin.blockerComponentProps = {
|
||||
blockerComponentTitle: 'my-plugin.blocker.title',
|
||||
@ -407,8 +407,8 @@ import MyCustomBlockerComponent from 'components/MyCustomBlockerComponent';
|
||||
const shouldRenderCompo = (plugin) => new Promise((resolve, request) => {
|
||||
request('/my-plugin/autoReload')
|
||||
.then(response => {
|
||||
// If autoReload is enabled the response is `{ autoReload: true }`
|
||||
plugin.preventComponentRendering = !response.autoReload;
|
||||
// If autoReload is enabled the response is `{ autoReload: { enabled: true } }`
|
||||
plugin.preventComponentRendering = !response.autoReload.enabled;
|
||||
|
||||
// Tell which component to be rendered instead
|
||||
plugin.blockerComponent = MyCustomBlockerComponent;
|
||||
|
@ -59,7 +59,7 @@ const renderIde = () => (
|
||||
"port": 1337,
|
||||
<br />
|
||||
<span style={{ color: '#006EE7'}}>
|
||||
"autoReload": true,
|
||||
"autoReload": { enabled: true }
|
||||
</span>
|
||||
<br />
|
||||
"proxi": {
|
||||
|
@ -190,7 +190,7 @@ module.exports = {
|
||||
|
||||
autoReload: async ctx => {
|
||||
ctx.send({
|
||||
autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false),
|
||||
autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false })
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -3,7 +3,7 @@ import request from 'utils/request';
|
||||
const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => {
|
||||
request('/settings-manager/autoReload')
|
||||
.then(response => {
|
||||
plugin.preventComponentRendering = !response.autoReload;
|
||||
plugin.preventComponentRendering = !response.autoReload.enabled;
|
||||
plugin.blockerComponentProps = {
|
||||
blockerComponentTitle: 'components.AutoReloadBlocker.header',
|
||||
blockerComponentDescription: 'components.AutoReloadBlocker.description',
|
||||
|
@ -334,8 +334,8 @@ module.exports = {
|
||||
|
||||
autoReload: async ctx => {
|
||||
ctx.send({
|
||||
autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false),
|
||||
environment: strapi.config.environment,
|
||||
autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false }),
|
||||
environment: strapi.config.environment
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user