mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added native menu support in desktop mode. #5503
This commit is contained in:
@@ -98,6 +98,7 @@ window.onload = function(e){
|
||||
<div class="row"><div class="col-12 pg-sp-text">{{ _('Loading {0} v{1}...').format(config.APP_NAME, config.APP_VERSION) }}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
{% if current_app.PGADMIN_RUNTIME | string() == 'False' %}
|
||||
<nav class="navbar fixed-top navbar-expand-lg navbar-dark pg-navbar">
|
||||
<a class="navbar-brand pgadmin_header_logo" onClick="return false;" href="{{ '#' }}"
|
||||
title="{{ config.APP_NAME }} {{ _('logo') }}" aria-label="{ config.APP_NAME }} {{ _('logo') }}">
|
||||
@@ -173,6 +174,9 @@ window.onload = function(e){
|
||||
</nav>
|
||||
|
||||
<div id="dockerContainer" class="pg-docker"></div>
|
||||
{% else %}
|
||||
<div id="dockerContainer" class="pg-docker pg-docker-native"></div>
|
||||
{% endif %}
|
||||
|
||||
{% include 'browser/messages.html' %}
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ define('pgadmin.browser.utils',
|
||||
/* Add hooked-in panels by extensions */
|
||||
pgBrowser['panels_items'] = '{{ current_app.panels|tojson }}';
|
||||
|
||||
pgBrowser['MainMenus'] = [];
|
||||
|
||||
pgAdmin['csrf_token_header'] = '{{ current_app.config.get('WTF_CSRF_HEADERS')[0] }}';
|
||||
pgAdmin['csrf_token'] = '{{ csrf_token() }}';
|
||||
pgAdmin['server_mode'] = '{{ current_app.config.get('SERVER_MODE') }}';
|
||||
@@ -104,7 +106,9 @@ define('pgadmin.browser.utils',
|
||||
{% for key in ('File', 'Edit', 'Object' 'Tools', 'Management', 'Help') %}
|
||||
obj.add_menus({{ MENU_ITEMS(key, current_app.menu_items['%s_items' % key.lower()])}});
|
||||
{% endfor %}
|
||||
obj.create_menus();
|
||||
if('{{current_app.PGADMIN_RUNTIME}}' == 'False') {
|
||||
obj.create_menus();
|
||||
}
|
||||
} else {
|
||||
//recall after some time
|
||||
setTimeout(function(){ self.addMenus(obj); }, 3000);
|
||||
|
||||
Reference in New Issue
Block a user