Compare commits
No commits in common. "adfb564ccc9fd2116e1eb4ae307cf7f745964af7" and "8b32ecc619a9720612bf3710c3ae2feb825cda7c" have entirely different histories.
adfb564ccc
...
8b32ecc619
@ -24,34 +24,24 @@ $router->any('/plugins', 'Plugins');
|
|||||||
$router->any('/ajax', 'Ajax');
|
$router->any('/ajax', 'Ajax');
|
||||||
$router->any('/oauth', 'Oauth');
|
$router->any('/oauth', 'Oauth');
|
||||||
|
|
||||||
//Vue APP - Authentication
|
//Vue APP
|
||||||
$router->post('/api/login', 'AuthApi@login');
|
$router->post('/api/login', 'AuthApi@login');
|
||||||
$router->post('/api/logout', 'AuthApi@logout');
|
$router->post('/api/logout', 'AuthApi@logout');
|
||||||
|
|
||||||
//Vue APP - Rooms
|
|
||||||
$router->get('/api/rooms', 'RoomsApi@default');
|
$router->get('/api/rooms', 'RoomsApi@default');
|
||||||
$router->get('/api/rooms/{roomId}/update', 'RoomsApi@update');
|
$router->get('/api/rooms/{roomId}/update', 'RoomsApi@update');
|
||||||
|
|
||||||
$router->get('/api/devices', 'DevicesApi@default');
|
$router->get('/api/devices', 'DevicesApi@default');
|
||||||
|
|
||||||
$router->get('/api/plugins', 'PluginsApi@default');
|
$router->get('/api/plugins', 'PluginsApi@default');
|
||||||
|
|
||||||
$router->get('/api/users', 'UsersApi@default');
|
$router->get('/api/users', 'UsersApi@default');
|
||||||
|
|
||||||
//Vue APP - Server Info
|
|
||||||
$router->get('/api/server', 'ServerApi@default');
|
$router->get('/api/server', 'ServerApi@default');
|
||||||
$router->get('/api/server/log', 'ServerApi@logStatus');
|
$router->get('/api/server/log', 'ServerApi@logStatus');
|
||||||
|
|
||||||
//Vue APP - Widgets
|
|
||||||
$router->post('/api/widgets/{widgetId}/run', 'WidgetApi@run');
|
$router->post('/api/widgets/{widgetId}/run', 'WidgetApi@run');
|
||||||
$router->get('/api/widgets/{widgetId}/detail', 'WidgetApi@detail');
|
$router->get('/api/widgets/{widgetId}/detail', 'WidgetApi@detail');
|
||||||
$router->get('/api/widgets/{widgetId}/detail/{period}', 'WidgetApi@detail');
|
$router->get('/api/widgets/{widgetId}/detail/{period}', 'WidgetApi@detail');
|
||||||
|
|
||||||
//Vue APP - Automations Endpoints
|
|
||||||
$router->get('/api/automations', 'AutomationsApi@default');
|
$router->get('/api/automations', 'AutomationsApi@default');
|
||||||
$router->get('/api/automations/{automationId}/detail', 'AutomationsApi@detail');
|
$router->get('/api/automations/{automationId}/detail', 'AutomationsApi@detail');
|
||||||
$router->post('/api/automations/create', 'AutomationsApi@create');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//cron
|
//cron
|
||||||
|
@ -20,15 +20,4 @@ class AutomationsApi extends ApiController
|
|||||||
|
|
||||||
$this->response($response);
|
$this->response($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
$this->requireAuth();
|
|
||||||
$obj = $this->input;
|
|
||||||
|
|
||||||
$response = [];
|
|
||||||
$response = AutomationManager::create($obj['name'],$obj['days'], $obj['tasks'], $obj['conditions']);
|
|
||||||
|
|
||||||
$this->response(['value'=>'OK']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ class AutomationManager{
|
|||||||
}
|
}
|
||||||
} catch(PDOException $error) {
|
} catch(PDOException $error) {
|
||||||
echo $error->getMessage();
|
echo $error->getMessage();
|
||||||
return false;
|
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user