Source

eyes / eyeswebapp / templates / core / monitor_list.html

{% extends 'base.html' %}
{% load eyes_filters %}

{% block title %}monitor list{% endblock %}

{% block pagetitle %}monitor list{% endblock %}

{% block content %}

<script type="text/javascript">
$(document).ready(function() {

	$("#tryit").click(function() {
		$.get("/core/ajax_monitor/{{plugin_name}}/", function(data) {
			var monitor_result = $.parseJSON(data);
			$("#monitor_output").html(monitor_result.output);
	    });
	});

	$("#help").click(function() {		
		var plugin_name = $("#select-monitor-type").val()
		// alert("/core/ajax_monitor/"+plugin_name+"/")
		$.get("/core/ajax_monitor/"+plugin_name+"/", function(data) {
			var monitor_result = $.parseJSON(data);
			$("#monitor_help_result").html(monitor_result.output);
	    });
		// alert('done...')
	})

	$("#tryit").click(function() {		
		var plugin_name = $("#select-monitor-type").val()
		$.post("/core/ajax_monitor/"+plugin_name+"/",
			$("#arguments").serialize(),
			function(data) {
				var monitor_result = $.parseJSON(data);
				$("#try_command").html(monitor_result.command);
				$("#try_error").html(monitor_result.error);
				$("#try_output").html(monitor_result.output);
			}
		);
	})

});
</script>

	<h3>Monitor Plugins</h3>

	<div data-role="fieldcontain">
		<label for="select-monitor-type" class="select">Choose monitor:</label>
		<select name="select-monitor-type" id="select-monitor-type">
			{% for plugin_name in plugin_list %}
			<option value="{{plugin_name}}">{{plugin_name}}</option>
			{% endfor %}			
		</select>
	</div>

	<div data-role="collapsible" data-collapsed="true" data-theme="b">
		<h3>Help</h3>
		<p><input type="button" data-icon="info" id="help" value="HELP"/></p>
		<pre id="monitor_help_result">...</pre>
	</div>
	
	<div data-role="collapsible" data-theme="b">
		<h3>Test</h3>
		<form id="arguments">
			<div><input type="text" name="argument"/></div>
			<div><input type="text" name="argument"/></div>
			<div><input type="text" name="argument"/></div>
			<div><input type="text" name="argument"/></div>
			<div><input type="button" data-icon="info" id="tryit" value="TRY"/></div>
		</form>
		<pre id="try_command"></pre>
		<pre id="try_error"></pre>
		<pre id="try_output"></pre>
	</div>

	
{% endblock %}