<%namespace file="_helpers.html" import="genListRows"/> <%namespace file="../lib.html" import="stylesheet_tags"/> <%namespace file="../lib.html" import="csrf_hidden_input"/> <%namespace name="helpers" file="_helpers.html"/> <% import copy import urllib as url import splunk.util as util import splunk.appserver.mrsparkle.lib.paginator as paginator from splunk.appserver.mrsparkle.lib.msg_pool import MsgPoolMgr, UI_MSG_POOL from splunk.appserver.mrsparkle.lib import util as libutil sessionId = cherrypy.session.id header = _(uiHelper["header"]) if uiHelper.get('header') else _("You do not have permission to access the configuration for this page.") introText = _(uiHelper['introText']) if uiHelper.get("introText") else '' deleteButtonText = _(uiHelper['deleteButtonText']) if uiHelper.get("deleteButtonText") else _("Delete") entitiesLen = -1 auth_change_confirm = _("Are you sure you want to switch authentication systems?") delete_confirm = _('Are you sure you want to delete: "%s"?') delete_confirm_file_input = _('Are you sure you want to remove this file input: "%s"? Once removed, Splunk will no longer index data from this source.') unembed_confirm = _('Are you sure you no longer want to share this report outside of Splunk?') try: entitiesLen = len(entities) except: pass # Build breadcrumbs string for passoff to appinstall page this_url = libutil.strip_url(libutil.current_url_path(include_qs=True)) child_breadcrumbs = libutil.complete_breadcrumb(breadcrumbs, this_url) child_breadcrumbs_string = libutil.build_breadcrumbs_string(child_breadcrumbs) %> <%call expr="stylesheet_tags(cssFiles)">
% if endpoint_path: <% msg_obj = MsgPoolMgr.get_poolmgr_instance()[UI_MSG_POOL].pop(msgid) %> % if msg_obj: <%helpers:message content="${msg_obj.text}" level="${msg_obj.severity}" msg_obj="${msg_obj}"/> % endif % if len(uiHelper) == 0: <%helpers:message content="There was an error retrieving the configuration, can not process this page." level="error"/> % endif ## Filter controls <% search = kwargs.get("search", "") pwnr = kwargs.get("pwnr", "-") ns = kwargs.get("ns", namespace) app_only = util.normalizeBoolean(kwargs.get("app_only", "0")) nss = appOptionList pwnrs = pwnrOptionList %>
% if 'sort_dir' in kwargs: % endif % if 'sort_key' in kwargs: % endif ## EAI pagination <% try: count = int(entities.count) except Exception, e: count = 25 try: offset = int(entities.offset) except Exception, e: offset = 0 try: totalResults = int(entities.totalResults) except Exception, e: totalResults = 0 newOffset = count + offset prevOffset = 0 if ( (offset - count) < 0 ) else (offset - count) spanStart = 1 if offset == 0 else (offset + 1) spanEnd = ( offset + count ) sel = "" resPerPage = [10, 25, 50, 100] if (spanEnd > totalResults): lastPage = True spanEnd = totalResults max_pages = 10 pager = paginator.Google(totalResults, count, max_pages=max_pages, item_offset=offset) page_range = [] for page in pager.page_range: page_range.append( { 'number':page, 'offset':pager.page_item_offset(page), 'active':pager.is_active_page(page) } ) %>
% if util.normalizeBoolean(uiHelper.get("showAppContext", "")):
% if len(pwnrs) > 0:
% endif % endif
% if util.normalizeBoolean(uiHelper.get("showAppContext", "")):
${_('Learn more')}
% endif
% if endpoint_path == 'admin/LDAP-groups': |« ${_('Back to strategies')} % endif <% try: hasCreateLink = filter((lambda x: x[0] == 'create'), entities.links) except: hasCreateLink = False %> % if showNewButton and hasCreateLink: % endif
% if len(uiHelper) == 0: ${_('Click here to start over from the manager home page.') % dict(url=make_url("/manager"))} % endif % if introText != 'None':
${introText | h}
% endif
% if totalResults > 0:

${ungettext('Showing %(first)s-%(last)s of %(total)s item', 'Showing %(first)s-%(last)s of %(total)s items', totalResults) % dict(first=spanStart, last=spanEnd, total=totalResults)}

% endif
<% page_opts = copy.deepcopy(kwargs) %>
% for arg in kwargs: % if not arg.lower().startswith('api.'): <% continue %> % endif %try: %except: <%helpers:message content="There was an error parsing url arguments, can not process this page." level="error"/> <% return %> %endtry % endfor
<% page_class = endpoint_path.replace('/','-').lower() %>
% if entitiesLen >= 0:
${csrf_hidden_input()} % for arg in kwargs: %try: %except: <%helpers:message content="There was an error parsing url arguments, can not process this page." level="error"/> <% return %> %endtry % endfor <%call expr="genListRows(namespace, uiHelper, entities, endpoint_path, kwargs)"/>
% endif
% if (totalResults > count) :

${ungettext('Showing %(first)s-%(last)s of %(total)s item', 'Showing %(first)s-%(last)s of %(total)s items', totalResults) % dict(first=spanStart, last=spanEnd, total=totalResults)}

<% page_opts = copy.deepcopy(kwargs) %>
% endif
${csrf_hidden_input()}
% endif