Improve UI of config-diff

This commit is contained in:
鳥井 雪 2015-02-04 12:19:25 +09:00
parent 16464e7e34
commit dc35729c74
2 changed files with 12 additions and 13 deletions

View File

@ -8,9 +8,9 @@ module SettingHistoryConcern
end end
def show def show
@current = @fluentd.agent.config current = @fluentd.agent.config
target = @backup_file.content target = @backup_file.content
@sdiff = Diff::LCS.sdiff(@current.split("\n").map(&:rstrip), target.split("\n").map(&:rstrip)) @sdiff = Diff::LCS.sdiff(current.split("\n").map(&:rstrip), target.split("\n").map(&:rstrip))
end end
def reuse def reuse

View File

@ -14,21 +14,20 @@
%p= @backup_file.note.content %p= @backup_file.note.content
.row .row
.col-xs-6 .col-xs-12
%h2 Current %h2
%pre ="Target Config(#{params[:id]})"
= preserve do
= @current
.col-xs-6
%h2 Target
%pre %pre
= preserve do = preserve do
= @backup_file.content = @backup_file.content
.col-xs-12.diff .col-xs-12.diff
%h2 %h2
Diff: Diff:
current %p
= ".." diff between
= params[:id] = " "
= link_to "current conf", daemon_setting_path(@fluentd)
= " and "
= "target conf(#{params[:id]})"
= preserve render "diff" = preserve render "diff"