Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions src/uds/static/modern/main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/uds/static/modern/polyfills.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/uds/static/modern/scripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/uds/static/modern/styles.css

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions src/uds/static/modern/translations-fakejs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
// "Fake" javascript file for translations
// Typescript
gettext("Errors found");
gettext("Favorites");
gettext("Warning");
gettext("Service is in maintenance and cannot be executed");
gettext("Errors found");
gettext("We use cookies to authenticate users and remember preferences.");
gettext("If you do not agree, please");
gettext("leave this site");
gettext("I Accept");
gettext("Refuse and leave");
gettext("I Accept");
gettext("Learn more");
gettext("Cookie Policy");
gettext("seconds");
gettext("Username");
gettext("Password");
gettext("Domain");
gettext("Service is in maintenance");
gettext("This service is currently not accessible due to schedule restrictions.");
gettext("Launcher");
Expand All @@ -17,10 +24,11 @@ gettext("Reset service: ");
gettext("Service released");
gettext("Service reseted");
gettext("Are you sure?");
gettext("Username");
gettext("Password");
gettext("Domain");
gettext("seconds");
gettext("Favorites");
gettext("Warning");
gettext("Service is in maintenance and cannot be executed");
gettext("Errors found");
gettext("Errors found");
gettext("Launching service");
gettext("Invalid UDS URL");
gettext("Please wait until the service is launched.");
Expand All @@ -36,38 +44,16 @@ gettext("Remember that you will need the UDS client on your platform to access t
gettext("Error communicating with your service. Please, retry again.");
gettext("Your session has expired. Please, login again");
gettext("Error");
gettext("We use cookies to authenticate users and remember preferences.");
gettext("If you do not agree, please");
gettext("leave this site");
gettext("I Accept");
gettext("Refuse and leave");
gettext("I Accept");
gettext("Learn more");
gettext("Cookie Policy");
// HTML
gettext("UDS Client");
gettext("Download UDS client for your platform");
gettext("Downloads");
gettext("Always download the UDS actor matching your platform");
gettext("Username");
gettext("Password");
gettext("Authenticator");
gettext("Login");
gettext("An error has occurred");
gettext("Return");
gettext("You can access UDS Open Source code at");
gettext("UDS has been developed using these components:");
gettext("If you find that we missed any component, please let us know");
gettext("UDS Service launcher");
gettext("The service you have requested is being launched.");
gettext("Please, note that reloading this page will not work.");
gettext("To relaunch service, you will have to do it from origin.");
gettext("If the service does not launchs automatically, probably you dont have the UDS Client installed");
gettext("You can obtain it from the");
gettext("UDS Client download page");
gettext("Login Verification");
gettext("Remember me for");
gettext("Submit");
gettext("Close");
gettext("Yes");
gettext("No");
gettext("Please, enter access credentials");
gettext("Release service");
gettext("Reset service");
gettext("Connections");
gettext("Actions");
gettext("Filter");
gettext("Information");
gettext("Client IP");
gettext("Client IP");
Expand All @@ -78,19 +64,33 @@ gettext("Networks");
gettext("UDS networks for this IP");
gettext("Groups");
gettext("UDS groups for this user");
gettext("Filter");
gettext("Release service");
gettext("Reset service");
gettext("Connections");
gettext("Actions");
gettext("Dashboard");
gettext("Downloads");
gettext("Logout");
gettext("UDS Client");
gettext("About");
gettext("UDS Client");
gettext("About");
gettext("Please, enter access credentials");
gettext("Close");
gettext("Yes");
gettext("No");
gettext("UDS Service launcher");
gettext("The service you have requested is being launched.");
gettext("Please, note that reloading this page will not work.");
gettext("To relaunch service, you will have to do it from origin.");
gettext("If the service does not launchs automatically, probably you dont have the UDS Client installed");
gettext("You can obtain it from the");
gettext("UDS Client download page");
gettext("UDS Client");
gettext("Download UDS client for your platform");
gettext("You can access UDS Open Source code at");
gettext("UDS has been developed using these components:");
gettext("If you find that we missed any component, please let us know");
gettext("Downloads");
gettext("Always download the UDS actor matching your platform");
gettext("An error has occurred");
gettext("Return");
gettext("Login Verification");
gettext("Remember me for");
gettext("Submit");
gettext("Username");
gettext("Password");
gettext("Authenticator");
gettext("Login");
4 changes: 2 additions & 2 deletions src/uds/templates/uds/modern/index.html

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions src/uds/web/views/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ def user_service_status(
@weblogin_required()
@never_cache
def action(request: 'ExtendedHttpRequestWithUser', service_id: str, action_string: str) -> HttpResponse:
# favorite/unfavorite do not require an existing UserService,
# so handle them before the userservice lookup.
# service_id is 'F<pool_uuid>' or 'M<meta_uuid>' — strip the prefix.
if action_string in ('favorite', 'unfavorite'):
pool_uuid = service_id[1:]
if action_string == 'favorite':
request.user.add_favorite(pool_uuid)
else:
request.user.remove_favorite(pool_uuid)
return HttpResponse(json.dumps(None), content_type='application/json')

userservice = UserServiceManager.manager().locate_meta_service(request.user, service_id)
if not userservice:
userservice = UserServiceManager.manager().locate_user_service(request.user, service_id, create=False)
Expand All @@ -180,14 +191,6 @@ def action(request: 'ExtendedHttpRequestWithUser', service_id: str, action_strin
rebuild: bool = False
if userservice:
match action_string:
case 'favorite':
if userservice.user is None:
raise Exception('UserService is None!')
userservice.user.add_favorite(userservice.service_pool.uuid)
case 'unfavorite':
if userservice.user is None:
raise Exception('UserService is None!')
userservice.user.remove_favorite(userservice.service_pool.uuid)
case 'release':
if userservice.service_pool.allow_users_remove:
rebuild = True
Expand All @@ -213,9 +216,7 @@ def action(request: 'ExtendedHttpRequestWithUser', service_id: str, action_strin
),
types.log.LogSource.WEB,
)
# UserServiceManager.manager().requestLogoff(userService)
UserServiceManager.manager().reset(userservice)
# Rest, ignore
case _:
log.log(
userservice.service_pool,
Expand All @@ -225,14 +226,12 @@ def action(request: 'ExtendedHttpRequestWithUser', service_id: str, action_strin
)

if rebuild:
# Rebuild services data, but return only "this" service
for v in services.get_services_info_dict(request)['services']:
if v['id'] == service_id:
response = v
break

return HttpResponse(json.dumps(response), content_type="application/json")

return HttpResponse(json.dumps(response), content_type='application/json')

@never_cache
@auth.deny_non_authenticated # web_login_required not used here because this is not a web page, but js
Expand Down
Loading