%! import cgi import splunk.entity as en from splunk.appserver.mrsparkle.lib import util, cached, decorators %> <% appListing = [ {'label': appList[x]['label'], 'uri':make_url(['/app', x]), 'id': x} for x in appList if x!='launcher'] # Sort app list by label, ignoring case appListing.sort(lambda a, b: cmp(a['label'].lower(), b['label'].lower())) endpoints = set(cached.getEntities('data/ui/manager', count=-1, namespace='search')) canInstallApps = 'data_inputs_monitor' in endpoints # launcher/Home is displayed at the end of the menu if it's available if 'launcher' in appList: launcher = {'label': appList['launcher']['label'], 'uri':make_url(['/app', 'launcher']), 'id': 'launcher'} else: launcher = None userLabel = cherrypy.session['user']['name'] userFullName = cherrypy.session['user'].get('fullName', userLabel) %> <%page args="module"/> % if (module.get("mode") != "popup") : <%namespace name="lib" file="//lib.html" import="*"/> <%call expr="lib.add_script_block()"> Splunk.Module.loadParams.${module['id']}.appList = ${jsonify(appListing)}; Splunk.Module.loadParams.${module['id']}.launcherApp = ${jsonify(launcher)}; Splunk.Module.loadParams.${module['id']}.canInstallApps = ${jsonify(canInstallApps)}; %call> % if (module.get('mode', '').startswith("lite")): % if 'noback' not in module['mode'] and APP['is_visible']: « ${_("Back to %s") % _(APP['label'])|h} % else: « ${_("Back to %s") % _('Home')} % endif