forked from Badgerati/Pode.Web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiframe.ps1
More file actions
33 lines (27 loc) · 1023 Bytes
/
iframe.ps1
File metadata and controls
33 lines (27 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Import-Module Pode -MaximumVersion 2.99.99 -Force
Import-Module ..\src\Pode.Web.psm1 -Force
Start-PodeServer {
# add a simple endpoint
Add-PodeEndpoint -Address localhost -Port 8090 -Protocol Http
New-PodeLoggingMethod -Terminal | Enable-PodeErrorLogging
# set the use of templates, and set a login page
Use-PodeWebTemplates -Title 'IFrame Example' -Theme Dark
$con1 = New-PodeWebContainer -Content @(
1..3 | ForEach-Object {
New-PodeWebButton -Name "Page$_" -ScriptBlock {
Update-PodeWebIFrame -Name 'IFrame' -Url "/pages/$($ElementData.Name)"
}
}
)
$con2 = New-PodeWebContainer -Content @(
New-PodeWebIFrame -Name 'IFrame' -Url '/pages/Page1'
)
Add-PodeWebPage -Name 'Example' -Content $con1, $con2
1..3 | ForEach-Object {
Add-PodeWebPage -Name "Page$_" -Hide -Content @(
New-PodeWebContainer -Content @(
New-PodeWebText -Value "Page$_!"
)
)
}
}