Diff2Html (CDrift)

In this example below you will see how to do a Diff2Html (CDrift) with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by lockenj, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright lockenj ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Diff2Html (CDrift)</title>
  
  
  <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.css'>

  
  
</head>

<body>

  
  <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html-ui.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.3.0/diff2html.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/lockenj/diff2html-cdrift-oZrZjP */
"use strict"
var loadGitHubScript = url => fetch(url).
  then(res => res.blob()).
  then(body => loadScript(URL.createObjectURL(body)));

var loadScript = url => new Promise(function(resolve, reject) {
  var script = document.createElement('script');
  script.src = url;
  script.onload = resolve;
  script.onerror = reject; // TODO Not sure it really works
  document.head.appendChild(script);
});

let createUnifiedDiffString = (beforeDtails,afterDetails) => {
  //BEFORE DETAILS
  let beforeDate = _.get(beforeDtails, "date","");
  if (beforeDate) {
    beforeDate = (new Date(beforeDtails.date)).toLocaleString();
  }
  let beforeContent = _.get(beforeDtails, "content", "").match(/.*\r?\n|.+$/g);

  //AFTER DETAILS
  let afterDate = _.get(afterDetails, "date","");
  if (afterDate) {
    afterDate = (new Date(afterDetails.date)).toLocaleString();
  }
  let afterContent = _.get(afterDetails, "content", "").match(/.*\r?\n|.+$/g);

  return difflib.unifiedDiff(beforeContent, afterContent, {
    fromfile: "Current Config",
    tofile: "Current Config",
    fromfileDate: beforeDate,
    tofileDate: afterDate,
    n: '2'
  });
};

// Usage
loadGitHubScript('https://raw.githubusercontent.com/qiao/difflib.js/master/dist/difflib-browser.js').then(() => {
 let unifiedDiff = createUnifiedDiffString(
    {
      date: Date.now(),
      content: `Current configuration : 10410 bytes
!
! Last configuration change at 17:31:09 UTC Fri Apr 7 2017 by gvoae
! NVRAM config last updated at 17:31:28 UTC Fri Apr 7 2017 by pod6user
!
version 15.5
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
service compress-config
service sequence-numbers
!
hostname LAX-VHE-01
!
boot-start-marker
boot-end-marker
!
!
security authentication failure rate 2 log
security passwords min-length 2
logging buffered 51200
!
aaa new-model
!
!
aaa authentication login default local
aaa authorization exec default local
!
!
!
!
!
aaa session-id common
ethernet lmi ce
!
!
!
!
!
!
no ip source-route
!
!
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain lookup
ip multicast-routing
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
chat-script lte "" "AT!CALL" TIMEOUT 60 "OK"
!
crypto pki server gn-local-rootca
 database archive pkcs12 password 7 00071A1507545A545C
 issuer-name CN=IWAN Local Root CA, OU=Certification Services ,OU=NET_135001, O=Glue Networks
 hash sha256
 lifetime crl 24
 lifetime ca-certificate 3650
 database url flash:
!
crypto pki trustpoint TP-self-signed-2465937345
 enrollment selfsigned
 subject-name cn=IOS-Self-Signed-Certificate-2465937345
 revocation-check none
 rsakeypair TP-self-signed-2465937345
!
crypto pki trustpoint gn-local-rootca
 revocation-check none
 rsakeypair gn-local-rootca 2048
!
crypto pki trustpoint gvo-pki_135001
 enrollment retry count 100
 enrollment url http://207.231.84.12:80
 serial-number
 fingerprint 2EF5C6633BD5D2DA8C6C03AB33C95112
 subject-name OU=NET_135001 O=Glue Networks
 revocation-check none
 rsakeypair gvo-pki_135001 2048
!
!
!
crypto pki certificate map gvo-cert-map_135001 10
 subject-name co ou = net_135001
!
crypto pki certificate chain TP-self-signed-2465937345
 certificate self-signed 01
crypto pki certificate chain gn-local-rootca
 certificate ca 01
crypto pki certificate chain gvo-pki_135001
 certificate 02
 certificate ca 01
license udi pid CISCO1921/K9 sn FTX1808827Q
!
!
file prompt quiet
username glue_sqa privilege 15 secret 5 $1$c6ql$r2cwMpKHm0HGc9Owr6R.X1
username gvoae privilege 15 secret 5 $1$8rjn$13nCH2KeMVRCL1nu9GwKH/
username installer privilege 15 secret 5 $1$5qgy$O5p1cq60mr1KcakvX3ptY.
username operator view operator secret 5 $1$02q9$Pv10x7CnvovJnKJJja8uK0
username jumpuser secret 5 $1$8amb$mhHHPyq240pHpeuvwqtsy0
!
redundancy
!
!
!
!
!
controller Cellular 0/0
 lte modem link-recovery rssi onset-threshold -110
 lte modem link-recovery monitor-timer 20
 lte modem link-recovery wait-timer 10
 lte modem link-recovery debounce-count 6
!
!
!
crypto isakmp policy 5
 encr aes 256
 group 2
crypto isakmp keepalive 30 10 periodic
crypto isakmp nat keepalive 10
crypto isakmp profile ike-profile_135001
   ca trust-point gvo-pki_135001
   match certificate gvo-cert-map_135001
!
!
crypto ipsec transform-set aes256-sha1 esp-aes 256 esp-sha-hmac
 mode transport
!
!
crypto ipsec profile ipsec-profile_135001
 set security-association lifetime seconds 43200
 set security-association idle-time 300
 set transform-set aes256-sha1
 set isakmp-profile ike-profile_135001
!
!
!
!
!
!
interface Loopback0
 description LAN Template Interface MGNT1
 ip address 10.10.10.0 255.255.255.255
 ip pim dr-priority 0
 ip tcp adjust-mss 1360
 load-interval 30
!
interface Tunnel135001
 description LAX135001_DMVPN Tunnel Interface
 ip address 10.135.0.1 255.255.255.0
 no ip redirects
 ip mtu 1400
 ip pim dr-priority 0
 ip nhrp authentication nhrp@135
 ip nhrp map multicast dynamic
 ip nhrp network-id 135001
 ip nhrp holdtime 600
 ip nhrp shortcut
 ip nhrp redirect
 ip tcp adjust-mss 1360
 load-interval 30
 delay 1000
 tunnel source GigabitEthernet0/0
 tunnel mode gre multipoint
 tunnel key 1135001
 tunnel protection ipsec profile ipsec-profile_135001
!
interface Embedded-Service-Engine0/0
 no ip address
 shutdown
!
interface GigabitEthernet0/0
 description $ETH-LAN$$ETH-SW-LAUNCH$$INTF-INFO-GE 0/0$
 ip address 207.231.84.12 255.255.255.224
 ip pim dr-priority 0
 ip tcp adjust-mss 1460
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 10.10.24.1 255.255.255.0
 ip pim dr-priority 0
 ip tcp adjust-mss 1460
 load-interval 30
 duplex auto
 speed auto
!
interface FastEthernet0/1/0
 no ip address
!
interface FastEthernet0/1/1
 no ip address
!
interface FastEthernet0/1/2
 no ip address
!
interface FastEthernet0/1/3
 no ip address
!
interface Cellular0/0/0
 no ip address
 encapsulation slip
 dialer in-band
 dialer string lte
!
interface Vlan1
 no ip address
 shutdown
!
!
router eigrp iwan
 !
 address-family ipv4 unicast autonomous-system 9999
  !
  af-interface default
   passive-interface
  exit-af-interface
  !
  af-interface Tunnel135001
   summary-address 10.1.0.0 255.255.0.0
   summary-address 10.2.0.0 255.255.0.0
   summary-address 10.10.0.0 255.255.0.0
   hello-interval 20
   hold-time 60
   no passive-interface
  exit-af-interface
  !
  topology base
   default-metric 10000 100 255 100 1500
   redistribute connected route-map rmap-ipv4-connected-out
   redistribute ospf 100 route-map rmap-routing-datacenter-outbound
  exit-af-topology
  network 10.135.0.0 0.0.0.255
 exit-address-family
!
router ospf 100
 redistribute eigrp 9999 subnets route-map rmap-routing-datacenter-inbound
 passive-interface default
 no passive-interface GigabitEthernet0/1
 no passive-interface Loopback0
 network 10.10.10.0 0.0.0.0 area 0.0.0.0
 network 10.10.24.0 0.0.0.255 area 0.0.0.0
!
ip forward-protocol nd
!
ip http server
ip http access-class 23
ip http authentication local
ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
ip route 0.0.0.0 0.0.0.0 207.231.84.1
ip ssh version 2
ip ssh server algorithm mac hmac-sha1
ip ssh server algorithm encryption aes256-ctr aes192-ctr aes128-ctr
!
ip access-list standard acl-routing-ipv4-connected
 permit 10.10.10.0
 permit 10.10.24.0 0.0.0.255
!
!
ip prefix-list plist-ipv4-datacenter-local seq 10 permit 10.10.0.0/16 ge 24
ip prefix-list plist-ipv4-datacenter-local seq 20 permit 10.1.0.0/16 ge 24
ip prefix-list plist-ipv4-datacenter-local seq 30 permit 10.2.0.0/16 ge 32
!
route-map rmap-routing-datacenter-inbound deny 10
 match ip address prefix-list plist-ipv4-datacenter-local
!
route-map rmap-routing-datacenter-inbound permit 20
 set tag 9999
!
route-map rmap-routing-datacenter-outbound deny 10
 match tag 9999
!
route-map rmap-routing-datacenter-outbound permit 20
 match ip address prefix-list plist-ipv4-datacenter-local
 set tag 240
!
route-map rmap-ipv4-connected-out permit 10
 match ip address acl-routing-ipv4-connected
!
!
!
!
!
control-plane
!
!
parser view operator
 secret 5 $1$5e06$vfa56hqG2oL1SUi6NPYvJ1
 commands configure include all event
 commands configure include all scheduler
 commands configure include all line
 commands configure include all banner
 commands configure include all control-plane
 commands configure include all snmp-server
 commands configure include all route-map
 commands configure include all menu
 commands configure include all dialer-list
 commands configure include all router
 commands configure include all interface
 commands configure include all track
 commands configure include all redundancy
 commands configure include all username
 commands configure include all file
 commands configure include all license
 commands configure include all crypto
 commands configure include all multilink
 commands configure include all ipv6
 commands configure include all ntp
 commands configure include all ip
 commands configure include all aaa
 commands configure include all logging
 commands configure include all security
 commands configure include all shell
 commands configure include all boot-end-marker
 commands configure include all boot-start-marker
 commands configure include all hostname
 commands configure include all service
 commands exec include all dir
 commands exec include all cd
 commands exec include all more
 commands exec include all ssh
 commands exec include all clock
 commands exec include all license
 commands exec include all traceroute
 commands exec include all ping
 commands exec exclude configure
 commands exec include terminal monitor
 commands exec include terminal
 commands exec exclude show parser
 commands exec include all show
 commands exec include exit
 commands exec include all debug
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 length 25
 history size 10
line aux 0
line 2
 no activation-character
 no exec
 transport preferred none
 transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
 stopbits 1
line 0/0/0
 script dialer lte
 no exec
line vty 0 4
 exec-timeout 0 0
 logging synchronous
 length 25
 history size 10
 transport input ssh
 transport output ssh
line vty 5 15
 exec-timeout 0 0
 length 25
 history size 10
 transport input ssh
 transport output ssh
!
scheduler allocate 20000 1000
event manager environment _gluware_hosts 52.32.83.73,52.23.48.228
event manager environment _gluware_gid sod5onojSoj
event manager environment _gluware_systemid 3bd628a4-adc5-4b0c-b3a9-617439fc4468
event manager environment _gluware_nodeid 16e03fb2-e758-4ff7-8c66-67073db3f169
event manager environment _gluware_gwd_version 5.7.9
event manager directory user policy "flash:/gluware/eem"
event manager directory user repository "flash:/gluware/eem"
event manager scheduler script thread class G number 1
event manager scheduler applet thread class G number 1
event manager policy gluWatchdog.tbc class G
event manager applet wdSyslogDHCP class G
 description applet to run gluWatchdog.tbc
 event syslog occurs 1 pattern "ADDRESS_ASSIGN" maxrun 20
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdSyslogDHCP" arg2 "dhcp"
 action 2.Exit    set _exit_status "1"
event manager applet wdSyslogLineProto class G
 description applet to run gluWatchdog.tbc
 event syslog occurs 1 pattern "LINEPROTO-5-UPDOWN" maxrun 20
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdSyslogLineProto" arg2 "lineProtocolChg"
 action 2.Exit    set _exit_status "1"
event manager applet wdCallHome class G
 description applet to run gluWatchdog.tbc
 event timer watchdog name wdCallHome time 86400 maxrun 30
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdCallHome" arg2 "callHome"
 action 2.Exit    set _exit_status "1"
!
end`
    },
    {
      date: new Date(Date.now() + 500),
      content:`Current configuration : 10633 bytes
!
! Last configuration change at 17:48:11 UTC Fri Apr 7 2017 by pod6user
! NVRAM config last updated at 17:48:15 UTC Fri Apr 7 2017 by pod6user
!
version 15.5
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
service compress-config
service sequence-numbers
!
hostname LAX-VHE-01
!
boot-start-marker
boot-end-marker
!
!
security authentication failure rate 2 log
security passwords min-length 2
logging buffered 51200
!
aaa new-model
!
!
aaa authentication login default local
aaa authorization exec default local
!
!
!
!
!
aaa session-id common
ethernet lmi ce
!
!
!
!
!
!
no ip source-route
!
!
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain lookup
ip multicast-routing
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
chat-script lte "" "AT!CALL" TIMEOUT 60 "OK"
!
crypto pki server gn-local-rootca
 database archive pkcs12 password 7 00071A1507545A545C
 issuer-name CN=IWAN Local Root CA, OU=Certification Services ,OU=NET_135001, O=Glue Networks
 hash sha256
 lifetime crl 24
 lifetime ca-certificate 3650
 database url flash:
!
crypto pki trustpoint TP-self-signed-2465937345
 enrollment selfsigned
 subject-name cn=IOS-Self-Signed-Certificate-2465937345
 revocation-check none
 rsakeypair TP-self-signed-2465937345
!
crypto pki trustpoint gn-local-rootca
 revocation-check none
 rsakeypair gn-local-rootca 2048
!
crypto pki trustpoint gvo-pki_135001
 enrollment retry count 100
 enrollment url http://207.231.84.12:80
 serial-number
 fingerprint 2EF5C6633BD5D2DA8C6C03AB33C95112
 subject-name OU=NET_135001 O=Glue Networks
 revocation-check none
 rsakeypair gvo-pki_135001 2048
!
!
!
crypto pki certificate map gvo-cert-map_135001 10
 subject-name co ou = net_135001
!
crypto pki certificate chain TP-self-signed-2465937345
 certificate self-signed 01
crypto pki certificate chain gn-local-rootca
 certificate ca 01
crypto pki certificate chain gvo-pki_135001
 certificate 02
 certificate ca 01
license udi pid CISCO1921/K9 sn FTX1808827Q
!
!
file prompt quiet
username glue_sqa privilege 15 secret 5 $1$c6ql$r2cwMpKHm0HGc9Owr6R.X1
username gvoae privilege 15 secret 5 $1$8rjn$13nCH2KeMVRCL1nu9GwKH/
username installer privilege 15 secret 5 $1$5qgy$O5p1cq60mr1KcakvX3ptY.
username operator view operator secret 5 $1$02q9$Pv10x7CnvovJnKJJja8uK0
username jumpuser secret 5 $1$8amb$mhHHPyq240pHpeuvwqtsy0
!
redundancy
!
!
!
!
!
controller Cellular 0/0
 lte modem link-recovery rssi onset-threshold -110
 lte modem link-recovery monitor-timer 20
 lte modem link-recovery wait-timer 10
 lte modem link-recovery debounce-count 6
!
!
!
crypto isakmp policy 5
 encr aes 256
 group 2
crypto isakmp keepalive 30 10 periodic
crypto isakmp nat keepalive 10
crypto isakmp profile ike-profile_135001
   ca trust-point gvo-pki_135001
   match certificate gvo-cert-map_135001
!
!
crypto ipsec transform-set aes256-sha1 esp-aes 256 esp-sha-hmac
 mode transport
!
!
crypto ipsec profile ipsec-profile_135001
 set security-association lifetime seconds 43200
 set security-association idle-time 300
 set transform-set aes256-sha1
 set isakmp-profile ike-profile_135001
!
!
!
!
!
!
interface Loopback0
 description LAN Template Interface MGNT1
 ip address 10.10.10.0 255.255.255.255
 ip pim dr-priority 0
 ip tcp adjust-mss 1360
 load-interval 30
!
interface Tunnel135001
 description LAX135001_DMVPN Tunnel Interface
 ip address 10.135.0.1 255.255.255.0
 no ip redirects
 ip mtu 1400
 ip pim dr-priority 0
 ip nhrp authentication nhrp@135
 ip nhrp map multicast dynamic
 ip nhrp network-id 135001
 ip nhrp holdtime 600
 ip nhrp shortcut
 ip nhrp redirect
 ip tcp adjust-mss 1360
 load-interval 30
 delay 1000
 tunnel source GigabitEthernet0/0
 tunnel mode gre multipoint
 tunnel key 1135001
 tunnel protection ipsec profile ipsec-profile_135001
!
interface Embedded-Service-Engine0/0
 no ip address
 shutdown
!
interface GigabitEthernet0/0
 description $ETH-LAN$$ETH-SW-LAUNCH$$INTF-INFO-GE 0/0$
 ip address 207.231.84.12 255.255.255.224
 ip pim dr-priority 0
 ip tcp adjust-mss 1460
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 10.10.24.1 255.255.255.0
 ip pim dr-priority 0
 ip tcp adjust-mss 1460
 load-interval 30
 duplex auto
 speed auto
!
interface FastEthernet0/1/0
 no ip address
!
interface FastEthernet0/1/1
 no ip address
!
interface FastEthernet0/1/2
 no ip address
 timeout absolute 65536 0
!
interface FastEthernet0/1/3
 no ip address
!
interface Cellular0/0/0
 no ip address
 encapsulation slip
 dialer in-band
 dialer string lte
!
interface Vlan1
 no ip address
 shutdown
!
!
router eigrp iwan
 !
 address-family ipv4 unicast autonomous-system 9999
  !
  af-interface default
   passive-interface
  exit-af-interface
  !
  af-interface Tunnel135001
   summary-address 10.1.0.0 255.255.0.0
   summary-address 10.2.0.0 255.255.0.0
   summary-address 10.10.0.0 255.255.0.0
   hello-interval 20
   hold-time 60
   no passive-interface
  exit-af-interface
  !
  topology base
   default-metric 10000 100 255 100 1500
   redistribute connected route-map rmap-ipv4-connected-out
   redistribute ospf 100 route-map rmap-routing-datacenter-outbound
  exit-af-topology
  network 10.135.0.0 0.0.0.255
 exit-address-family
!
router ospf 100
 redistribute eigrp 9999 subnets route-map rmap-routing-datacenter-inbound
 passive-interface default
 no passive-interface GigabitEthernet0/1
 no passive-interface Loopback0
 network 10.10.10.0 0.0.0.0 area 0.0.0.0
 network 10.10.24.0 0.0.0.255 area 0.0.0.0
!
ip forward-protocol nd
!
ip http server
ip http access-class 23
ip http authentication local
ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
ip route 0.0.0.0 0.0.0.0 207.231.84.1
ip ssh version 2
ip ssh server algorithm mac hmac-sha1
ip ssh server algorithm encryption aes256-ctr aes192-ctr aes128-ctr
!
ip access-list standard acl-routing-ipv4-connected
 permit 10.10.10.0
 permit 10.10.24.0 0.0.0.255
!
!
ip prefix-list plist-ipv4-datacenter-local seq 10 permit 10.10.0.0/16 ge 24
ip prefix-list plist-ipv4-datacenter-local seq 20 permit 10.1.0.0/16 ge 24
ip prefix-list plist-ipv4-datacenter-local seq 30 permit 10.2.0.0/16 ge 32
!
route-map rmap-routing-datacenter-inbound deny 10
 match ip address prefix-list plist-ipv4-datacenter-local
!
route-map rmap-routing-datacenter-inbound permit 20
 set tag 9988
!
route-map rmap-routing-datacenter-inbound permit 64
 set tag 9999
!
route-map rmap-routing-datacenter-outbound deny 10
 match tag 9999
!
route-map rmap-routing-datacenter-outbound permit 20
 match ip address prefix-list plist-ipv4-datacenter-local
 set tag 240
!
route-map rmap-routing-datacenter-outbound permit 64
 match ip address prefix-list plist-ipv4-datacenter-local
 set tag 210
!
route-map rmap-ipv4-connected-out permit 10
 match ip address acl-routing-ipv4-connected
!
!
!
!
!
control-plane
!
!
parser view operator
 secret 5 $1$5e06$vfa56hqG2oL1SUi6NPYvJ1
 commands configure include all event
 commands configure include all scheduler
 commands configure include all line
 commands configure include all banner
 commands configure include all control-plane
 commands configure include all snmp-server
 commands configure include all route-map
 commands configure include all menu
 commands configure include all dialer-list
 commands configure include all router
 commands configure include all interface
 commands configure include all track
 commands configure include all redundancy
 commands configure include all username
 commands configure include all file
 commands configure include all license
 commands configure include all crypto
 commands configure include all multilink
 commands configure include all ipv6
 commands configure include all ntp
 commands configure include all ip
 commands configure include all aaa
 commands configure include all logging
 commands configure include all security
 commands configure include all shell
 commands configure include all boot-end-marker
 commands configure include all boot-start-marker
 commands configure include all hostname
 commands configure include all service
 commands exec include all dir
 commands exec include all cd
 commands exec include all more
 commands exec include all ssh
 commands exec include all clock
 commands exec include all license
 commands exec include all traceroute
 commands exec include all ping
 commands exec exclude configure
 commands exec include terminal monitor
 commands exec include terminal
 commands exec exclude show parser
 commands exec include all show
 commands exec include exit
 commands exec include all debug
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 length 25
 history size 10
line aux 0
line 2
 no activation-character
 no exec
 transport preferred none
 transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
 stopbits 1
line 0/0/0
 script dialer lte
 no exec
line vty 0 4
 exec-timeout 0 0
 logging synchronous
 length 25
 history size 10
 transport input ssh
 transport output ssh
line vty 5 15
 exec-timeout 0 0
 length 25
 history size 10
 transport input ssh
 transport output ssh
!
scheduler allocate 20000 1000
event manager environment _gluware_hosts 52.32.83.73,52.23.48.228
event manager environment _gluware_gid sod5onojSoj
event manager environment _gluware_systemid 3bd628a4-adc5-4b0c-b3a9-617439fc4468
event manager environment _gluware_nodeid 16e03fb2-e758-4ff7-8c66-67073db3f169
event manager environment _gluware_gwd_version 5.7.9
event manager directory user policy "flash:/gluware/eem"
event manager directory user repository "flash:/gluware/eem"
event manager scheduler script thread class G number 1
event manager scheduler applet thread class G number 1
event manager policy gluWatchdog.tbc class G
event manager applet wdSyslogDHCP class G
 description applet to run gluWatchdog.tbc
 event syslog occurs 1 pattern "ADDRESS_ASSIGN" maxrun 20
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdSyslogDHCP" arg2 "dhcp"
 action 2.Exit    set _exit_status "1"
event manager applet wdSyslogLineProto class G
 description applet to run gluWatchdog.tbc
 event syslog occurs 1 pattern "LINEPROTO-5-UPDOWN" maxrun 20
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdSyslogLineProto" arg2 "lineProtocolChg"
 action 2.Exit    set _exit_status "1"
event manager applet wdCallHome class G
 description applet to run gluWatchdog.tbc
 event timer watchdog name wdCallHome time 86400 maxrun 30
 action 1.Publish publish-event sub-system 798 type 3 arg1 "wdCallHome" arg2 "callHome"
 action 2.Exit    set _exit_status "1"
!
end`
    }
  );
  let unifiedDiffStr = '';
  unifiedDiff.forEach((line)=>{
    unifiedDiffStr += `${line}`;
  });
  let diffUi = new Diff2HtmlUI({diff: unifiedDiffStr});
  diffUi.draw('body',{
    synchronisedScroll: true,
    matching: 'words',
    //outputFormat: 'line-by-line'
    outputFormat: 'side-by-side'
  });
  diffUi.highlightCode('body');
});

Comments