Console

From DreamFactory
Jump to: navigation, search
DFEConsole

Overview

The Console is the DreamFactory Enterprise management system, which can be used to setup servers, clusters, instances, users etc.

The Console UI is build with Blades, which is Laravel’s templating engine. The UI consists of five blades:

  • Main (main.blade.php)
  • Top Navbar (navbar.blade.php)
  • Top Menu (topmenu.blade.php)
  • Content Blade
  • Sidebar Menu (sidebar-menu.blade.php)

Console elements.png

The main blade (main.blade.php) is the main page file with HTML headers, includes and placeholders for the top navigation and content. The top navigation has a dropdown menu for easy user account access and for Console logout.

The content section is the blade specific to the selected page (e.g. Home, home.blade.php), and it has placeholders for the main (top) menu blade (topmenu.blade.php), the side menu blade (sidebar-menu.blade.php) and the page’s HTML.

The top menu and side menu are static, but have awareness of selected top/side menu, and highlights the selected menus.

File Structure

The layout files, like the main blade and menu blades, are located in /resources/views/layouts. The main blade is in the root of the folder and the menu blades etc. are in the partials folder.

The content blades are located in /resources/views/app. The default blade (e.g. servers.blade.php) is in the root of the folder, and the create/edit blades are in subfolders (e.g. servers/create.blade.php). Javascript functions are located in /public/js/blade-scripts, each content blade has a Javascript file in a subfolder (e.g. servers/servers.js).

Page load flow

The router handles loading of the pages, by routing the request to the appropriate resource controller, and the controller will then render the page. This is an example of how the Home page is loaded and rendered.

Flow home.png

Home

The Home page contains a welcome message with an introduction video, and resource, support and license information. The welcome content is loaded from another domain, and injected with an iframe.

Route HTTP Verb Controller/Function
/v1/home GET HomeController@index()

The Home page is different from the other pages. The sidebar menu is not loading other pages, but replacing the URL in the page’s iframe. The sidebar menu is build from the console link array in config/links.php.

Servers

DFE requires Web-, Database- and Application servers to host DreamFactory instances. The DFE Console doesn’t configure or install servers, but create the relationship between DFE and the servers.

The Console UI stores the configuration (URL, port, type, credentials etc.) of physical/virtual servers in the database table `server_t`. The server types are defined in the table `server_type_t`, and are by default Database, Web and Application.

Route HTTP Verb Controller/Function
/v1/servers GET ServerController@index()
/v1/servers POST ServerController@store()
/v1/servers/create GET ServerController@create()
/v1/servers/{id}/edit GET ServerController@edit()
/v1/servers/{id} PUT ServerController@update()
/v1/servers/{id} POST ServerController@destroy()

Clusters

A cluster is a grouping of servers, each cluster can have a database server, a web server and an application server assigned to it. The cluster is stored in the database table `cluster_t`, and the assignment of servers to the cluster is stored the `cluster_server_asgn_t` table.

Route HTTP Verb Controller/Function
/v1/clusters GET ClusterController@index()
/v1/clusters POST ClusterController@store()
/v1/clusters/create GET ClusterController@create()
/v1/clusters/{id}/edit GET ClusterController@edit()
/v1/clusters/{id} PUT ClusterController@update()
/v1/clusters/{id} POST ClusterController@destroy()

Users

The Console can create and manage users. There are two different types of user, System Administrators and Instance Owners. System Administrators have access to the Console, and Instance Owners have access to Dashboard. System Administrators are stored in the database table `service_user_t` and Instance Owners are stored in the table `user_t`.

Route HTTP Verb Controller/Function
/v1/users GET UserController@index()
/v1/users POST UserController@store()
/v1/users/create GET UserController@create()
/v1/users/{id}/edit GET UserController@edit()
/v1/users/{id} PUT UserController@update()
/v1/users/{id} POST UserController@destroy()

Instances

Instances are created in with the Dashboard, and they are only displayed in the Console.

Route HTTP Verb Controller/Function
/v1/instances GET InstanceController@index()

Limits

Limits makes it possible to define the maximum number of API requests within a given period of time. The limits can be applied to a specific cluster, instance or user, or limits can be applied per cluster, instance or user. The limits are stored in the database table `limit_t`. The limit key field is defined like this:

  • cluster-name.period
  • cluster-name.instance-name.period
  • cluster-name.instance-name.user:id.period

A limit for a given user per hour could look like this: `asd.qwe.user:123.hour`

Route HTTP Verb Controller/Function
/v1/limits GET LimitController@index()
/v1/limits POST LimitController@store()
/v1/limits/create GET LimitController@create()
/v1/limits/{id}/edit GET LimitController@edit()
/v1/limits/{id} PUT LimitController@update()
/v1/limits/{id} POST LimitController@destroy()

Reports

The reports page’s only function is to link to Kibana (ELK stack).

Route HTTP Verb Controller/Function
/v1/reports GET ReportController@index()