Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Nov 13, 2024
1 parent 82a6020 commit 49f962b
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 38 deletions.
2 changes: 1 addition & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ Date: 24th May 2020
### Enhancements
* #533: Support on states for inclusion/exlcusions when saving, and scopes on states
* #538: Support to batch log items together before sending them off to be recorded
* #540: Adds a Ctrl+B shortcutto open the server in the default browser
* #540: Adds a Ctrl+B shortcut to open the server in the default browser
* #542: Add new switch to help toggling of Status Page exception message
* #548: Adds new `Get-PodeSchedule` and `Get-PodeTimer` functions
* #549: Support for calculating a schedule's next trigger datetime
Expand Down
1 change: 1 addition & 0 deletions src/Locales/ar/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'جارٍ إعادة التشغيل'
suspendedMessage = 'معلق'
runningMessage = 'يعمل'
openHttpEndpointMessage = 'افتح أول نقطة نهاية HTTP في المتصفح الافتراضي.'
}
1 change: 1 addition & 0 deletions src/Locales/de/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Neustart'
suspendedMessage = 'Angehalten'
runningMessage = 'Läuft'
openHttpEndpointMessage = 'Öffnen Sie den ersten HTTP-Endpunkt im Standardbrowser.'
}
1 change: 1 addition & 0 deletions src/Locales/en-us/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Restarting'
suspendedMessage = 'Suspended'
runningMessage = 'Running'
openHttpEndpointMessage = 'Open the first HTTP endpoint in the default browser.'
}
1 change: 1 addition & 0 deletions src/Locales/en/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Restarting'
suspendedMessage = 'Suspended'
runningMessage = 'Running'
openHttpEndpointMessage = 'Open the first HTTP endpoint in the default browser.'
}
1 change: 1 addition & 0 deletions src/Locales/es/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Reiniciando'
suspendedMessage = 'Suspendido'
runningMessage = 'En ejecución'
openHttpEndpointMessage = 'Abrir el primer endpoint HTTP en el navegador predeterminado.'
}
1 change: 1 addition & 0 deletions src/Locales/fr/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Redémarrage'
suspendedMessage = 'Suspendu'
runningMessage = "En cours d'exécution"
openHttpEndpointMessage = 'Ouvrez le premier point de terminaison HTTP dans le navigateur par défaut.'
}
1 change: 1 addition & 0 deletions src/Locales/it/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Riavvio'
suspendedMessage = 'Sospeso'
runningMessage = 'In esecuzione'
openHttpEndpointMessage = 'Apri il primo endpoint HTTP nel browser predefinito.'
}
1 change: 1 addition & 0 deletions src/Locales/ja/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = '再起動中'
suspendedMessage = '一時停止中'
runningMessage = '実行中'
openHttpEndpointMessage = 'デフォルトのブラウザで最初の HTTP エンドポイントを開きます。'
}
1 change: 1 addition & 0 deletions src/Locales/ko/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = '재시작 중'
suspendedMessage = '일시 중지됨'
runningMessage = '실행 중'
openHttpEndpointMessage = '기본 브라우저에서 첫 번째 HTTP 엔드포인트를 엽니다.'
}
1 change: 1 addition & 0 deletions src/Locales/nl/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Herstarten'
suspendedMessage = 'Gepauzeerd'
runningMessage = 'Actief'
openHttpEndpointMessage = 'Open het eerste HTTP-eindpunt in de standaardbrowser.'
}
1 change: 1 addition & 0 deletions src/Locales/pl/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Ponowne uruchamianie'
suspendedMessage = 'Wstrzymany'
runningMessage = 'Działa'
openHttpEndpointMessage = 'Otwórz pierwszy punkt końcowy HTTP w domyślnej przeglądarce.'
}
1 change: 1 addition & 0 deletions src/Locales/pt/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = 'Reiniciando'
suspendedMessage = 'Suspenso'
runningMessage = 'Executando'
openHttpEndpointMessage = 'Abrir o primeiro endpoint HTTP no navegador padrão.'
}
1 change: 1 addition & 0 deletions src/Locales/zh/Pode.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,5 @@
restartingMessage = '正在重启'
suspendedMessage = '已暂停'
runningMessage = '运行中'
openHttpEndpointMessage = '在默认浏览器中打开第一个 HTTP 端点。'
}
5 changes: 3 additions & 2 deletions src/Private/Server.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ function Show-PodeConsoleInfo {
Write-PodeHost " Ctrl+C : $($Podelocale.GracefullyTerminateMessage)" -ForegroundColor Cyan
Write-PodeHost " Ctrl+R : $($Podelocale.RestartServerMessage)" -ForegroundColor Cyan
Write-PodeHost " Ctrl+U : $resumeOrSuspend" -ForegroundColor Cyan
if (Get-PodeEndpointUrl) {
Write-PodeHost ' Ctrl+B : Browser' -ForegroundColor Cyan

if ((Get-PodeEndpointUrl) -and !($PodeContext.Server.Suspended)) {
Write-PodeHost " Ctrl+B : $($Podelocale.OpenHttpEndpointMessage)" -ForegroundColor Cyan
}

if ($PodeContext.Server.Debug.Dump.Enabled) {
Expand Down
70 changes: 35 additions & 35 deletions src/Public/Core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -207,51 +207,50 @@ function Start-PodeServer {

# sit here waiting for termination/cancellation, or to restart the server
while ( !($PodeContext.Tokens.Cancellation.IsCancellationRequested)) {
try {
Start-Sleep -Seconds 1
Start-Sleep -Seconds 1

if (!$PodeContext.Server.DisableTermination) {
# get the next key presses
$key = Get-PodeConsoleKey
}
if (!$PodeContext.Server.DisableTermination) {
# get the next key presses
$key = Get-PodeConsoleKey
}

# check for internal restart
if (($PodeContext.Tokens.Restart.IsCancellationRequested) -or (Test-PodeRestartPressed -Key $key)) {
Restart-PodeInternalServer
}
# check for internal restart
if (($PodeContext.Tokens.Restart.IsCancellationRequested) -or (Test-PodeRestartPressed -Key $key)) {
Clear-PodeKeyPressed
Restart-PodeInternalServer
}

if (($PodeContext.Tokens.Dump.IsCancellationRequested) -or (Test-PodeDumpPressed -Key $key) ) {
Invoke-PodeDumpInternal
if ($PodeContext.Server.Debug.Dump.Param.Halt) {
Write-PodeHost -ForegroundColor Red 'Halt switch detected. Closing the application.'
break
}
if (($PodeContext.Tokens.Dump.IsCancellationRequested) -or (Test-PodeDumpPressed -Key $key) ) {
Clear-PodeKeyPressed
Invoke-PodeDumpInternal
if ($PodeContext.Server.Debug.Dump.Param.Halt) {
Write-PodeHost -ForegroundColor Red 'Halt switch detected. Closing the application.'
break
}
}

if (($PodeContext.Tokens.Suspend.SuspendResume) -or (Test-PodeSuspendPressed -Key $key)) {
if ( $PodeContext.Server.Suspended) {
Resume-PodeServerInternal
}
else {
Suspend-PodeServerInternal
}
if (($PodeContext.Tokens.Suspend.SuspendResume) -or (Test-PodeSuspendPressed -Key $key)) {
Clear-PodeKeyPressed
if ( $PodeContext.Server.Suspended) {
Resume-PodeServerInternal
}

# check for open browser
if (Test-PodeOpenBrowserPressed -Key $key) {
$url = Get-PodeEndpointUrl
if ($null -ne $url) {
Invoke-PodeEvent -Type Browser
Start-Process $url
}
else {
Suspend-PodeServerInternal
}
}

if (Test-PodeTerminationPressed -Key $key) {
break
# check for open browser
if (Test-PodeOpenBrowserPressed -Key $key) {
Clear-PodeKeyPressed
$url = Get-PodeEndpointUrl
if ($null -ne $url) {
Invoke-PodeEvent -Type Browser
Start-Process $url
}
}
finally {
Clear-PodeKeyPressed

if (Test-PodeTerminationPressed -Key $key) {
break
}
}

Expand All @@ -260,6 +259,7 @@ function Start-PodeServer {
Write-PodeHost $PodeLocale.iisShutdownMessage -NoNewLine -ForegroundColor Yellow
Write-PodeHost ' ' -NoNewLine
}

# Terminating...
Write-PodeHost $PodeLocale.terminatingMessage -NoNewLine -ForegroundColor Yellow
Invoke-PodeEvent -Type Terminate
Expand Down

0 comments on commit 49f962b

Please sign in to comment.