cron message
This commit is contained in:
@@ -171,15 +171,15 @@ class ScheduledJob
|
||||
$cronFile = Util::concatPath($this->getSystemUtil()->getRootDir(), $this->cronFile);
|
||||
$desc = $language->translate('cronSetup', 'options', 'ScheduledJob');
|
||||
|
||||
$label = isset($desc[$OS]) ? $desc[$OS] : $desc['default'];
|
||||
$message = isset($desc[$OS]) ? $desc[$OS] : $desc['default'];
|
||||
|
||||
$command = isset($this->cronSetup[$OS]) ? $this->cronSetup[$OS] : $this->cronSetup['default'];
|
||||
$command = str_replace(array('{PHP-BIN-DIR}', '{CRON-FILE}'), array($phpBin, $cronFile), $command);
|
||||
|
||||
return array(
|
||||
'label' => $label,
|
||||
'message' => $message,
|
||||
'command' => $command,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,8 @@
|
||||
"log":{
|
||||
"readOnly": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"views": {
|
||||
"list": "ScheduledJob.List"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="cronjob well">
|
||||
<div class="message"> </div>
|
||||
<div class="command"> </div>
|
||||
</div>
|
||||
@@ -37,13 +37,17 @@ Espo.define('Views.List', 'Views.Main', function (Dep) {
|
||||
view: 'Header'
|
||||
}
|
||||
},
|
||||
|
||||
searchPanel: true,
|
||||
|
||||
setup: function () {
|
||||
this.createView('search', 'Record.Search', {
|
||||
collection: this.collection,
|
||||
el: '#main > .search-container',
|
||||
searchManager: this.options.searchManager,
|
||||
});
|
||||
if (this.searchPanel) {
|
||||
this.createView('search', 'Record.Search', {
|
||||
collection: this.collection,
|
||||
el: '#main > .search-container',
|
||||
searchManager: this.options.searchManager,
|
||||
});
|
||||
}
|
||||
|
||||
this.menu.buttons.unshift({
|
||||
link: '#' + this.scope + '/create',
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/************************************************************************
|
||||
* This file is part of EspoCRM.
|
||||
*
|
||||
* EspoCRM - Open Source CRM application.
|
||||
* Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
|
||||
* Website: http://www.espocrm.com
|
||||
*
|
||||
* EspoCRM is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* EspoCRM is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
Espo.define('Views.ScheduledJob.List', 'Views.List', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
searchPanel: false,
|
||||
|
||||
setup: function () {
|
||||
Dep.prototype.setup.call(this);
|
||||
|
||||
this.createView('search', 'Base', {
|
||||
el: '#main > .search-container',
|
||||
template: 'scheduled-job.cronjob'
|
||||
});
|
||||
},
|
||||
|
||||
afterRender: function () {
|
||||
Dep.prototype.afterRender.call(this);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: 'Admin/action/cronMessage',
|
||||
error: function (x) {
|
||||
}.bind(this)
|
||||
}).done(function (data) {
|
||||
console.log(data);
|
||||
this.$el.find('.cronjob .message').html(data.message);
|
||||
this.$el.find('.cronjob .command').html('<strong>' + data.command + '</strong>');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user