Repository navigation
Expand file tree
/
Copy pathflowview_filters.php
More file actions
622 lines (534 loc) · 22.5 KB
/
Copy pathflowview_filters.php
File metadata and controls
622 lines (534 loc) · 22.5 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDTool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
chdir('../../');
require('./include/auth.php');
global $config;
require_once($config['base_path'] . '/plugins/flowview/setup.php');
require_once($config['base_path'] . '/plugins/flowview/includes/functions.php');
require_once($config['base_path'] . '/lib/time.php');
require_once($config['base_path'] . '/lib/timespan_settings.php');
flowview_connect();
set_default_action();
$sched_actions = array(
/* 2 => __('Send Now', 'flowview'), */
1 => __('Delete', 'flowview'),
3 => __('Disable', 'flowview'),
4 => __('Enable', 'flowview'),
5 => __('Materialize', 'flowview')
);
switch (get_request_var('action')) {
case 'actions':
actions_filters();
break;
case 'save':
save_filter();
break;
case 'sort_filter':
sort_filter();
break;
case 'check_material':
flowview_check_filter_save();
break;
case 'prune_shards':
prune_shards();
break;
case 'edit':
if (!isset_request_var('embed')) {
top_header();
}
edit_filter();
if (!isset_request_var('embed')) {
bottom_footer();
}
break;
default:
top_header();
show_filters();
bottom_footer();
break;
}
/**
* Removes the cached shards that match no Filter and returns to the Filters
* page. It is posted by the confirmation dialog of the Prune button. Called
* from this script's main request-dispatch switch when action=prune_shards.
*
* @return void
*/
function prune_shards(): void {
/* it removes data, so it is only done when posted from the dialog */
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
header('Location: flowview_filters.php?header=false');
exit;
}
$pruned = flowview_prune_shard_cache();
if ($pruned === null) {
raise_message('flowview_prune', __('The cache keys of the Filters could not be worked out, so nothing was pruned.', 'flowview'), MESSAGE_LEVEL_ERROR);
} else {
raise_message('flowview_prune', __('Pruned %s cached shard(s) that did not match any Filter.', number_format_i18n($pruned, 0), 'flowview'), MESSAGE_LEVEL_INFO);
}
header('Location: flowview_filters.php?header=false');
exit;
}
/**
* Handles the bulk-action confirmation page/submission for the saved
* filters list: on first display, renders a confirmation box listing
* the selected filters; on confirmed submission, performs the selected
* action (delete, disable, enable) for each selected filter. Called
* from this script's main request-dispatch switch when action=actions.
* @global array $sched_actions Map of drp_action value => action
* label, used to populate the
* confirmation box title.
* @global array $config Cacti global configuration array
* (declared but not directly used here).
*
* @return void
*/
function actions_filters(): void {
global $sched_actions, $config;
/* ================= input validation ================= */
get_filter_request_var('drp_action');
/* ==================================================== */
if (isset_request_var('selected_items')) {
$selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items'));
if ($selected_items != false) {
if (get_nfilter_request_var('drp_action') == '1') {
for ($i=0; $i<cacti_count($selected_items); $i++) {
flowview_db_execute('DELETE FROM plugin_flowview_queries WHERE id = ' . $selected_items[$i]);
}
} elseif (get_nfilter_request_var('drp_action') == '3') {
for ($i=0; $i<cacti_count($selected_items); $i++) {
flowview_db_execute("UPDATE plugin_flowview_queries SET enabled='' WHERE id = " . $selected_items[$i]);
}
} elseif (get_nfilter_request_var('drp_action') == '4') {
for ($i=0; $i<cacti_count($selected_items); $i++) {
flowview_db_execute("UPDATE plugin_flowview_queries SET enabled='on' WHERE id = " . $selected_items[$i]);
}
} elseif (get_nfilter_request_var('drp_action') == '5') {
$started = flowview_launch_materialize($selected_items);
$skipped = cacti_count($selected_items) - cacti_sizeof($started);
/* give the materialization time to register, so the page shows it as running */
if (cacti_sizeof($started)) {
sleep(2);
}
if (cacti_sizeof($started) && $skipped > 0) {
raise_message('flowview_materialize', __('Materialization of %d Filter(s) was started in the background. %d Filter(s) are already being materialized. Its results are reported in the Cacti log.', cacti_sizeof($started), $skipped, 'flowview'), MESSAGE_LEVEL_INFO);
} elseif (cacti_sizeof($started)) {
raise_message('flowview_materialize', __('Materialization of %d Filter(s) was started in the background. Its results are reported in the Cacti log.', cacti_sizeof($started), 'flowview'), MESSAGE_LEVEL_INFO);
} else {
raise_message('flowview_materialize', __('The selected Filter(s) are already being materialized. Please try again once that has finished.', 'flowview'), MESSAGE_LEVEL_WARN);
}
/* } elseif (get_nfilter_request_var('drp_action') == '2') {
for ($i=0; $i<cacti_count($selected_items); $i++) {
plugin_flowview_run_schedule($selected_items[$i]);
} */
}
}
header('Location: flowview_filters.php?header=false');
exit;
}
/* setup some variables */
$filter_list = '';
/* loop through each of the devices selected on the previous page and get more info about them */
foreach($_POST as $var => $val) {
if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) {
/* ================= input validation ================= */
input_validate_input_number($matches[1]);
/* ==================================================== */
$filter_list .= '<li>' . flowview_db_fetch_cell_prepared('SELECT name FROM plugin_flowview_queries
WHERE id = ?', [$matches[1]]) . '</li>';
$filter_array[] = $matches[1];
}
}
general_header();
form_start('flowview_filters.php');
html_start_box($sched_actions[get_nfilter_request_var('drp_action')], '60%', false, 3, 'center', '');
if (get_nfilter_request_var('drp_action') == '1') { /* Delete */
print "<tr>
<td colspan='2' class='textArea'>
<p>" . __('Click \'Continue\' to delete the following Filter(s) and all matching Filter.', 'flowview') . "</p>
<ul>$filter_list</ul>
</td>
</tr>";
} elseif (get_nfilter_request_var('drp_action') == '3') { /* Disable */
print "<tr>
<td colspan='2' class='textArea'>
<p>" . __('Click \'Continue\' to Disable the following Filters(s) and all matching Filter.', 'flowview') . "</p>
<ul>$filter_list</ul>
</td>
</tr>";
} elseif (get_nfilter_request_var('drp_action') == '4') { /* Enable */
print "<tr>
<td colspan='2' class='textArea'>
<p>" . __('Click \'Continue\' to Enable the following Filters(s).', 'flowview') . "</p>
<ul>$filter_list</ul>
</td>
</tr>";
} elseif (get_nfilter_request_var('drp_action') == '5') { /* Materialize */
print "<tr>
<td colspan='2' class='textArea'>
<p>" . __('Click \'Continue\' to Materialize the following Filter(s) in the background, with NAT on and off, for the entire range of flow data. Partitions that are already materialized and accurate are skipped. This can take a long time on large data sets. A Filter that is already being materialized is skipped.', 'flowview') . "</p>
<ul>$filter_list</ul>
</td>
</tr>";
}
if (!isset($filter_array)) {
print "<tr><td><span class='textError'>" . __('You must select at least one Filter.', 'flowview') . "</span></td></tr>\n";
$save_html = '';
} else {
$save_html = "<button type='submit' class='ui-button ui-corner-all ui-widget ui-state-active'>" . __esc('Continue', 'flowview') . '</button>';
}
print "<tr>
<td colspan='2' class='saveRow'>
<input type='hidden' name='action' value='actions'>
<input type='hidden' name='selected_items' value='" . (isset($filter_array) ? serialize($filter_array) : '') . "'>
<input type='hidden' name='drp_action' value='" . get_nfilter_request_var('drp_action') . "'>
<button type='button' class='ui-button ui-corner-all ui-widget cactiReturnTo'>" . __esc('Cancel', 'flowview') . "</button>
$save_html
</td>
</tr>";
html_end_box();
form_end();
bottom_footer();
}
/**
* Renders the main saved filters list page: validates/stores this
* view's filter request variables, then displays a sortable/paginated
* table of saved flow query filters along with the bulk-actions
* dropdown. Called from this script's main request-dispatch switch as
* the default view.
* @global array $config Cacti global configuration array;
* used to include the arrays library.
* @global array $sched_actions Map of drp_action value => action
* label, used for the bulk-actions
* dropdown.
* @global array $graph_timespans Reserved/declared for parity with
* other functions in this file; not
* used directly here.
* @global array $item_rows Cacti's standard row-count option
* list, used to populate the rows
* dropdown.
*
* @return void
*/
function show_filters(): void {
global $stat_report_array, $stat_columns_array, $print_report_array, $print_columns_array;
global $config, $sched_actions, $graph_timespans, $item_rows;
require($config['base_path'] . '/plugins/flowview/includes/arrays.php');
/* ================= input validation and session storage ================= */
$filters = array(
'rows' => [
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
],
'page' => [
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
],
'filter' => [
'filter' => FILTER_DEFAULT,
'pageset' => true,
'default' => ''
],
'sort_column' => array(
'filter' => FILTER_CALLBACK,
'default' => 'fq.name',
'options' => ['options' => 'sanitize_search_string']
),
'sort_direction' => array(
'filter' => FILTER_CALLBACK,
'default' => 'ASC',
'options' => ['options' => 'sanitize_search_string']
)
);
validate_store_request_vars($filters, 'sess_fvf');
/* ================= input validation ================= */
if (get_request_var('rows') == '-1' || isempty_request_var('rows')) {
$rows = read_config_option('num_rows_table');
} else {
$rows = get_request_var('rows');
}
$listeners = flowview_db_fetch_cell('SELECT COUNT(*) FROM plugin_flowview_devices');
if ($listeners) {
html_start_box(__('FlowView Filters', 'flowview'), '100%', false, 3, 'center', 'flowview_filters.php?action=edit');
} else {
html_start_box(__('FlowView Filters [ Add Devices before Filters ]', 'flowview'), '100%', false, 3, 'center', '');
}
?>
<tr class='even'>
<td>
<form id='form_filter' action='flowview_filters.php'>
<table class='filterTable'>
<tr>
<td>
<?php print __('Search', 'flowview');?>
</td>
<td>
<input type='text' id='filter' size='25' value='<?php print html_escape_request_var('filter');?>'>
</td>
<td>
<?php print __('Filters', 'flowview');?>
</td>
<td>
<select id='rows'>
<option value='-1'<?php print (get_request_var('rows') == '-1' ? ' selected>':'>') . __('Default', 'flowview');?></option>
<?php
if (cacti_sizeof($item_rows)) {
foreach ($item_rows as $key => $value) {
print "<option value='" . $key . "'"; if (get_request_var('rows') == $key) { print ' selected'; } print '>' . $value . "</option>\n";
}
}
?>
</select>
</td>
<td>
<span>
<button type='submit' id='go' class='ui-button ui-corner-all ui-widget ui-state-active' title='<?php print __esc('Set/Refresh Filters', 'flowview');?>'><?php print __esc('Go', 'flowview');?></button>
<button type='button' id='clear' class='ui-button ui-corner-all ui-widget' title='<?php print __esc('Clear Filters', 'flowview');?>'><?php print __esc('Clear', 'flowview');?></button>
<button type='button' id='prune' class='ui-button ui-corner-all ui-widget' title='<?php print __esc('Remove the cached shards that do not match any Filter', 'flowview');?>'><?php print __esc('Prune', 'flowview');?></button>
</span>
</td>
</tr>
</table>
</form>
<script type='text/javascript' <?php print plugin_flowview_csp_nonce(); ?>>
function applyFilter() {
strURL = 'flowview_filters.php?header=false';
strURL += '&filter='+escape($('#filter').val());
strURL += '&rows='+$('#rows').val();
loadPageNoHeader(strURL);
}
function clearFilter() {
strURL = 'flowview_filters.php?clear=true&header=false';
loadPageNoHeader(strURL);
}
$(function() {
$('#clear').on('click', function() {
clearFilter();
});
$('#rows').on('change', function() {
applyFilter();
});
$('#form_filter').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
});
</script>
</td>
</tr>
<?php
html_end_box();
if (get_request_var('filter') != '') {
$sql_where = 'WHERE fq.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%');
} else {
$sql_where = '';
}
$sql_order = get_order_string();
$sql_limit = ' LIMIT ' . ($rows*(get_request_var('page')-1)) . ',' . $rows;
$sql = "SELECT fq.*, fd.name AS device
FROM plugin_flowview_queries AS fq
LEFT JOIN plugin_flowview_devices AS fd
ON fq.device_id = fd.id
$sql_where
$sql_order
$sql_limit";
$filters = flowview_db_fetch_assoc($sql);
$total_rows = flowview_db_fetch_cell("SELECT COUNT(*)
FROM plugin_flowview_queries AS fq
LEFT JOIN plugin_flowview_devices AS fd
ON fq.device_id = fd.id
$sql_where");
$display_array = array(
'name' => array(
'display' => __('Filter Name', 'flowview'),
'align' => 'left',
'sort' => 'ASC'
),
'id' => array(
'display' => __('ID', 'flowview'),
'align' => 'right',
'sort' => 'ASC'
),
'nosort5' => array(
'display' => __('Materialization', 'flowview'),
'align' => 'center',
'tip' => __('Materialization pre-computes the results of a Filter for each flow partition, with NAT on and off, and stores them in the Parallel Query cache, so reports over older data open quickly. New partitions are materialized automatically once they stop receiving flows. Required means partitions that have rotated are not materialized yet, Running means a materialization is in progress, and Up to date means every rotated partition is materialized. Running: N is how many queries of the Filter are working now. The partition still receiving flows is not materialized, so it does not count.', 'flowview')
),
'device' => array(
'display' => __('Listener', 'flowview'),
'align' => 'left',
'sort' => 'ASC'
),
'nosort0' => array(
'display' => __('Report Type', 'flowview'),
'align' => 'left',
'sort' => 'ASC'
),
'nosort2' => array(
'display' => __('NAT Shards', 'flowview'),
'align' => 'right',
'tip' => __('The number of partitions of this Filter that are stored in the Parallel Query cache with NAT on.', 'flowview')
),
'nosort3' => array(
'display' => __('Non-NAT Shards', 'flowview'),
'align' => 'right',
'tip' => __('The number of partitions of this Filter that are stored in the Parallel Query cache with NAT off.', 'flowview')
),
'nosort4' => array(
'display' => __('Partitions', 'flowview'),
'align' => 'right',
'tip' => __('The total number of flow partitions, which is the most shards a Filter can have cached with or without NAT.', 'flowview')
),
'sortfield' => array(
'display' => __('Sort Field', 'flowview'),
'align' => 'right',
'sort' => 'ASC'
),
'nosort1' => array(
'display' => __('Resolution', 'flowview'),
'align' => 'right',
'sort' => 'ASC'
)
);
$nav = html_nav_bar('flowview_filters.php?filter=' . get_request_var('filter'), MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, cacti_sizeof($display_array), __('Filters', 'flowview'), 'page', 'main');
form_start('flowview_filters.php', 'chk');
print $nav;
html_start_box('', '100%', false, 3, 'center', '');
html_header_sort_checkbox($display_array, get_request_var('sort_column'), get_request_var('sort_direction'), false);
if (cacti_sizeof($filters)) {
$tables = flowview_get_partition_tables();
$cold = flowview_get_cold_partitions($tables);
$partitions = cacti_sizeof($tables);
$materializing = flowview_get_materializing_filters();
$requests = flowview_get_running_requests();
foreach ($filters as $filter) {
$md5sums = flowview_get_filter_md5sums((int) $filter['id']);
$cached = flowview_get_cached_shard_tables((int) $filter['id'], $md5sums);
$queries = flowview_count_running_queries($md5sums, $requests);
/* only the filters being materialized, or with a query running, are running */
$running = in_array((int) $filter['id'], $materializing, true) || $queries > 0;
$status = flowview_materialization_status($cached['nat'], $cached['non_nat'], $cold, $running);
$missing = flowview_get_missing_partitions($cached['nat'], $cached['non_nat'], $cold);
form_alternate_row('line' . $filter['id'], true);
form_selectable_cell('<a class="linkEditMain" href="' . html_escape('flowview_filters.php?action=edit&id=' . $filter['id']) . '">' . html_escape($filter['name']) . '</a>', $filter['id']);
form_selectable_cell($filter['id'], $filter['id'], '', 'right');
form_selectable_cell(trim(flowview_get_colored_materialization_status($status, $missing) . ' ' . flowview_get_colored_running_queries($queries, flowview_count_running_queries_by_mode($md5sums, $requests))), $filter['id'], '', 'center');
if (empty($filter['device'])) {
form_selectable_cell(__('All', 'flowview'), $filter['id']);
} else {
form_selectable_cell($filter['device'], $filter['id']);
}
if ($filter['statistics'] > 0) {
$type = $stat_report_array[$filter['statistics']];
$sort = $stat_columns_array[$filter['statistics']][$filter['sortfield']];
} else {
$type = $print_report_array[$filter['printed']];
$sort = $print_columns_array[$filter['printed']][$filter['sortfield']];
}
form_selectable_cell($type, $filter['id']);
form_selectable_cell(number_format_i18n(cacti_sizeof($cached['nat']), 0), $filter['id'], '', 'right');
form_selectable_cell(number_format_i18n(cacti_sizeof($cached['non_nat']), 0), $filter['id'], '', 'right');
form_selectable_cell(number_format_i18n($partitions, 0), $filter['id'], '', 'right');
form_selectable_cell($sort, $filter['id'], '', 'right');
form_selectable_cell($filter['resolve'], $filter['id'], '', 'right');
form_checkbox_cell($filter['name'], $filter['id']);
form_end_row();
}
}
html_end_box(false);
if (cacti_sizeof($filters)) {
print $nav;
}
draw_actions_dropdown($sched_actions);
form_end();
show_shard_cache_summary();
}
/**
* Shows how much of the Parallel Query cache matches a Filter and how much
* does not, which is what the Prune button removes.
*
* @return void
*/
function show_shard_cache_summary(): void {
$summary = flowview_get_shard_cache_summary();
$prune = false;
html_start_box('', '100%', false, 3, 'center', '');
if ($summary === null) {
$text = __('The cached shards of the Filters could not be told apart from the others, as the cache keys of a Filter could not be worked out.', 'flowview');
$dialog = __('The cache keys of the Filters could not be worked out, so nothing can be pruned right now. Check that each Filter has a valid Report.', 'flowview');
} else {
$text = __('Cached Shards: %s matching a Filter. %s not matching any Filter, which Prune removes.', number_format_i18n($summary['matching']['shards'], 0), number_format_i18n($summary['other']['shards'], 0), 'flowview');
if ($summary['other']['shards'] > 0) {
$prune = true;
$dialog = __('This removes %s cached shard(s) that do not match any Filter, for every Filter and every user. They come from Filters that were changed or deleted, and from reports with settings changed on the report page. The %s cached shard(s) of the Filters are kept. This can not be undone.', number_format_i18n($summary['other']['shards'], 0), number_format_i18n($summary['matching']['shards'], 0), 'flowview');
} else {
$dialog = __('Every cached shard matches a Filter. There is nothing to prune.', 'flowview');
}
}
print "<tr class='even'><td>" . html_escape($text) . '</td></tr>';
html_end_box();
$js = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP;
print "<div id='prune_dialog' style='display:none;' title='" . __esc('Prune Cached Shards', 'flowview') . "'><p>" . html_escape($dialog) . '</p></div>';
?>
<script type='text/javascript' <?php print plugin_flowview_csp_nonce(); ?>>
$(function() {
var canPrune = <?php print $prune ? 'true' : 'false';?>;
function pruneShards() {
var data = { action: 'prune_shards' };
if (typeof csrfMagicToken != 'undefined') {
data['__csrf_magic'] = csrfMagicToken;
}
$.post('flowview_filters.php', data).always(function() {
loadPageNoHeader('flowview_filters.php?header=false');
});
}
$('#prune').off('click').on('click', function() {
var buttons = [{
text: <?php print json_encode($prune ? __('Cancel', 'flowview') : __('Close', 'flowview'), $js);?>,
click: function() {
$(this).dialog('close');
}
}];
if (canPrune) {
buttons.push({
text: <?php print json_encode(__('Prune', 'flowview'), $js);?>,
'class': 'ui-state-active',
click: function() {
$(this).dialog('close');
pruneShards();
}
});
}
$('#prune_dialog').dialog({
modal: false,
resizable: false,
width: 500,
buttons: buttons
});
});
});
</script>
<?php
}