Skip to content

Commit

Permalink
Controller: Make exported SQL queries copyable
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Mar 21, 2024
1 parent c2e977b commit 8a17a4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Icingadb/Web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use ipl\Web\Control\PaginationControl;
use ipl\Web\Filter\QueryString;
use ipl\Web\Url;
use ipl\Web\Widget\CopyToClipboard;

class Controller extends CompatController
{
Expand Down Expand Up @@ -357,7 +358,9 @@ public function export(Query ...$queries)
$sql .= ' /* Unused values: "' . join('", "', $unused) . '" */';
}

$this->content->add(Html::tag('pre', $sql));
$pre = Html::tag('pre', $sql);
CopyToClipboard::attachTo($pre);
$this->content->add($pre);
}

return true;
Expand Down

0 comments on commit 8a17a4f

Please sign in to comment.