Part 2 β€” UI Rendering [Simplest UI Application]

In this part, you will learn to create a basic UI application.

Table of contents

Step 1 β€” HTML file

This is very similar to a modal window application. But now instead of a modal window β€” a whole browser page!

memo you can preview your HTML in our Application Designer

Let's create some simple HTML:

src/gui.html

<div>
	<sly-field title="INFO: Test massage"
			   description="this is a common template for displaying information"
			   style="padding-top: 0; padding-bottom: 0">

		<sly-icon slot="icon" :options="{ color: '#13ce66', bgColor: '#e1f7eb', rounded: false }">
			<i class="zmdi zmdi-info"></i>
		</sly-icon>
	</sly-field>
	<sly-field title="WARNING: Test message"
			   description="this is a common template for displaying warnings">
		<sly-icon slot="icon" :options="{ color: '#fba607', bgColor: '#ffeee3', rounded: false }">
			<i class="zmdi zmdi-alert-triangle"></i>
		</sly-icon>
	</sly-field>
	<sly-field title="ERROR: Test message"
			   description="this is a common template for displaying errors">
		<sly-icon slot="icon" :options="{ color: '#de1212', bgColor: '#ffebeb', rounded: false }">
			<i class="zmdi zmdi-alert-circle"></i>
		</sly-icon>
	</sly-field>
</div>

Step 2 β€” Python Script

To keep the application running all the time, we will use the app.run method.

src/main.py

Step 3 β€” Updating debug.env && config.json

  1. Write TASK_ID While True Script from Part 7 to debug.env We also need to specify the path along which our application can cache debugging data DEBUG_APP_DIR and DEBUG_CACHE_DIR

debug.env

  1. Write path to GUI file to config.json

config.json

Step 4 β€” Results

UI Rendering

Last updated

Was this helpful?