-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make compare API richer * Add compare view * Unified diff * Version chooser * Use a directive for syntax highlighting * Diff UI * Do not include empty diffs in resource_diff
- Loading branch information
1 parent
f8ca6ee
commit 7192158
Showing
11 changed files
with
393 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<div id="mainrow" class="row"> | ||
<div id="leftcol" class="col-md-4"> | ||
<div class="panel-group"> | ||
<div class="panel panel-info"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title"> | ||
From version | ||
</h4> | ||
</div> | ||
<ul class="list-group"> | ||
<li class="list-group-item">Terraform version: {{compare.stats.from.terraform_version}}</li> | ||
<li class="list-group-item">Serial: {{compare.stats.from.serial}}</li> | ||
<li class="list-group-item">Version: <select class="form-control" ng-model="fromVersion" ng-options="version as version.date for version in versions track by version.versionId"></select></li> | ||
<li class="list-group-item">Resource count: {{compare.stats.from.resource_count}}</li> | ||
</ul> | ||
</div> | ||
<div class="panel panel-info"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title"> | ||
To version | ||
</h4> | ||
</div> | ||
<ul class="list-group"> | ||
<li class="list-group-item">Terraform version: {{compare.stats.to.terraform_version}}</li> | ||
<li class="list-group-item">Serial: {{compare.stats.to.serial}}</li> | ||
<li class="list-group-item">Version: <select class="form-control" ng-model="toVersion" ng-options="version as version.date for version in versions track by version.versionId"></select></li> | ||
<li class="list-group-item">Resource count: {{compare.stats.to.resource_count}}</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="node" class="col-md-8" ng-if="compare.differences"> | ||
<h2 class="node-title">{{compare.stats.from.path}}</h2> | ||
<div class="panel-group"> | ||
<div class="panel panel-warning"> | ||
<div class="panel-heading"> | ||
<h4 id="panel-title-diff" class="panel-title"> | ||
<a data-toggle="collapse" data-target="#panel-body-diff"> | ||
Differences | ||
</a> | ||
<span id="badge-diff" class="badge">{{differences}}</span> | ||
</h4> | ||
</div> | ||
<div id="panel-body-diff" class="panel-collapse collapse in"> | ||
<div class="panel-body"> | ||
<div class="list-group resource" ng-repeat="(resource, diff) in compare.differences.resource_diff"> | ||
<div class="resource-title">{{resource}}</div> | ||
<hlcode lang="'diff'" code="diff.unified_diff"></hlcode> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="panel panel-danger"> | ||
<div class="panel-heading"> | ||
<h4 id="panel-title-in-old" class="panel-title"> | ||
<a data-toggle="collapse" data-target="#panel-body-in-old"> | ||
Only in serial {{compare.stats.from.serial}} | ||
</a> | ||
<span id="badge-diff" class="badge">{{only_in_old}}</span> | ||
</h4> | ||
</div> | ||
<div id="panel-body-in-old" class="panel-collapse collapse in"> | ||
<div class="panel-body"> | ||
<div class="list-group resource" ng-repeat="(resource, code) in compare.differences.only_in_old"> | ||
<div class="resource-title">{{resource}}</div> | ||
<hlcode lang="'ruby'" code="code"></hlcode> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="panel panel-success"> | ||
<div class="panel-heading"> | ||
<h4 id="panel-title-in-new" class="panel-title"> | ||
<a data-toggle="collapse" data-target="#panel-body-in-new"> | ||
Only in serial {{compare.stats.to.serial}} | ||
</a> | ||
<span id="badge-diff" class="badge">{{only_in_new}}</span> | ||
</h4> | ||
</div> | ||
<div id="panel-body-in-new" class="panel-collapse collapse in"> | ||
<div class="panel-body"> | ||
<div class="list-group resource" ng-repeat="(resource, code) in compare.differences.only_in_new"> | ||
<div class="resource-title">{{resource}}</div> | ||
<hlcode lang="'ruby'" code="code"></hlcode> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
if (! this.sh_languages) { | ||
this.sh_languages = {}; | ||
} | ||
sh_languages['diff'] = [ | ||
[ | ||
[ | ||
/(?=^[-]{3})/g, | ||
'sh_oldfile', | ||
1, | ||
1 | ||
], | ||
[ | ||
/(?=^[*]{3})/g, | ||
'sh_oldfile', | ||
3, | ||
1 | ||
], | ||
[ | ||
/(?=^[\d])/g, | ||
'sh_difflines', | ||
6, | ||
1 | ||
] | ||
], | ||
[ | ||
[ | ||
/^[-]{3}/g, | ||
'sh_oldfile', | ||
2 | ||
], | ||
[ | ||
/^[-]/g, | ||
'sh_oldfile', | ||
2 | ||
], | ||
[ | ||
/^[+]/g, | ||
'sh_newfile', | ||
2 | ||
], | ||
[ | ||
/^@@/g, | ||
'sh_difflines', | ||
2 | ||
] | ||
], | ||
[ | ||
[ | ||
/$/g, | ||
null, | ||
-2 | ||
] | ||
], | ||
[ | ||
[ | ||
/^[*]{3}[ \t]+[\d]/g, | ||
'sh_oldfile', | ||
4 | ||
], | ||
[ | ||
/^[*]{3}/g, | ||
'sh_oldfile', | ||
2 | ||
], | ||
[ | ||
/^[-]{3}[ \t]+[\d]/g, | ||
'sh_newfile', | ||
5 | ||
], | ||
[ | ||
/^[-]{3}/g, | ||
'sh_newfile', | ||
2 | ||
] | ||
], | ||
[ | ||
[ | ||
/^[\s]/g, | ||
'sh_normal', | ||
2 | ||
], | ||
[ | ||
/(?=^[-]{3})/g, | ||
'sh_newfile', | ||
-2 | ||
] | ||
], | ||
[ | ||
[ | ||
/^[\s]/g, | ||
'sh_normal', | ||
2 | ||
], | ||
[ | ||
/(?=^[*]{3})/g, | ||
'sh_newfile', | ||
-2 | ||
], | ||
[ | ||
/^diff/g, | ||
'sh_normal', | ||
2 | ||
] | ||
], | ||
[ | ||
[ | ||
/^[\d]/g, | ||
'sh_difflines', | ||
2 | ||
], | ||
[ | ||
/^[<]/g, | ||
'sh_oldfile', | ||
2 | ||
], | ||
[ | ||
/^[>]/g, | ||
'sh_newfile', | ||
2 | ||
] | ||
] | ||
]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.