layout_base.jinja2
116 lines
| 5.3 KiB
| text/plain
|
TextLexer
r0 | {% import 'widgets.jinja2' as widgets %} | |||
<!DOCTYPE html> | ||||
r62 | <html {% block ng_controller %}{% endblock %}> | |||
r0 | <head> | |||
<title>{% block title %}Application performance, exception and error monitoring for Python, | ||||
r28 | Django, Flask and Javascript - AppEnlight{% endblock %}</title> | |||
r0 | {% block meta %} | |||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | ||||
<meta name="robots" content="all"> | ||||
<meta name="Description" | ||||
r28 | content="AppEnlight provides a helpful interface to let you and your team save time spent on debugging and reproducing issues from a production environment."> | |||
r0 | <meta name="Keywords" | |||
content="monitoring, debugging, alerting, errors, programming, python, ruby, django, flask, profiling"> | ||||
<meta name="Author" content="RhodeCode - sales@rhodecode.com"> | ||||
<meta name="Copyright" content="RhodeCode"> | ||||
<base href="{{ request.route_path('/') }}"> | ||||
<link rel="shortcut icon" href="{{ request.static_url('appenlight:webassets/appenlight/favicon.ico')}}"/> | ||||
{% endblock %} | ||||
{% block styles %} | ||||
<link href="{{ request.static_url('appenlight:webassets/appenlight/css/front.css', _query={'rev':css_hash}) }}" rel="stylesheet" type="text/css"/> | ||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||
{% endblock %} | ||||
{% block additional_styles %}{% endblock %} | ||||
<script type="text/javascript"> | ||||
var AE = {}; | ||||
AE.urls = {{ url_list|tojson|safe }}; | ||||
AE.ws_url = '{{ request.registry.settings['cometd.ws_url'] }}'; | ||||
AE.flash_messages = {{ flash_msgs|toJSONUnsafe }}; | ||||
AE.timeOptions = {{ h.time_options|toJSONUnsafe }}; | ||||
AE.plugins = {{ js_plugins|toJSONUnsafe }}; | ||||
</script> | ||||
{% if request.registry.settings.get('appenlight.public_api_key') %} | ||||
<script type="application/javascript"> | ||||
var initAppEnlight = function () { | ||||
if(this.readyState!='loading'){ | ||||
AppEnlight.init({ | ||||
apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}', | ||||
windowOnError: 1 // enable to hook to window.onerror | ||||
}); | ||||
// setting request info is completly optional | ||||
AppEnlight.setRequestInfo({ | ||||
server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}", | ||||
{% if request.user %} | ||||
username:'{{ request.user.user_name }}', | ||||
{% endif %} | ||||
ip: "{{ request.environ.get('REMOTE_ADDR', '') }}", | ||||
request_id:"{{ request.environ.get('appenlight.request_id', '') }}" | ||||
}); | ||||
AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'}); | ||||
AppEnlight.addGlobalExtra({some_key:'on every request'}); | ||||
} | ||||
}; | ||||
// load the script asynchroneously | ||||
var scrElem = document.createElement('script'); | ||||
scrElem.type = 'text/javascript'; | ||||
scrElem.async = true; | ||||
scrElem.onload = scrElem.onreadystatechange = initAppEnlight; | ||||
scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js"; | ||||
var p = document.getElementsByTagName('script')[0]; | ||||
p.parentNode.insertBefore(scrElem, p); | ||||
</script> | ||||
{% endif %} | ||||
<script src="{{ request.static_url('appenlight:webassets/appenlight/js/appenlight.js', _query={'rev':js_hash}) }}"></script> | ||||
{% for plugin in js_plugins %} | ||||
<script src="{{ request.static_url('appenlight:webassets/{}/js/{}'.format(plugin['name'], plugin['config']['src']), _query={'rev':js_hash}) }}"></script> | ||||
{% endfor %} | ||||
r62 | <script> | |||
var xhr = new XMLHttpRequest(); | ||||
xhr.open('GET', AE.urls.userSelf); | ||||
xhr.onload = function() { | ||||
if (xhr.status === 200) { | ||||
kickstartAE(JSON.parse(xhr.responseText)); | ||||
angular.bootstrap(document, ['appenlight']); | ||||
} | ||||
else { | ||||
kickstartAE(null); | ||||
angular.bootstrap(document, ['appenlight']); | ||||
} | ||||
}; | ||||
// do not run angular on register page | ||||
var noAngularRoutes = [ | ||||
AE.urls.otherRoutes.register, | ||||
AE.urls.otherRoutes.lostPassword, | ||||
AE.urls.otherRoutes.lostPasswordGenerate, | ||||
]; | ||||
shouldRunAngular = true; | ||||
for (var i=0; i< noAngularRoutes.length; i++){ | ||||
if (window.location.toString().indexOf(noAngularRoutes[i]) !== -1) { | ||||
shouldRunAngular = false; | ||||
} | ||||
} | ||||
if (shouldRunAngular) { | ||||
xhr.send(); | ||||
} | ||||
</script> | ||||
r0 | </head> | |||
<body class="{% block section_name %}{% endblock %} {% raw %}top-state-{{$state.current.name.split('.')[0].replace('.', '-').replace('.', '-')}} state-{{$state.current.name.replace('.', '-').replace('.', '-')}}{% endraw %} {% if request.user %}user-logged {% else %}user-unlogged{% endif %}" id="html_body"> | ||||
<div class="extra-deco1"></div> | ||||
<div class="extra-deco2"></div> | ||||
<div id="holder"> | ||||
{% include "/header.jinja2" with context %} | ||||
<div id="outer-content"> | ||||
{% block outer_content %}Content{% endblock %} | ||||
</div> | ||||
{% include "/footer.jinja2" %} | ||||
</div> | ||||
</body> | ||||
</html> | ||||