Skip to content

Commit

Permalink
Add ability to remove commands from history list of drop-down terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Rostovtsev committed Nov 19, 2017
1 parent d09ca04 commit d270dbf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
32 changes: 24 additions & 8 deletions authentic-lib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,9 @@ sub get_sysinfo_vars
use Version::Compare;

# Build version response message
if (Version::Compare::version_compare(replace('git-', '', $remote_version), replace('git-', '', $installed_version)) == 1) {
if (Version::Compare::version_compare(replace('git-', '', $remote_version), replace('git-', '', $installed_version))
== 1)
{
my $git_version_remote = $remote_version =~ /-git-/;
my $remote_version_tag = $remote_version;
my @_remote_version_tag = split /-/, $remote_version_tag;
Expand Down Expand Up @@ -1197,10 +1199,12 @@ sub get_sysinfo_vars
foreach my $t (@{ $info->{'cputemps'} }) {
$cpu_temperature .=
'<span class="badge-custom badge-drivestatus badge-cpustatus" data-stats="cpu" style="margin-right:3px; margin-bottom: 3px"> Core '
. $t->{'core'}
. ': ' . (get_module_config_data('system-status', 'collect_units') ?
(int(($t->{'temp'} * 9.0 / 5) + 32) . "&#176;F") :
(int($t->{'temp'}) . '&#176;C ')) .
. $t->{'core'} . ': '
.
( get_module_config_data('system-status', 'collect_units') ?
(int(($t->{'temp'} * 9.0 / 5) + 32) . "&#176;F") :
(int($t->{'temp'}) . '&#176;C ')
) .
'</span>' .
($__settings{'settings_sysinfo_drive_status_on_new_line'} eq 'true' ? '<br>' : '&nbsp;');
}
Expand All @@ -1223,9 +1227,12 @@ sub get_sysinfo_vars
}
$hdd_temperature .=
'<span class="badge-custom badge-drivestatus" data-stats="drive" style="margin-right:3px; margin-bottom: 3px">'
. $short . ': ' . (get_module_config_data('system-status', 'collect_units') ?
(int(($t->{'temp'} * 9.0 / 5) + 32) . "&#176;F") :
(int($t->{'temp'}) . '&#176;C ')) .
. $short . ': '
.
( get_module_config_data('system-status', 'collect_units') ?
(int(($t->{'temp'} * 9.0 / 5) + 32) . "&#176;F") :
(int($t->{'temp'}) . '&#176;C ')
) .
$emsg . '</span>' .
($__settings{'settings_sysinfo_drive_status_on_new_line'} eq 'true' ? '<br>' : '&nbsp;');
}
Expand Down Expand Up @@ -2714,6 +2721,15 @@ sub get_xhr_request
} elsif ($in{'xhr-tmp_var_action'} eq 'get') {
print get_tmp_var($in{'xhr-tmp_var_name'}, $in{'xhr-tmp_var_keep'});
}
} elsif ($in{'xhr-shell-pop'}) {
my $file = "$config_directory/shell/previous.$remote_user";
my $index = (int($in{'xhr-shell-pop'}) - 1);
my $history = read_file_lines($file);
if (@$history[$index]) {
splice(@$history, $index, 1);
flush_file_lines($file);
print 1;
}
} elsif ($in{'xhr-get_autocompletes'} eq '1') {
my @data =
get_autocomplete_shell($in{'xhr-get_autocomplete_type'}, $in{'xhr-get_autocomplete_string'});
Expand Down
4 changes: 2 additions & 2 deletions unauthenticated/js/bundle.min.js

Large diffs are not rendered by default.

0 comments on commit d270dbf

Please sign in to comment.