-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmethod_qm_stats.php
More file actions
100 lines (79 loc) · 2.53 KB
/
Copy pathmethod_qm_stats.php
File metadata and controls
100 lines (79 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
include "./page/common_code.php.inc";
include "./page/00header.php.inc";
?>
<h1>Method: QM.stats</h1>
<p>Extracts general reports from QueueMetrics</p>
<?php
if ( $_POST["op"] == "run" ) {
$dtFrom = $_POST["dtFrom"];
$dtTo = $_POST["dtTo"];
$queues = $_POST["queues"];
$agent = $_POST["agent"];
$req_blocks = generateRequestFromBlockList( $_POST["blocks"] );
$params = array(
new xmlrpcval($queues),
new xmlrpcval($qm_login),
new xmlrpcval($qm_pass),
new xmlrpcval(""),
new xmlrpcval(""),
new xmlrpcval($dtFrom),
new xmlrpcval($dtTo),
new xmlrpcval($agent),
$req_blocks
);
$out = queryServer( $qm_srv, $qm_port, $qm_webapp, "QM.stats", $params );
}
?>
<script>
function addValue() {
var val = $("#inputHelper").val();
var oltText = $("#blocks").val();
$( "#blocks" ).val( oltText + "\n" + val );
}
</script>
<form method="POST">
<div class="row">
<div class="span6">
<label>Date from</label>
<input <?= nameVal("dtFrom") ?> type="text"
placeholder="Format yyyy-mm-dd.hh:mm:ss"
class="input-xlarge">
<label>Date to</label>
<input <?= nameVal("dtTo") ?> type="text"
placeholder="Format yyyy-mm-dd.hh:mm:ss"
class="input-xlarge">
<label>Agent filter</label>
<input <?= nameVal("agent") ?> type="text"
placeholder="Agent code, or leave blank"
class="input-xlarge">
<br>
<!-- <span class="help-block">Example block-level help text here.</span> -->
<button type="submit" class="btn btn-primary btn-large">Run query</button>
</div>
<div class="span6">
<label>Blocks</label>
<textarea name="blocks" id="blocks"
placeholder="Format: DO.method"
rows="6"
class="input-xlarge"><?= $_POST["blocks"] ?></textarea>
<div class="input-append">
<input id="inputHelper" type="text" class="span3" style="margin: 0 auto;"
data-provide="typeahead" data-items="4"
data-source='[<?= dsOptions($qmstats_blocks) ?>]'>
<button class="btn" type="button" onclick="addValue();">Add</button>
</div>
<label>Queues (separate with a pipe)</label>
<input <?= nameVal("queues") ?> type="text"
placeholder="e.g A|B|C"
class="input-xlarge">
</div>
</div>
<input type="hidden" name="op" value="run">
</form>
<?php
include "./page/block_results.php.inc";
?>
<?php
include "./page/00footer.php.inc";
?>