<%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?') isLite = (cherrypy.config['product_type'] == 'lite' or cherrypy.config['product_type'] == 'lite_free') canShowAppContext = (not isLite and util.normalizeBoolean(uiHelper.get("showAppContext", ""))) 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) newInputMap = { 'data/inputs/win-event-log-collections/localhost': 'evt_logs_local', 'data/inputs/win-event-log-collections': 'evt_logs_remote', 'data/inputs/monitor': 'file_monitor', 'data/inputs/win-perfmon': 'perfmon_local', 'data/inputs/win-wmi-collections': 'perfmon_remote', 'data/inputs/tcp/raw': 'tcp', 'data/inputs/udp': 'udp', 'data/inputs/registry': 'regmon', 'data/inputs/ad': 'admon', 'data/inputs/WinHostMon': 'hostmon', 'data/inputs/WinNetMon': 'netmon', 'data/inputs/WinPrintMon': 'printmon', 'data/inputs/script': 'scripts', 'deploymentsetup/app/data/inputs/remote_eventlogs': 'evt_logs_local', 'deploymentsetup/app/data/inputs/remote_perfmon': 'perfmon_local', 'deploymentsetup/app/data/inputs/remote_monitor': 'file_monitor', 'deploymentsetup/app/data/inputs/tcp/remote_raw': 'tcp', 'deploymentsetup/app/data/inputs/remote_udp': 'udp', 'deploymentsetup/app/data/inputs/remote_script': 'scripts' } %> <%call expr="stylesheet_tags(cssFiles)"> % if endpoint_path == 'apps/local' and isLite:
% else:
% endif % if endpoint_path: <% msg_obj = None try: msg_obj = MsgPoolMgr.get_poolmgr_instance()[UI_MSG_POOL].pop(msgid) except Exception, e: pass %> % 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 endpoint_path == 'apps/local' and isLite: % else:
% if canShowAppContext:
% if len(pwnrs) > 0:
% endif % endif
% if canShowAppContext:
${_('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:
% if endpoint_path == 'apps/local': <%doc>TRANS: Clicked to browse SplunkBase${_('Browse more apps')} ${_('Install app from file')} <%doc>TRANS: Clicked to create a new entry${_('Create app')} % elif endpoint_path in newInputMap: <% inputMode = 2 if endpoint_path.startswith('deploymentsetup') else 1 %> <%doc>TRANS: Clicked to create a new entry${_('New')} % elif endpoint_path.startswith('data/inputs/') and endpoint_path != 'data/inputs/tcp/cooked': <%doc>TRANS: Clicked to create a new entry${_('New')} % elif endpoint_path == 'data/props/extractions': %if not isLite: <%doc>TRANS: Clicked to create a new entry${_('New')} %endif ${_('Open Field Extractor')} % else: <%doc>TRANS: Clicked to create a new entry${_('New')} % endif
% 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 % endif
<% 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 % if endpoint_path == 'apps/local' and isLite: <%call expr="genListRows(namespace, uiHelper, entities, endpoint_path, kwargs)"/> % else: <%call expr="genListRows(namespace, uiHelper, entities, endpoint_path, kwargs)"/>
% endif
% endif
% if (totalResults > count) and not (endpoint_path == 'apps/local' and isLite):

${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