2007-07-16 13:26:37 +00:00
|
|
|
<?php
|
2011-05-11 09:48:51 +00:00
|
|
|
if (support("kill") && $_POST && !$error) {
|
2007-07-16 13:26:37 +00:00
|
|
|
$killed = 0;
|
|
|
|
foreach ((array) $_POST["kill"] as $val) {
|
2015-03-18 09:34:35 +00:00
|
|
|
if (kill_process($val)) {
|
2007-07-16 13:26:37 +00:00
|
|
|
$killed++;
|
|
|
|
}
|
|
|
|
}
|
2009-10-13 20:01:52 +00:00
|
|
|
queries_redirect(ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"]);
|
2007-07-16 13:26:37 +00:00
|
|
|
}
|
2009-07-20 12:12:55 +00:00
|
|
|
|
2008-04-10 14:37:10 +00:00
|
|
|
page_header(lang('Process list'), $error);
|
2007-07-16 13:26:37 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<form action="" method="post">
|
2018-01-12 12:54:08 +00:00
|
|
|
<table cellspacing="0" class="nowrap checkable">
|
2007-07-16 13:26:37 +00:00
|
|
|
<?php
|
2018-01-12 14:27:44 +00:00
|
|
|
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
2011-08-11 09:43:37 +00:00
|
|
|
// HTML valid because there is always at least one process
|
2010-12-10 16:08:07 +00:00
|
|
|
$i = -1;
|
2011-05-11 09:48:51 +00:00
|
|
|
foreach (process_list() as $i => $row) {
|
2013-07-24 23:26:41 +00:00
|
|
|
|
2007-07-16 13:26:37 +00:00
|
|
|
if (!$i) {
|
2013-04-18 00:57:14 +00:00
|
|
|
echo "<thead><tr lang='en'>" . (support("kill") ? "<th> " : "");
|
|
|
|
foreach ($row as $key => $val) {
|
2013-08-06 01:55:27 +00:00
|
|
|
echo "<th>$key" . doc_link(array(
|
|
|
|
'sql' => "show-processlist.html#processlist_" . strtolower($key),
|
|
|
|
'pgsql' => "monitoring-stats.html#PG-STAT-ACTIVITY-VIEW",
|
|
|
|
'oracle' => "../b14237/dynviews_2088.htm",
|
|
|
|
));
|
2013-04-18 00:57:14 +00:00
|
|
|
}
|
|
|
|
echo "</thead>\n";
|
2007-07-16 13:26:37 +00:00
|
|
|
}
|
2016-02-28 20:30:52 +00:00
|
|
|
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row[$jush == "sql" ? "Id" : "pid"], 0) : "");
|
2010-10-19 14:54:48 +00:00
|
|
|
foreach ($row as $key => $val) {
|
2012-05-10 21:07:34 +00:00
|
|
|
echo "<td>" . (
|
2013-07-24 23:26:41 +00:00
|
|
|
($jush == "sql" && $key == "Info" && preg_match("~Query|Killed~", $row["Command"]) && $val != "") ||
|
2012-05-10 21:07:34 +00:00
|
|
|
($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
|
|
|
|
($jush == "oracle" && $key == "sql_text" && $val != "")
|
2013-04-22 20:48:39 +00:00
|
|
|
? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>'
|
2012-05-10 21:07:34 +00:00
|
|
|
: nbsp($val)
|
|
|
|
);
|
2010-10-19 14:54:48 +00:00
|
|
|
}
|
|
|
|
echo "\n";
|
2007-07-16 13:26:37 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
<p>
|
2011-05-11 09:48:51 +00:00
|
|
|
<?php
|
|
|
|
if (support("kill")) {
|
2015-03-18 09:34:35 +00:00
|
|
|
echo ($i + 1) . "/" . lang('%d in total', max_connections());
|
2011-05-11 09:48:51 +00:00
|
|
|
echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
|
|
|
|
}
|
|
|
|
?>
|
2011-03-08 12:43:05 +00:00
|
|
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
2007-07-16 13:26:37 +00:00
|
|
|
</form>
|
2018-02-06 12:53:15 +00:00
|
|
|
<?php echo script("tableCheck();"); ?>
|