Skip to content

Commit

Permalink
conf: make file name copy / pastable
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 13, 2024
1 parent eff821d commit f8d93f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions plugins/plugins-available/conf/lib/Thruk/Controller/conf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2363,15 +2363,12 @@ sub _file_editor {
$c->stash->{'line'} = $c->req->parameters->{'line'} || 1;
$c->stash->{'back'} = $c->req->parameters->{'back'} || '';
$c->stash->{'file_link'} = $file->{'display'};
$c->stash->{'file_name'} = $file->{'display'};
$c->stash->{'file_name'} =~ s/^$files_root//gmx;
$c->stash->{'file_content'} = decode_utf8($file->get_new_file_content());
}
elsif(_is_extra_file($filename, $c->config->{'Thruk::Plugin::ConfigTool'}->{'edit_files'})) {
$file = Monitoring::Config::File->new($filename, [], $c->{'obj_db'}->{'coretype'}, 1);
$c->stash->{'file'} = $file;
$c->stash->{'file_link'} = $filename;
$c->stash->{'file_name'} = $filename;
$c->stash->{'line'} = $c->req->parameters->{'line'} || 1;
$c->stash->{'file_content'} = '';
if(-f $filename) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<i class="uil uil-angle-double-left"></i>Back
</a>
<h3>
<span>[% IF file_name.substr(0,1) != '/' %]/[% END %][% file_name %]</span>
<span id="filename" class="js-copy-to-clipboard">[% file_link | html %]</span>
[% IF file.readonly %]<span class="textHINT"> (read-only)</span>[% END %]
[% IF file_locked %] <br><a href="[% uri_with(c, unlock => 1) %]"><span class="textHINT"> File is currently locked by [% file_locked.user %]. Edit Anyway? (Last changed: [% date_format(c, file_locked.time) %]) </span></a>[% END %]
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<i class="uil uil-angle-double-left"></i>Back
</a>
<h3>
<span>[% IF file_name.substr(0,1) != '/' %]/[% END %][% file_name %]</span>
<span id="filename" class="js-copy-to-clipboard">[% file_link | html %]</span>
[% IF file.readonly %]<span class="textHINT"> (read-only)</span>[% END %]
[% IF file_locked %] <br><a href="[% uri_with(c, unlock => 1) %]"><span class="textHINT"> File is currently locked by [% file_locked.user %]. Edit Anyway? (Last changed: [% date_format(c, file_locked.time) %]) </span></a>[% END %]
</h3>
Expand Down

0 comments on commit f8d93f1

Please sign in to comment.