v8.0.1: Handle missing services and improve error handling

Enhanced error handling for missing NGINX and Keepalived services. Updated JavaScript to handle 404 errors and provide clearer messages in UI if services are not installed.
pull/399/head
Aidaho 2024-09-09 22:15:05 +03:00
parent 8ef721d72c
commit f66b3b70bd
1 changed files with 4 additions and 1 deletions

View File

@ -125,7 +125,10 @@ class ServiceView(MethodView):
out1 = out.split('\r')
try:
out1[0] = out1[0].split('/')[1]
out1[1] = out1[1].split(';')[1]
try:
out1[1] = out1[1].split(';')[1]
except IndexError:
out1[1] = out1[1].split(' ')[1]
except IndexError:
return ErrorResponse(error='NGINX service not found').model_dump(mode='json'), 404
try: