UniversalDashboard.CodeEditor

Code editor control for Universal Dashboard. This controls requires a Universal Dashboard Enterprise license.
Adam Driscoll
save_alt 537 downloads

Universal Dashboard Code Editor

Code editor control for Universal Dashboard based on Monaco.

Installation

Install-Module UniversalDashboard.CodeEditor

Licensing

This component requires a Universal Dashboard Enterprise license.

Issues

Please file issues on the Universal Dashboard GitHub repository.

Examples

Creating an editor

New-UDCodeEditor -Language 'powershell' -Height '100ch' -Width '100ch' -Code 'Start-Process'

Readonly Editor

New-UDCodeEditor -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark -Code "Get-Process" -ReadOnly

Adding Content

New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark -Code "Get-Process" -ReadOnly
New-UDButton -Text 'Add Text' -OnClick {
    Add-UDElement -ParentId 'editor' -Content {
        'Get-Process'
    }
}

Getting Content

New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark
New-UDButton -Text "Get Text" -OnClick {
    Show-UDToast -Message (Get-UDElement -Id 'editor').Attributes["code"]
}

Setting Content

New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark
 New-UDButton -Text "Set Text" -OnClick {
    Set-UDElement -Id 'editor' -Attributes @{
        code = 'Get-Service'
    }
}

Diff Support

New-UDCodeEditor -Id 'editor2' -Language 'powershell' -Theme vs-dark -Code "Get-Process" -ReadOnly -Height '500px' -Original 'Start-Process'

Install

Install-Module UniversalDashboard.CodeEditor
Version

1.0.1

Last Updated

9/27/2019 8:57:17 PM +00:00

Tags

universaldashboard monaco code ud-control ud-licensed

Author

Adam Driscoll

Type

extension Control

License

Premium