<%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 = libutil.isLite() isCloud = libutil.isCloud() canShowAppContext = 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', 'deployment/server/setup/data/inputs/remote_eventlogs': 'evt_logs_local', 'deployment/server/setup/data/inputs/remote_perfmon': 'perfmon_local', 'deployment/server/setup/data/inputs/remote_monitor': 'file_monitor', 'deployment/server/setup/data/inputs/tcp/remote_raw': 'tcp', 'deployment/server/setup/data/inputs/remote_udp': 'udp', 'deployment/server/setup/data/inputs/remote_script': 'scripts' } newInputLabel = { 'data/inputs/win-event-log-collections/localhost': _('New Event Log'), 'data/inputs/win-event-log-collections': _('New Event Log Collection'), 'data/inputs/monitor': _('New Local File & Directory'), 'data/inputs/win-perfmon': _('New Local Performance Monitoring'), 'data/inputs/win-wmi-collections': _('New Remote Performance Monitoring'), 'data/inputs/tcp/raw': _('New Local TCP'), 'data/inputs/udp': _('New Local UDP'), 'data/inputs/registry': _('New Registry Monitoring'), 'data/inputs/ad': _('New Active Directory Monitoring'), 'data/inputs/WinHostMon': _('New Local Host Monitoring'), 'data/inputs/WinNetMon': _('New Splunk Network Monitoring'), 'data/inputs/WinPrintMon': _('New Local Print Monitoring'), 'data/inputs/script': _('New Local Script'), 'deployment/server/setup/data/inputs/remote_eventlogs': _('New Remote Windows Event Log'), 'deployment/server/setup/data/inputs/remote_perfmon': _('New Remote Windows Performance Monitoring'), 'deployment/server/setup/data/inputs/remote_monitor': _('New Remote File & Directory'), 'deployment/server/setup/data/inputs/tcp/remote_raw': _('New Remote TCP'), 'deployment/server/setup/data/inputs/remote_udp': _('New Remote UDP'), 'deployment/server/setup/data/inputs/remote_script': ('New Remote Script'), 'saved/searches': _('New Search'), 'saved/eventtypes': _('New Event Type'), 'saved/fvtags': _('New Tag'), 'saved/ntags': _('New Tag'), 'admin/tags': _('New Tag'), 'data/props/fieldaliases': _('New Field Alias'), 'data/props/calcfields': _('New Calculated Field'), 'data/props/extractions': _('New Field Extraction'), 'data/transforms/extractions': _('New Field Transformation'), 'data/props/sourcetype-rename': _('New Sourcetype Rename'), 'data/ui/workflow-actions': _('New Workflow Action'), 'data/lookup-table-files': _('New Lookup Table File'), 'data/transforms/lookups': _('New Lookup Definition'), 'data/props/lookups': _('New Automatic Lookup'), 'data/ui/times': _('New Time Range'), 'data/ui/views': _('New View'), 'scheduled/views': _('New View PDF Schedule'), 'data/ui/nav': _('New Navigation Menu'), 'messages': _('New Bulletin Message'), 'admin/macros': _('New Search Macro'), 'admin/commandsconf': _('New Search Command'), 'data/outputs/tcp/server': _('New Forwarding Host'), 'data/inputs/tcp/cooked': _('New Receiving Port'), 'search/distributed/peers': _('New Search Peer'), 'authentication/users': _('New User'), 'authorization/roles': _('New Role'), 'authentication/providers/LDAP': _('New LDAP'), } %> <%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 as 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")) sort_dir = kwargs.get("sort_dir", "") sort_key = kwargs.get("sort_key", "") nss = appOptionList pwnrs = pwnrOptionList %>
% if 'sort_dir' in kwargs: % endif % if 'sort_key' in kwargs: % endif % if 'redirect' in kwargs: % endif ## EAI pagination <% try: count = int(entities.count) except Exception as e: count = 25 try: offset = int(entities.offset) except Exception as e: offset = 0 try: totalResults = int(entities.totalResults) except Exception as 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 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 % if canShowAppContext:
% if len(pwnrs) > 0:
% endif % endif % if canShowAppContext:
% 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 can_view_remote_apps and endpoint_path == 'apps/local': % if not isCloud or isDMCDisabled: <%doc>TRANS: Clicked to browse SplunkBase${_('Browse more apps')} % endif % endif % if showNewButton and hasCreateLink: % if endpoint_path == 'apps/local': % if not isCloud: ${_('Install app from file')} % endif <%doc>TRANS: Clicked to create a new entry${_('Create app')} % elif endpoint_path in newInputMap: <% inputMode = 2 if endpoint_path.startswith('deployment/server/setup') else 1 %> % if endpoint_path in newInputLabel: <%doc>TRANS: Clicked to create a new entry${newInputLabel[endpoint_path]} % else: <%doc>TRANS: Clicked to create a new entry${_('New')} % endif % elif endpoint_path.startswith('data/inputs/') and endpoint_path != 'data/inputs/tcp/cooked': % if endpoint_path in newInputLabel: <%doc>TRANS: Clicked to create a new entry${newInputLabel[endpoint_path]} % else: <%doc>TRANS: Clicked to create a new entry${_('New')} % endif % elif endpoint_path == 'data/props/extractions': %if not isLite: % if endpoint_path in newInputLabel: <%doc>TRANS: Clicked to create a new entry${newInputLabel[endpoint_path]} % else: <%doc>TRANS: Clicked to create a new entry${_('New')} % endif %endif <% appName = namespace if namespace != 'system' else 'search' %> ${_('Open Field Extractor')} % else: % if endpoint_path in newInputLabel: <%doc>TRANS: Clicked to create a new entry${newInputLabel[endpoint_path]} % else: <%doc>TRANS: Clicked to create a new entry${_('New')} % endif % endif % endif % if endpoint_path == 'admin/directory' and kwargs['can_reassign']: ${_('Reassign Knowledge Objects')} % 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
<% 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 in newInputLabel: <% newLabel = newInputLabel[endpoint_path] %> % else: <% newLabel = _('New') %> % endif % if endpoint_path == 'apps/local' and isLite: <%call expr="genListRows(namespace, uiHelper, entities, endpoint_path, kwargs, newLabel)"/> % else: <%call expr="genListRows(namespace, uiHelper, entities, endpoint_path, showAdvancedEdit, kwargs, newLabel)"/>
% 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
% if len(nss) == 1 and nss[0].get('value') == ns: % endif % for option in nss: % if option.get('value') != ns: % endif % endfor
${csrf_hidden_input()}
% endif