diff --git a/assets/js/src/cron.jsx b/assets/js/src/cron.jsx deleted file mode 100644 index 0f81b26759..0000000000 --- a/assets/js/src/cron.jsx +++ /dev/null @@ -1,72 +0,0 @@ -define( - [ - 'react', - 'react-dom', - 'mailpoet' - ], - function( - React, - ReactDOM, - MailPoet - ) { - var CronControl = React.createClass({ - getInitialState: function() { - return { - status: 'loading' - }; - }, - getCronData: function() { - MailPoet.Ajax.post({ - endpoint: 'cron', - action: 'getStatus' - }).done((response) => { - this.setState({ - status: response.data.status - }); - }).fail((response) => { - this.setState({ - status: false - }); - }); - }, - componentDidMount: function() { - if(this.isMounted()) { - this.getCronData(); - setInterval(this.getCronData, 5000); - } - }, - render: function() { - let status; - - switch(this.state.status) { - case false: - case 'stopping': - case 'stopped': - status = MailPoet.I18n.t('cronDaemonIsNotRunning'); - break; - case 'starting': - case 'started': - status = MailPoet.I18n.t('cronDaemonIsRunning'); - break; - case 'loading': - status = MailPoet.I18n.t('loadingDaemonStatus'); - break; - } - - return ( -
- { status } -
- ); - } - }); - - const container = document.getElementById('cron_container'); - - if(container) { - ReactDOM.render( - , - container - ); - } -}); \ No newline at end of file diff --git a/lib/API/Endpoints/Cron.php b/lib/API/Endpoints/Cron.php deleted file mode 100644 index d7945b2318..0000000000 --- a/lib/API/Endpoints/Cron.php +++ /dev/null @@ -1,23 +0,0 @@ -errorResponse(array( - APIError::NOT_FOUND => __('Cron daemon is not running.') - )); - } else { - return $this->successResponse($daemon); - } - } -} \ No newline at end of file diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index c2fef5f198..56005890a7 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -186,15 +186,6 @@ class Menu { 'mailpoet-newsletter-editor', array($this, 'newletterEditor') ); - - add_submenu_page( - $main_page_slug, - $this->setPageTitle(__('Cron')), - __('Cron'), - 'manage_options', - 'mailpoet-cron', - array($this, 'cron') - ); } function welcome() { @@ -418,10 +409,6 @@ class Menu { echo $this->renderer->render('form/editor.html', $data); } - function cron() { - echo $this->renderer->render('cron.html'); - } - function setPageTitle($title) { return sprintf( '%s - %s', diff --git a/lib/Cron/BootStrapMenu.php b/lib/Cron/BootStrapMenu.php deleted file mode 100644 index 6842c2c58b..0000000000 --- a/lib/Cron/BootStrapMenu.php +++ /dev/null @@ -1,32 +0,0 @@ -daemon = Setting::where('name', 'cron_daemon') - ->findOne(); - } - - function bootStrap() { - return ($this->daemon) ? - array_merge( - array( - 'timeSinceStart' => Carbon::createFromFormat( - 'Y-m-d H:i:s', - $this->daemon->created_at, - 'UTC' - )->diffForHumans(), - 'timeSinceUpdate' => Carbon::createFromFormat( - 'Y-m-d H:i:s', - $this->daemon->updated_at, - 'UTC' - )->diffForHumans() - ), - json_decode($this->daemon->value, true) - ) : - "false"; - } -} diff --git a/views/cron.html b/views/cron.html deleted file mode 100644 index 9be55f76d0..0000000000 --- a/views/cron.html +++ /dev/null @@ -1,13 +0,0 @@ -<% extends 'layout.html' %> - -<% block content %> -
-<% endblock %> - -<% block translations %> - <%= localize({ - 'loadingDaemonStatus': __('Loading daemon status...'), - 'cronDaemonIsRunning': __('Cron daemon is running'), - 'cronDaemonIsNotRunning': __('Cron daemon is not running') - }) %> -<% endblock %>