Difference between revisions of "Unit WebStatus"
From Ultibo.org
| Line 415: | Line 415: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function WebStatusFind(AListener:THTTPListener; const AHost:String):TWebStatusMain;</pre> | <pre style="border: 0; padding-bottom:0px;">function WebStatusFind(AListener:THTTPListener; const AHost:String):TWebStatusMain;</pre> | ||
| − | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find the WebStatus instance associated with the supplied Listener and Host</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! Listener | ||
| + | | The HTTP listener to find an instance for | ||
| + | |- | ||
| + | ! Host | ||
| + | | The HTTP host name to find an instance for (eg host.domain.com) | ||
| + | |- | ||
| + | ! Return | ||
| + | | The Main object of the requested instance or nil if not found | ||
|- | |- | ||
! Note | ! Note | ||
| − | | | + | | If Listener is nil and Host is empty then return the default (first) instance |
|- | |- | ||
|} | |} | ||
| Line 427: | Line 436: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function WebStatusRegister(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean):Boolean;</pre> | <pre style="border: 0; padding-bottom:0px;">function WebStatusRegister(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean):Boolean;</pre> | ||
| − | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and register an instance of WebStatus associated with the supplied Listener and Host and automatically register all standard internal pages</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
| − | ! | + | ! Listener |
| − | | | + | | The HTTP listener to create an instance for |
| + | |- | ||
| + | ! Host | ||
| + | | The HTTP host name to create an instance for (eg host.domain.com) (Optional) | ||
| + | |- | ||
| + | ! URL | ||
| + | | The base path on this host of the WebStatus pages (eg /status) (Optional) | ||
| + | |- | ||
| + | ! Redirect | ||
| + | | If True add a redirection from / to the WebStatus path | ||
| + | |- | ||
| + | ! Return | ||
| + | | True if successful or False if an error occurred | ||
|- | |- | ||
|} | |} | ||
| Line 439: | Line 460: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function WebStatusRegisterEx(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean; AClass:TWebStatusClass):Boolean;</pre> | <pre style="border: 0; padding-bottom:0px;">function WebStatusRegisterEx(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean; AClass:TWebStatusClass):Boolean;</pre> | ||
| − | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and register an instance of WebStatus associated with the supplied Listener and Host and / or register a page of the supplied class only. If a WebStatus instance already exists for the supplied Listener and Host then add a new page of the supplied class to the existing instance</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
| − | ! | + | ! Listener |
| − | | | + | | The HTTP listener to create an instance for |
| + | |- | ||
| + | ! Host | ||
| + | | The HTTP host name to create an instance for (eg host.domain.com) (Optional) | ||
| + | |- | ||
| + | ! URL | ||
| + | | The base path on this host of the WebStatus pages (eg /status) (Optional) | ||
| + | |- | ||
| + | ! Redirect | ||
| + | | If True add a redirection from / to the WebStatus path | ||
| + | |- | ||
| + | ! Class | ||
| + | | The class of the page to be created and added to the instance | ||
| + | |- | ||
| + | ! Return | ||
| + | | True if successful or False if an error occurred | ||
|- | |- | ||
|} | |} | ||
| Line 451: | Line 487: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function WebStatusDeregister(AListener:THTTPListener; const AHost:String):Boolean;</pre> | <pre style="border: 0; padding-bottom:0px;">function WebStatusDeregister(AListener:THTTPListener; const AHost:String):Boolean;</pre> | ||
| − | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister and destroy the instance of WebStatus associated with the supplied Listener and Host</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
| − | ! | + | ! Listener |
| − | | | + | | The HTTP listener to destroy the instance for |
| + | |- | ||
| + | ! Host | ||
| + | | The HTTP host name to destroy the instance for (eg host.domain.com) | ||
| + | |- | ||
| + | ! Return | ||
| + | | True if successful or False if an error occurred | ||
|- | |- | ||
|} | |} | ||
Latest revision as of 02:59, 5 November 2025
Return to Unit Reference
Contents
Description
Ultibo Web Status unit
Constants
Web status specific constants
RtlMaxUnits* RtlMaxUnits = 1024;
|
See maxunits in system.inc |
DeviceTreeMaxColumns = 140;
|
|
DeviceTreeColumnOffset = 20;
|
|
Type definitions
RTL initialize final record
TRtlInitFinalRec = record
| Note: See TInitFinalRec in system.inc | |
InitProc:TProcedure;
|
|
FinalProc:TProcedure;
|
|
RTL initialize final table
PRtlInitFinalTable = ^TRtlInitFinalTable;
TRtlInitFinalTable = record
| Note: See TInitFinalTable in system.inc | |
TableCount:LongWord;
|
|
InitCount:LongWord;
|
|
Procs:array[1..RtlMaxUnits] of TRtlInitFinalRec;
|
|
Web status data
PWebStatusData = ^TWebStatusData;
TWebStatusData = record
Document:TWebStatusSub;
|
|
Host:THTTPHost;
|
|
Request:THTTPServerRequest;
|
|
Response:THTTPServerResponse;
|
|
ContentStream:TStream;
|
|
Data:Pointer;
|
Web status content
TWebStatusContent = function(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean of Object;
|
Class definitions
Web status specific classes
TWebStatusMain = class(THTTPDocument)
|
TWebStatusSub = class(THTTPDocument)
|
TWebStatusPage = class(TWebStatusSub)
|
TWebStatusClass = class (TWebStatusPage)
|
TWebStatusPlatform = class(TWebStatusPage)
|
TWebStatusMemory = class(TWebStatusPage)
|
TWebStatusHeap = class(TWebStatusPage)
|
TWebStatusCPU = class(TWebStatusPage)
|
TWebStatusFPU = class(TWebStatusPage)
|
TWebStatusGPU = class(TWebStatusPage)
|
TWebStatusRTL = class(TWebStatusPage)
|
TWebStatusClock = class(TWebStatusPage)
|
TWebStatusLocale = class(TWebStatusPage)
|
TWebStatusThreading = class(TWebStatusPage)
|
TWebStatusThreadList = class(TWebStatusPage)
|
TWebStatusScheduler = class(TWebStatusPage)
|
TWebStatusDevices = class(TWebStatusPage)
|
TWebStatusDrivers = class(TWebStatusPage)
|
TWebStatusHandles = class(TWebStatusPage)
|
TWebStatusUSB = class(TWebStatusPage)
|
TWebStatusPCI = class(TWebStatusPage)
|
TWebStatusMMC = class(TWebStatusPage)
|
TWebStatusHID = class(TWebStatusPage)
|
TWebStatusNetwork = class(TWebStatusPage)
|
TWebStatusStorage = class(TWebStatusPage)
|
TWebStatusFilesystem = class(TWebStatusPage)
|
TWebStatusCache = class(TWebStatusPage)
|
TWebStatusKeyboard = class(TWebStatusPage)
|
TWebStatusMouse = class(TWebStatusPage)
|
TWebStatusTouch = class(TWebStatusPage)
|
TWebStatusJoystick = class(TWebStatusPage)
|
TWebStatusFramebuffer = class(TWebStatusPage)
|
TWebStatusConsole = class(TWebStatusPage)
|
TWebStatusLogging = class(TWebStatusPage)
|
TWebStatusTimezone = class(TWebStatusPage)
|
TWebStatusEnvironment = class(TWebStatusPage)
|
TWebStatusPageTables = class(TWebStatusPage)
|
TWebStatusVectorTables = class(TWebStatusPage)
|
TWebStatusIRQFIQSWI = class(TWebStatusPage)
|
TWebStatusGPIO = class(TWebStatusPage)
|
TWebStatusConfiguration = class(TWebStatusPage)
|
TWebStatusDeviceTree = class(TWebStatusPage)
|
TWebStatusDebug = class(TWebStatusPage)
|
TWebStatusCustom = class(TWebStatusPage)
|
TWebStatusLogin = class(TWebStatusSub)
|
TWebStatusLogout = class(TWebStatusSub)
|
Public variables
Web status specific variables
WEBSTATUS_FONT_NAME:String = 'Arial';
|
WEBSTATUS_HEAP_FREE_COUNT:LongWord = 250;
|
Maximum number of free heap blocks to display |
WEBSTATUS_HEAP_USED_COUNT:LongWord = 250;
|
Maximum number of used heap blocks to display |
WEBSTATUS_ALLOW_RESTART:LongBool = True;
|
If True enable the Restart button on the main page |
WEBSTATUS_ALLOW_SHUTDOWN:LongBool = True;
|
If True enable the Shutdown button on the main page |
Function declarations
Initialization functions
procedure WebStatusInit;
Description: To be documented
| Note | None documented |
|---|
Web status functions
function WebStatusFind(AListener:THTTPListener; const AHost:String):TWebStatusMain;
Description: Find the WebStatus instance associated with the supplied Listener and Host
| Listener | The HTTP listener to find an instance for |
|---|---|
| Host | The HTTP host name to find an instance for (eg host.domain.com) |
| Return | The Main object of the requested instance or nil if not found |
| Note | If Listener is nil and Host is empty then return the default (first) instance |
function WebStatusRegister(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean):Boolean;
Description: Create and register an instance of WebStatus associated with the supplied Listener and Host and automatically register all standard internal pages
| Listener | The HTTP listener to create an instance for |
|---|---|
| Host | The HTTP host name to create an instance for (eg host.domain.com) (Optional) |
| URL | The base path on this host of the WebStatus pages (eg /status) (Optional) |
| Redirect | If True add a redirection from / to the WebStatus path |
| Return | True if successful or False if an error occurred |
function WebStatusRegisterEx(AListener:THTTPListener; const AHost,AURL:String; ARedirect:Boolean; AClass:TWebStatusClass):Boolean;
Description: Create and register an instance of WebStatus associated with the supplied Listener and Host and / or register a page of the supplied class only. If a WebStatus instance already exists for the supplied Listener and Host then add a new page of the supplied class to the existing instance
| Listener | The HTTP listener to create an instance for |
|---|---|
| Host | The HTTP host name to create an instance for (eg host.domain.com) (Optional) |
| URL | The base path on this host of the WebStatus pages (eg /status) (Optional) |
| Redirect | If True add a redirection from / to the WebStatus path |
| Class | The class of the page to be created and added to the instance |
| Return | True if successful or False if an error occurred |
function WebStatusDeregister(AListener:THTTPListener; const AHost:String):Boolean;
Description: Deregister and destroy the instance of WebStatus associated with the supplied Listener and Host
| Listener | The HTTP listener to destroy the instance for |
|---|---|
| Host | The HTTP host name to destroy the instance for (eg host.domain.com) |
| Return | True if successful or False if an error occurred |
function WebStatusEnableUserAuthentication(AListener:THTTPListener; const AHost:String; AUserAuthenticator:TAuthenticator):Boolean;
Description: To be documented
| Note | None documented |
|---|
function WebStatusEnableSessionAuthentication(AListener:THTTPListener; const AHost:String; AUserAuthenticator,ASessionAuthenticator:TAuthenticator):Boolean;
Description: To be documented
| Note | None documented |
|---|
function WebStatusDisableAuthentication(AListener:THTTPListener; const AHost:String):Boolean;
Description: To be documented
| Note | None documented |
|---|
Web status helper functions
procedure WebStatusDeviceTreeLogOutput(const AText:String; Data:Pointer);
Description: To be documented
| Note | None documented |
|---|
function WebStatusDeviceEnumerate(Device:PDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusDriverEnumerate(Driver:PDriver; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusHandleEnumerate(Handle:PHandleEntry; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusUSBDeviceEnumerate(Device:PUSBDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusUSBHostEnumerate(Host:PUSBHost; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusUSBDriverEnumerate(Driver:PUSBDriver; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusMMCEnumerate(MMC:PMMCDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
procedure WebStatusUSBLogOutput(const AText:String; Data:Pointer);
Description: To be documented
| Note | None documented |
|---|
function WebStatusUSBLogDeviceCallback(Device:PUSBDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusUSBLogTreeCallback(Device:PUSBDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusPCIDeviceEnumerate(Device:PPCIDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusPCIHostEnumerate(Host:PPCIHost; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusPCIDriverEnumerate(Driver:PPCIDriver; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusMMCEnumerate(MMC:PMMCDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusSDHCIEnumerate(SDHCI:PSDHCIHost; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusSDIODriverEnumerate(Driver:PSDIODriver; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusHIDDeviceEnumerate(Device:PHIDDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusHIDConsumerEnumerate(Consumer:PHIDConsumer; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusNetworkEnumerate(Network:PNetworkDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusStorageEnumerate(Storage:PStorageDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusMouseEnumerate(Mouse:PMouseDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusTouchEnumerate(Touch:PTouchDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusKeyboardEnumerate(Keyboard:PKeyboardDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusJoystickEnumerate(Joystick:PJoystickDevice; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
function WebStatusConsoleWindowEnumerate(Console:PConsoleDevice; Handle:TWindowHandle; Data:Pointer):LongWord;
Description: To be documented
| Note | None documented |
|---|
Return to Unit Reference