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