-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from innogames/servershell_diff_objects
Add diff command to servershell
- Loading branch information
Showing
9 changed files
with
142 additions
and
7 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,11 @@ | ||
let toggle_diff = function(element) { | ||
let button = $(element); | ||
|
||
if (button.attr('aria-pressed') === 'true') { | ||
$('tbody tr').show(); | ||
} | ||
else { | ||
$('tbody tr').hide(); | ||
$('tbody td.diff').parent('tr').show(); | ||
} | ||
}; |
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
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,47 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}Diff{% endblock %} | ||
|
||
{% block additional_styles %} | ||
<link rel="stylesheet" href="{{ STATIC_URL }}css/servershell.css"> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<button class="btn btn-primary" data-toggle="button" aria-pressed="false" onclick="toggle_diff(this);"> | ||
Differences only | ||
</button> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<table class="table table-sm table-borderless table-striped table-responsive"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Attribute</th> | ||
{% for host in hosts %} | ||
<th scope="col">{{ host.hostname }}</th> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in diff_data %} | ||
<tr> | ||
<td>{{ row.0 }}</td> | ||
{% with compare_to=row.1.0 %} | ||
{% for value in row.1 %} | ||
<td class="{% if value != compare_to %}diff{% else %}equal{% endif %}">{{ value }}</td> | ||
{% endfor %} | ||
{% endwith %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block additional_scripts %} | ||
<script src="{{ STATIC_URL }}js/diff.js"></script> | ||
{% endblock %} |
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
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