mitchell852 commented on a change in pull request #2907: WIP Using HTML5
Elements in CDN Snapshot Diffs
URL: https://github.com/apache/trafficcontrol/pull/2907#discussion_r223079334
##########
File path:
traffic_portal/app/src/modules/private/cdns/config/ConfigController.js
##########
@@ -56,33 +56,53 @@ var ConfigController = function(cdn, currentSnapshot,
newSnapshot, $scope, $stat
if (oldJSON) {
var diff = JsDiff.diffJson(oldJSON, newJSON);
diff.forEach(function(part){
- var partChanged = part.added || part.removed;
- if (!partChanged && part.count > (context * 2))
{
- var partArr = part.value.split("\n"),
- newArr = [];
- _.each(partArr, function(element,
index) {
- if (index < context || index >
partArr.length - context) {
- newArr.push(element);
- }
- });
- newArr.splice(context, 0,
"\n*****************\n* TRUNCATED *\n*****************\n");
Review comment:
the reason i added the TRUNCATED part is because without it, this view will
show the ENTIRE crconfig.json file which is massive (i think 9 mb or something)
and the browser will puke and lock up.
TRUNCATED basically truncates the non-changed parts rather than their entire
contents.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services