Badgerati / Pode.Web

Web template framework for use with the Pode PowerShell web server
MIT License
183 stars 23 forks source link

Adds Actions to allow Updating, Enabling, and Disabling Links #584

Closed Badgerati closed 2 weeks ago

Badgerati commented 2 weeks ago

Description of the Change

Adds the following actions for Links:

Adds a new -Disabled switch on New-PodeWebLink, and renames the -Source parameter to be -Url.

Examples

New-PodeWebCard -Name 'Link' -Content @(
    New-PodeWebLink -Value 'Google' -Url 'https://www.google.com' -Id 'link' -NewTab
)

New-PodeWebCard -Name 'Update Link' -Content @(
    New-PodeWebButtonGroup -Buttons @(
        New-PodeWebButton -Name 'Update to Goole' -ScriptBlock {
            Update-PodeWebLink -Id 'link' -Value 'Google' -Url 'https://www.google.com'
        }
        New-PodeWebButton -Name 'Update to DuckDuckGo' -ScriptBlock {
            Update-PodeWebLink -Id 'link' -Value 'DuckDuckGo' -Url 'https://www.duckduckgo.com'
        }
        New-PodeWebButton -Name 'Disable Link' -ScriptBlock {
            Disable-PodeWebLink -Id 'link'
        }
        New-PodeWebButton -Name 'Enable Link' -ScriptBlock {
            Enable-PodeWebLink -Id 'link'
        }
    )
)