Skip to content

ADMIN UI Interface

Vasat comes with its own administration UI interface to view and manage data as well as all Vasat modules.

It is a stand-alone Angular app that can be deployed on any webserver. It can also be embeded into a Vasat instance if you would like to have it alongside your project APIs. Moreover, if your vasat instance is accessible to the public you can use the already live Vadmin interface and simply provide the vasat URL.

Saas Admin UI

Simply login to our Saas Admin Url and provide your Vasat instance public URL or IP address

Embedded interface

You can embed the admin interface on your Vasat instance.

  • On your Vasat build.sbt file add the below dependency
lazy val vadminDep = System.getProperty("withBaseHref") match {
  case "true" =>
    println("Running with Vadmin baseHref")
    Seq(
      "io.vasat" % "vadmin" % "0.0.11-base", // Any -base version is for when vasat runs on a subfolder in the domain
    )
  case _ =>
    println("Running with Vadmin root")
    Seq(
      "io.vasat" % "vadmin" % "0.0.28", // Any normal version without -base is for when vasat runs in the root
    )
}

libraryDependencies ++= vadminDep
  • Make sure you specify the latest vadmin version
  • Use the sytem property withBaseHref if you want to install the Admin interface under the vadmin web route. Note the name of the subroute cannot be changed.
  • Add the admin site to the top of your routes file.
    • To serve the Admin interface under the root directory.
    # /public/lib/ is the path under the public directory where play places all webjars in the dependecies
    GET     /     controllers.Assets.at(path="/public/lib/vadmin", file="index.html")
    • To serve Admin interface udner vadmin subfolder.
    # /public/lib/ is the path under the public directory where play places all webjars in the dependecies
    GET     /vadmin     controllers.Assets.at(path="/public/lib/vadmin", file="index.html")
  • At the ends of your *routes file add the below to tell Vasat to redirect any unknown routes to Vasat Admin for the Angular app to work properly.
# This is for when vasat runs in the root domain
GET     /*path     controllers.HomeController.vadminRedirect(path, default = "index.html")
  • Add the above redirect method into your HomeController or your main Controller. If you add to your custom Controller make sure you update the above route.
scala
  def vadminRedirect(path: String, default:String): Action[AnyContent] = defa.async( req => {
    assets.at(path="/public/lib/vadmin/",file = path).apply(req).flatMap(res => {
      val contentType = res.body.contentType.getOrElse("NA")
      
      if( (res.header.status == 304 || res.header.status == 200) && !contentType.equals("text/html") ) {
        Future(res)
      }
      else {
        assets.at(path="/public/lib/vadmin/",file = default).apply(req)
      }
    })

  })

Deploy on external web server

Please contact us if you would like to deploy the Admin interface on your own web server.