Getting started

The idea behind Blended Admin, was to create a tool that could ease creation of an administration panel.

Blended Admin is implemented in Microsoft ASP.NET Core and uses jint to run JavaScript code.

To give you a glimpse of how it works, see the following example.

CreateItem

The JavaScript code connects to Sqlite database and gets the list of employees. The results are returned as a table. You can test the code by pressing “Run Code” button, and once you are happy with it, just save it.

Now, you can execute it, every time you need it!

RunItem

function main(arg)

The entry point of the script is main function.

function main(arg)
{
   var htmlView = new HtmlView('<div>hello!</div>');
   return [htmlView];
}
main(arg);

Arg parameter has the following structure:

{
   "environment": "",
   "variables": {},
   "queryString": {},
   "form": {},
   "method": "get"
}

Blended admin allows to configure environments and variables, so you can change between environments. The property environment contains name of current environment and the property variables holds values for the current environemnt.

Depending on the http method that was sent to a server, the property method can be get or post. If the method is get, then the form property is empty and all the values are expected to be in the queryString. The opposite is for the post method. Check FormView to read more about it.

Main method returns one or more views to display. You can display FormView, TableView or HtmlView.

Debugging

As a script is not run in a browser, debugging capabilities are limited. The only way to debug a script is to use console.log method to output information.

function main(arg)
{
   console.log(arg);
   
   var htmlView = new HtmlView('<div>hello!</div>');
   return [htmlView];
}
main(arg);