def register_preferences(self): """ register_preferences Register preferences for this module. """ # Register options for the PG and PPAS help paths self.help_preference = Preferences('paths', gettext('Paths')) self.pg_help_path = self.help_preference.register( 'help', 'pg_help_path', gettext("PostgreSQL Help Path"), 'text', 'http://www.postgresql.org/docs/$VERSION$/static/', category_label=gettext('Help'), help_str=gettext( 'Path to the PostgreSQL documentation. $VERSION$ will be replaced with the major.minor version number.' )) self.edbas_help_path = self.help_preference.register( 'help', 'edbas_help_path', gettext("EDB Advanced Server Help Path"), 'text', 'http://www.enterprisedb.com/docs/en/$VERSION$/pg/', category_label=gettext('Help'), help_str=gettext( 'Path to the EDB Advanced Server documentation. $VERSION$ will be replaced with the major.minor version number.' ))
def register_preferences(cls): paths = Preferences('paths', _('Paths')) for key in cls.registry: st = cls.registry[key] default_path = config.DEFAULT_BINARY_PATHS.get(st.stype, "") st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir', st.UTILITY_PATH_LABEL, 'text', default_path, category_label=_('Binary paths'), help_str=st.UTILITY_PATH_HELP )
def register_preferences(self): """ register_preferences Register preferences for this module. """ # Register options for the PG and PPAS help paths self.dashboard_preference = Preferences( 'dashboards', gettext('Dashboards') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'session_stats_refresh', gettext("Session statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'tps_stats_refresh', gettext("Transaction throughput refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'ti_stats_refresh', gettext("Tuples in refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'to_stats_refresh', gettext("Tuples out refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'bio_stats_refresh', gettext("Block I/O statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') )
def register_preferences(cls): paths = Preferences('paths', _('Paths')) for key in cls.registry: st = cls.registry[key] st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir', _("{0} Binary Path").format(st.desc), 'text', "", category_label=_('Binary paths'), help_str=_("Path to the {0} binary utilities.".format( st.desc)))
def register_preferences(cls): paths = Preferences('paths', _('Paths')) for key in cls.registry: st = cls.registry[key] default_path = config.DEFAULT_BINARY_PATHS[st.stype] or "" st.utility_path = paths.register( 'bin_paths', st.stype + '_bin_dir', _("{0} Binary Path").format(st.desc), 'text', default_path, category_label=_('Binary paths'), help_str=_( "Path to the directory containing the {0} utility programs (pg_dump, pg_restore etc).".format( st.desc ) ) )
def register_preferences(self): """ Register preferences for this module. """ self.misc_preference = Preferences('miscellaneous', _('Miscellaneous')) lang_options = [] for lang in config.LANGUAGES: lang_options.append({'label': config.LANGUAGES[lang], 'value': lang}) # Register options for the User language settings language = self.misc_preference.register( 'miscellaneous', 'user_language', _("User language"), 'options', 'en', category_label=_('User language'), options=lang_options )
def register_preferences(self): """ register_preferences Register preferences for this module. """ help_string = gettext('The number of seconds between graph samples.') # Register options for the PG and PPAS help paths self.dashboard_preference = Preferences('dashboards', gettext('Dashboards')) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'session_stats_refresh', gettext("Session statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=help_string) self.tps_stats_refresh = self.dashboard_preference.register( 'dashboards', 'tps_stats_refresh', gettext("Transaction throughput refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=help_string) self.ti_stats_refresh = self.dashboard_preference.register( 'dashboards', 'ti_stats_refresh', gettext("Tuples in refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=help_string) self.to_stats_refresh = self.dashboard_preference.register( 'dashboards', 'to_stats_refresh', gettext("Tuples out refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=help_string) self.bio_stats_refresh = self.dashboard_preference.register( 'dashboards', 'bio_stats_refresh', gettext("Block I/O statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=help_string) self.display_graphs = self.dashboard_preference.register( 'display', 'show_graphs', gettext("Show graphs?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, graphs ' 'will be displayed on dashboards.')) self.display_server_activity = self.dashboard_preference.register( 'display', 'show_activity', gettext("Show activity?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, activity tables ' 'will be displayed on dashboards.')) self.graph_data_points = self.dashboard_preference.register( 'display', 'graph_data_points', gettext("Show graph data points?"), 'boolean', False, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, data points will be ' 'visible on graph lines.')) self.graph_mouse_track = self.dashboard_preference.register( 'display', 'graph_mouse_track', gettext("Show mouse hover tooltip?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, tooltip will appear on mouse ' 'hover on the graph lines giving the data point ' 'details'))
def register_preferences(cls): paths = Preferences('paths', _('Paths')) bin_paths = copy.deepcopy(BINARY_PATHS) for key in cls.registry: st = cls.registry[key] if key not in ['pg', 'ppas']: continue if key == 'pg': # Set the DEFAULT_BINARY_PATHS if any ServerType.set_default_binary_path(bin_paths['pg_bin_paths'], key) st.utility_path = paths.register( 'bin_paths', 'pg_bin_dir', _("PostgreSQL Binary Path"), 'selectFile', json.dumps(bin_paths['pg_bin_paths']), category_label=_('Binary paths')) elif key == 'ppas': # Set the DEFAULT_BINARY_PATHS if any ServerType.set_default_binary_path(bin_paths['as_bin_paths'], key) st.utility_path = paths.register( 'bin_paths', 'ppas_bin_dir', _("EDB Advanced Server Binary Path"), 'selectFile', json.dumps(bin_paths['as_bin_paths']), category_label=_('Binary paths')) def path_converter(old_path): """ This function is used to convert old path to the new paths which are in JSON format. """ bin_paths_server_based = \ copy.deepcopy(BINARY_PATHS['pg_bin_paths']) if key == 'ppas': bin_paths_server_based = \ copy.deepcopy(BINARY_PATHS['as_bin_paths']) if not ServerType.is_binary_path_of_type_json(old_path): set_binary_path(old_path, bin_paths_server_based, key, set_as_default=True) else: bin_paths_server_based = json.loads(old_path) # Set the DEFAULT_BINARY_PATHS if any ServerType.set_default_binary_path(bin_paths_server_based, key) return json.dumps(bin_paths_server_based) # Run the migrate user preferences. paths.migrate_user_preferences(st.utility_path.pid, path_converter)
def register_preferences(self): """ register_preferences Register preferences for this module. """ # Register options for the PG and PPAS help paths self.dashboard_preference = Preferences( 'dashboards', gettext('Dashboards') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'session_stats_refresh', gettext("Session statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'tps_stats_refresh', gettext("Transaction throughput refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'ti_stats_refresh', gettext("Tuples in refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'to_stats_refresh', gettext("Tuples out refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'bio_stats_refresh', gettext("Block I/O statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=gettext('Graphs'), help_str=gettext('The number of seconds between graph samples.') ) self.display_graphs = self.dashboard_preference.register( 'display', 'show_graphs', gettext("Show graphs?"), 'boolean', True, category_label=gettext('Display'), help_str=gettext('If set to True, graphs ' 'will be displayed on dashboards.') ) self.display_server_activity = self.dashboard_preference.register( 'display', 'show_activity', gettext("Show activity?"), 'boolean', True, category_label=gettext('Display'), help_str=gettext('If set to True, activity tables ' 'will be displayed on dashboards.') )
def register_preferences(self): """ register_preferences Register preferences for this module. """ help_string = gettext('The number of seconds between graph samples.') # Register options for Dashboards self.dashboard_preference = Preferences('dashboards', gettext('Dashboards')) self.session_stats_refresh = self.dashboard_preference.register( 'dashboards', 'session_stats_refresh', gettext("Session statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=PREF_LABEL_REFRESH_RATES, help_str=help_string) self.tps_stats_refresh = self.dashboard_preference.register( 'dashboards', 'tps_stats_refresh', gettext("Transaction throughput refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=PREF_LABEL_REFRESH_RATES, help_str=help_string) self.ti_stats_refresh = self.dashboard_preference.register( 'dashboards', 'ti_stats_refresh', gettext("Tuples in refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=PREF_LABEL_REFRESH_RATES, help_str=help_string) self.to_stats_refresh = self.dashboard_preference.register( 'dashboards', 'to_stats_refresh', gettext("Tuples out refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=PREF_LABEL_REFRESH_RATES, help_str=help_string) self.bio_stats_refresh = self.dashboard_preference.register( 'dashboards', 'bio_stats_refresh', gettext("Block I/O statistics refresh rate"), 'integer', 1, min_val=1, max_val=999999, category_label=PREF_LABEL_REFRESH_RATES, help_str=help_string) self.display_graphs = self.dashboard_preference.register( 'display', 'show_graphs', gettext("Show graphs?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, graphs ' 'will be displayed on dashboards.')) self.display_server_activity = self.dashboard_preference.register( 'display', 'show_activity', gettext("Show activity?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, activity tables ' 'will be displayed on dashboards.')) self.long_running_query_threshold = self.dashboard_preference.register( 'display', 'long_running_query_threshold', gettext('Long running query thresholds'), 'threshold', '2|5', category_label=PREF_LABEL_DISPLAY, help_str=gettext('Set the warning and alert threshold value to ' 'highlight the long-running queries on the ' 'dashboard.')) # Register options for Graphs self.graphs_preference = Preferences('graphs', gettext('Graphs')) self.graph_data_points = self.graphs_preference.register( 'graphs', 'graph_data_points', gettext("Show graph data points?"), 'boolean', False, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, data points will be ' 'visible on graph lines.')) self.use_diff_point_style = self.graphs_preference.register( 'graphs', 'use_diff_point_style', gettext("Use different data point styles?"), 'boolean', False, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, data points will be visible ' 'in a different style on each graph lines.')) self.graph_mouse_track = self.graphs_preference.register( 'graphs', 'graph_mouse_track', gettext("Show mouse hover tooltip?"), 'boolean', True, category_label=PREF_LABEL_DISPLAY, help_str=gettext('If set to True, tooltip will appear on mouse ' 'hover on the graph lines giving the data point ' 'details')) self.graph_line_border_width = self.graphs_preference.register( 'graphs', 'graph_line_border_width', gettext("Chart line width"), 'integer', 1, min_val=1, max_val=10, category_label=PREF_LABEL_DISPLAY, help_str=gettext('Set the width of the lines on the line chart.'))