FastX Custom Start Forms


Administrators can create custom forms in FastX that will appear in the start session dialog box.  These forms allow admins to create user friendly options that will be added to the start data when sending the start command.

Selecting the Start Server

In a cluster setup, an admin may want to allow the user to select on which server he wants to start a new session.

  • Log in as an admin
  • System > Clustering > Cluster Setup > Allow user to select server on session start
  • Save

When launching a session, this will pop up a list of servers to connect to (if there is more than one server in a cluster).

Note that this option only sets the serverId of the start data.  An admin will still need to set up a load balancing script that will use this option

Creating a Custom Params Form

System administrations may have custom parameters that they want their users to set when launching sessions.  For example, if job scheduling, a system admin may want to know if a user needs a server with a video card.  The custom params form allows the system admin to use basic html to create a form that will be injected into the start script.

  • Log in as an admin
  • System > Sessions > Forms > Create a new form
  • Save

The form allows for a subset of HTML to be used.  Javascript is disabled to prevent XSS attacks.  The admin can simply add in the form inputs he wants and it will appear.
FastX uses Bootstrap 4 styling which can be added o keep the look and feel consistent through the form.  Valid input will be added to the params object of the start data.

Example

<div class="form-group">
   <label>My Custom Input</label>
   <input type="text" class="form-control" name="myCustomInput" />
</div>
<div class="form-group">
   <select name="minRam" class="form-control">
       <option value="1">1 GB</option>
       <option value="2">2 GB</option>
       <option value="10">10 GB</option>
   </select>
</div>

Setting myCustomInput to “hello” and selecting minRam to 1 GB will set the params object to

{
   "myCustomInput":"hello",
   "minRam": "1"
}

Note that both values are strings

data-type option

You can set a custom data-type attribute on a form input that will convert the string into a more useful type.

The data-type options include

  • “number” — parse the value as a Floating Point number
  • “boolean” — parse the value as a boolean
  • “json” — parse the value as a JSON object

Adding data-type to our original example

<div class="form-group">
 <label>My Custom Input</label>
 <input type="text" class="form-control" name="myCustomInput" />
</div>
<div class="form-group">
 <select name="minRam" data-type="number" class="form-control">
    <option value="1">1 GB</option>
    <option value="2">2 GB</option>
    <option value="10">10 GB</option>
 </select>
</div>

Will result in

{
 "myCustomInput":"hello",
 "minRam": 1
}

Reserved names

FastX automatically overwrites the following parameter names.  You should avoid using these

  • “name” — sets the display name
  • “icon” — sets the default icon
  • “bookmarkId” — sets the bookmark id when connecting with a bookmark. This id is used in making shortcuts
  • “clientVersion” — overwritten with the client version on connect
  • “clientId” — The desktop client that connected
  • “clientIP” — IP address the client connected from (when using the desktop client)
  • “clientTransport” — The method used to connect (“SSH”, “Web” etc)