Compare commits
21
Commits
main
..
0cc2a7022c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cc2a7022c | ||
|
|
c23e289e0c | ||
|
|
fa4d3a80ae | ||
|
|
eb4b0b8575 | ||
|
|
983969ed9e | ||
|
|
86d4f8f1d3 | ||
|
|
0aa8955b4a | ||
|
|
a2354c2ba7 | ||
|
|
ea825f0190 | ||
|
|
a44108901e | ||
|
|
14782c06c4 | ||
|
|
fdcdca8e87 | ||
|
|
66556bf890 | ||
|
|
0511c74f0b | ||
|
|
92db21739a | ||
|
|
bc9408fc73 | ||
|
|
ebfcfb9f67 | ||
|
|
239341c032 | ||
|
|
b2a88d9a78 | ||
|
|
7be813c0aa | ||
|
|
8ad5b590de |
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.4
|
Metadata-Version: 2.4
|
||||||
Name: zhurnal
|
Name: zhurnal
|
||||||
Version: 0.2.0
|
Version: 0.1.0
|
||||||
Summary: Process monitoring and management web application
|
Summary: Process monitoring and management web application
|
||||||
Author: retoor
|
Author: retoor
|
||||||
Author-email: retoor@molodetz.nl
|
Author-email: retoor@molodetz.nl
|
||||||
@@ -8,7 +8,7 @@ Requires-Python: >=3.8
|
|||||||
Description-Content-Type: text/markdown
|
Description-Content-Type: text/markdown
|
||||||
Requires-Dist: aiohttp
|
Requires-Dist: aiohttp
|
||||||
Requires-Dist: setuptools
|
Requires-Dist: setuptools
|
||||||
Requires-Dist: app @ git+https://retoor.molodetz.nl/retoor/app.git
|
Requires-Dist: app@ git+https://retoor.molodetz.nl/retoor/app.git
|
||||||
|
|
||||||
# Zhurnal: Real-Time Process Monitoring Web Interface 🚀
|
# Zhurnal: Real-Time Process Monitoring Web Interface 🚀
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
aiohttp
|
aiohttp
|
||||||
setuptools
|
setuptools
|
||||||
app @ git+https://retoor.molodetz.nl/retoor/app.git
|
app@ git+https://retoor.molodetz.nl/retoor/app.git
|
||||||
|
|||||||
+7
-13
@@ -236,7 +236,7 @@ class Zhurnal(BaseApplication):
|
|||||||
for command, process_info in list(self.processes.items()):
|
for command, process_info in list(self.processes.items()):
|
||||||
try:
|
try:
|
||||||
# Get the subprocess
|
# Get the subprocess
|
||||||
process = process_info.get("process")
|
process = process_info.get('process')
|
||||||
if process and process.returncode is None:
|
if process and process.returncode is None:
|
||||||
log.info(f"Terminating process: {command}")
|
log.info(f"Terminating process: {command}")
|
||||||
try:
|
try:
|
||||||
@@ -299,7 +299,10 @@ class Zhurnal(BaseApplication):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Store process information
|
# Store process information
|
||||||
self.processes[command] = {"process": process, "name": process_name}
|
self.processes[command] = {
|
||||||
|
'process': process,
|
||||||
|
'name': process_name
|
||||||
|
}
|
||||||
|
|
||||||
log.info(f"Running process {process_name}: {command}")
|
log.info(f"Running process {process_name}: {command}")
|
||||||
|
|
||||||
@@ -317,9 +320,7 @@ class Zhurnal(BaseApplication):
|
|||||||
)
|
)
|
||||||
decoded_line = line.decode("utf-8", "ignore").strip()
|
decoded_line = line.decode("utf-8", "ignore").strip()
|
||||||
print(decoded_line)
|
print(decoded_line)
|
||||||
decoded_line = "".join(
|
decoded_line = "".join(c for c in decoded_line if c.isprintable())
|
||||||
c for c in decoded_line if c.isprintable()
|
|
||||||
)
|
|
||||||
|
|
||||||
# Broadcast to all WebSocket clients
|
# Broadcast to all WebSocket clients
|
||||||
for client in app.clients:
|
for client in app.clients:
|
||||||
@@ -345,13 +346,7 @@ class Zhurnal(BaseApplication):
|
|||||||
# Read stdout and stderr concurrently
|
# Read stdout and stderr concurrently
|
||||||
await asyncio.gather(
|
await asyncio.gather(
|
||||||
read_output(self, f"{process_name}:stdout", process, process.stdout),
|
read_output(self, f"{process_name}:stdout", process, process.stdout),
|
||||||
read_output(
|
read_output(self, f"{process_name}:stderr", process, process.stderr, is_stderr=True)
|
||||||
self,
|
|
||||||
f"{process_name}:stderr",
|
|
||||||
process,
|
|
||||||
process.stderr,
|
|
||||||
is_stderr=True,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wait for process to complete
|
# Wait for process to complete
|
||||||
@@ -427,6 +422,5 @@ def cli():
|
|||||||
|
|
||||||
app.run(host=args.host, port=args.port)
|
app.run(host=args.host, port=args.port)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cli()
|
cli()
|
||||||
|
|||||||
Reference in New Issue
Block a user