public function scriptingAction()
{
$this->request->restrictAccess(Acl::RESOURCE_LOGS_SCRIPTING_LOGS);
$farms = self::loadController('Farms')->getList();
array_unshift($farms, ['id' => '0', 'name' => 'All farms']);
//todo: use Script::getScriptingData
$scripts = array_map(function ($s) {
return ['id' => $s['id'], 'name' => $s['name']];
}, Script::getList($this->user->getAccountId(), $this->getEnvironmentId()));
array_unshift($scripts, ['id' => 0, 'name' => '']);
$glEvents = array_keys(EVENT_TYPE::getScriptingEvents());
sort($glEvents);
array_unshift($glEvents, '');
$events = array_merge($glEvents, array_keys(\Scalr\Model\Entity\EventDefinition::getList($this->user->getAccountId(), $this->getEnvironmentId())));
$tasks = $this->db->GetAll('SELECT id, name FROM scheduler WHERE env_id = ? ORDER BY name ASC', [$this->getEnvironmentId()]);
array_unshift($tasks, ['id' => 0, 'name' => '']);
$this->response->page('ui/logs/scripting.js', ['farms' => $farms, 'scripts' => $scripts, 'events' => $events, 'tasks' => $tasks]);
}