Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Update 0.4.1. Added enpoint: events and web filtring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifailon committed Jan 29, 2024
1 parent d349d35 commit 0c1e15b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

1 change: 0 additions & 1 deletion 0

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ When accessing the endpoint, there is a health check and a startup in case the p
`/service` - Checking status, starting and stopping services \
`/process` - Characteristics as well as starting and stopping processes \
`/events/list` - List of all Windows event providers \
`/events/<EventName>` - List of all events of the selected log with the ability to filter by content
`/events/<Event_Name>` - List of all events of the selected log with the ability to filter by content

- **POST**

`/apt/service/service_name` - Stop, start and restart services by name (only one at a time, not wildcard format), status is transmitted in the request header (**Status: <Stop/Start/Restart>**). Upon execution, the service status is returned in the format of a GET request. \
`/apt/process/process_name` - Check the number of running processes (**Status: Check**), stop a process by name (**Status: Stop**) and start a process (**Status: Start**). To start a process, you can use the function to search for an executable file in the file system by its name, but you can also pass the path to the executable file through the request header (e.g. **Path: C:\Program Files\qBittorrent\qbittorrent.exe**). \
`/apt/service/<Service_Name>` - Stop, start and restart services by name (only one at a time, not wildcard format), status is transmitted in the request header (**Status: <Stop/Start/Restart>**). Upon execution, the service status is returned in the format of a GET request. \
`/apt/process/<Process_Name>` - Check the number of running processes (**Status: Check**), stop a process by name (**Status: Stop**) and start a process (**Status: Start**). To start a process, you can use the function to search for an executable file in the file system by its name, but you can also pass the path to the executable file through the request header (e.g. **Path: C:\Program Files\qBittorrent\qbittorrent.exe**). \
`/api/file-delete` - Deleting the file or directory specified in the header **Path** one at a time

## 🚀 Install
Expand Down
1 change: 1 addition & 0 deletions WinAPI/Modules/Get-Event.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function Get-Event {
else {
Get-WinEvent -LogName $LogName | Select-Object @{Name="TimeCreated"; Expression={Get-Date -Date $($_.TimeCreated) -UFormat "%d.%m.%Y %T"}},
LevelDisplayName,
Level,
Message
}
}
16 changes: 15 additions & 1 deletion WinAPI/Source/WinAPI-0.4.1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ function Get-Event {
else {
Get-WinEvent -LogName $LogName | Select-Object @{Name="TimeCreated"; Expression={Get-Date -Date $($_.TimeCreated) -UFormat "%d.%m.%Y %T"}},
LevelDisplayName,
Level,
Message
}
}
Expand Down Expand Up @@ -925,9 +926,22 @@ function Start-Socket {
$GetEvent += "</tr>"
### Filling out the table
foreach ($Event in $Events) {
$Level = $Event.Level
if ($Level -eq 2) {
$level_color = "<font color='#FF6666'><b>$($Event.LevelDisplayName)</b></font>"
}
elseif ($Level -eq 3) {
$level_color = "<font color='#FFFF99'><b>$($Event.LevelDisplayName)</b></font>"
}
elseif (($Level -eq 4) -or ($Level -eq 0)) {
$level_color = "<font color='#99FF99'><b>$($Event.LevelDisplayName)</b></font>"
}
else {
$level_color = "$($Event.LevelDisplayName)"
}
$GetEvent += "<tr>"
$GetEvent += "<td>$($Event.TimeCreated)</td>"
$GetEvent += "<td>$($Event.LevelDisplayName)</td>"
$GetEvent += "<td>$level_color</td>"
$GetEvent += "<td>$($Event.Message)</td>"
$GetEvent += "</tr>"
}
Expand Down

0 comments on commit 0c1e15b

Please sign in to comment.