Skip to content

Commit

Permalink
Remap some key shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Dec 15, 2024
1 parent 14ade7a commit 8b03412
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 55 deletions.
56 changes: 28 additions & 28 deletions docs/Getting-Started/Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ OpenAPI Information:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Server Control Commands:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Ctrl+c : Gracefully terminate the server.
Ctrl+r : Restart the server and reload configurations.
Ctrl+u : Suspend the server.
Ctrl+d : Disable Server
Ctrl+h : Hide Help
Ctrl+b : Open the first HTTP endpoint in the default browser.
Ctrl+C : Gracefully terminate the server.
Ctrl+R : Restart the server and reload configurations.
Ctrl+P : Suspend the server.
Ctrl+D : Disable Server
Ctrl+H : Hide Help
Ctrl+B : Open the first HTTP endpoint in the default browser.
----
Ctrl+m : Show Metrics
Ctrl+e : Hide Endpoints
Ctrl+t : Hide OpenAPI
Ctrl+l : Clear the Console
Ctrl+t : Enable Quiet Mode
Ctrl+M : Show Metrics
Ctrl+E : Hide Endpoints
Ctrl+Q : Hide OpenAPI
Ctrl+L : Clear the Console
Ctrl+Q : Enable Quiet Mode
```

---
Expand Down Expand Up @@ -127,17 +127,17 @@ Here is the default `Server.Console` configuration:
}
KeyBindings = @{ # Define custom key bindings for controls.
Browser = 'b' # Open the default browser.
Help = 'h' # Show/hide help instructions.
OpenAPI = 'o' # Show/hide OpenAPI information.
Endpoints = 'e' # Show/hide endpoints.
Clear = 'l' # Clear the console output.
Quiet = 't' # Toggle quiet mode.
Terminate = 'c' # Terminate the server.
Restart = 'r' # Restart the server.
Disable = 'd' # Disable the server.
Suspend = 'u' # Suspend the server.
Metrics = 'm' # Show Metrics.
Browser = 'B' # Open the default browser.
Help = 'H' # Show/hide help instructions.
OpenAPI = 'O' # Show/hide OpenAPI information.
Endpoints = 'E' # Show/hide endpoints.
Clear = 'L' # Clear the console output.
Quiet = 'Q' # Toggle quiet mode.
Terminate = 'C' # Terminate the server.
Restart = 'R' # Restart the server.
Disable = 'D' # Disable the server.
Suspend = 'P' # Suspend the server.
Metrics = 'M' # Show Metrics.
}
}
}
Expand Down Expand Up @@ -233,12 +233,12 @@ The console colors are fully customizable via the `Colors` section of the config
### **3. Interactive Controls**

- Control server behavior using keyboard shortcuts. For example:
- **Ctrl+c**: Gracefully terminate the server.
- **Ctrl+r**: Restart the server.
- **Ctrl+d**: Disable the server, preventing new requests.
- **Ctrl+u**: Suspend the server temporarily.
- **Ctrl+h**: Display or hide help instructions.
- **Ctrl+m**: Display the server metrics.
- **Ctrl+C**: Gracefully terminate the server.
- **Ctrl+R**: Restart the server.
- **Ctrl+D**: Disable the server, preventing new requests.
- **Ctrl+P**: Suspend the server temporarily.
- **Ctrl+H**: Display or hide help instructions.
- **Ctrl+M**: Display the server metrics.

### **4. OpenAPI Integration**

Expand Down
37 changes: 21 additions & 16 deletions examples/server.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@
}
}
AllowedActions = @{
Suspend = $true
Restart = $true
Timeout = @{
Suspend = 30
Resume = 30
Suspend = $true # Enable or disable the suspend operation
Restart = $true # Enable or disable the restart operation
Disable = $true # Enable or disable the disable operation
DisableSettings = @{
RetryAfter = 3600 # Default retry time (in seconds) for Disable-PodeServer
MiddlewareName = '__Pode_Midleware_Code_503' # Name of the middleware scriptblock
}
Timeout = @{
Suspend = 30 # Maximum seconds to wait before suspending
Resume = 30 # Maximum seconds to wait before resuming
}
}
Console = @{
Expand Down Expand Up @@ -101,17 +106,17 @@
MetricsValue = 'Green' # The actual values displayed in the Metrics section.
}
KeyBindings = @{ # Define custom key bindings for controls.
Browser = 'b' # Open the default browser.
Help = 'h' # Show/hide help instructions.
OpenAPI = 'o' # Show/hide OpenAPI information.
Endpoints = 'e' # Show/hide endpoints.
Clear = 'l' # Clear the console output.
Quiet = 't' # Toggle quiet mode.
Terminate = 'c' # Terminate the server.
Restart = 'r' # Restart the server.
Disable = 'd' # Disable the server.
Suspend = 'u' # Suspend the server.
Metrics = 'm' # Show Metrics.
Browser = 'B' # Open the default browser.
Help = 'H' # Show/hide help instructions.
OpenAPI = 'O' # Show/hide OpenAPI information.
Endpoints = 'E' # Show/hide endpoints.
Clear = 'L' # Clear the console output.
Quiet = 'Q' # Toggle quiet mode.
Terminate = 'C' # Terminate the server.
Restart = 'R' # Restart the server.
Disable = 'D' # Disable the server.
Suspend = 'P' # Suspend the server.
Metrics = 'M' # Show Metrics.
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/Private/Console.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -971,17 +971,17 @@ function Get-PodeDefaultConsole {
}

KeyBindings = @{ # Define custom key bindings for controls.
Browser = 'b' # Open the default browser.
Help = 'h' # Show/hide help instructions.
OpenAPI = 'o' # Show/hide OpenAPI information.
Endpoints = 'e' # Show/hide endpoints.
Clear = 'l' # Clear the console output.
Quiet = 't' # Toggle quiet mode.
Terminate = 'c' # Terminate the server.
Restart = 'r' # Restart the server.
Disable = 'd' # Disable the server.
Suspend = 'u' # Suspend the server.
Metrics = 'm' # Show Metrics.
Browser = 'B' # Open the default browser.
Help = 'H' # Show/hide help instructions.
OpenAPI = 'O' # Show/hide OpenAPI information.
Endpoints = 'E' # Show/hide endpoints.
Clear = 'L' # Clear the console output.
Quiet = 'Q' # Toggle quiet mode.
Terminate = 'C' # Terminate the server.
Restart = 'R' # Restart the server.
Disable = 'D' # Disable the server.
Suspend = 'P' # Suspend the server.
Metrics = 'M' # Show Metrics.
}
}
}

0 comments on commit 8b03412

Please sign in to comment.