MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / panel

Function panel

web/pgadmin/tools/erd/__init__.py:517–581  ·  view source on GitHub ↗

This method calls index.html to render the erd tool. Args: panel_title: Title of the panel

(trans_id)

Source from the content-addressed store, hash-verified

515@permissions_required(AllPermissionTypes.tools_erd_tool)
516@pga_login_required
517def panel(trans_id):
518 """
519 This method calls index.html to render the erd tool.
520
521 Args:
522 panel_title: Title of the panel
523 """
524 params = {'trans_id': trans_id, }
525 if request.form:
526 for key, val in request.form.items():
527 params[key] = val
528
529 if request.args:
530 params.update({k: v for k, v in request.args.items()})
531
532 if 'gen' in params:
533 params['gen'] = True if params['gen'] == 'true' else False
534
535 # We need client OS information to render correct Keyboard shortcuts
536 user_agent = UserAgent(request.headers.get('User-Agent'))
537
538 """
539 Animations and transitions are not automatically GPU accelerated and by
540 default use browser's slow rendering engine. We need to set 'translate3d'
541 value of '-webkit-transform' property in order to use GPU. After applying
542 this property under linux, Webkit calculates wrong position of the
543 elements so panel contents are not visible. To make it work, we need to
544 explicitly set '-webkit-transform' property to 'none' for .ajs-notifier,
545 .ajs-message, .ajs-modal classes.
546
547 This issue is only with linux runtime application and observed in Query
548 tool and debugger. When we open 'Open File' dialog then whole Query tool
549 panel content is not visible though it contains HTML element in back end.
550
551 The port number should have already been set by the runtime if we're
552 running in desktop mode.
553 """
554 is_linux_platform = False
555
556 from sys import platform as _platform
557 if "linux" in _platform:
558 is_linux_platform = True
559
560 s = get_server(int(params['sid']))
561
562 if s:
563 params.update({
564 'bgcolor': s.bgcolor,
565 'fgcolor': s.fgcolor,
566 'client_platform': user_agent.platform,
567 'is_desktop_mode': app.PGADMIN_RUNTIME,
568 'is_linux': is_linux_platform
569 })
570
571 return render_template(
572 "erd/index.html",
573 connectionTitle=underscore_unescape(params['connectionTitle']),
574 params=json.dumps(params),

Callers

nothing calls this directly

Calls 4

get_serverFunction · 0.90
underscore_unescapeFunction · 0.90
updateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected