Endpoint issues

Hi all,

Vscode.UDStudio is giving an error “You cannot call a method on a null-valued expression.” and is not showing my scheduled endpoints correctly even though I’d given all components with endpoints an ID

image

$Schedule5 = New-UDEndpointSchedule -Every 5 -Minute
$Schedule2 = New-UDEndpointSchedule -Every 2 -Minute
$endpoint1 = New-UDEndpoint -Schedule $Schedule5 -Id 'endpoint1' -Endpoint {
    $Cache:oldesttickets = get-oldesttickets
    $Cache:summarytable = get-summarytable
    $Cache:totaltickets = get-totaltickets
    $Cache:totalticketsbystatus = get-totalticketsbystatus
    $Cache:responsesla = get-responsesla
    $Cache:resolutionsla = get-resolutionsla
    $Cache:responsesoonfail = get-responsesoonfail
    $Cache:resolutionsoonfail = get-resolutionsoonfail
}
$endpoint2 = New-UDEndpoint -Schedule $Schedule2 -Id 'endpoint2' -Endpoint {
    Sync-UDElement -id 'responsesla' -Broadcast
    Sync-UDElement -id 'resolutionsla' -Broadcast
    Sync-UDElement -id 'Total' -Broadcast
    Sync-UDElement -id 'Totalheading' -Broadcast
}
$endpoint = $endpoint1, $endpoint2


Start-UDDashboard -Port $ConfigurationFile.dashboard.port -Dashboard $MyDashboard -Name $ConfigurationFile.dashboard.title -Force -Endpoint  $endpoint  -AutoReload

I am also getting errors
17:17:52 [Warn] ComponentController Endpoint Total not found
17:17:52 [Warn] ComponentController Endpoint Totalheading not found.

but I’ve given them Id’s?

New-UDStyle -id 'Totalstyle' -Style '
                .card .card-content {
                    font-size   = 40px }' -Content {
            New-UDCard -ID 'Total' -TextAlignment center -Endpoint {
                #New-UDIcon -Size 3x -Icon 'hands_helping' -Style @{color = '#fff' } -Id 'hands'

                New-UDHeading -id 'Totalheading' -Size 1 -Text "Open Calls:   $($Cache:totaltickets.column1)" -Color white
                New-UDHtml -Markup "<br></br>"
            }
        }

Does anyone have any ideas?

I think its a bug…

I agree. Can you file an issue on GitHub? there is a label for UDStudio

Would that also apply for these errors above? My component doesn’t seem to get refreshed.

That I’m not sure about. From the code you’ve shown, it looks like it should be refreshed.

What if you change it to:

New-UDElement -Tag 'div' -Id 'total' -Endpoint {
New-UDStyle -id 'Totalstyle' -Style '
                .card .card-content {
                    font-size   = 40px }' -Content {
            New-UDCard -TextAlignment center -Endpoint {
                #New-UDIcon -Size 3x -Icon 'hands_helping' -Style @{color = '#fff' } -Id 'hands'

                New-UDHeading -id 'Totalheading' -Size 1 -Text "Open Calls:   $($Cache:totaltickets.column1)" -Color white
                New-UDHtml -Markup "<br></br>"
            }
        }
}

Then in your schedule:

$endpoint2 = New-UDEndpoint -Schedule $Schedule2 -Id 'endpoint2' -Endpoint {
    Sync-UDElement -id 'responsesla' -Broadcast
    Sync-UDElement -id 'resolutionsla' -Broadcast
    Sync-UDElement -id 'Total' -Broadcast
}

Thanks @adam that worked…but why :smiley:

Raised the first issue on github but I cannot see how to add a label? https://github.com/ironmansoftware/universal-dashboard/issues/1376

Also, my UDStyle does not seem to work, can you see anything wrong in the syntax?

I’m not exactly sure why that worked…honestly. But glad it did.

Maybe the style is being overriden? Try this:

New-UDStyle -id 'Totalstyle' -Style '
                .card .card-content {
                    font-size   = 40px !important }' 

Also, i’m releasing a new version of UDStudio to fix the issue with 2.8. Will be available in like 10 minutes.

1 Like