You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a brief guide on the breaking changes introduced into v0.6 from v0.5.
4
+
5
+
## Select
6
+
7
+
The `-NoChooseOption` and `-ChooseOptionValue` parameters on `New-PodeWebSelect` have been removed. The default "choose an option" option has also been removed.
8
+
9
+
If you want to have a first option of "choose an option", this can be defined as the first option in the `-Options` array:
Copy file name to clipboardexpand all lines: docs/Tutorials/Basics.md
+8-2
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Once the templates are enabled, you can start to add some pages! You can find mo
58
58
* Login
59
59
* Webpage
60
60
61
-
To just add a new page, you use [`Add-PodeWebPage`](../../Functions/Pages/Add-PodeWebPage), supplying the `-Name` of the page and a `-ScriptBlock` for defining the layouts/elements on the page:
61
+
To just add a new page, you use [`Add-PodeWebPage`](../../Functions/Pages/Add-PodeWebPage), supplying the `-Name` of the page and a `-ScriptBlock` for defining the layout/element components on the page:
@@ -79,12 +79,18 @@ The above would render a new page with a table, showing all the services on the
79
79
80
80
### Sidebar
81
81
82
-
Pages added to your site will appear in the sidebar on the left of your pages. The sidebar has a filter box at the top by default, but this can be hidden via `-NoPageFilter`:
82
+
Pages added to your site will appear in the sidebar on the left of your pages. The sidebar has a filter box at the top by default, but this can be removed via `-NoPageFilter`:
83
83
84
84
```powershell
85
85
Use-PodeWebTemplates -Title 'Example' -Theme Dark -NoPageFilter
86
86
```
87
87
88
+
You can also force the sidebar to be hidden by default via `-HideSidebar`:
89
+
90
+
```powershell
91
+
Use-PodeWebTemplates -Title 'Example' -Theme Dark -HideSidebar
92
+
```
93
+
88
94
## Custom Scripts/Styles
89
95
90
96
You can reference custom JavaScript and CSS files to use via [`Import-PodeWebJavaScript`](../../Functions/Utilities/Import-PodeWebJavaScript) and [`Import-PodeWebStylesheet`](../../Functions/Utilities/Import-PodeWebStylesheet). Both take a relative/literal `-Url` to the file.
Nearly every component in Pode.Web has a `-CssClass` and a `-CssStyle` parameter. These parameters allow you to add custom classes/styles onto the components, so you can control their look and functionality.
4
+
5
+
## Classes
6
+
7
+
The `-CssClass` parameter accepts an array of strings, which are set on the `class` property on the parent element of approparite component. The classes by themselves don't do anything, but you can use them to build custom CSS files and import them via [`Import-PodeWebStylesheet`](../../Functions/Utilities/Import-PodeWebStylesheet); you can also use the custom classes as references in custom JavaScript files, and import these via [`Import-PodeWebJavaScript`](../../Functions/Utilities/Import-PodeWebJavaScript).
8
+
9
+
For example, the following would apply the `my-custom-textbox` class to a textbox:
Then you could create some `/public/my-styles.css` file with the following, to set the textbox's text colour to purple:
16
+
17
+
```css
18
+
.my-custom-textbox {
19
+
color: purple
20
+
}
21
+
```
22
+
23
+
and import it via: `Import-PodeWebStylesheet -Url '/my-styles.css'`.
24
+
25
+
or, you can create some JavaScript file at `/public/my-scritps.js` with an event to write to console on keyup. jQuery works here, as Pode.Web uses jQuery. Also, we have to reference the class then the input control, as the class is at the paraent level of the textbox element; this allows for more fine grained control of a component as a whole - such as a textbox's labels, divs, spans, etc.
and import it via: `Import-PodeWebJavaScript -Url '/my-scripts.js'`.
34
+
35
+
You can add/remove classes on components using the [Class output actions](../Outputs/Components#classes). (This will add classes onto the component itself, not the parent).
36
+
37
+
## Styles
38
+
39
+
The `-CssStyle` parameter accepts a hashtable where the key is the name of a CSS property, with an appropriate value for that property. These styles are applied directly onto the main component.
40
+
41
+
For example, the following would display a paragraph with yellow text:
42
+
43
+
```powershell
44
+
New-PodeWebParagraph -CssStyle @{ Color = 'Yellow' } -Elements @(
45
+
New-PodeWebText -Value 'And then here is some more text, that also includes a '
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Alert.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Alert
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
An alert is a colour block containing information text; alerts can for warning, errors, tips, etcs. To add an alert you use [`New-PodeWebAlert`](../../../Functions/Elements/New-PodeWebAlert), and supply either a `-Value` or `-Content`:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Badge.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Badge
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
A Badge is just normal text, but has a styled/coloured background. You can add a badge to your page using [`New-PodeWebBadge`](../../../Functions/Elements/New-PodeWebBadge):
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Button.md
+16
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Button
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
To display a button on your page you use [`New-PodeWebButton`](../../../Functions/Elements/New-PodeWebButton); a button can either be dynamic and run custom logic via a `-ScriptBlock`, or it can redirect a user to a `-Url`.
You can pass values to the scriptblock by using the `-ArgumentList` parameter. This accepts an array of values/objects, and they are supplied as parameters to the scriptblock:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Charts.md
+33
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Charts
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
You can display data rendered as a chart by using [`New-PodeWebChart`](../../../Functions/Elements/New-PodeWebChart), and the following chart types are supported:
4
8
5
9
* Line (default)
@@ -13,6 +17,18 @@ A chart gets its data from a supplied `-ScriptBlock`, more information below, an
13
17
14
18
To supply data to be rendered on a chart, you have to supply a `-ScritpBlock` which returns the appropriate data in the correct format; fortunately there's [`ConvertTo-PodeWebChartData`](../../../Functions/Outputs/ConvertTo-PodeWebChartData) to help with this format.
15
19
20
+
You can pass values to the scriptblock by using the `-ArgumentList` parameter. This accepts an array of values/objects, and they are supplied as parameters to the scriptblock:
Before showing the ConvertTo function, the data format needed is as follows: the returned value has be an array of hashtables, with each hashtable requires a `Key` property, and a `Values` property that's an array of further hashtables. The `Key` is the value used on the X-axis, and the `Values` is an array of data points used on the Y-axis. The `Values` hashtables also has to contain a `Key` and a `Value` property - the `Key` here is the dataset group name, and the `Value` is the value on the Y-axis.
@@ -71,6 +87,23 @@ which renders a chart that looks like below:
A chart has 15 default colours that they can be rendered using. These colours can be customised if required, by suppling an array of hex colour codes to the `-Colours` parameter.
93
+
94
+
For example, to render the below bar chart with reg/green bars, you could use:
Now let's say we want `-AutoRefresh` a chart every minute, and we want it to display the current CPU usage, but only for the last 15 minutes. To do this, you have to supply `-Append` and any data returned from the `-ScriptBlock` will be appended to the chart instead. To restrict the data points to 15 minutes, we can supply `-MaxItems 15`.
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Checkbox.md
+8
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Checkbox
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
The Checkbox element is a form input element, and can be added using [`New-PodeWebCheckbox`](../../../Functions/Elements/New-PodeWebCheckbox). This will add a checkbox to your form, and you can render with checkbox as a switch using `-AsSwitch`:
You can render this element inline with other non-form elements by using the `-NoForm` switch. This will remove the form layout, and render the element more cleanly when used outside of a form.
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Code.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Code
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
The code element will render pre-formatted text as `<code>value</code>`. To create a code element you use [`New-PodeWebCode`](../../../Functions/Elements/New-PodeWebCode):
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/CodeBlock.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Code Block
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
The code block element will render pre-formatted text as `<pre>value</pre>`. To create a code block element you use [`New-PodeWebCodeBlock`](../../../Functions/Elements/New-PodeWebCodeBlock), and you can specify the highlighting language via `-Language` - the default is plain text.
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/CodeEditor.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Code Editor
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
The code editor, which is done using MicroSoft's Monaco Editor, is currently still a WIP but functional. You can add a code editor to your page via [`New-PodeWebCodeEditor`](../../../Functions/Elements/New-PodeWebCodeEditor), and specify the language is editor is for via `-Language`.
4
8
5
9
To display the editor with some initial content you can supply `-Value`:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/CommentBlock.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Comment Block
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
A Comment Block lets you display messages/comments on your page, showing a user's name, message and an icon/avatar. You can add comment blocks using [`New-PodeWebComment`](../../../Functions/Elements/New-PodeWebComment):
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Credentials.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Credentials
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
The Credentials element is a form input element, and can be added using [`New-PodeWebCredential`](../../../Functions/Elements/New-PodeWebCredential). This will automatically add a username and password input fields to your form:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/DateTime.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# DateTime
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
The DateTime element is a form input element, and can be added using [`New-PodeWebDateTime`](../../../Functions/Elements/New-PodeWebDateTime). This will automatically add a date and time input fields to your form:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/FileStream.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# File Stream
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
A file stream element is a readonly textarea that will stream the contents of a file from the server - usually a text/log file from the `/public` directory. To add a file streaming element to your page you can use [`New-PodeWebFileStream`](../../../Functions/Elements/New-PodeWebFileStream).
4
8
5
9
The simplest file stream just needs a `-Url` being supplied; this URL should be a relative/literal URL path to a static text file.
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/FileUpload.md
+8
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# File Upload
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
The File Upload element is a form input element, and can be created using [`New-PodeWebFileUpload`](../../../Functions/Elements/New-PodeWebFileUpload). It allows users to upload files from your page forms:
4
8
5
9
```powershell
@@ -15,3 +19,7 @@ New-PodeWebCard -Content @(
15
19
Which looks like below:
16
20
17
21

22
+
23
+
## Inline
24
+
25
+
You can render this element inline with other non-form elements by using the `-NoForm` switch. This will remove the form layout, and render the element more cleanly when used outside of a form.
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Form.md
+16
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Form
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
A form is kind of like a layout, but is an element that contains other elements. It automatically wraps the `-Content` as a `<form>` and adds a submit button to the bottom. When clicked, the form is serialised and sent to the `-ScriptBlock`. To add a form to you page use [`New-PodeWebForm`](../../../Functions/Elements/New-PodeWebForm) along with other form elements:
4
8
5
9
```powershell
@@ -27,6 +31,18 @@ Which looks like below:
27
31
28
32

29
33
34
+
You can pass values to the scriptblock by using the `-ArgumentList` parameter. This accepts an array of values/objects, and they are supplied as parameters to the scriptblock:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Header.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Header
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
You can render header titles to your page by using [`New-PodeWebHeader`](../../../Functions/Elements/New-PodeWebHeader). This will show a title in various header sizes (`h1` - `h6`):
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Hidden.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Hidden
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
The Hidden element is a form input element, and can be added using [`New-PodeWebHidden`](../../../Functions/Elements/New-PodeWebHidden). It allows you to add hidden values/elements to your forms:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/IFrame.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# iFrame
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | No |
6
+
3
7
The iFrame element lets you embed other websites into your pages via [`New-PodeWebIFrame`](../../../Functions/Elements/New-PodeWebIFrame), and you just need to supply the `-Url` to embed:
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Icon.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Icon
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
The icon element will render a [Material Design Icon](https://materialdesignicons.com) to your page. To create an icon element you use [`New-PodeWebIcon`](../../../Functions/Elements/New-PodeWebIcon), and supply the name of a Material Design Icon using `-Name`; you can also change the icon colour via `-Colour` which can be a known name (red/green/etc) or a hex value (#333333).
Copy file name to clipboardexpand all lines: docs/Tutorials/Elements/Image.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Image
2
2
3
+
| Support ||
4
+
| ------- |-|
5
+
| Events | Yes |
6
+
3
7
This will render an image onto your page, using [`New-PodeWebImage`](../../../Functions/Elements/New-PodeWebImage). You need to supply a `-Source` URL to the image you wish to display:
0 commit comments