mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-29 02:39:06 +01:00
Fix plugin Settings button to use main route instead of /settings/
- Change default manage_url from /plugins/{plugin}/settings/ to /plugins/{plugin}/
- Many plugins don't have a /settings/ route but have a main route
- Ensures Settings button works for plugins like examplePlugin that only have a main route
- Still respects settings_url and url from meta.xml if provided
This commit is contained in:
@@ -167,7 +167,11 @@ def installed(request):
|
||||
if plugin == 'emailMarketing':
|
||||
data['manage_url'] = '/emailMarketing/'
|
||||
elif os.path.exists(completePath):
|
||||
data['manage_url'] = f'/plugins/{plugin}/settings/'
|
||||
# Check if settings route exists, otherwise use main plugin URL
|
||||
settings_route = f'/plugins/{plugin}/settings/'
|
||||
main_route = f'/plugins/{plugin}/'
|
||||
# Default to main route - most plugins have a main route even if no settings
|
||||
data['manage_url'] = main_route
|
||||
else:
|
||||
data['manage_url'] = None
|
||||
|
||||
@@ -258,8 +262,12 @@ def installed(request):
|
||||
data['manage_url'] = url_elem.text
|
||||
else:
|
||||
# Default to /plugins/{plugin}/ for regular plugins
|
||||
# But emailMarketing is already handled above
|
||||
data['manage_url'] = f'/plugins/{plugin}/' if plugin != 'emailMarketing' else '/emailMarketing/'
|
||||
# Special handling for emailMarketing
|
||||
if plugin == 'emailMarketing':
|
||||
data['manage_url'] = '/emailMarketing/'
|
||||
else:
|
||||
# Default to main plugin route (most plugins work from main route)
|
||||
data['manage_url'] = f'/plugins/{plugin}/'
|
||||
|
||||
# Extract author information
|
||||
author_elem = root.find('author')
|
||||
|
||||
Reference in New Issue
Block a user