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
def show
@current = @fluentd.agent.config
current = @fluentd.agent.config
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
def reuse

View File

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