#49976 Ticket 49926 - Add replication functionality to UI
Closed 3 years ago by spichugi. Opened 5 years ago by mreynolds.
mreynolds/389-ds-base ticket49926  into  master

@@ -2921,23 +2921,23 @@ 

  {

      char *tmpstr = NULL;

  

-     PR_Lock(ra->lock);

- 

      tmpstr = slapi_entry_attr_get_charptr(e, type_nsds5ReplicaStripAttrs);

-     if (NULL != tmpstr) {

-         if (ra->attrs_to_strip) {

-             slapi_ch_array_free(ra->attrs_to_strip);

-         }

+ 

+     PR_Lock(ra->lock);

+     if (ra->attrs_to_strip) {

+         slapi_ch_array_free(ra->attrs_to_strip);

+     }

+     if (tmpstr == NULL) {

+         ra->attrs_to_strip = NULL;

+     } else {

          ra->attrs_to_strip = slapi_str2charray_ext(tmpstr, " ", 0);

-         PR_Unlock(ra->lock);

-         prot_notify_agmt_changed(ra->protocol, ra->long_name);

-         slapi_ch_free_string(&tmpstr);

-         return 0;

      }

- 

      PR_Unlock(ra->lock);

  

-     return -1;

+     prot_notify_agmt_changed(ra->protocol, ra->long_name);

+     slapi_ch_free_string(&tmpstr);

+ 

+     return 0;

  }

  

  /* this is called whenever an update (total/incremental)

@@ -543,7 +543,7 @@ 

                  } else if (strcasecmp(config_attr, type_replicaReleaseTimeout) == 0) {

                      if (apply_mods) {

                          int64_t val;

-                         if (repl_config_valid_num(config_attr, config_attr_value, 1, INT_MAX, returncode, errortext, &val) == 0) {

+                         if (repl_config_valid_num(config_attr, config_attr_value, 0, INT_MAX, returncode, errortext, &val) == 0) {

                              replica_set_release_timeout(r, val);

                          } else {

                              break;

@@ -273,39 +273,41 @@ 

        <h3 class="ds-config-header" id="chaining-header">Database Chaining Configuration</h3>

        <div class="ds-container">

          <div class="ds-inline">

-           <div>

-             <label for="nsfarmserverurl" class="ds-config-label" title=

-               "The URL for the remote server.  Add additional failure servers URLs separated by a space. (nsfarmserverurl)">

-               Remote Server URL(s)</label><input class="ds-input" type="text" id="nsfarmserverurl"/>

-           </div>

-           <div>

-             <label for="nsmultiplexorbinddn" class="ds-config-label" title="Bind DN used to authenticate against the remote server (nsmultiplexorbinddn).">Remote Server Bind DN</label><input

-               class="ds-input" type="text" placeholder="Bind DN" id="nsmultiplexorbinddn">

-           </div>

-           <div>

-             <label for="nsmultiplexorcredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Bind DN Credentials</label><input

-               class="ds-input" type="password" placeholder="Enter password" id="nsmultiplexorcredentials">

-           </div>

-           <div>

-             <label for="nsmultiplexorcredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

-               class="ds-input" type="password" placeholder="Confirm password" id="nsmultiplexorcredentials-confirm">

-           </div>

-           <div>

-             <label for="dblink-conn" class="ds-config-label" title="The connection protocol for the remote server.">Connection Protocol</label><select

-               class="btn btn-default dropdown ds-dblink-dropdown" id="dblink-conn">

-                 <option>LDAP</option>

-                 <option>LDAPS</option>

-                 <option>Start TLS</option>

-               </select>

-           </div>

-           <div>

-             <label for="nsbindmechanism" class="ds-config-label" title="The bind method for contacting the remote server  (nsbindmechanism).">Bind Method</label><select

-               class="btn btn-default dropdown ds-dblink-dropdown" id="nsbindmechanism">

-                 <option>Simple</option>

-                 <option>SASL/DIGEST-MD5</option>

-                 <option>SASL/GSSAPI</option>

-               </select>

-           </div>

+           <form>

+             <div>

+               <label for="nsfarmserverurl" class="ds-config-label" title=

+                 "The URL for the remote server.  Add additional failure servers URLs separated by a space. (nsfarmserverurl)">

+                 Remote Server URL(s)</label><input class="ds-input" type="text" id="nsfarmserverurl"/>

+             </div>

+             <div>

+               <label for="nsmultiplexorbinddn" class="ds-config-label" title="Bind DN used to authenticate against the remote server (nsmultiplexorbinddn).">Remote Server Bind DN</label><input

+                 class="ds-input" type="text" autocomplete="username" placeholder="Bind DN" id="nsmultiplexorbinddn">

+             </div>

+             <div>

+               <label for="nsmultiplexorcredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Bind DN Credentials</label><input

+                 class="ds-input" type="password" autocomplete="new-password" placeholder="Enter password" id="nsmultiplexorcredentials">

+             </div>

+             <div>

+               <label for="nsmultiplexorcredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

+                 class="ds-input" type="password" autocomplete="new-password" placeholder="Confirm password" id="nsmultiplexorcredentials-confirm">

+             </div>

+             <div>

+               <label for="dblink-conn" class="ds-config-label" title="The connection protocol for the remote server.">Connection Protocol</label><select

+                 class="btn btn-default dropdown ds-dblink-dropdown" id="dblink-conn">

+                   <option>LDAP</option>

+                   <option>LDAPS</option>

+                   <option>Start TLS</option>

+                 </select>

+             </div>

+             <div>

+               <label for="nsbindmechanism" class="ds-config-label" title="The bind method for contacting the remote server  (nsbindmechanism).">Bind Method</label><select

+                 class="btn btn-default dropdown ds-dblink-dropdown" id="nsbindmechanism">

+                   <option>Simple</option>

+                   <option>SASL/DIGEST-MD5</option>

+                   <option>SASL/GSSAPI</option>

+                 </select>

+             </div>

+           </form>

          </div>

        </div>

        <p></p>

@@ -12,7 +12,6 @@ 

  .ds-logo-hr {

    padding: 0 !important;

    margin-top: -20px !important;

-   /*margin-bottom: 25px;*/

    line-height:0;

  }

  
@@ -136,7 +135,6 @@ 

  .ds-button {

    height: 30px;

    width: 160px !important;

-   /* margin-left: 10px; */

    margin-top: 5px;

    float:none;

    left:auto;
@@ -191,11 +189,10 @@ 

    margin-top: 0px !important;

    margin-left: 6px;

    padding: 0px !important;

-   padding-left: 10px;

+   padding-left: 10px !important;

+   padding-right: 10px !important;

    height: 30px;

-   width: 250px !important;

    text-align: left;

-   /* border-radius: 5px; */

  }

  

  .ds-passwd-dropdown {
@@ -221,17 +218,6 @@ 

    border-radius: 5px;

  }

  

- /*

- .dropdown {

-   color: black !important;

- }

- */

- /* Fix Chrome dropdowns 

- .dropdownZZZZ select, .dropdownZZZZ option, .dropdownZZZ option:hover, .dropdownZZZ select:hover {

-   background-color: white !important;

-   color: #181818; !important;

- }*/

- 

  .ds-table {

    padding: 0px;

    border: 1px solid #909090;
@@ -338,37 +324,6 @@ 

    font-size: 16px;

  }

  

- /*

- input[type=text], input[type=search], input[type=password], input[type=""], textarea {

-   Zborder-radius: 5px;

-   border-style: solid;

-   border-color:	#B8B8B8 !important;

-   padding-left: 5px !important;

-   min-height: 30px;

- }

- */

- 

- /*

- input[type=text]:focus, input[type=search]:focus, input[type=password]:focus, input[type=""]:focus, textarea:focus{

-   outline:none;

-   webkit-box-shadow: 0px 0px 0px 0px #0a676f;

-   box-shadow: 0px 0px .1px 0px #0a676f;

- }

- */

- Zselect:focus {

-   outline:none !important;

-   -webkit-box-shadow: 0px 0px 4px 0px #0a676f !important;

-   box-shadow: 0px 0px 2px 0px #0a676f !important;

-   max-height: 350px !important;

- }

- 

- Zbutton:focus {

-   outline:none !important;

-   border: 1.5px solid #0a676f;

-   -webkit-box-shadow: 0px 0px 4px 0px #0a676f !important;

-   box-shadow: 0px 0px 4px 0px #0a676f !important;

- }

- 

  .ds-input {

    margin-top: 5px !important;

    padding-right: 5px !important;
@@ -392,7 +347,6 @@ 

  }

  

  .ds-ro-input {

-   height: 37px !important;

    margin-top: 5px;

    padding-left: 5px;

    margin-right: 5px;
@@ -400,7 +354,7 @@ 

  }

  

  .ds-input-lrg {

-   width: 315px !important;  /* <input size="40"> */

+   width: 315px !important;

    height: 37px !important;

    margin-top: 5px;

    padding-right: 10px;
@@ -411,6 +365,17 @@ 

    width: 500px !important;

  }

  

+ .ds-input-max {

+   margin-left: 10px;

+   margin-bottom: 20px;

+   width: 500px;

+   max-width: 600px;

+ }

+ 

+ .ds-repl-mgr {

+   max-width: 600px !important;

+ }

+ 

  .ds-role-input {

    height: 30px !important;

    min-height: 30px;
@@ -538,7 +503,6 @@ 

    text-align: left;

  }

  

- 

  .ds-agmt-wiz-dropdown {

    width: 175px !important;

    text-align: left;
@@ -579,7 +543,7 @@ 

  }

  

  .ds-agmt-dropdown-button {

-   width: 160px;

+   width: 120px;

  }

  

  .ds-agmt-button {
@@ -705,13 +669,14 @@ 

  }

  

  .ds-modal-wide {

-   width: 850px;

+   min-width: 850px;

    vertical-align: middle;

  }

  

  .modal-content {

    position: absolute;

    max-height: 750px;

+   max-width: 550px;

    overflow: auto;

  }

  
@@ -869,6 +834,11 @@ 

    padding-left: 20px;

  }

  

+ .ds-label-lrg {

+   width: 200px;

+   margin-bottom: 10px !important;

+ }

+ 

  .ds-label-med {

    width: 180px;

    margin-bottom: 10px !important;
@@ -880,11 +850,27 @@ 

    margin-bottom: 10px !important;

  }

  

+ .ds-monitor-label-med {

+   width: 175px;

+   margin-top: 10px;

+   margin-bottom: 10px !important;

+ }

+ 

  .ds-label-sm {

    width: 130px !important;

    margin-bottom: 10px !important;

  }

  

+ .ds-label-xsm {

+   width: 100px !important;

+   margin-bottom: 10px !important;

+ }

+ 

+ .ds-cleanallruv-label {

+   width: 110px !important;

+   margin-bottom: 10px !important;

+ }

+ 

  .ds-cache-label {

    width: 210px !important;

    margin-left: 20px !important;
@@ -1220,6 +1206,38 @@ 

    margin-top: 0px;

  }

  

+ /* wizard accordions are narrower */

+ .ds-wiz-accordion {

+   margin-top: 20px;

+   color: #228bc0 !important;

+   background-color: white;

+   border: 0;

+   position: relative;

+   overflow: hidden;

+ 	width:500px;

+ 	text-align:left;

+ }

+ 

+ .ds-wiz-accordion:after {

+   display: inline-block;

+   content: "";

+   height: 1px;

+   background: #228bc0;

+   position: absolute;

+   width: 500px;

+   top: 50% !important;

+   margin-left: 10px;

+ 	text-align:left;

+ }

+ 

+ .ds-wiz-accordion:focus {

+   outline: none !important;

+   border: 0 !important;

+   -moz-outline: none !important;

+   -webkit-box-shadow: none !important;

+   box-shadow: 0 !important;

+ }

+ 

  .ds-indent {

    margin-left: 15px !important;

    margin-right: 15px !important;
@@ -1238,18 +1256,9 @@ 

    height: 30px;

    outline: 0 !important;

    padding: 0px !important;

-   padding-left: 10px;

-   text-align: left;

-   width: 250px;

- }

- 

- .ds-select-sm {

-   height: 30px;

-   outline: 0 !important;

-   padding: 0px !important;

-   padding-left: 10px;

+   padding-left: 5px;

+   padding-right: 10px;

    text-align: left;

-   width: 100px;

  }

  

  .ds-center {
@@ -1268,7 +1277,6 @@ 

    height: 30px;

  }

  

- 

  .ds-td {

   padding-left: 10px !important;

   padding-top: 8px !important;
@@ -1277,8 +1285,8 @@ 

  }

  

  .ds-mgr-table {

-   max-width: 700px;

-   min-width: 700px;

+   max-width: 600px;

+   min-width: 600px;

  }

  

  .ds-loglevel-table {
@@ -1327,6 +1335,11 @@ 

    margin-right: 10px;

  }

  

+ .ds-spacing-med {

+   margin-right: 20px;

+ }

+ 

+ 

  .navbar-default {

    margin-bottom: 0px;

  }
@@ -1369,3 +1382,19 @@ 

    min-width: 500px;

  }

  

+ .ds-loading-spinner {

+   position: fixed;

+   top: 25%;

+   left: 50%;

+   transform: translate(-25%, -50%);

+ }

+ 

+ .ds-loader {

+   font-size: 15px;

+ }

+ 

+ .ds-popup {

+   min-width: 350px !important;

+ }

+ 

+ 

@@ -1,73 +0,0 @@ 

- /********** TABS **********/

- .tab-list {

-   margin: 0;

-   padding: 0;

- }

- 

- .tab-list li {

-   /* display: inline-block;*/

-   list-style-type: none;

-   background-color: #303030;

-   /*border: 1px solid #ddd;*/

-   border: 1px solid black;

-   letter-spacing: 0.2em;

- }

- 

- .tab-list ul {

-   margin-left: 10px;

-   margin-right: 10px;

- }

- 

- .tab-list li a {

-   color: #f2f2f2;

-   text-decoration:none;

-   padding: 3px 10px 3px 10px;

- 

- }

- 

- 

- /********** HOVER STATES **********/

- .tab-list li.active, .tab-list li.hover {

-   background-color: #e5e5e5;

-   text-decoration:none !important;

-   /* border-bottom: 1px solid #e5e5e5; */

-   border: 1px solid #484848;

- }

- 

- .tab-list li.active a, .tab-list li a:hover {

-   color: #666;

-   background-color: #e5e5e5;

-   text-decoration:none !important;

-   outline: 0 !important;

- }

- 

- 

- /********** PANELS **********/

- .tab-panel {

-   outline: 0 !important;

-   line-height: 0;

-   display: none;

-   background-color: #e5e5e5;

-   color: #666;

-   /*min-height: 500px; */

-   margin-top: -1px;

-   margin-left: 10px;

-   margin-right: 10px;

-   margin-bottom: 10px;

-   /* border: 1px solid #ddd; */

-   border: 1px groove gray !important;

-   white-space: pre-line;

-   overflow: auto;

-   min-height: 700px;

-   border-top-right-radius: 12px;

-   border-bottom-right-radius: 12px;

-   border-bottom-left-radius: 12px;

- }

- 

- .tab-panel.active {

-   display: block;

- }

- 

- .tab-panel p {

-   margin: 20px;

- }

file modified
+433 -427
@@ -33,509 +33,515 @@ 

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

  </head>

  

- <body hidden>

-   <div class="ds-nav-bar">

-     <div class="ds-logo">

-       <h2 class="ds-logo-style" id="main-banner"></h2>

-     </div>

- 

-     <nav class="navbar navbar-default" id="ds-navigation" role="navigation">

-       <div class="collapse navbar-collapse navbar-collapse-5 ds-nav">

-         <ul class="nav navbar-nav navbar-primary">

- 

-           <!-- Server Config navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="server-tab">

-               Server Settings

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu dropup ds-nav-item">

-               <li><a href="#0" class="ds-nav-choice" id="server-config-btn" parent-id="server-tab">Server Configuration</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="server-tuning-btn" parent-id="server-tab">Tuning & Limits</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="server-sasl-btn"   parent-id="server-tab">SASL</a></li>

-               <li class="dropdown-submenu">

-                 <a tabindex="-1" href="#0">Password Policy</a>

-                 <ul class="dropdown-menu">

-                   <li><a href="#0" class="ds-nav-choice" id="server-gbl-pwp-btn"   parent-id="server-tab">Global Password Policy</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="server-local-pwp-btn" parent-id="server-tab">Local Password Policy</a></li>

-                 </ul>

-               </li>

-               <li><a href="#0" class="ds-nav-choice" id="server-ldapi-btn" parent-id="server-tab">LDAPI & Autobind</a></li>

-               <li class="dropdown-submenu">

-                 <a tabindex="-1" href="#0">Logging</a>

-                 <ul class="dropdown-menu">

-                   <li><a href="#0" class="ds-nav-choice" id="server-log-access-btn"    parent-id="server-tab">Access Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="server-log-audit-btn"     parent-id="server-tab">Audit Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="server-log-auditfail-btn" parent-id="server-tab">Audit Failure Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="server-log-errors-btn"    parent-id="server-tab">Errors Log</a></li>

-                 </ul>

-               </li>

-             </ul>

-           </li>

- 

-           <!-- Security navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="security-tab">

-               Security

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu ds-nav-item">

-               <li><a href="#0" class="ds-nav-choice" id="sec-config-btn" parent-id="security-tab">Security Settings</a></li>

-               <li class="dropdown-submenu">

-                 <a tabindex="-1" href="#0">Certificate Management</a>

-                 <ul class="dropdown-menu">

-                   <li><a href="#0" class="ds-nav-choice" id="sec-cacert-btn"  parent-id="security-tab">CA Certificates</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="sec-srvcert-btn" parent-id="security-tab">Server Certificates</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="sec-revoked-btn" parent-id="security-tab">Revoked Certificates</a></li>

-                 </ul>

-               </li>

-               <li><a href="#0" class="ds-nav-choice" id="sec-ciphers-btn" parent-id="security-tab">Supported Ciphers</a></li>

-             </ul>

-           </li>

- 

-           <!-- Database navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="database-tab">

-               Database

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu dropup ds-nav-item">

-               <li><a href="#0" class="ds-nav-choice" id="db-chaining-btn" parent-id="database-tab">Chaining Settings</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="db-global-btn" parent-id="database-tab">Global Database Settings</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="db-suffix-btn"   parent-id="database-tab">Database Management</a></li>

-             </ul>

-           </li>

- 

-           <!-- Replication navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="replication-tab">

-               Replication

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu ds-nav-item">

-               <li><a href="#0" class="ds-nav-choice" id="repl-config-btn" parent-id="replication-tab">Configuration</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="repl-agmts-btn" parent-id="replication-tab">Agreements</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="repl-winsync-btn" parent-id="replication-tab">Winsync Agreements</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="repl-cleanallruv-btn" parent-id="replication-tab">CleanAllRUV Tasks</a></li>

-             </ul>

-           </li>

- 

-           <!-- Schema navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="schema-tab">

-               Schema

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu ds-nav-item">

-               <li><a href="#0"class="ds-nav-choice" id="objectclass-btn" parent-id="schema-tab">Objectclasses</a></li>

-               <li><a href="#0"class="ds-nav-choice" id="attribute-btn" parent-id="schema-tab">Attributes</a></li>

-               <li><a href="#0" class="ds-nav-choice" id="schema-mr-btn" parent-id="schema-tab">Matching Rules</a></li>

-             </ul>

-           </li>

- 

-           <!-- Plugins navtab -->

-           <li class="ds-nav-tab">

-             <a href="#0" class="ds-tab-list ds-tab-standalone" id="plugin-tab">

-               Plugins

-             </a>

-           </li>

- 

-           <!-- Monitoring navtab -->

-           <li class="dropdown ds-nav-tab">

-             <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="monitor-tab">

-               Monitoring

-               <b class="caret"></b>

-             </a>

-             <ul class="dropdown-menu ds-nav-item">

-               <li><a tabindex="-1" id="monitor-db-btn" class="ds-nav-choice"  parent-id="monitor-tab" href="#0">Database Performance</a></li>

-               <li class="dropdown-submenu">

-                 <a tabindex="-1" href="#0">Logging</a>

-                 <ul class="dropdown-menu">

-                   <li><a href="#0" class="ds-nav-choice" id="monitor-log-access-btn"    parent-id="monitor-tab">Access Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="monitor-log-audit-btn"     parent-id="monitor-tab">Audit Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="monitor-log-auditfail-btn" parent-id="monitor-tab">Audit Failure Log</a></li>

-                   <li><a href="#0" class="ds-nav-choice" id="monitor-log-errors-btn"    parent-id="monitor-tab">Errors Log</a></li>

-                 </ul>

-               </li>

-               <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-repl-btn"   href="#0">Replication Monitoring</a></li>

-               <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-server-btn" href="#0">Server Statistics</a></li>

-               <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-snmp-btn"   href="#0">SNMP Counters</a></li>

-             </ul>

-           </li>

-         </ul>

-       </div>

-     </nav>

+ <body>

+   <div id="loading-page" class="ds-center ds-loading-spinner" hidden>

+     <h3 id="loading-msg">Loading Directory Server Configuration...</h3>

+     <p><span class="spinner spinner-lg spinner-inline"></span></p>

    </div>

+   <div id="everything" hidden>

+     <div class="ds-nav-bar">

+       <div class="ds-logo">

+         <h2 class="ds-logo-style" id="main-banner"></h2>

+       </div>

  

+       <nav class="navbar navbar-default" id="ds-navigation" role="navigation">

+         <div class="collapse navbar-collapse navbar-collapse-5 ds-nav">

+           <ul class="nav navbar-nav navbar-primary">

+ 

+             <!-- Server Config navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="server-tab">

+                 Server Settings

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu dropup ds-nav-item">

+                 <li><a href="#0" class="ds-nav-choice" id="server-config-btn" parent-id="server-tab">Server Configuration</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="server-tuning-btn" parent-id="server-tab">Tuning & Limits</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="server-sasl-btn"   parent-id="server-tab">SASL</a></li>

+                 <li class="dropdown-submenu">

+                   <a tabindex="-1" href="#0">Password Policy</a>

+                   <ul class="dropdown-menu">

+                     <li><a href="#0" class="ds-nav-choice" id="server-gbl-pwp-btn"   parent-id="server-tab">Global Password Policy</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="server-local-pwp-btn" parent-id="server-tab">Local Password Policy</a></li>

+                   </ul>

+                 </li>

+                 <li><a href="#0" class="ds-nav-choice" id="server-ldapi-btn" parent-id="server-tab">LDAPI & Autobind</a></li>

+                 <li class="dropdown-submenu">

+                   <a tabindex="-1" href="#0">Logging</a>

+                   <ul class="dropdown-menu">

+                     <li><a href="#0" class="ds-nav-choice" id="server-log-access-btn"    parent-id="server-tab">Access Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="server-log-audit-btn"     parent-id="server-tab">Audit Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="server-log-auditfail-btn" parent-id="server-tab">Audit Failure Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="server-log-errors-btn"    parent-id="server-tab">Errors Log</a></li>

+                   </ul>

+                 </li>

+               </ul>

+             </li>

+ 

+             <!-- Security navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="security-tab">

+                 Security

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu ds-nav-item">

+                 <li><a href="#0" class="ds-nav-choice" id="sec-config-btn" parent-id="security-tab">Security Settings</a></li>

+                 <li class="dropdown-submenu">

+                   <a tabindex="-1" href="#0">Certificate Management</a>

+                   <ul class="dropdown-menu">

+                     <li><a href="#0" class="ds-nav-choice" id="sec-cacert-btn"  parent-id="security-tab">CA Certificates</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="sec-srvcert-btn" parent-id="security-tab">Server Certificates</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="sec-revoked-btn" parent-id="security-tab">Revoked Certificates</a></li>

+                   </ul>

+                 </li>

+                 <li><a href="#0" class="ds-nav-choice" id="sec-ciphers-btn" parent-id="security-tab">Supported Ciphers</a></li>

+               </ul>

+             </li>

+ 

+             <!-- Database navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="database-tab">

+                 Database

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu dropup ds-nav-item">

+                 <li><a href="#0" class="ds-nav-choice" id="db-chaining-btn" parent-id="database-tab">Chaining Settings</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="db-global-btn" parent-id="database-tab">Global Database Settings</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="db-suffix-btn"   parent-id="database-tab">Database Management</a></li>

+               </ul>

+             </li>

+ 

+             <!-- Replication navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="replication-tab">

+                 Replication

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu ds-nav-item">

+                 <li><a href="#0" class="ds-nav-choice" id="repl-config-btn" parent-id="replication-tab">Configuration</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="repl-agmts-btn" parent-id="replication-tab">Agreements</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="repl-winsync-btn" parent-id="replication-tab">Winsync Agreements</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="repl-cleanallruv-btn" parent-id="replication-tab">CleanAllRUV Tasks</a></li>

+               </ul>

+             </li>

+ 

+             <!-- Schema navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="schema-tab">

+                 Schema

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu ds-nav-item">

+                 <li><a href="#0"class="ds-nav-choice" id="objectclass-btn" parent-id="schema-tab">Objectclasses</a></li>

+                 <li><a href="#0"class="ds-nav-choice" id="attribute-btn" parent-id="schema-tab">Attributes</a></li>

+                 <li><a href="#0" class="ds-nav-choice" id="schema-mr-btn" parent-id="schema-tab">Matching Rules</a></li>

+               </ul>

+             </li>

+ 

+             <!-- Plugins navtab -->

+             <li class="ds-nav-tab">

+               <a href="#0" class="ds-tab-list ds-tab-standalone" id="plugin-tab">

+                 Plugins

+               </a>

+             </li>

+ 

+             <!-- Monitoring navtab -->

+             <li class="dropdown ds-nav-tab">

+               <a href="#0" class="dropdown-toggle ds-tab-list" data-toggle="dropdown" id="monitor-tab">

+                 Monitoring

+                 <b class="caret"></b>

+               </a>

+               <ul class="dropdown-menu ds-nav-item">

+                 <li><a tabindex="-1" id="monitor-db-btn" class="ds-nav-choice"  parent-id="monitor-tab" href="#0">Database Performance</a></li>

+                 <li class="dropdown-submenu">

+                   <a tabindex="-1" href="#0">Logging</a>

+                   <ul class="dropdown-menu">

+                     <li><a href="#0" class="ds-nav-choice" id="monitor-log-access-btn"    parent-id="monitor-tab">Access Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="monitor-log-audit-btn"     parent-id="monitor-tab">Audit Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="monitor-log-auditfail-btn" parent-id="monitor-tab">Audit Failure Log</a></li>

+                     <li><a href="#0" class="ds-nav-choice" id="monitor-log-errors-btn"    parent-id="monitor-tab">Errors Log</a></li>

+                   </ul>

+                 </li>

+                 <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-repl-btn"   href="#0">Replication</a></li>

+                 <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-server-btn" href="#0">Server Statistics</a></li>

+                 <li><a tabindex="-1" class="ds-nav-choice" parent-id="monitor-tab" id="monitor-snmp-btn"   href="#0">SNMP Counters</a></li>

+               </ul>

+             </li>

+           </ul>

+         </div>

+       </nav>

+     </div>

  

-   <!-- -------------------------------------

-   popup modals from any action dropdown, or right-click option need to be defined here

-   ---------------------------------------- -->

  

-   <div class="modal fade" id="success-form" tabindex="-1" role="dialog" aria-labelledby="success-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content">

-         <div class="modal-header">

-            <h4 class="modal-title" id="success-label">Success!</h4>

-         </div>

-         <div class="modal-body">

-           <p id="success-msg"><p>

+     <!-- -------------------------------------

+     popup modals from any action dropdown, or right-click option need to be defined here

+     ---------------------------------------- -->

+ 

+     <div class="modal fade" id="success-form" tabindex="-1" role="dialog" aria-labelledby="success-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-popup">

+           <div class="modal-header">

+              <h4 class="modal-title" id="success-label">Success!</h4>

+           </div>

+           <div class="modal-body">

+             <p id="success-msg"><p>

+           </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <div class="modal fade" id="restart-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="restart-inst-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content ds-modal">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="restart-inst-label">Restart Instance</h4>

-         </div>

-         <div class="modal-body">

-           <div id="reload-spinner" class="ds-center">

-             <p></p>

-             <p id="ds-restart-inst"><span class="spinner spinner-xs spinner-inline"></span> Restarting instance...</p>

+     <div class="modal fade" id="restart-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="restart-inst-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-modal">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="restart-inst-label">Restart Instance</h4>

+           </div>

+           <div class="modal-body">

+             <div id="reload-spinner" class="ds-center">

+               <p></p>

+               <p id="ds-restart-inst"><span class="spinner spinner-xs spinner-inline"></span> Restarting instance...</p>

+             </div>

            </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <div class="modal fade" id="stop-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="stop-inst-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content ds-modal">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="stop-inst-label">Stop Instance</h4>

-         </div>

-         <div class="modal-body">

-           <div id="reload-spinner" class="ds-center">

-             <p></p>

-             <p id="ds-stop-inst"><span class="spinner spinner-xs spinner-inline"></span> Stopping instance...</p>

+     <div class="modal fade" id="stop-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="stop-inst-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-modal">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="stop-inst-label">Stop Instance</h4>

+           </div>

+           <div class="modal-body">

+             <div id="reload-spinner" class="ds-center">

+               <p></p>

+               <p id="ds-stop-inst"><span class="spinner spinner-xs spinner-inline"></span> Stopping instance...</p>

+             </div>

            </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <div class="modal fade" id="start-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="start-inst-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content ds-modal">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="start-inst-label">Start Instance</h4>

-         </div>

-         <div class="modal-body">

-           <div id="reload-spinner" class="ds-center">

-             <p></p>

-             <p id="ds-start-inst"><span class="spinner spinner-xs spinner-inline"></span> Starting instance...</p>

+     <div class="modal fade" id="start-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="start-inst-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-modal">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="start-inst-label">Start Instance</h4>

+           </div>

+           <div class="modal-body">

+             <div id="reload-spinner" class="ds-center">

+               <p></p>

+               <p id="ds-start-inst"><span class="spinner spinner-xs spinner-inline"></span> Starting instance...</p>

+             </div>

            </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <div class="modal fade" id="remove-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="remove-inst-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content ds-modal">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="remove-inst-label">Remove Instance</h4>

-         </div>

-         <div class="modal-body">

-           <div id="reload-spinner" class="ds-center">

-             <p></p>

-             <p id="ds-remove-inst"><span class="spinner spinner-xs spinner-inline"></span> Removing instance...</p>

+     <div class="modal fade" id="remove-instance-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="remove-inst-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-modal">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="remove-inst-label">Remove Instance</h4>

            </div>

-         </div>>

+           <div class="modal-body">

+             <div id="reload-spinner" class="ds-center">

+               <p></p>

+               <p id="ds-remove-inst"><span class="spinner spinner-xs spinner-inline"></span> Removing instance...</p>

+             </div>

+           </div>

+         </div>

        </div>

      </div>

-   </div>

  

-   <div class="modal fade" id="schema-reload-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="reload-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content ds-modal">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="reload-label">Reload Schema Files</h4>

-         </div>

-         <div class="modal-body">

-           <form class="form-horizontal">

-             <label for="reload-dir" class="ds-config-label" title="The name of the database link.">Schema File Directory</label><input

-               class="ds-input" type="text" placeholder="Leave empty to use default schema location" id="reload-dir">

-           </form>

-           <div id="reload-spinner" class="ds-center" hidden>

-             <p></p>

-             <p><span class="spinner spinner-xs spinner-inline"></span> Reloading schema files...</p>

+     <div class="modal fade" id="schema-reload-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="reload-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content ds-modal">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="reload-label">Reload Schema Files</h4>

+           </div>

+           <div class="modal-body">

+             <form class="form-horizontal">

+               <label for="reload-dir" class="ds-config-label" title="The name of the database link.">Schema File Directory</label><input

+                 class="ds-input" type="text" placeholder="Leave empty to use default schema location" id="reload-dir">

+             </form>

+             <div id="reload-spinner" class="ds-center" hidden>

+               <p></p>

+               <p><span class="spinner spinner-xs spinner-inline"></span> Reloading schema files...</p>

+             </div>

+           </div>

+           <div class="modal-footer ds-modal-footer">

+             <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+             <button type="button" class="btn btn-primary" id ="schema-reload-btn">Reload Schema</button>

            </div>

-         </div>

-         <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id ="schema-reload-btn">Reload Schema</button>

          </div>

        </div>

      </div>

-   </div>

  

-   <!-- Manage Backups/restore -->

-   <div class="modal fade" id="restore-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="restore-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="restore-label">Restore Directory Server</h4>

-         </div>

-         <div class="modal-body">

-           <form class="form-horizontal">

-             <table id="backup-table" class="display ds-repl-table" cellspacing="0" width="100%">

-               <thead>

-                 <tr class="ds-table-header">

-                   <th>Backup Name</th>

-                   <th>Date</th>

-                   <th>Size</th>

-                   <th>Restore</th>

-                   <th>Delete</th>

-                 </tr>

-               </thead>

-               <tbody id="restore-tbody">

-               </tbody>

-             </table>

-           </form>

-           <div id="restore-spinner" class="ds-center" hidden>

-             <p></p>

-             <p><span class="spinner spinner-xs spinner-inline"></span> Restoring the server...</p>

+     <!-- Manage Backups/restore -->

+     <div class="modal fade" id="restore-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="restore-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="restore-label">Restore Directory Server</h4>

+           </div>

+           <div class="modal-body">

+             <form class="form-horizontal">

+               <table id="backup-table" class="display ds-repl-table" cellspacing="0" width="100%">

+                 <thead>

+                   <tr class="ds-table-header">

+                     <th>Backup Name</th>

+                     <th>Date</th>

+                     <th>Size</th>

+                     <th>Restore</th>

+                     <th>Delete</th>

+                   </tr>

+                 </thead>

+                 <tbody id="restore-tbody">

+                 </tbody>

+               </table>

+             </form>

+             <div id="restore-spinner" class="ds-center" hidden>

+               <p></p>

+               <p><span class="spinner spinner-xs spinner-inline"></span> Restoring the server...</p>

+             </div>

+           </div>

+           <div class="modal-footer ds-modal-footer">

+             <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

            </div>

-         </div>

-         <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

          </div>

        </div>

      </div>

-   </div>

  

-   <!-- Create database link -->

-   <div class="modal fade" id="create-db-link-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="dblink-label" aria-hidden="true">

-     <div class="modal-dialog ds-modal">

-       <div class="modal-content">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="dblink-label">Create Database Link</h4>

+     <!-- Create database link -->

+     <div class="modal fade" id="create-db-link-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="dblink-label" aria-hidden="true">

+       <div class="modal-dialog ds-modal">

+         <div class="modal-content">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="dblink-label">Create Database Link</h4>

+           </div>

+           <div class="modal-body">

+             <form class="form-horizontal">

+               <div class="ds-container">

+                 <div class="ds-inline">

+                   <div>

+                     <label for="chaining-name" class="ds-config-label" title="The name of the database link.">Database Link Name</label><input

+                       class="ds-dblink-form-input" type="text" placeholder="Bind DN" id="chaining-name" name="name">

+                   </div>

+                   <div>

+                     <label for="create-nsfarmserverurl" class="ds-config-label" title=

+                       "The URL for the remote server.  Add additional failure servers URLs separated by a space. (nsfarmserverurl)">

+                       Remote Server URL(s)</label><input class="ds-dblink-form-input" type="text" id="create-nsfarmserverurl"/>

+                   </div>

+                   <div>

+                     <label for="create-nsmultiplexorbinddn" class="ds-config-label" title="Bind DN used to authenticate against the remote server (nsmultiplexorbinddn).">Remote Server Bind DN</label><input

+                       class="ds-dblink-form-input" type="text" autocomplete="username" placeholder="Bind DN" id="create-nsmultiplexorbinddn" name="name">

+                   </div>

+                   <div>

+                     <label for="create-nsmultiplexorcredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Bind DN Credentials</label><input

+                       class="ds-dblink-form-input" type="password" autocomplete="new-password" placeholder="Enter password" id="create-nsmultiplexorcredentials" name="name">

+                   </div>

+                   <div>

+                     <label for="create-nsmultiplexorcredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

+                       class="ds-dblink-form-input" type="password" autocomplete="new-password" placeholder="Confirm password" id="create-nsmultiplexorcredentials-confirm" name="name">

+                   </div>

+                   <div>

+                     <label for="dblink-conn" class="ds-config-label" title="The connection protocol for the remote server.">Connection Protocol</label><select

+                       class="btn btn-default dropdown ds-dblink-dropdown" id="dblink-conn">

+                         <option>LDAP</option>

+                         <option>LDAPS</option>

+                         <option>Start TLS</option>

+                       </select>

+                   </div>

+                   <div>

+                     <label for="nsbindmechanism" class="ds-config-label" title="The bind method for contacting the remote server  (nsbindmechanism).">Bind Method</label><select

+                       class="btn btn-default dropdown ds-dblink-dropdown" id="nsbindmechanism">

+                         <option>Simple</option>

+                         <option>SASL/DIGEST-MD5</option>

+                         <option>SASL/GSSAPI</option>

+                       </select>

+                   </div>

+                 </div>

+               </div>

+             </form>

+           </div>

+           <div class="modal-footer ds-modal-footer">

+             <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+             <button type="button" class="btn btn-primary" id="chaining-save">Create Link</button>

+           </div>

          </div>

-         <div class="modal-body">

-           <form class="form-horizontal">

-             <div class="ds-container">

+       </div>

+     </div>

+ 

+     <!--

+         Create New Instance

+     -->

+     <div class="modal fade" id="create-inst-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="create-inst-header" aria-hidden="true">

+       <div class="modal-dialog ds-modal">

+         <div class="modal-content animate">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="create-inst-header">Create New Server Instance</h4>

+           </div>

+           <div class="modal-body">

+             <form class="form-horizontal">

+               <p class="ds-modal-error"></p>

                <div class="ds-inline">

                  <div>

-                   <label for="chaining-name" class="ds-config-label" title="The name of the database link.">Database Link Name</label><input

-                     class="ds-dblink-form-input" type="text" placeholder="Bind DN" id="chaining-name" name="name">

+                   <label for="create-inst-serverid" class="ds-config-label" title="The instance name, this is what gets appended to \"slapi-\"">

+                     Instance Name</label><input class="ds-input ds-inst-input" type="text" id="create-inst-serverid" placeholder="Your_Instance_Name" required />

                  </div>

                  <div>

-                   <label for="create-nsfarmserverurl" class="ds-config-label" title=

-                     "The URL for the remote server.  Add additional failure servers URLs separated by a space. (nsfarmserverurl)">

-                     Remote Server URL(s)</label><input class="ds-dblink-form-input" type="text" id="create-nsfarmserverurl"/>

+                   <label for="create-inst-port" class="ds-config-label" title="The server port number">

+                     Port</label><input class="ds-input ds-inst-input" type="text" value="389" id="create-inst-port" required />

                  </div>

                  <div>

-                   <label for="create-nsmultiplexorbinddn" class="ds-config-label" title="Bind DN used to authenticate against the remote server (nsmultiplexorbinddn).">Remote Server Bind DN</label><input

-                     class="ds-dblink-form-input" type="text" placeholder="Bind DN" id="create-nsmultiplexorbinddn" name="name">

+                   <label for="create-inst-secureport" class="ds-config-label" title="The secure port number for TLS connections">

+                     Secure Port</label><input class="ds-input ds-inst-input" type="text" value="636" id="create-inst-secureport" required />

                  </div>

                  <div>

-                   <label for="create-nsmultiplexorcredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Bind DN Credentials</label><input

-                     class="ds-dblink-form-input" type="password" placeholder="Enter password" id="create-nsmultiplexorcredentials" name="name">

+                   <label for="create-inst-rootdn" class="ds-config-label" title="The DN for the unrestricted  user">

+                     Directory Manager DN</label><input class="ds-input ds-inst-input" autocomplete="username" value="cn=Directory Manager" type="text" id="create-inst-rootdn" required />

                  </div>

                  <div>

-                   <label for="create-nsmultiplexorcredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

-                     class="ds-dblink-form-input" type="password" placeholder="Confirm password" id="create-nsmultiplexorcredentials-confirm" name="name">

+                   <label for="rootdn-pw" class="ds-config-label" title="Directory Manager password.">Directory Manager Password</label><input

+                     class="ds-input ds-inst-input" type="password" autocomplete="new-password" placeholder="Enter password" id="rootdn-pw" name="name" required>

                  </div>

                  <div>

-                   <label for="dblink-conn" class="ds-config-label" title="The connection protocol for the remote server.">Connection Protocol</label><select

-                     class="btn btn-default dropdown ds-dblink-dropdown" id="dblink-conn">

-                       <option>LDAP</option>

-                       <option>LDAPS</option>

-                       <option>Start TLS</option>

-                     </select>

+                   <label for="rootdn-pw-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

+                     class="ds-input ds-inst-input" type="password" autocomplete="new-password" placeholder="Confirm password" id="rootdn-pw-confirm" name="name" required>

                  </div>

+                 <hr>

                  <div>

-                   <label for="nsbindmechanism" class="ds-config-label" title="The bind method for contacting the remote server  (nsbindmechanism).">Bind Method</label><select

-                     class="btn btn-default dropdown ds-dblink-dropdown" id="nsbindmechanism">

-                       <option>Simple</option>

-                       <option>SASL/DIGEST-MD5</option>

-                       <option>SASL/GSSAPI</option>

-                     </select>

+                   <label for="backend-name" class="ds-config-label" title="The backend name, like 'userroot'">Backend Name (optional)</label><input

+                     class="ds-input ds-inst-input" type="text" id="backend-name">

+                 </div>

+                 <div>

+                   <label for="backend-suffix" class="ds-config-label" title="Database suffix, like 'dc=example,dc=com'">Backend Suffix (optional)</label><input

+                     class="ds-input ds-inst-input" type="text" id="backend-suffix">

+                 </div>

+                 <div>

+                   <label for="create-sample-entries" class="ds-config-label" title="Create sample entries in the suffix">Create Sample Entries </label><input

+                     type="checkbox" class="ds-input ds-config-checkbox" id="create-sample-entries">

                  </div>

-               </div>

-             </div>

-           </form>

-         </div>

-         <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id="chaining-save">Create Link</button>

-         </div>

-       </div>

-     </div>

-   </div>

- 

-   <!--

-       Create New Instance

-   -->

-   <div class="modal fade" id="create-inst-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="create-inst-header" aria-hidden="true">

-     <div class="modal-dialog ds-modal">

-       <div class="modal-content animate">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="create-inst-header">Create New Server Instance</h4>

-         </div>

-         <div class="modal-body">

-           <form class="form-horizontal">

-             <p class="ds-modal-error"></p>

-             <div class="ds-inline">

-               <div>

-                 <label for="create-inst-serverid" class="ds-config-label" title="The instance name, this is what gets appended to \"slapi-\"">

-                   Instance Name</label><input class="ds-input ds-inst-input" type="text" id="create-inst-serverid" placeholder="Your_Instance_Name" required />

-               </div>

-               <div>

-                 <label for="create-inst-port" class="ds-config-label" title="The server port number">

-                   Port</label><input class="ds-input ds-inst-input" type="text" value="389" id="create-inst-port" required />

-               </div>

-               <div>

-                 <label for="create-inst-secureport" class="ds-config-label" title="The secure port number for TLS connections">

-                   Secure Port</label><input class="ds-input ds-inst-input" type="text" value="636" id="create-inst-secureport" required />

-               </div>

-               <div>

-                 <label for="create-inst-rootdn" class="ds-config-label" title="The DN for the unrestricted  user">

-                   Directory Manager DN</label><input class="ds-input ds-inst-input" value="cn=Directory Manager" type="text" id="create-inst-rootdn" required />

-               </div>

-               <div>

-                 <label for="rootdn-pw" class="ds-config-label" title="Directory Manager password.">Directory Manager Password</label><input

-                   class="ds-input ds-inst-input" type="password" placeholder="Enter password" id="rootdn-pw" name="name" required>

-               </div>

-               <div>

-                 <label for="rootdn-pw-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

-                   class="ds-input ds-inst-input" type="password" placeholder="Confirm password" id="rootdn-pw-confirm" name="name" required>

-               </div>

-               <hr>

-               <div>

-                 <label for="backend-name" class="ds-config-label" title="The backend name, like 'userroot'">Backend Name (optional)</label><input

-                   class="ds-input ds-inst-input" type="text" id="backend-name">

-               </div>

-               <div>

-                 <label for="backend-suffix" class="ds-config-label" title="Database suffix, like 'dc=example,dc=com'">Backend Suffix (optional)</label><input

-                   class="ds-input ds-inst-input" type="text" id="backend-suffix">

-               </div>

-               <div>

-                 <label for="create-sample-entries" class="ds-config-label" title="Create sample entries in the suffix">Create Sample Entries </label><input

-                   type="checkbox" class="ds-input ds-config-checkbox" id="create-sample-entries">

-               </div>

-               <hr>

-               <div>

-                 <input type="checkbox" class="ds-config-checkbox" id="create-inst-tls" checked><label

-                   for="create-inst-tls" class="ds-label" title="Create a self-signed certificate database">Create Self Signed Certificate DB</label>

-               </div>

-               <div id="create-inst-spinner" class="ds-center" hidden>

                  <hr>

-                 <p><span class="spinner spinner-xs spinner-inline"></span> Creating instance...</p>

+                 <div>

+                   <input type="checkbox" class="ds-config-checkbox" id="create-inst-tls" checked><label

+                     for="create-inst-tls" class="ds-label" title="Create a self-signed certificate database">Create Self Signed Certificate DB</label>

+                 </div>

+                 <div id="create-inst-spinner" class="ds-center" hidden>

+                   <hr>

+                   <p><span class="spinner spinner-xs spinner-inline"></span> Creating instance...</p>

+                 </div>

                </div>

-             </div>

-           </form>

-         </div>

-         <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id="create-inst-save">Create Instance</button>

+             </form>

+           </div>

+           <div class="modal-footer ds-modal-footer">

+             <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+             <button type="button" class="btn btn-primary" id="create-inst-save">Create Instance</button>

+           </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <!--

-       Do Backup

-   -->

-   <div class="modal fade" id="backup-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="backup-label" aria-hidden="true">

-     <div class="modal-dialog">

-       <div class="modal-content">

-         <div class="modal-header">

-           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

-             <span class="pficon pficon-close"></span>

-           </button>

-           <h4 class="modal-title" id="backup-label">Backup Directory Server</h4>

-         </div>

-         <div class="modal-body">

-           <form class="form-horizontal">

-             <div class="ds-inline">

-               <label for="backup-name" title="Enter a directory name for the backup">

-                 Backup Name</label><input class="ds-input ds-left-margin" type="text" id="backup-name"/>

+     <!--

+         Do Backup

+     -->

+     <div class="modal fade" id="backup-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="backup-label" aria-hidden="true">

+       <div class="modal-dialog">

+         <div class="modal-content">

+           <div class="modal-header">

+             <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+               <span class="pficon pficon-close"></span>

+             </button>

+             <h4 class="modal-title" id="backup-label">Backup Directory Server</h4>

+           </div>

+           <div class="modal-body">

+             <form class="form-horizontal">

+               <div class="ds-inline">

+                 <label for="backup-name" title="Enter a directory name for the backup">

+                   Backup Name</label><input class="ds-input ds-left-margin" type="text" id="backup-name"/>

+               </div>

+             </form>

+             <div id="backup-spinner" class="ds-center" hidden>

+               <p></p>

+               <p><span class="spinner spinner-xs spinner-inline"></span> Backing up the server...</p>

              </div>

-           </form>

-           <div id="backup-spinner" class="ds-center" hidden>

-             <p></p>

-             <p><span class="spinner spinner-xs spinner-inline"></span> Backing up the server...</p>

            </div>

-         </div>

-         <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id="ds-backup-btn">Do Backup</button>

+           <div class="modal-footer ds-modal-footer">

+             <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+             <button type="button" class="btn btn-primary" id="ds-backup-btn">Do Backup</button>

+           </div>

          </div>

        </div>

      </div>

-   </div>

  

-   <!-- The Nav Tabs  -->

+     <!-- The Nav Tabs  -->

  

-   <div class="ds-content">

-     <div id="no-package" class="all-pages ds-center" hidden>

-       <h3>There is no <b>389-ds-base</b> package installed on this system.  Sorry there is nothing to manage...</h3>

-     </div>

-     <div id="no-instances" class="all-pages ds-center" hidden>

-       <h3>There are no Directory Server instances to manage</h3>

-       <p>

-         <button type="button" class="btn btn-primary" id="no-inst-create-btn" data-toggle="modal" data-target="#create-inst-form">Create New Instance</button>

-       </p>

-     </div>

-     <div id="not-running" class="all-pages ds-center" hidden>

-       <h3>This server instance is not running, either start it from the <b>Actions</b> dropdown menu, or choose a different instance</h3>

-     </div>

-     <div id="no-connect" class="all-pages ds-center" hidden>

-       <h3>This server instance is running, but we can not connect to it.  Check LDAPI is properly configured on this instance.</h3>

-     </div>

+     <div class="ds-content">

+       <div id="no-package" class="all-pages ds-center" hidden>

+         <h3>There is no <b>389-ds-base</b> package installed on this system.  Sorry there is nothing to manage...</h3>

+       </div>

+       <div id="no-instances" class="all-pages ds-center" hidden>

+         <h3>There are no Directory Server instances to manage</h3>

+         <p>

+           <button type="button" class="btn btn-primary" id="no-inst-create-btn" data-toggle="modal" data-target="#create-inst-form">Create New Instance</button>

+         </p>

+       </div>

+       <div id="not-running" class="all-pages ds-center" hidden>

+         <h3>This server instance is not running, either start it from the <b>Actions</b> dropdown menu, or choose a different instance</h3>

+       </div>

+       <div id="no-connect" class="all-pages ds-center" hidden>

+         <h3>This server instance is running, but we can not connect to it.  Check LDAPI is properly configured on this instance.</h3>

+       </div>

  

-     <div id="server-content" class="all-pages" hidden>

-     </div>

+       <div id="server-content" class="all-pages" hidden>

+       </div>

  

-     <div id="security-content" class="all-pages" hidden>

-     </div>

+       <div id="security-content" class="all-pages" hidden>

+       </div>

  

-     <div id="database-content" class="all-pages" hidden>

-     </div>

+       <div id="database-content" class="all-pages" hidden>

+       </div>

  

-     <div id="replication-content" class="all-pages" hidden>

-     </div>

+       <div id="replication-content" class="all-pages" hidden>

+       </div>

  

-     <div id="schema-content" class="all-pages" hidden>

-     </div>

+       <div id="schema-content" class="all-pages" hidden>

+       </div>

  

-     <div id="plugin-content" class="all-pages" hidden>

-     </div>

+       <div id="plugin-content" class="all-pages" hidden>

+       </div>

+ 

+       <div id="monitor-content" class="all-pages" hidden>

+       </div>

  

-     <div id="monitor-content" class="all-pages" hidden>

      </div>

  

    </div>

- 

  </body>

  </html>

  

file modified
+122 -57
@@ -14,24 +14,28 @@ 

  var plugin_page_loaded = 0;

  var schema_page_loaded = 0;

  var monitor_page_loaded = 0;

+ var config_loaded = 0;

  

  // objects to store original values (used for comparing what changed when saving

  var config_values = {};

  var localpwp_values = {};

- //TODO - need "config_values" for all the other pages: backend, replication, suffix, etc.

+ var repl_config_values = {};

+ var repl_cl_values = {};

  

+ //TODO - need "config_values" for all the other pages: backend, replication, suffix, etc.

+ /*

  var DSCONF = "dsconf";

  var DSCTL = "dsctl";

  var DSCREATE = "dscreate";

  var ENV = "";

+ */

  

- /*

  // Used for local development testing

  var DSCONF = '/home/mareynol/source/ds389/389-ds-base/src/lib389/cli/dsconf';

  var DSCTL = '/home/mareynol/source/ds389/389-ds-base/src/lib389/cli/dsctl';

  var DSCREATE = '/home/mareynol/source/ds389/389-ds-base/src/lib389/cli/dscreate';

  var ENV = "PYTHONPATH=/home/mareynol/source/ds389/389-ds-base/src/lib389";

- */

+ 

  

  // TODO validation functions

  
@@ -82,13 +86,27 @@ 

  }

  

  

+ function get_date_string (timestamp) {

+   // Convert DS timestamp to a friendly string: 20180921142257Z -> 10/21/2018, 2:22:57 PM

+   var year = timestamp.substr(0,4);

+   var month = timestamp.substr(4,2);

+   var day = timestamp.substr(6,2);

+   var hour = timestamp.substr(8,2);

+   var minute = timestamp.substr(10,2);

+   var sec = timestamp.substr(12,2);

+   var date = new Date(parseInt(year), parseInt(month), parseInt(day),

+                       parseInt(hour), parseInt(minute), parseInt(sec));

+ 

+   return date.toLocaleString();

+ }

+ 

+ 

+ 

  function set_no_insts () {

-     var select = document.getElementById("select-server");

-     var el = document.createElement("option");

-     el.textContent = "No instances";

-     el.value = "No instances";

-     select.appendChild(el);

-     select.selectedIndex = "0";

+     $("#select-server").empty();

+     $("#select-server").append('<option value="No instances">No instances</option>');

+     $("#select-server").prop('selectedIndex',0);

+ 

      server_id = "";

      server_inst = "";

  
@@ -121,16 +139,18 @@ 

        $(".all-pages").hide();

        $("#no-connect").show();

      } else {

-       $(".all-pages").hide();

-       $("#ds-navigation").show();

-       $("#server-content").show();

-       $("#server-config").show();

-       //$("#no-instances").hide();

-       //$("#no-package").hide();

+       // if nav page was hidden reset everything

+       if ($("#ds-navigation").is(":hidden") ){

+         $(".all-pages").hide();

+         $("#ds-navigation").show();

+         $("#server-content").show();

+         $("#server-config").show();

+       }

        $("#not-running").hide();

-       $("#no_connect").hide();

+       $("#no-connect").hide();

      }

    }).fail(function(data) {

+     $("#loading-page").hide();

      $("#ds-navigation").hide();

      $(".all-pages").hide();

      $("#not-running").show();
@@ -138,6 +158,12 @@ 

  }

  

  function get_insts() {

+   // Load initial forms

+   $("#server-list-menu").attr('disabled', false);

+   $("#ds-navigation").show();

+   $(".all-pages").hide();

+   $("#no-instances").hide();

+ 

    var insts = [];

    var cmd = ["/bin/sh", "-c", "/usr/bin/ls -d " + DS_HOME + "slapd-*"];

    cockpit.spawn(cmd, { superuser: true }).done(function(data) {
@@ -156,43 +182,27 @@ 

      }

  

      // Populate the server instance drop down

-     var select = document.getElementById("select-server");

-     var list_length = select.options.length;

- 

-     // Clear the list first

-     for (i = 0; i < list_length; i++) {

-       select.options[i] = null;

-     }

- 

-     // Update the list

+     $("#select-server").empty();

      for (i = 0; i < insts.length; i++) {

-       var opt = insts[i];

-       var el = document.createElement("option");

-       el.textContent = opt;

-       el.value = opt;

-       select.appendChild(el);

+       $("#select-server").append('<option value="' + insts[i] + '">' + insts[i] +'</option>');

      }

-     select.selectedIndex = "0";

+     $("#select-server").prop('selectedIndex',0);

+ 

      if (insts[0] === undefined) {

        set_no_insts();

+       $("#loading-page").hide();

+       $("#everything").show();

      } else {

        // We have at least one instance, make sure we "open" the UI

-       $("#server-list-menu").attr('disabled', false);

-       $("#ds-navigation").show();

-       $(".all-pages").hide();

-       $("#no-instances").hide();

-       $("#server-content").show();

-       $("#server-config").show();

        server_id = insts[0];

        server_inst = insts[0].replace("slapd-", "");

        check_inst_alive();

-       // We have an instance, so load its config

        load_config();

      }

-     $("body").show();

    }).fail(function(error){

      set_no_insts();

-     $("body").show();

+     $("#loading-page").hide();

+     $("#everything").show();

    });

  }

  
@@ -211,6 +221,7 @@ 

        '<pre>' + msg + '</pre>'

      ]

    });

+   check_inst_alive(0);

  }

  

  function popup_msg(title, msg) {
@@ -235,14 +246,14 @@ 

      showclose: false,

      buttons: ["no", "yes"],

      yes: function() { answer = true; },

-     dismiss: function() { callback(answer); }

+     dismiss: function() { callback(answer); },

    });

  }

  

  function popup_success(msg) {

    $('#success-msg').html(msg);

    $('#success-form').modal('show');

-   setTimeout(function() {$('#success-form').modal('hide');}, 1500);

+   setTimeout(function() {$('#success-form').modal('hide');}, 2000);

  }

  

  // This is called when any Save button is clicked on the main page.  We call
@@ -259,21 +270,75 @@ 

  }

  

  function load_config (){

-   // Populate all the suffix dropdown lists

-   update_suffix_dropdowns();

- 

-   // Server page

-   get_and_set_config(); // cn=config stuff

-   get_and_set_sasl();

-   get_and_set_localpwp();

-   get_and_set_schema_tables();

- 

-   // Security page

-   // Database page

-   // Replication page

-   // Schema page

-   // Plugin page

-   // Monitoring page

+   // Load the configuration for all the pages.

+   var dropdowns = ['local-pwp-suffix', 'select_repl_suffix', 'select-repl-cfg-suffix',

+                    'select-repl-agmt-suffix', 'select-repl-winsync-suffix',

+                    'cleanallruv-suffix', 'monitor-repl-backend-list'];

+ 

+   // Show the spinner, and reset the pages

+   $("#loading-msg").html("Loading Directory Server configuration for <i><b>" + server_id + "</b></i>...");

+   $("#everything").hide();

+   $(".all-pages").hide();

+   $("#loading-page").show();

+   config_loaded = 0;

+ 

+   /*

+    * Start with the dropdowns, if this fails we stop here, otherwise we assume

+    * we are up and running and we can load the other config/

+    */

+   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','backend', 'list', '--suffix'];

+   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+     // Update dropdowns

+     for (var idx in dropdowns) {

+       $("#" + dropdowns[idx]).empty();

+     }

+     var obj = JSON.parse(data);

+     for (var idx in obj['items']) {

+       for (var list in dropdowns){

+         $("#" + dropdowns[list]).append('<option value="' + obj['items'][idx] + '" selected="selected">' + obj['items'][idx] +'</option>');

+       }

+     }

+ 

+     // Server page

+     get_and_set_config();

+     get_and_set_sasl();

+     get_and_set_localpwp();

+ 

+     // Schema page

+     get_and_set_schema_tables();

+ 

+     // Replication page

+     get_and_set_repl_config();

+     get_and_set_repl_agmts();

+     get_and_set_repl_winsync_agmts();

+     get_and_set_cleanallruv();

+ 

+     // Security page

+     // Database page

+     // Plugin page

+     // Monitoring page

+ 

+     // Initialize the tabs

+     $(".ds-tab-list").css( 'color', '#777');

+     $("#server-tab").css( 'color', '#228bc0');

+ 

+     // Set an interval event to wait for all the pages to load, then show the content

+     var loading_config = setInterval(function() {

+       if (config_loaded == 1) {

+         $("#loading-page").hide();

+         $("#everything").show();

+         $("#server-content").show();

+         $("#server-config").show();

+         clearInterval(loading_config);

+         console.log("Completed configuration initialization.");

+       }

+     }, 300);

+ 

+   }).fail(function(data) {

+     popup_err("Failed To Contact Server",data.message);

+     $("#everything").show();

+     check_inst_alive(1);

+   });

  }

  

  $(window.document).ready(function() {

@@ -277,6 +277,7 @@ 

        "bAutoWidth": false,

        "searching": false,

        "dom": '<"pull-left"f><"pull-right"l>tip',

+       "lengthChange": false,

        "lengthMenu": [ 10, 25, 50, 100],

        "language": {

          "emptyTable": "No active connections",

@@ -1,8 +1,24 @@ 

  var repl_suffix = "";

- var prev_repl_role ="no-repl";

+ var prev_repl_role = "no-repl";

  var prev_role_button;

- var prev_rid = "";

  var binddn_list_color = "";

+ var repl_mgr_table;

+ var current_role = "";

+ var current_rid = "";

+ var repl_agmt_table;

+ var repl_winsync_agmt_table;

+ var repl_clean_table;

+ var mgr_dn;

+ var repl_agmt_values = {};

+ var repl_winsync_agmt_values = {};

+ var frac_prefix = "(objectclass=*) $ EXCLUDE";

+ var agmt_init_intervals = [];

+ var agmt_init_counter = 0;

+ var winsync_init_intervals = [];

+ var winsync_init_counter = 0;

+ 

+ // HTML items

+ var progress_html = '<p><span class="spinner spinner-xs spinner-inline"></span> Initializing Agreement...</p>';

  

  var agmt_action_html =

    '<div class="dropdown">' +
@@ -11,11 +27,10 @@ 

        '<span class="caret"></span>' +

      '</button>' +

      '<ul class="dropdown-menu ds-agmt-dropdown" role="menu">' +

-       '<li role=""><a class="repl-agmt-btn agmt-edit-btn" href="#">View/Edit Agreement</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Initialize Consumer (online)</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Initialize Consumer (ldif)</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Send Updates Now</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Enable/Disable Agreement</a></li>' +

+       '<li role=""><a class="repl-agmt-btn agmt-edit-btn" href="#">Edit Agreement</a></li>' +

+       '<li role=""><a class="repl-agmt-btn agmt-init-btn" href="#">Initialize Agreement</a></li>' +

+       '<li role=""><a class="repl-agmt-btn agmt-send-updates-btn" href="#">Send Updates Now</a></li>' +

+       '<li role=""><a class="repl-agmt-btn agmt-enable-btn" href="#">Enable/Disable Agreement</a></li>' +

        '<li role=""><a class="repl-agmt-btn agmt-del-btn" href="#">Delete Agreement</a></li>' +

      '</ul>' +

    '</div>';
@@ -27,66 +42,87 @@ 

        '<span class="caret"></span>' +

      '</button>' +

      '<ul class="dropdown-menu ds-agmt-dropdown" role="menu" aria-labelledby="dropdownMenu2">' +

-       '<li role=""><a class="repl-agmt-btn winsync-agmt-edit-btn" href="#">View/Edit Agreement</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Send/Receives Updates Now</a></li>' +

-       '<li role=""><a class="repl-agmt-btn" href="#">Full Re-synchronization</a></li>' +

+       '<li role=""><a class="repl-agmt-btn winsync-agmt-edit-btn" href="#">Edit Agreement</a></li>' +

+       '<li role=""><a class="repl-agmt-btn winsync-agmt-send-updates-btn" href="#">Send/Receives Updates Now</a></li>' +

+       '<li role=""><a class="repl-agmt-btn winsync-agmt-init-btn" href="#">Full Re-synchronization</a></li>' +

+       '<li role=""><a class="repl-agmt-btn winsync-agmt-enable-btn" href="#">Enable/Disable Agreement</a></li>' +

        '<li role=""><a class="repl-agmt-btn winsync-agmt-del-btn" href="#">Delete Agreement</a></li>' +

      '</ul>' +

    '</div>';

  

  var cleanallruv_action_html =

-   '<button class="btn btn-default ds-agmt-dropdown-button" type="button" class="abort-cleanallruv">Abort Task</button>';

+   '<button class="btn btn-default ds-agmt-dropdown-button abort_cleanallruv_btn" type="button" class="abort-cleanallruv">Abort Task</button>';

+ 

+ // Attribute to CLI argument mappings

+ var repl_attr_map = {

+   'nsds5replicaid': '--replica-id',

+   'nsds5replicapurgedelay': '--repl-purge-delay',

+   'nsds5replicatombstonepurgeinterval': '--repl-tombstone-purge-interval',

+   'nsds5Replicaprecisetombstonepurging': '--repl-fast-tombstone-purging',

+   'nsds5replicabinddngroup': '--repl-bind-group',

+   'nsds5replicabinddngroupcheckinterval':  '--repl-bind-group-interval',

+   'nsds5replicaprotocoltimeout': '--repl-protocol-timeout',

+   'nsds5replicabackoffmin': '--repl-backoff-min',

+   'nsds5replicabackoffmax': '--repl-backoff-_max',

+   'nsds5replicareleasetimeout': '--repl-release-timeout',

+   'nsds5flags': '',

+   'nsds5replicatype': '',

+   'nsds5replicabinddn': '',

+   'nsslapd-changelogdir': '--cl-dir',

+   'nsslapd-changelogmaxentries': '--max-entries',

+   'nsslapd-changelogmaxage': '--max-age',

+   'nsslapd-changelogcompactdb-interval': '--compact-interval',

+   'nsslapd-changelogtrim-interval': '--trim-interval',

+   'nsslapd-encryptionalgorithm': '--encrypt-algo',

+ };

  

- function load_repl_jstree() {

-   $('#repl-tree').jstree( {

-     "plugins" : [ "wholerow" ]

-   });

+ var repl_cl_attrs = ['nsslapd-changelogdir', 'nsslapd-changelogmaxentries', 'nsslapd-changelogmaxage',

+                      'nsslapd-changelogcompactdb-interval', 'nsslapd-changelogtrim-interval',

+                      'nsslapd-encryptionalgorithm' ];

+ 

+ var repl_attrs = ['nsds5replicaid', 'nsds5replicapurgedelay', 'nsds5replicatombstonepurgeinterval',

+                   'nsds5replicaprecisetombstonepurging', 'nsds5replicabinddngroup',

+                   'nsds5replicabinddngroupcheckinterval', 'nsds5replicaprotocoltimeout', 'nsds5replicabackoffmin',

+                   'nsds5replicabackoffmax', 'nsds5replicareleasetimeout'];

  

-   // Set rid for each suffix if applicable

-   prev_rid = "1";

- 

-   $('#repl-tree').on("changed.jstree", function (e, data) {

-     console.log("The selected nodes are:");

-     console.log(data.selected);

-     repl_suffix = data.selected;

-     if (repl_suffix == "repl-root") {

-       $("#repl-config").hide();

-       $("#repl-splash").show();

-     } else {

-       // Suffix

-       $("#repl-splash").hide();

-       $("#replica-header").html("Replication Configuration <font size='3'>(<b>" + repl_suffix + "</b>)</font>");

-       // Check if this suffix is already setup for replication.  If so set the radio button, and populate the form

-       $("#repl-config").show();

-     }

-   });

- };

  

+ // Helper functions

  function clear_agmt_wizard () {

    // Clear input fields and reset dropboxes

-   $('.ds-agmt-schedule-checkbox').prop('checked', true);

+   $('.ds-agmt-schedule-checkbox').prop('checked', false);

    $('#agmt-schedule-checkbox').prop('checked', true);

-   $(".ds-wiz-input").val("");

-   $("#agmt-start-time").val("");

-   $("#agmt-end-time").val("");

+   $("#agmt-start-time").val("00:00");

+   $("#agmt-end-time").val("00:15");

    $(".ds-agmt-wiz-dropdown").prop('selectedIndex',0);

    $(".ds-agmt-panel").css('display','none');

+   $(".agmt-form-input").css("border-color", "initial");

+   $(".agmt-form-input").val("");

+   $('#frac-exclude-list').find('option').remove();

+   $('#frac-exclude-tot-list').find('option').remove();

+   $('#frac-strip-list').find('option').remove();

+   load_schema_objects_to_select('attributetypes', 'select-attr-list');

+   $("#select-attr-list").prop('selectedIndex',-1);

+   $("#init-options").prop("selectedIndex", 0);

+   $("#init-agmt-dropdown").show();

  };

  

  function clear_winsync_agmt_wizard() {

    // Clear out winsync agreement form

    $("#winsync-agmt-cn").val("");

-   $("#nsds7windowsdomain").val("");

+   $("#winsync-nsds7windowsdomain").val("");

    $("#winsync-nsds5replicahost").val("");

    $("#winsync-nsds5replicaport").val("");

-   $("#nsds7windowsreplicasubtree").val("");

-   $("#nsds7directoryreplicasubtree").val("");

-   $("#nsds7newwinusersyncenabled-checkbox").prop('checked', false);

-   $("#nsds7newwingroupsyncenabled-checkbox").prop('checked', false);

+   $("#winsync-nsds7windowsreplicasubtree").val("");

+   $("#winsync-nsds7directoryreplicasubtree").val("");

+   $("#winsync-nsds7newwinusersyncenabled-checkbox").prop('checked', false);

+   $("#winsync-nsds7newwingroupsyncenabled-checkbox").prop('checked', false);

+   $("#winsync-init-checkbox").prop('checked', false);

+   $("#winsync-init-chbx").show();

    $("#winsync-nsds5replicabinddn").val("");

    $("#winsync-nsds5replicacredentials").val("");

    $("#winsync-nsds5replicacredentials-confirm").val("");

-   $("#winsync-nsds5replicabindmethod").prop('selectedIndex', 0);

+   $("#winsync-nsds5replicatransportinfo").prop('selectedIndex', 0);

+   $("#winsync-agmt-wizard-title").html("<b>Create Winsync Agreement</b>");

  }

  

  function clear_cleanallruv_form () {
@@ -105,143 +141,453 @@ 

  

  

  function add_repl_mgr(dn){

+   // First check if manager is set to none

  	$("#repl-mgr-table tbody").append(

  		"<tr>"+

  		"<td class='ds-td'>" + dn +"</td>"+

      "<td class='ds-center'>"+

-     "<button type='button' class='btn btn-default ds-table-btn del-repl-mgr'>" +

-     "<span class='glyphicon glyphicon-trash'></span> Remove</button></td>" +

+     "<button type='button' class='btn btn-default remove-repl-mgr' data-toggle='modal' data-target='#del-repl-mgr-form' title='Remove the manager from the replication configuration'>" +

+     "<span class='glyphicon glyphicon-trash'></span> Remove </button></td>" +

  		"</tr>");

  };

  

  

- $(document).ready( function() {

-   $("#replication-content").load("replication.html", function () {

-     // Load the dropdown TODO

- 

-     binddn_list_color = $("#repl-managers-list").css("border-color");

- 

-     // Load existing replication config (if any), set role, etc

- 

-     $("#schedule-settings").hide();

+ function do_agmt_init(suffix, agmt_cn, idx) {

+   var status_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'init-status', '--suffix=' + suffix, '"' + agmt_cn + '"' ];

+   console.log("CMD: Get initialization status for agmt: " + status_cmd.join(' '));

+   cockpit.spawn(status_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+     var init_stat = JSON.parse(data);

+     if (init_stat == 'Agreement successfully initialized.' ||

+         init_stat == 'Agreement initialization failed.')

+     {

+       // Init is done (good or bad)

+       get_and_set_repl_agmts();

+       clearInterval(agmt_init_intervals[idx]);

+     }

+   });

+ }

  

-     $("#repl-config-btn").on("click", function() {

-       $(".all-pages").hide();

-       $("#replication-content").show();

-       $("#repl-config").show();

-     });

+ function do_winsync_agmt_init(suffix, agmt_cn, idx) {

+   var status_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'init-status', '--suffix=' + suffix, '"' + agmt_cn + '"' ];

+   console.log("CMD: Get initialization status for agmt: " + status_cmd.join(' '))

+   cockpit.spawn(status_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+     var init_stat = JSON.parse(data);

+     if (init_stat == 'Agreement successfully initialized.' ||

+         init_stat == 'Agreement initialization failed.')

+     {

+       // Init is done (good or bad)

+       get_and_set_repl_winsync_agmts();

+       clearInterval(agmt_init_intervals[idx]);

+     }

+   });

+ }

  

-     $("#repl-agmts-btn").on("click", function() {

-       $(".all-pages").hide();

-       $("#replication-content").show();

-       $("#repl-agmts").show();

-     });

+ function get_and_set_repl_winsync_agmts() {

+   /*

+    * Get the replication agreements for the selected suffix

+    */

+   var suffix = $("#select-repl-winsync-suffix").val();

+   repl_winsync_agmt_table.clear();

+ 

+   if (suffix) {

+     console.log("Loading winsync replication agreements...");

+     var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'list', '--suffix=' + suffix ];

+     console.log("CMD: Get winsync agmts: " + cmd.join(' '))

+     cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+       var obj = JSON.parse(data);

+       for (var idx in obj['items']) {

+         var state = "Enabled";

+         var con_host = "";

+         var con_port = "";

+         var ds_subtree = "";

+         var win_subtree = "";

+         agmt_attrs = obj['items'][idx]['attrs'];

+         var agmt_name = agmt_attrs['cn'][0];

+ 

+         // Compute state (enabled by default)

+         if ('nsds5replicaenabled' in agmt_attrs) {

+           if (agmt_attrs['nsds5replicaenabled'][0].toLowerCase() == 'off'){

+             state = "Disabled";

+           }

+         }

+         var ws_agmt_init_status = "Initialized";

+         if ('nsds5replicalastinitstatus' in agmt_attrs &&

+             agmt_attrs['nsds5replicalastinitstatus'][0] != "")

+         {

+           ws_agmt_init_status = agmt_attrs['nsds5replicalastinitstatus'][0];

+           if (ws_agmt_init_status == "Error (0) Total update in progress") {

+             ws_agmt_init_status = progress_html;

+             var ws_interval_agmt_name = agmt_name;

+             var ws_init_status_interval = setInterval(function() {

+               var status_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'init-status', '--suffix=' + suffix, '"' + ws_interval_agmt_name + '"' ];

+               console.log("CMD: Get initialization status for winsync agmt: " + status_cmd.join(' '))

+               cockpit.spawn(status_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                 var init_stat = JSON.parse(data);

+                 if (init_stat == 'Agreement successfully initialized.' ||

+                     init_stat == 'Agreement initialization failed.')

+                 {

+                   // Init is done (good or bad)

+                   get_and_set_repl_winsync_agmts();

+                   clearInterval(ws_init_status_interval);

+                 }

+               });

+             }, 2000);

+           } else if (ws_agmt_init_status == "Error (0) Total update succeeded") {

+             ws_agmt_init_status = "Initialized";

+           }

+         } else if (agmt_attrs['nsds5replicalastinitstart'][0] == "19700101000000Z"){

+           ws_agmt_init_status = "Not initialized";

+         }

  

-     $("#repl-winsync-btn").on("click", function() {

-       $(".all-pages").hide();

-       $("#replication-content").show();

-       $("#repl-winsync").show();

-     });

-     $("#repl-cleanallruv-btn").on("click", function() {

-       $(".all-pages").hide();

-       $("#replication-content").show();

-       $("#repl-cleanallruv").show();

+         repl_winsync_agmt_table.row.add( [

+           agmt_attrs['cn'][0],

+           agmt_attrs['nsds5replicahost'][0],

+           agmt_attrs['nsds5replicaport'][0],

+           state,

+           agmt_attrs['nsds5replicalastupdatestatus'][0],

+           ws_agmt_init_status,

+           winsync_agmt_action_html

+         ] ).draw( false );

+         console.log("Finished loading winsync replication agreements.");

+       }

      });

+   } // suffix

+ }

  

  

-     $("#nsds5replicaid").on("change", function() {

-       prev_rid = $("#nsds5replicaid").val();

-     });

- 

-     $("#save-repl-cfg-btn").on('click', function () {

-        // validate values

+ function get_and_set_repl_agmts () {

+   /*

+    * Get the replication agreements for the selected suffix

+    */

+   var suffix = $("#select-repl-agmt-suffix").val();

+   repl_agmt_table.clear();

+ 

+   if (suffix) {

+     console.log("Loading replication agreements...");

+     var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'list', '--suffix=' + suffix ];

+     console.log("CMD: Get agmts: " + cmd.join(' '))

+     cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+       var obj = JSON.parse(data);

+       for (var idx in obj['items']) {

+         agmt_attrs = obj['items'][idx]['attrs'];

+         var agmt_name = agmt_attrs['cn'][0];

+         var state = "Enabled";

+         var update_status = "";

+         var agmt_init_status = "Initialized";

+ 

+         // Compute state (enabled by default)

+         if ('nsds5replicaenabled' in agmt_attrs) {

+           if (agmt_attrs['nsds5replicaenabled'][0].toLowerCase() == 'off'){

+             state = "Disabled";

+           }

+         }

  

-        // Do the save in DS

+         // Check for status msgs

+         if ('nsds5replicalastupdatestatus' in agmt_attrs) {

+           update_status = agmt_attrs['nsds5replicalastupdatestatus'][0];

+         }

+         if ('nsds5replicalastinitstatus' in agmt_attrs &&

+             agmt_attrs['nsds5replicalastinitstatus'][0] != "")

+         {

+           agmt_init_status = agmt_attrs['nsds5replicalastinitstatus'][0];

+           if (agmt_init_status == "Error (0) Total update in progress") {

+             agmt_init_status = progress_html;

+             var interval_agmt_name = agmt_name;

+             var init_idx = agmt_init_counter;

+             agmt_init_counter += 1;

+             agmt_init_intervals[init_idx] = setInterval( do_agmt_init, 2000, suffix, interval_agmt_name, init_idx);

+           } else if (agmt_init_status == "Error (0) Total update succeeded") {

+             agmt_init_status = "Initialized";

+           }

+         } else if (agmt_attrs['nsds5replicalastinitstart'][0] == "19700101000000Z"){

+           agmt_init_status = "Not initialized";

+         }

  

-        // In case we updated the bind group...

-        check_repl_binddn_list();

+         // Update table

+         repl_agmt_table.row.add( [

+           agmt_attrs['cn'][0],

+           agmt_attrs['nsds5replicahost'][0],

+           agmt_attrs['nsds5replicaport'][0],

+           state,

+           update_status,

+           agmt_init_status,

+           agmt_action_html

+         ] ).draw( false );

+       }

+       console.log("Finished loading replication agreements.");

+     }).fail(function () {

+       repl_agmt_table.clear().draw();

      });

+   } // suffix

+ }

  

  

-     /*

-      * Setting/Changing the replication role

-      */

-     $("#nsds5replicaid").on('click', function () {

-       if ( $("#nsds5replicaid").prop('disabled') == false ) {

-         // Set radio button to master role when we click on the rid input

-         $("#master").prop("checked", true);

+ function get_and_set_cleanallruv() {

+   console.log("Loading replication tasks...");

+   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-tasks', 'list-cleanallruv'];

+   console.log("CMD: Get repl tasks: " + cmd.join(' '));

+   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+     var tasks = JSON.parse(data);

+     repl_clean_table.clear();

+     for (var idx in tasks['items']) {

+       task_attrs = tasks['items'][idx]['attrs'];

+       // Update table

+       var abort_btn = cleanallruv_action_html;

+       if (task_attrs['nstaskstatus'][0].includes('Successfully cleaned rid') ){

+         abort_btn = "<i>Task Complete</i>";

+       } else if (task_attrs['nstaskstatus'][0].includes('Task aborted for rid') ){

+          abort_btn = "<i>Task Aborted</i>";

        }

-     });

-     $("#change-repl-role").on("click", function() {

-       var role_button = $("input[name=repl-role]:checked");

-       var role = $("input[name=repl-role]:checked").val();

+       repl_clean_table.row.add( [

+           task_attrs['cn'][0],

+           get_date_string(task_attrs['createtimestamp'][0]),

+           task_attrs['replica-base-dn'][0],

+           task_attrs['replica-id'][0],

+           task_attrs['nstaskstatus'][0],

+           abort_btn

+         ] );

+     }

+     repl_clean_table.draw(false);

+     console.log("Finished loading replication tasks.");

+   });

+ }

  

-       if (prev_repl_role == role) {

-         // Nothing changed

-         return;

-       }

  

-       if (role == "master") {

-         if ($("#nsds5replicaid").val() == "" || $("#nsds5replicaid").val() === undefined ){

-           popup_msg("Attention!", "Replica ID is required for a Master role");

-           return;

-         }

-         if ( !valid_num($("#nsds5replicaid").val()) ) {

-           popup_msg("Attention!", "Replica ID must be a number");

-           return;

+ function get_and_set_repl_config () {

+   var suffix = $("#select-repl-cfg-suffix").val();

+   if (suffix) {

+     $("#nsds5replicaid").css("border-color", "initial");

+     $("#nsds5replicaid").val("");

+     console.log("Loading replication configuration...");

+ 

+     var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'get', '--suffix=' + suffix ];

+     console.log("CMD: Get repl config: " + cmd.join(' '));

+     cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+       var repl = JSON.parse(data);

+       var repl_type;

+       var repl_flags;

+       var manager = false;

+       repl_config_values = {};

+       repl_cl_values = {};

+ 

+       // Clear the tables

+       //$("#repl-mgr-table tr").remove();

+       $('#repl-mgr-table').find("tr:gt(0)").remove();

+ 

+       // Set configuration and the repl manager table

+       for (var attr in repl['attrs']) {

+         var vals = repl['attrs'][attr];

+         attr = attr.toLowerCase();

+ 

+         if (attr in repl_attr_map) {

+           if (attr == "nsds5replicabinddn") {

+             // update manager table

+             for (var val_idx in vals){

+               add_repl_mgr(vals[val_idx]);

+               manager = true;

+             }

+           } else if (attr == "nsds5replicatype") {

+             repl_type = vals[0];

+           } else if (attr == "nsds5flags") {

+             repl_flags = vals[0];

+           } else {

+             // regular config value, add it any existing input fields that match

+             $("#" + attr ).val(vals[0]);

+             repl_config_values[attr] = vals[0];

+           }

          }

+       }

+       if (!manager) {

+         // Add an empty row to define the table

+         $("#repl-mgr-table tbody").append(

+ 		      "<tr>"+

+ 		      "<td class='ds-td'>None</td>"+

+           "<td></td>" +

+           "</tr>");

+       }

  

-         // TODO - check if replication is set up, if not launch a basic popup windows asking for replica ID

- 

-         // TODO - if prev_role is not "disabled" after for confirmation before promoting replica

-         $("#repl-settings-header").html("Master Replication Settings");

-         $('#repl-cleanallruv').show();

-         $('#repl-agmts').show();

-         $("#nsds5replicaid").prop('disabled', true); // Can not edit rid after setup

+       // Set the replica role

+       if (repl_type == "3"){

+         $("#select-repl-role").val("Master");

+         current_role = "Master";

+         $("#nsds5replicaid").prop("readonly", false);

        } else {

-         $("#nsds5replicaid").prop('disabled', false);

-         $('#repl-cleanallruv').hide()

-         $("#nsds5replicaid").prop('required', false);

- 

-         if (role == "hub"){

-           // TODO - if prev_role is not "disabled" after for confirmation before promoting/demoting replica

-           $("#nsds5replicaid").val("");

-           $("#repl-settings-header").html("Hub Replication Settings");

-           $('#repl-agmts').show();

-         } else if (role == "consumer") {

-           // consumer

-           // TODO - if prev_role is not "disabled" after for confirmation before demoting replica

-           $('#repl-agmts').hide();

-           $("#nsds5replicaid").val("");

-           $("#repl-settings-header").html("Consumer Replication Settings");

+         if (repl_flags == "1"){

+           $("#select-repl-role").val("Hub");

+           current_role = "Hub";

+           $("#nsds5replicaid").prop("readonly", true);

+         } else {

+           $("#select-repl-role").val("Consumer");

+           current_role = "Consumer";

+           $("#nsds5replicaid").prop("readonly", true);

          }

        }

-       if (role == "no-repl") {

-         // This also means disable replication: delete agmts, everything

+       current_rid = $("#nsds5replicaid").val();

  

-         popup_confirm("Are you sure you want to disable replication and remove all agreements?", "Confirmation", function (yes) {

-           if (yes) {

-             // TODO Delete attr from DS

+       // Show the page (in case it was hidden)

+       $("#repl-config-content").show();

  

-             //delete everything

-             $("#repl-form").hide();

-             $("#nsds5replicaid").val("");

-             prev_role_button = role_button;

-             prev_repl_role = role;

-           } else {

-             // We don't change the prev anything in this case

-             prev_role_button.prop('checked', true);

+       console.log("Finished loading replication configuration.");

+     }).fail(function(data) {

+       // No replication

+       $("#select-repl-role").val("Disabled");

+       current_role = "Disabled";

+       $("#repl-config-content").hide();

+     });

+   } else {

+     // No suffixes - hide page

+     $("#select-repl-role").val("Disabled");

+     current_role = "Disabled";

+     $("#repl-config-content").hide();

+   }

+ 

+   // Do the changelog settings

+   $("#cl-create-div").show();

+   $("#cl-del-div").hide();

+   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'get-changelog'];

+   console.log("CMD: Get changelog: " + cmd.join(' '));

+   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+     $(".ds-cl").val("");  // Clear form

+     var cl = JSON.parse(data);

+     for (var attr in cl['attrs']) {

+       var val = cl['attrs'][attr][0];

+       attr = attr.toLowerCase();

+       $("#" + attr ).val(val);

+       $("#cl-create-div").hide();

+       $("#cl-del-div").show();

+       repl_cl_values[attr] = val;

+     }

+   }).fail(function() {

+     // No changelog, clear the form

+     $(".ds-cl").val("");

+   });

+ }

+ 

+ 

+ function save_repl_config(suffix, ignore_rid) {

+   /*

+    * Check for changes in the replication settings

+    */

+   var set_repl_values = {};

+   var set_cl_values = {};

+   var arg_list = [];

+   for (var attr in repl_attrs) {

+     attr = repl_attrs[attr];

+     var val = $("#" + attr).val();

+     var prev_val = "";

+     if (attr in repl_config_values) {

+       prev_val = repl_config_values[attr];

+     }

+     if (val != prev_val) {

+       if (ignore_rid && attr == "nsds5replicaid"){

+         // skip it since we are doing a promotion

+         continue;

+       }

+       if (val != "") {

+         // Regular setting - add to the list

+         arg_list.push(repl_attr_map[attr] + "=" + val );

+       } else {

+         // removed

+         arg_list.push(repl_attr_map[attr] + "=");

+       }

+       set_repl_values[attr] = val;

+     }

+   }

+ 

+   get_and_set_repl_config();

+ 

+   /*

+    * Check for changes in the changelog settings

+    */

+   var arg_cl_list = [];

+   for (var attr in repl_cl_attrs) {

+     attr = repl_cl_attrs[attr];

+     var val = $("#" + attr).val();

+     var prev_val = "";

+     if (attr in repl_cl_values) {

+       prev_val = repl_cl_values[attr];

+     }

+     if (val != prev_val) {

+       // we have a difference

+       if (val != "") {

+         // Regular setting -add to the list

+         arg_cl_list.push(repl_attr_map[attr] + "=" + val);

+       } else {

+         // removed

+         arg_cl_list.push(repl_attr_map[attr] + "=");

+       }

+       set_cl_values[attr] = val;

+     }

+   }

+ 

+   /*

+    * Save repl config settings

+    */

+   if (arg_list.length > 0){

+ 

+     var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'set', '--suffix=' + suffix ];

+     cmd = cmd.concat(arg_list);

+     console.log("CMD: set replication: " + cmd.join(' '));

+     cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+       popup_success('Saved replication configuration');

+       for (var key in set_repl_values) {

+         // Update current in memory values

+         repl_config_values[key] = set_repl_values[key];

+       }

+       get_and_set_repl_config();

+       /*

+        * Save changelog settings

+        */

+       if (arg_cl_list.length > 0){

+         var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication' ,'set-changelog'];

+         cmd = cmd.concat(arg_cl_list);

+         console.log("CMD: Set changelog: " + cmd.join(' '));

+         cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+           popup_success('Saved changelog configuration');

+           for (var key in set_cl_values) {

+             // Update current in memory values

+             repl_cl_values[key] = set_cl_values[key];

            }

+           get_and_set_repl_config();

+         }).fail(function(data) {

+           get_and_set_repl_config();

+           popup_err("Failed to save changelog configuration", data.message);

          });

-       } else {

-         $("#repl-form").show();

-         prev_role_button = role_button;

-         prev_repl_role = role;

        }

+     }).fail(function(data) {

+       // Restore prev values

+       get_and_set_repl_config();

+       popup_err("Failed to set replication configuration", data.message);

      });

+   } else if (arg_cl_list.length > 0) {

+     /*

+      * Only changelog settings need to be applied

+      */

+     var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication' ,'set-changelog'];

+     cmd = cmd.concat(arg_cl_list);

+     console.log("CMD: Set changelog: " + cmd.join(' '));

+     cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+       popup_success('Saved changelog configuration');

+       for (var key in set_cl_values) {

+         // Update current in memory values

+         repl_cl_values[key] = set_cl_values[key];

+       }

+       get_and_set_repl_config();

+     }).fail(function(data) {

+       get_and_set_repl_config();

+       popup_err("Failed to save changelog configuration", data.message);

+     });

+   }

+ }

+ 

  

-     // Set up agreement table

-     var repl_agmt_table = $('#repl-agmt-table').DataTable( {

+ /*

+  * Load the replication page, and set the handlers

+  */

+ $(document).ready( function() {

+   $("#replication-content").load("replication.html", function () {

+         // Set up agreement table

+     repl_agmt_table = $('#repl-agmt-table').DataTable( {

        "paging": true,

        "bAutoWidth": false,

        "dom": '<"pull-left"f><"pull-right"l>tip',
@@ -251,13 +597,22 @@ 

          "search": "Search Agreements"

        },

        "columnDefs": [ {

-         "targets": 4,

+         "targets": 6,

          "orderable": false

-       } ]

+       } ],

+       "columns": [

+         { "width": "20%" },

+         { "width": "20%" },

+         { "width": "50px" },

+         { "width": "50px" },

+         { "width": "20%" },

+         { "width": "20%" },

+         { "width": "130px" }

+       ],

      });

  

      // Set up windows sync agreement table

-     var repl_winsync_agmt_table = $('#repl-winsync-agmt-table').DataTable( {

+     repl_winsync_agmt_table = $('#repl-winsync-agmt-table').DataTable( {

        "paging": true,

        "bAutoWidth": false,

        "dom": '<"pull-left"f><"pull-right"l>tip',
@@ -267,30 +622,300 @@ 

          "search": "Search Agreements"

        },

        "columnDefs": [ {

-         "targets": 5,

+         "targets": 6,

          "orderable": false

        } ]

      });

  

      // Set up CleanAllRUV Table

-     var repl_clean_table = $('#repl-clean-table').DataTable( {

+     repl_clean_table = $('#repl-clean-table').DataTable( {

        "paging": true,

+       "searching": false,

        "bAutoWidth": false,

-       "dom": '<"pull-left"f><"pull-right"l>tip',

-       "lengthMenu": [ 10, 25, 50, 100],

+       "dom": 'B<"pull-left"f><"pull-right"l>tip',

+       buttons: [

+             {

+                 text: 'Refresh Task List',

+                 action: function ( e, dt, node, config ) {

+                   console.log("hmmm");

+                   get_and_set_cleanallruv();

+                 }

+             }

+         ],

+       "lengthChange": false,

        "language": {

          "emptyTable": "No CleanAllRUV tasks",

-         "search": "Search Tasks"

        },

        "columnDefs": [ {

-         "targets": 3,

+         "targets": 5,

          "orderable": false

        } ]

      });

  

-     // Repl Agreement Wizard

+     binddn_list_color = $("#repl-managers-list").css("border-color");

+ 

+     // Load existing replication config (if any), set role, etc

+ 

+     $("#schedule-settings").hide();

+ 

+     $("#repl-config-btn").on("click", function() {

+       $(".all-pages").hide();

+       $("#replication-content").show();

+       $("#repl-config").show();

+     });

+ 

+     $("#repl-agmts-btn").on("click", function() {

+       $(".all-pages").hide();

+       $("#replication-content").show();

+       $("#repl-agmts").show();

+     });

+ 

+     $("#repl-winsync-btn").on("click", function() {

+       $(".all-pages").hide();

+       $("#replication-content").show();

+       $("#repl-winsync").show();

+     });

+     $("#repl-cleanallruv-btn").on("click", function() {

+       $(".all-pages").hide();

+       $("#replication-content").show();

+       $("#repl-cleanallruv").show();

+     });

+ 

+     $("#select-repl-cfg-suffix").on("change", function() {

+       get_and_set_repl_config();

+     });

+ 

+     $("#select-repl-agmt-suffix").on("change", function() {

+       get_and_set_repl_agmts();

+     });

+ 

+     $("#select-repl-winsync-suffix").on("change", function() {

+       get_and_set_repl_winsync_agmts();

+     });

+ 

+     $("#select-repl-role").on("change", function() {

+       var new_role = $(this).val();

+       if (current_role == new_role) {

+         // reset rid

+         $("#nsds5replicaid").val(current_rid);

+       }

+       if (new_role == "Master"){

+         $("#nsds5replicaid").prop("readonly", false);

+         var cur_rid = $("#nsds5replicaid").val();

+         var rid_num;

+         if (cur_rid == ""){

+           rid_num = 0;

+         } else {

+           rid_num = parseInt(cur_rid, 10);

+         }

+         if (rid_num < 1 || rid_num >= 65535){

+           $("#nsds5replicaid").css("border-color", "red");

+         }

+         $("#repl-config-content").show();

+       } else {

+         if (new_role == "Disabled"){

+           $("#nsds5replicaid").val("");

+           $("#repl-config-content").hide();

+         } else {

+           $("#nsds5replicaid").val("65535");

+           $("#repl-config-content").show();

+         }

+         $("#nsds5replicaid").prop("readonly", true);

+         $("#nsds5replicaid").css("border-color", "initial");

+       }

+     });

+ 

+     /*

+      * Save replication configuration

+      */

+     $("#repl-config-save").on('click', function () {

+       var suffix = $("#select-repl-cfg-suffix").val();

+       var rid = $("#nsds5replicaid").val();

+ 

+       if (suffix) {

+         /*

+          * Did we enable, disable, promote, or demote this replica?

+          */

+         var new_role = $("#select-repl-role").val();

+         if (new_role != current_role) {

+           if (current_role == "Disabled"){

+             /*

+              * Enable replication for the first time

+              */

+             var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'enable',

+                        '--suffix=' + suffix, "--role=" + new_role];

+             if (new_role == "Master") {

+               if (rid == ""){

+                 popup_msg("Missing Required Replica ID",

+                           "A Master replica requires a unique identifier.  Please enter a value for <b>Replica ID</b> between 1 and 65534");

+                 return;

+               }

+               cmd.push("--replica-id=" + rid);

+             }

+             console.log("CMD: Enable replication: " + cmd.join(' '));

+             cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+               popup_success('Successfully enabled replication');

+               get_and_set_repl_config();

+               save_repl_config(suffix, true);

+             }).fail(function(data) {

+               popup_err("Failed to enable replication configuration", data.message);

+               get_and_set_repl_config();

+               return;

+             });

+           } else if (new_role == "Disabled") {

+             /*

+              * Disable replication

+              */

+             popup_confirm("Are you sure you want to disable replication?  This will remove all your replication agreements and can not be undone!", "Confirmation", function (yes) {

+               if (yes) {

+                 var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'disable', '--suffix=' + suffix ];

+                 console.log("CMD: Disable replication: " + cmd.join(' '));

+                 cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                   current_role = "Disabled";

+                   $("#repl-config-content").hide();

+                   popup_success('Successfully disabled replication');

+                   get_and_set_repl_config();

+                 }).fail(function(data) {

+                   popup_err("Failed to disable replication", data.message);

+                   get_and_set_repl_config();

+                 });

+               }

+             });

+           } else {

+             /*

+              * Promote/demote the replica

+              */

+             popup_confirm("Are you sure you want to change the <i>replication role</i> to \"<b>" + new_role + "</b>\"?", "Confirmation", function (yes) {

+               if (yes) {

+                 if (new_role == "Master"){

+                   /*

+                    * Promote to Master

+                    */

+                   if ( !valid_num(rid) ) {

valid_num is not defined too

It's defined in ds.js, am I missing something?

Looks like it is commented out (at least I see it like this, maybe bad rebase)

Where do you see it commented out? What file/line?

Okay, it is my mistake. I commented it out accidently with '/*' while changing back to 'var DSCONF = "dsconf"'... Sorry

+                     popup_msg("Missing Required Replica ID",

+                               "A Master replica requires a unique numerical identifier.  Please enter a value for <b>Replica ID</b> between 1 and 65534");

+                     get_and_set_repl_config();

+                     return;

+                   }

+                   var rid_num = parseInt(rid, 10);

+                   if (rid_num < 1 || rid_num >= 65535){

+                     popup_msg("Missing Required Replica ID",

+                               "A Master replica requires a unique numerical identifier.  Please enter a value for <b>Replica ID</b> between 1 and 65534");

+                     get_and_set_repl_config();

+                     return;

+                   }

+                   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'promote',

+                              '--suffix=' + suffix, "--newrole=" + new_role, "--replica-id=" + rid];

+                   console.log("CMD: Promote replica: " + cmd.join(' '));

+                   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                     current_role = "Master";;

+                     popup_success('Successfully promoted replica to a <b>Master</b>');

+                     get_and_set_repl_config();

+                     save_repl_config(suffix, true);

+                   }).fail(function(data) {

+                     popup_err("Failed to promote replica to a Master", data.message);

+                     get_and_set_repl_config();

+                   });

+                 } else if (new_role == "Hub" && current_role == "Master"){

+                   /*

+                    * Demote to Hub

+                    */

+                   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'demote',

+                              '--suffix=' + suffix, "--newrole=" + new_role];

+                   console.log("CMD: Demote replica: " + cmd.join(' '));

+                   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                     current_role = "Hub";

+                     popup_success('Successfully demoted replica to a <b>Hub</b>');

+                     save_repl_config(suffix, true);

+                   }).fail(function(data) {

+                     popup_err("Failed to demote replica to a Hub", data.message);

+                     get_and_set_repl_config();

+                   });

+                 } else if (new_role == "Hub" && current_role == "Consumer"){

+                   /*

+                    * Promote to Hub

+                    */

+                   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'promote',

+                              '--suffix=' + suffix, "--newrole=" + new_role];

+                   console.log("CMD: Promote replica: " + cmd.join(' '));

+                   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                     current_role = "Hub";;

+                     popup_success('Successfully promoted replica to a <b>Hub</b>');

+                     save_repl_config(suffix, true);

+                   }).fail(function(data) {

+                     popup_err("Failed to promote replica to a Hub", data.message);

+                     get_and_set_repl_config();

+                   });

+                 } else {

+                   /*

+                    * Demote to Consumer

+                    */

+                   var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'demote',

+                              '--suffix=' + suffix, "--newrole=" + new_role];

+                   console.log("CMD: Demote replica: " + cmd.join(' '));

+                   cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+                     current_role = "Consumer";

+                     popup_success('Successfully demoted replica to a <b>Consumer</b>');

+                     save_repl_config(suffix, true);

+                   }).fail(function(data) {

+                     popup_err("Failed to demote replica to a Consumer", data.message);

+                     get_and_set_repl_config();

+                   });

+                 }

+               } else {

+                 // NO - not changing the role - seset the dropdown

+                 $("#select-repl-role").val(current_role);

+                 get_and_set_repl_config();

+               }

+             }); // popup_confirm

+           }

+         } else {

+           /*

+            * We did NOT promote/demote, etc.  This was just a configuration change...

+            */

+           save_repl_config(suffix, false);

+         }

+       } // Suffix

+     });

+ 

+     // Create changelog

+     $("#create-cl-btn").on('click', function () {

+       var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication' ,'create-changelog'];

+       console.log("CMD: Create changelog: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         get_and_set_repl_config();

+         popup_success('Successfully created replication changelog');

+       }).fail(function(data) {

+         get_and_set_repl_config();

+         popup_err("Failed to create replication changelog", data.message);

+       });

+     });

+ 

+     // Remove changelog

+     $("#delete-cl-btn").on('click', function () {

+       popup_confirm("Are you sure you want to delete the replication changelog as it will break all the existing agreements?", "Confirmation", function (yes) {

+         if (yes) {

+           var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication' ,'delete-changelog'];

+           console.log("CMD: Delete changelog: " + cmd.join(' '));

+           cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+             get_and_set_repl_config();

+             popup_success('Successfully removed replication changelog');

+           }).fail(function(data) {

+             get_and_set_repl_config();

+             popup_err("Failed to remove replication changelog", data.message);

+           });

+         }

+       });

+     });

+ 

+ 

+     // Save Repl Agreement Wizard

      $("#agmt-save").on("click", function() {

        // Get all the settings

+       var suffix = $("#select-repl-agmt-suffix").val();

+       var cmd = [];

+       var cmd_args = [];

+       var param_err = false;

        var agmt_name = $("#agmt-cn").val();

        var agmt_host = $("#nsds5replicahost").val();

        var agmt_port = $("#nsds5replicaport").val();
@@ -299,22 +924,138 @@ 

        var agmt_bindpw_confirm = $("#nsds5replicacredentials-confirm").val();

        var agmt_conn = $("#nsds5replicatransportinfo").val();

        var agmt_method = $("#nsds5replicabindmethod").val();

-       var agmt_exclude = $("#frac-list").val();  // exclude list

-       var agmt_tot_exclude = $("#frac-total-list").val();  // total init exclude list

-       var agmt_strip = $("#frac-strip-list").val();

        var agmt_schedule = "";

        var agmt_init = $("#init_options").val();

+       var agmt_exclude = "";

+       var agmt_tot_exclude = "";

+       var agmt_strip = "";

+       var editing = false;

+       var init_replica = false;

+ 

+       if ($("#agmt-wizard-title").text().includes('Edit') ) {

+         editing = true;

+       }

+ 

+       // Check required settings

+       if ( agmt_port == "") {

+         $("#nsds5replicaport").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#nsds5replicaport").css("border-color", "initial");

+         cmd_args.push("--port=" + agmt_port);

+       }

+       if ( agmt_host == "") {

+         $("#nsds5replicahost").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#nsds5replicahost").css("border-color", "initial");

+         cmd_args.push('--host=' + agmt_host);

+       }

+       if ( agmt_conn == "") {

+         $("#nsds5replicatransportinfo").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#nsds5replicatransportinfo").css("border-color", "initial");

+         cmd_args.push('--conn-protocol=' + agmt_conn);

+       }

+       if ( agmt_method == "") {

+         $("#nsds5replicabindmethod").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#nsds5replicabindmethod").css("border-color", "initial");

+         cmd_args.push('--bind-method=' + agmt_method);

+       }

+      if ( agmt_bind == "") {

+         $("#nsds5replicabinddn").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#nsds5replicabinddn").css("border-color", "initial");

+         cmd_args.push('--bind-dn=' + agmt_bind);

+       }

+       if (param_err ){

+         popup_msg("Error", "Missing required parameters");

+         return;

+       }

+ 

+       /*

+        * Handle the optional settings

+        */

+       $("#frac-exclude-list option").each(function() {

+         agmt_exclude += $(this).val() + " ";

+       });

+       $("#frac-exclude-tot-list option").each(function() {

+         agmt_tot_exclude += $(this).val() + " ";

+       });

+       $("#frac-strip-list option").each(function() {

+         agmt_strip += $(this).val() + " ";

+       });

  

-       // Confirm passwords match

        if (agmt_bindpw != agmt_bindpw_confirm) {

          popup_msg("Attention!", "Passwords do not match");

          return;

        }

  

-       if ( !$("#agmt-schedule-checkbox").is(":checked") ){

+       // Bind Password

+       if (!editing ){

+         if (agmt_bindpw != "") {

+           cmd_args.push('--bind-passwd=' + agmt_bindpw);

+         }

+       } else {

+         if ( !('nsds5replicacredentials' in repl_agmt_values) ||

+              agmt_bindpw != repl_agmt_values['nsds5replicacredentials'])

+         {

+           cmd_args.push('--bind-passwd="' + agmt_bindpw);

+         }

+       }

+       // Frac attrs

+       agmt_exclude = agmt_exclude.trim();

+       if (!editing) {

+         if (agmt_exclude != "") {

+           cmd_args.push('--frac-list='+ agmt_exclude);

+         }

+       } else {

+         if ( !('nsds5replicatedattributelist' in repl_agmt_values) ||

+             agmt_exclude != repl_agmt_values['nsds5replicatedattributelist'].replace(frac_prefix, ""))

+         {

+           cmd_args.push('--frac-list=' + frac_prefix + ' ' + agmt_exclude);

+         }

+       }

+       // Frac total attr

+       agmt_tot_exclude = agmt_tot_exclude.trim();

+       if (!editing) {

+         if (agmt_tot_exclude != "") {

+           cmd_args.push('--frac-list-total='+ agmt_tot_exclude);

+         }

+       } else {

+         if ( !('nsds5replicatedattributelisttotal' in repl_agmt_values) ||

+              agmt_tot_exclude != repl_agmt_values['nsds5replicatedattributelisttotal'].replace(frac_prefix, ""));

+         {

+           cmd_args.push('--frac-list-total=' + frac_prefix + ' ' + agmt_tot_exclude);

+         }

+       }

+       // Strip attrs

+       agmt_strip = agmt_strip.trim();

+       if (!editing) {

+         if (agmt_strip != "") {

+           cmd_args.push('--strip-list='+ agmt_strip);

+         }

+       } else {

+         if ( !('nsds5replicastripattrs' in repl_agmt_values) ||

+              agmt_strip != repl_agmt_values['nsds5replicastripattrs']);

+         {

+           cmd_args.push('--strip-list='+ agmt_strip);

+         }

+       }

+ 

+       if ( !($("#agmt-schedule-checkbox").is(":checked")) ){

          agmt_start = $("#agmt-start-time").val().replace(':','');

          agmt_end = $("#agmt-end-time").val().replace(':','');

  

+         if (agmt_start == agmt_end) {

+           popup_msg("Error", "The replication start and end times can not behte same");

+           return;

+         }

+ 

          // build the days

          var agmt_days = "";

          if ( $("#schedule-sun").is(":checked") ){
@@ -338,93 +1079,401 @@ 

          if ( $("#schedule-sat").is(":checked") ){

            agmt_days += "6";

          }

-         agmt_schedule = agmt_start + "-" + agmt_end + " " + agmt_days

+         if (agmt_days == "" ){

+           popup_msg("Error", "You must set at least one day in the schedule to perform replication");

+           return;

+         }

+         // Set final value

+         agmt_schedule = agmt_start + "-" + agmt_end + " " + agmt_days;

+ 

+         if (!editing ){

+           cmd_args.push('--schedule=' + agmt_schedule);

+         } else {

+           if ( !('nsds5replicaupdateschedule' in repl_agmt_values) ||

+                agmt_schedule != repl_agmt_values['nsds5replicaupdateschedule'] )

+           {

+             cmd_args.push('--schedule=' + agmt_schedule);

+           }

+         }

+       } else {

+         // if "sync all the time" is checked, might need to remove the schedule attribute

+         if ('nsds5replicaupdateschedule' in repl_agmt_values) {

+           cmd_args.push('--schedule=');

+         }

        }

  

-       // TODO add agmt to DS

- 

-       // TODO Do agmt init (if requested)

  

-       // TODO get agmt status for table

-       var agmt_status = "";

+       if (agmt_init == "Do Online Initialization") {

+         init_replica = true;

+       }

+       if ( agmt_name == "") {

+         $("#agmt-cn").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#agmt-cn").css("border-color", "initial");

+         cmd_args.push('"' + agmt_name + '"');

+       }

  

-       // Update Agmt Table

-       repl_agmt_table.row.add( [

-             agmt_name,

-             agmt_host,

-             agmt_port,

-             "Enabled",

-             agmt_action_html

-         ] ).draw( false );

+       // Create agreement in DS

+       if ( editing ) {

+         cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'set', '--suffix=' + suffix ];

+       } else {

+         cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'create', '--suffix=' + suffix];

+       }

+       cmd = cmd.concat(cmd_args);

+       console.log("CMD: Set/Create repl agmt: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         if (editing){

+           popup_success('Successfully edited replication agreement');

+         } else {

+           popup_success('Successfully created replication agreement');

+         }

+         if (init_replica) {

+           // Launch popup stating initialization has begun

+           var init_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'init', '--suffix=' + suffix, agmt_name ];

+           console.log("CMD: Init agmt: " + init_cmd.join(' '));

+           cockpit.spawn(init_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+             popup_msg("Agreement Initialization", "The agreement initialization has begun...");

+           }).fail(function(data) {

+             popup_err("Failed to initialize replication agreement", data.message);

+           });

+         }

+         // Reload table

+         get_and_set_repl_agmts();

+       }).fail(function(data) {

+         if (editing) {

+          popup_err("Failed to edit replication agreement", data.message);

+        } else {

+          popup_err("Failed to create replication agreement", data.message);

+        }

+       });

  

        // Done, close the form

        $("#agmt-form").modal('toggle');

        clear_agmt_wizard();

      });

  

-     $(document).on('click', '.del-repl-mgr', function(e) {

+     /*

+      * Initialize agreement

+      */

+     $(document).on('click', '.agmt-init-btn', function(e) {

+       e.preventDefault();

+       var suffix = $("#select-repl-agmt-suffix").val();

+       var data = repl_agmt_table.row( $(this).parents('tr') ).data();

+       var agmt_name = data[0];

+       var row_idx = $(this).closest('tr').index();

+       repl_agmt_table.cell({row: row_idx, column: 5}).data(progress_html).draw();

+ 

+       var status_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'init', '--suffix=' + suffix, '"' + agmt_name + '"' ];

+       console.log("CMD: init agmt: " + status_cmd.join(' '));

+       cockpit.spawn(status_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         var init_idx = agmt_init_counter;

+         agmt_init_counter += 1;

+         agmt_init_intervals[init_idx] = setInterval( do_agmt_init, 2000, suffix, agmt_name, init_idx);

+       }).fail(function(data) {

+         get_and_set_repl_agmts();

+         popup_err("Failed to initialize agreement", data.message);

+       });

+     });

+ 

+     $(document).on('click', '.winsync-agmt-init-btn', function(e) {

        e.preventDefault();

-       var row = $(this).parent().parent(); //tr

-       var repl_dn = row.children("td:nth-child(1)");

-       popup_confirm("Are you sure you want to delete replication manager:  <b>" + repl_dn.html() + "</b>", "Confirmation", function (yes) {

-         if (yes) {

-           row.remove();

+       var suffix = $("#select-repl-winsync-suffix").val();

+       var data = repl_winsync_agmt_table.row( $(this).parents('tr') ).data();

+       var agmt_name = data[0];

+       var row_idx = $(this).closest('tr').index();

+       repl_winsync_agmt_table.cell({row: row_idx, column: 5}).data(progress_html).draw();

+ 

+       var status_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'init', '--suffix=' + suffix, '"' + agmt_name + '"' ];

+       console.log("CMD: Init winsync agmt: " + status_cmd.join(' '));

+       cockpit.spawn(status_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         var init_idx = agmt_init_counter;

+         agmt_init_counter += 1;

+         agmt_init_intervals[init_idx] = setInterval( do_winsync_agmt_init, 2000, suffix, agmt_name, init_idx);

+       }).fail(function(data) {

+         get_and_set_repl_winsync_agmts();

+         popup_err("Failed to initialize winsync agreement", data.message);

+       });

+     });

+ 

+ 

+     /* Store the repl dn from the table when opening the mgr delete confirmation modal */

+     $(document).on('click', '.remove-repl-mgr', function(e) {

+       e.preventDefault();

+       var mgr_row =  $(this).parent().parent();

+       mgr_dn = mgr_row.children("td:nth-child(1)");

+     });

+ 

+     /* delete manager from confirmation response */

+     $(document).on('click', '#remove-mgr-btn', function(e) {

+       e.preventDefault();

+       var suffix = $("#select-repl-cfg-suffix").val();

+       var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication' ,'set',

+                  '--repl-del-bind-dn=' + mgr_dn.text(), '--suffix=' + suffix];

+       console.log("CMD: Set replication config: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         /* Success, now check if they want the entry deleted */

+         if ($("#delete-mgr-checkbox").is(":checked")) {

+           /* Remove the manager entry */

+           var del_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication',

+                          'delete-manager', "--name=" + mgr_dn.text()];

+           console.log("CMD: Delete replication manager: " + del_cmd.join(' '));

+           cockpit.spawn(del_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+             popup_success('Successfully removed replication manager');

+           });

+           /* Reset config/tables */

+           get_and_set_repl_config();

+           popup_success('Successfully removed replication manager');

+           $("#del-repl-mgr-form").modal('toggle');

          }

+       }).fail(function(data) {

+         get_and_set_repl_config();

+         $("#del-repl-mgr-form").modal('toggle');

+         popup_err("Failed to remove replication manager", data.message);

        });

      });

  

-     // Delete agreement

+     /*

+      * Delete repl agreement

+      */

      $(document).on('click', '.agmt-del-btn', function(e) {

        e.preventDefault();

-       // TODO  -delete agreement in DS

- 

-       // Update HTML table

        var data = repl_agmt_table.row( $(this).parents('tr') ).data();

        var del_agmt_name = data[0];

        var agmt_row = $(this);

        popup_confirm("Are you sure you want to delete replication agreement: <b>" + del_agmt_name + "</b>", "Confirmation", function (yes) {

          if (yes) {

-           // TODO Delete agmt

-           repl_agmt_table.row( agmt_row.parents('tr') ).remove().draw( false );

+           var suffix = $("#select-repl-agmt-suffix").val();

+           var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'delete', '--suffix=' + suffix, '"' + del_agmt_name + '"'];

+           console.log("CMD: Delete agmt: " + cmd.join(' '));

+           cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+             popup_success('Successfully removed replication agreement');

+             // Update table

+             repl_agmt_table.row( agmt_row.parents('tr') ).remove().draw( false );

+           }).fail(function(data) {

+             get_and_set_repl_config();

+             popup_err("Failed to remove replication agreement", data.message);

+           });

          }

        });

      });

  

+     $(document).on('click', '.winsync-agmt-del-btn', function(e) {

+       e.preventDefault();

+       var data = repl_winsync_agmt_table.row( $(this).parents('tr') ).data();

+       var del_agmt_name = data[0];

+       var agmt_row = $(this);

+       popup_confirm("Are you sure you want to delete replication agreement: <b>" + del_agmt_name + "</b>", "Confirmation", function (yes) {

+         if (yes) {

+           var suffix = $("#select-repl-agmt-suffix").val();

+           var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'delete', '--suffix=' + suffix, '"' + del_agmt_name + '"'];

+           console.log("CMD: Delete winsync agmt: " + cmd.join(' '));

+           cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+             popup_success('Successfully removed replication winsync agreement');

+             // Update table

+             repl_winsync_agmt_table.row( agmt_row.parents('tr') ).remove().draw( false );

+           }).fail(function(data) {

+             get_and_set_repl_config();

+             popup_err("Failed to remove replication winsync agreement", data.message);

+           });

+         }

+       });

+     });

  

-     // Edit Agreement

+     /*

+      * Edit Agreement

+      */

      $(document).on('click', '.agmt-edit-btn', function(e) {

        e.preventDefault();

        clear_agmt_wizard();

- 

+       var suffix = $("#select-repl-agmt-suffix").val();

        var data = repl_agmt_table.row( $(this).parents('tr') ).data();

        var edit_agmt_name = data[0];

- 

-       // TODO Get agreement from DS and populate form

- 

        // Set agreement form values

        $("#agmt-wizard-title").html("<b>Edit Replication Agreement</b>");

  

-       // Open form

-       $("#agmt-form").modal('toggle');

+       // Hide init dropdown

+       $("#init-agmt-dropdown").hide();

+ 

+       // Get agreement from DS and populate form

+       var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'get', '--suffix=' + suffix, '"' + edit_agmt_name + '"'];

+       console.log("CMD: Get agmt: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         var agmt_obj = JSON.parse(data);

+         var frac_attrs = "";

+         var frac_tot_attrs = "";

+         var strip_attrs = "";

+ 

+         $("#agmt-cn").val(edit_agmt_name);

+         for (var attr in agmt_obj['attrs']) {

+           var val = agmt_obj['attrs'][attr][0];

+           attr = attr.toLowerCase();

+           $("#" + attr).val(val);

+           repl_agmt_values[attr] = val;

+         }

+ 

+         // Fill Password Confirm Input

+         if ( 'nsds5replicacredentials' in agmt_obj['attrs'] ){

+           $("#nsds5replicacredentials-confirm").val(agmt_obj['attrs']["nsds5replicacredentials"][0]);

+         }

+ 

+         // Transport info

+         val = agmt_obj['attrs']["nsds5replicatransportinfo"][0].toLowerCase();

+         if (val == "ldap"){

+           $("#nsds5replicatransportinfo").val("LDAP");

+         } else if (val == "ldaps"){

+           $("#nsds5replicatransportinfo").val("LDAPS");

+         } else if (val == "starttls" || val == "tls"){

+           $("#nsds5replicatransportinfo").val("StartTLS");

+         }

+ 

+         // Bind Method

+         val = agmt_obj['attrs']["nsds5replicabindmethod"][0].toLowerCase();

+         if (val == "simple"){

+           $("#nsds5replicabindmethod").val("SIMPLE");

+         } else if (val == "sasl/digest-md5"){

+           $("#nsds5replicabindmethod").val("SASL/DIGEST-MD5");

+         } else if (val == "sasl/gssapi"){

+           $("#nsds5replicabindmethod").val("SASL/GSSAPI");

+         } else if (val == "sslclientauth"){

+           $("#nsds5replicatransportinfo").val("SSLCLIENTAUTH");

+         }

+ 

+         // Load fractional lists

+         if ( 'nsds5replicatedattributelist' in agmt_obj['attrs'] ){

+           frac_attrs = agmt_obj['attrs']['nsds5replicatedattributelist'][0];

+           frac_attrs = frac_attrs.replace(frac_prefix, "").split(" ");

+           for(var i = 0; i < frac_attrs.length; i++) {

+             var opt = frac_attrs[i];

+             if (opt != "") {

+               var option = $('<option></option>').attr("value", opt).text(opt);

+               $("#frac-exclude-list").append(option);

+             }

+           }

+         }

+         if ( 'nsds5replicatedattributelisttotal' in agmt_obj['attrs'] ){

+           frac_tot_attrs = agmt_obj['attrs']['nsds5replicatedattributelisttotal'][0];

+           frac_tot_attrs = frac_tot_attrs.replace(frac_prefix, "").split(" ");

+           for(var i = 0; i < frac_tot_attrs.length; i++) {

+             var opt = frac_tot_attrs[i];

+             if (opt != "") {

+              var option = $('<option></option>').attr("value", opt).text(opt);

+               $("#frac-exclude-tot-list").append(option);

+             }

+           }

+         }

+         if ( 'nsds5replicastripattrs' in agmt_obj['attrs'] ){

+           strip_attrs = agmt_obj['attrs']['nsds5replicastripattrs'][0];

+           strip_attrs = strip_attrs.split(" ");

+           for(var i = 0; i < strip_attrs.length; i++) {

+             var opt = strip_attrs[i];

+             if (opt != "") {

+               var option = $('<option></option>').attr("value", opt).text(opt);

+               $("#frac-strip-list").append(option);

+             }

+           }

+         }

+ 

+         // Set schedule

+         if ( 'nsds5replicaupdateschedule' in agmt_obj['attrs'] ){

+           var val =  agmt_obj['attrs']['nsds5replicaupdateschedule'][0];

+           var parts = val.split(" ");

+           var days = parts[1];

+           var times = parts[0].split("-");

+           var start_time = times[0].substring(0,2) + ":" + times[0].substring(2,4);

+           var end_time = times[1].substring(0,2) + ":" + times[1].substring(2,4);

+ 

+           $("#agmt-schedule-checkbox").prop('checked', false);

+           $('#agmt-schedule-panel *').attr('disabled', false);

+           $("#schedule-settings").show();

+ 

+           $("#agmt-start-time").val(start_time);

+           $("#agmt-end-time").val(end_time);

+           if ( days.indexOf('0') != -1){ // Sunday

+             $("#schedule-sun").prop('checked', true);

+           }

+           if ( days.indexOf('1') != -1){ // Monday

+             $("#schedule-mon").prop('checked', true);

+           }

+           if ( days.indexOf('2') != -1){ // Tuesday

+             $("#schedule-tue").prop('checked', true);

+           }

+           if ( days.indexOf('3') != -1){ // Wednesday

+             $("#schedule-wed").prop('checked', true);

+           }

+           if ( days.indexOf('4') != -1){ // Thursday

+             $("#schedule-thu").prop('checked', true);

+           }

+           if ( days.indexOf('5') != -1){ // Friday

+             $("#schedule-fri").prop('checked', true);

+           }

+           if ( days.indexOf('6') != -1){ // Saturday

+             $("#schedule-sat").prop('checked', true);

+           }

+         }

+         // Finally Open form

+         $("#agmt-form").modal('toggle');

+       }).fail(function(data) {

+         popup_err("Failed to get replication agreement entry", data.message);

+       });

      });

  

-     // Edit Winsync Agreement

+     /*

+      * Edit Winsync Agreement

+      */

      $(document).on('click', '.winsync-agmt-edit-btn', function(e) {

        e.preventDefault();

        clear_winsync_agmt_wizard();

- 

+       var suffix = $("#select-repl-winsync-suffix").val();

        var data = repl_winsync_agmt_table.row( $(this).parents('tr') ).data();

        var edit_agmt_name = data[0];

  

-       // TODO Get agreement from DS and populate form

+       // Get agreement from DS and populate form

+       var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'get', '--suffix=' + suffix, '"' + edit_agmt_name + '"'];

+       console.log("CMD: Get winsync agmt: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         var agmt_obj = JSON.parse(data);

+ 

+         // Set agreement form values

+         $("#winsync-agmt-wizard-title").html("<b>Edit Winsync Agreement</b>");

+         // Hide init dropdown

+         $("#winsync-init-chbx").hide();

+         $("#winsync-agmt-cn").val(edit_agmt_name);

+         for (var attr in agmt_obj['attrs']) {

+           var val = agmt_obj['attrs'][attr][0];

+           attr = attr.toLowerCase();

+           $("#winsync-" + attr).val(val);

+           if (val == "on") {

+             $("#winsync-" + attr + "-checkbox").prop('checked', true);

+           } else if (val == "off") {

+             $("#winsync-" + attr + "-checkbox").prop('checked', false);

+           }

+           repl_winsync_agmt_values[attr] = val;

+         }

  

-       // Set agreement form values

-       $("#winsync-label").html("<b>Edit Winsync Agreement</b>");

+         // Fill Password Confirm Input

+         if ( 'nsds5replicacredentials' in agmt_obj['attrs'] ){

+           $("#winsync-nsds5replicacredentials-confirm").val(agmt_obj['attrs']["nsds5replicacredentials"][0]);

+         }

  

-       // Open form

-       $("#winsync-agmt-form").modal('toggle');

+         // Transport info

+         val = agmt_obj['attrs']["nsds5replicatransportinfo"][0].toLowerCase();

+         if (val == "ldap"){

+           $("#winsync-nsds5replicatransportinfo").val("LDAP");

+         } else if (val == "ldaps"){

+           $("#winsync-nsds5replicatransportinfo").val("LDAPS");

+         } else if (val == "starttls" || val == "tls"){

+           $("#winsync-nsds5replicatransportinfo").val("StartTLS");

+         }

+ 

+         // Finally open the form

+         $("#winsync-agmt-form").modal('toggle');

+       }).fail(function(data) {

+         popup_err("Failed to load replication winsync agreement entry", data.message);

+       });

      });

  

+ 

      // Handle disabling/enabling of agmt schedule panel

      $('#agmt-schedule-panel *').attr('disabled', true); /// Disabled by default

      $("#agmt-schedule-checkbox").change(function() {
@@ -539,160 +1588,296 @@ 

       * Handle the repl agmt wizard select lists

       */

  

-     // Fractional attrs

-     $("#frac-list-add-btnZZ").on("click", function () {

-       var add_attrs = $("#frac-attr-list").val();

-       if (add_attrs != '' && add_attrs.length > 0) {

-         for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#frac-list option[value="' + add_attrs[i] + '"]').val() === undefined) {

-             $('#frac-list').append($("<option/>") .val(add_attrs[i]) .text(add_attrs[i]));

-           }

-         }

-         $("#frac-attr-list").find('option:selected').remove();

-       }

+     /*

+      * Set the "select"'s list-id in a hidden field on the select attribute form

+      * so we know what list to update after the selection

+      */

+ 

+     $(".ds-fractional-btn").on('click', function() {

+       // reset the list

+       $("#select-attr-list").prop('selectedIndex',-1);

      });

-     $("#frac-list-remove-btn").on("click", function () {

-       var add_attrs = $("#frac-list").find('option:selected');

-       if (add_attrs && add_attrs != '' && add_attrs.length > 0) {

-         for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#frac-attr-list option[value="' + add_attrs[i].text + '"]').val() === undefined) {

-             $('#frac-attr-list').append($("<option/>").val(add_attrs[i].text).text(add_attrs[i].text));

-           }

-         }

-       }

-       $("#frac-list").find('option:selected').remove();

-       sort_list( $("#frac-attr-list") );

+     $("#frac-list-add-btn").on('click', function () {

+       $("#attr-form-id").val("frac-exclude-list");

      });

- 

- 

-     // Total Fractional attrs

-     $("#frac-total-list-add-btnZZ").on("click", function () {

-       var add_attrs = $("#total-attr-list").val();

-       if (add_attrs != '' && add_attrs.length > 0) {

-         for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#frac-total-list option[value="' + add_attrs[i] + '"]').val() === undefined) {

-             // Not a duplicate

-             $('#frac-total-list').append($("<option/>") .val(add_attrs[i]) .text(add_attrs[i]));

-           }

-         }

-         $("#total-attr-list").find('option:selected').remove();

-       }

+     $("#frac-total-list-add-btn").on('click', function () {

+       $("#attr-form-id").val("frac-exclude-tot-list");

      });

-     $("#frac-total-list-remove-btn").on("click", function () {

-       var add_attrs = $("#frac-total-list").find('option:selected');

-       if (add_attrs && add_attrs != '' && add_attrs.length > 0) {

-         for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#total-attr-list option[value="' + add_attrs[i].text + '"]').val() === undefined) {

-             $('#total-attr-list').append($("<option/>").val(add_attrs[i].text).text(add_attrs[i].text));

-           }

-         }

-       }

-       $("#frac-total-list").find('option:selected').remove();

-       sort_list( $("#total-attr-list") );

+     $("#frac-strip-list-add-btn").on('click', function () {

+       $("#attr-form-id").val("frac-strip-list");

      });

  

-     // Strip Fractional attrs

-     $("#frac-strip-list-add-btnZZ").on("click", function () {

-       var add_attrs = $("#strip-attr-list").val();

-       if (add_attrs != '' && add_attrs.length > 0) {

-         for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#frac-strip-list option[value="' + add_attrs[i] + '"]').val() === undefined) {

-             // Not a duplicate

-             $('#frac-strip-list').append($("<option/>") .val(add_attrs[i]) .text(add_attrs[i]));

-           }

-         }

-         $("#strip-attr-list").find('option:selected').remove();

-       }

+     // Handle the attribute removal from the lists

+     $("#frac-list-remove-btn").on("click", function () {

+       $("#frac-exclude-list").find('option:selected').remove();

+     });

+     $("#frac-total-list-remove-btn").on("click", function () {

+       $("#frac-exclude-tot-list").find('option:selected').remove();

      });

      $("#frac-strip-list-remove-btn").on("click", function () {

-       var add_attrs = $("#frac-strip-list").find('option:selected');

+       $("#frac-strip-list").find('option:selected').remove();

+     });

+ 

+     // Update agmt form attribute selection lists

+     $("#select-attr-save").on("click", function () {

+       // Get the id from the hidden input filed and append the attribute to it

+       var list_id = $("#attr-form-id").val();

+       var add_attrs = $("#select-attr-list").find('option:selected');

        if (add_attrs && add_attrs != '' && add_attrs.length > 0) {

          for (var i = 0; i < add_attrs.length; i++) {

-           if ( $('#strip-attr-list option[value="' + add_attrs[i].text + '"]').val() === undefined) {

-             $('#strip-attr-list').append($("<option/>").val(add_attrs[i].text).text(add_attrs[i].text));

+           if ( $('#' + list_id + ' option[value="' + add_attrs[i].text + '"]').val() === undefined) {

+             $('#' + list_id).append($("<option/>").val(add_attrs[i].text).text(add_attrs[i].text));

            }

          }

+         sort_list( $("#" + list_id) );

        }

-       $("#frac-strip-list").find('option:selected').remove();

-       sort_list( $("#strip-attr-list") );

+       $("#select-attr-form").modal('toggle');

      });

  

-     // Modals

- 

- 

  

+     /*

+      * Modals

+      */

  

      // Winsync-agmt Agreement Wizard

  

      $("#winsync-create-agmt").on("click", function() {

        clear_winsync_agmt_wizard(); // TODO

      });

+ 

+     $("#create-agmt").on("click", function() {

+       clear_agmt_wizard();

+     });

+ 

      $("#winsync-agmt-save").on("click", function() {

+       var suffix = $("#select-repl-winsync-suffix").val();

+       var cmd = [];

+       var cmd_args = [];

+       var param_err = false;

+       var editing = false;

+       var init_replica = false;

  

        // Check passwords match:

- 

        var agmt_passwd = $("#winsync-nsds5replicacredentials").val();

        var passwd_confirm = $("#winsync-nsds5replicacredentials-confirm").val();

- 

        if (agmt_passwd != passwd_confirm) {

          popup_msg("Attention!", "Passwords do not match!");

          return;

        }

        // Get form values

-       var repl_root = repl_suffix;

+       var repl_root = $("#select-repl-winsync-suffix").val();

        var agmt_name = $("#winsync-agmt-cn").val();

-       var win_domain = $("#nsds7windowsdomain").val();

+       var win_domain = $("#winsync-nsds7windowsdomain").val();

        var agmt_host = $("#winsync-nsds5replicahost").val();

        var agmt_port = $("#winsync-nsds5replicaport").val();

-       var win_subtree = $("#nsds7windowsreplicasubtree").val();

-       var ds_subtree = $("#nsds7directoryreplicasubtree").val();

+       var win_subtree = $("#winsync-nsds7windowsreplicasubtree").val();

+       var ds_subtree = $("#winsync-nsds7directoryreplicasubtree").val();

        var bind_dn = $("#winsync-nsds5replicabinddn").val();

-       var conn_protocol = $("#winsync-nsds5replicabindmethod").val();

-       var sync_new_users = "no";

-       var sync_new_groups = "no";

-       if ( $("#nsds7newwinusersyncenabled-checkbox").is(":checked") ){

-         sync_new_users = "yes";

+       var bind_pw = $("#winsync-nsds5replicacredentials").val();

+       var agmt_conn = $("#winsync-nsds5replicatransportinfo").val();

+       var sync_new_users = "off";

+       var sync_new_groups = "off";

+       if ( $("#winsync-nsds7newwinusersyncenabled-checkbox").is(":checked") ){

+         sync_new_users = "on";

        }

-       if ( $("#nsds7newwingroupsyncenabled-checkbox").is(":checked") ){

-         sync_new_groups = "yes"

+       if ( $("#winsync-nsds7newwingroupsyncenabled-checkbox").is(":checked") ){

+         sync_new_groups = "on"

+       }

+       if ($("#winsync-agmt-wizard-title").text().includes('Edit') ) {

+         editing = true;

        }

  

-       // Validate

- 

+       // Check required settings

+       if (bind_pw == "") {

+         $("#winsync-nsds5replicacredentials").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds5replicacredentials").css("border-color", "initial");

+         cmd_args.push("--bind-passwd=" + bind_pw);

+       }

+       if ( ds_subtree == "") {

+         $("#winsync-nsds7directoryreplicasubtree").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds7directoryreplicasubtree").css("border-color", "initial");

+         cmd_args.push("--ds-subtree=" + ds_subtree);

+       }

+       if ( win_subtree == "") {

+         $("#winsync-nsds7windowsreplicasubtree").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds7windowsreplicasubtree").css("border-color", "initial");

+         cmd_args.push("--win-subtree=" + win_subtree);

+       }

+       if ( win_domain == "") {

+         $("#winsync-nsds7windowsdomain").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds7windowsdomain").css("border-color", "initial");

+         cmd_args.push("--win-domain=" + win_domain);

+       }

+       if ( agmt_port == "") {

+         $("#winsync-nsds5replicaport").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds5replicaport").css("border-color", "initial");

+         cmd_args.push("--port=" + agmt_port);

+       }

+       if ( agmt_host == "") {

+         $("#winsync-nsds5replicahost").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds5replicahost").css("border-color", "initial");

+         cmd_args.push('--host=' + agmt_host);

+       }

+       if ( agmt_conn == "") {

+         $("#winsync-nsds5replicatransportinfo").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds5replicatransportinfo").css("border-color", "initial");

+         cmd_args.push('--conn-protocol=' + agmt_conn);

+       }

+       if ( bind_dn == "") {

+         $("#winsync-nsds5replicabinddn").css("border-color", "red");

+         param_err = true;

+       } else {

+         $("#winsync-nsds5replicabinddn").css("border-color", "initial");

+         cmd_args.push('--bind-dn=' + bind_dn);

+       }

+       if (param_err ){

+         popup_msg("Error", "Missing required parameters");

+         return;

+       }

  

-       // Update DS

+       // Checkboxes

+       if ( ($("#winsync-nsds7newwinusersyncenabled-checkbox").is(":checked")) ){

+         sync_new_users = "on";

+       }

+       if ( ($("#winsync-nsds7newwingroupsyncenabled-checkbox").is(":checked")) ){

+         sync_groups_users = "on";

+       }

+       if ( ($("#winsync-init-chbx").is(":checked")) ){

+         init_replica = true;

+       }

+       cmd_args.push('--sync-users=' + sync_new_users);

+       cmd_args.push('--sync-groups=' + sync_new_groups);

  

-       // Update Winsync Agmt Table

-       repl_winsync_agmt_table.row.add( [

-         agmt_name,

-         agmt_host,

-         agmt_port,

-         ds_subtree,

-         win_subtree,

-         winsync_agmt_action_html

-       ] ).draw( false );

+       // Create winsync agreement in DS

+       if ( editing ) {

+         cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'set', '"' + agmt_name + '"', '--suffix=' + suffix ];

+       } else {

+         cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'create', '"' + agmt_name + '"', '--suffix=' + suffix];

+       }

+       cmd = cmd.concat(cmd_args);

+       console.log("CMD: Set/Create winsync agmt: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+         if (editing){

+           popup_success('Successfully edited replication winsync agreement');

+         } else {

+           popup_success('Successfully created replication winsync agreement');

+         }

+         if (init_replica) {

+           // Launch popup stating initialization has begun

+           var init_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'init', '--suffix=' + suffix, '"' + agmt_name + '"' ];

+           console.log("CMD: Init winsync agmt: " + init_cmd.join(' '));

+           cockpit.spawn(init_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+             popup_msg("Agreement Initialization", "The agreement initialization has begun...");

+           }).fail(function(data) {

+             popup_err("Failed to initialize replication agreement", data.message);

+           });

+         }

+         // Reload table

+         get_and_set_repl_winsync_agmts();

+       }).fail(function(data) {

+         if (editing) {

+          popup_err("Failed to edit replication winsync agreement", data.message);

+        } else {

+          popup_err("Failed to create replication winsync agreement", data.message);

+        }

+       });

  

-       // Done

+       // Reload winsync agmt table

        $("#winsync-agmt-form").modal('toggle');

      });

  

-     // Create CleanAllRUV Task

+     // Create CleanAllRUV Task - TODO

      $("#create-cleanallruv-btn").on("click", function() {

        clear_cleanallruv_form();

      });

+ 

      $("#cleanallruv-save").on("click", function() {

-       $("#cleanallruv-form").css('display', 'none');

        // Do the actual save in DS

-       // Update html

- 

-       // Update Agmt Table

-       repl_clean_table.row.add( [

-         "Creation date WIP",

-         $("#cleanallruv-rid").val(),

-         "Task starting...",

-         cleanallruv_action_html

-       ] ).draw( false );

+       var suffix = $("#cleanallruv-suffix").val();

+       var rid = $("#cleanallruv-rid").val();

+       var force = false;

+       if ( $("#force-clean").is(":checked") ) {

+         force = true;

+       }

+       if (suffix == ""){

+         popup_msg("Error", "There is no suffix to run the task on");

+         return;

+       }

+       if (rid == ""){

+         popup_msg("Error", "You must enter a Replica ID to clean");

+         return;

+       }

        $("#cleanallruv-form").modal('toggle');

+       var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-tasks', 'cleanallruv', '--suffix=' + suffix, '--replica-id=' + rid ];

+       if (force) {

+         cmd.push('--force-cleaning');

+       }

+       console.log("CMD: Creating cleanAllRUV Task: " + cmd.join(' '));

+       cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+         var list_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-tasks', 'list-cleanallruv'];

+         console.log("CMD: Listing cleanAllRUV tasks: " + list_cmd.join(' '));

+         cockpit.spawn(list_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+           repl_clean_table.clear();

+           var obj = JSON.parse(data);

+           for (var idx in obj['items']) {

+             task_attrs = obj['items'][idx]['attrs'];

+             var task_create_date = task_attrs['createtimestamp'][0];

+             var abort_btn = cleanallruv_action_html;

+             if (task_attrs['nstaskstatus'][0].includes('Successfully cleaned rid') ){

+               abort_btn = "";

+             }

+             repl_clean_table.row.add( [

+               task_attrs['cn'][0],

+               get_date_string(task_create_date),

+               suffix,

+               rid,

+               task_attrs['nstaskstatus'][0],

+               abort_btn

+             ] ).draw( false );

+           }

+         }).fail( function (data) {

+           popup_err("Failed to get CleanAllRUV Tasks", data.message);

+         });

+       }).fail( function (data) {

+         popup_err("Failed to create CleanAllRUV Task", data.message);

+       });

+     });

+ 

+     $(document).on('click', '.abort_cleanallruv_btn', function(e) {

+       e.preventDefault();

+       var data = repl_clean_table.row( $(this).parents('tr') ).data();

+       var suffix = $("#cleanallruv-suffix").val();

+       var task_rid = data[3];

+       popup_confirm("Are you sure you want to abort the cleaning task on: <b>" + suffix + "</b> for Replica ID <b>" + task_rid + "</b>", "Confirmation", function (yes) {

+         if (yes) {

+           var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-tasks', 'abort-cleanallruv', '--replica-id=' + task_rid, '--suffix=' + suffix];

+           console.log("CMD: Abort cleanAllRUV task: " + cmd.join(' '));

+           cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

+             popup_success("Creating task to abort the CleanAllRUV Task");

+           }).fail(function(data) {

+             popup_err("Failed to add Abort CleanAllRUV Task", data.message);

+           });

+         }

+       });

+     });

+ 

+     $("#refresh-cleanlist-btn").on('click', function () {

+       // Refresh the list

+       get_and_set_cleanallruv();

      });

  

      // Add repl manager
@@ -712,66 +1897,206 @@ 

        if (repl_mgr_dn.val() !== undefined) {

          popup_confirm("Are you sure you want to delete replication manager: <b>" + repl_mgr_dn.val() + "</b>", "Confirmation", function (yes) {

            if (yes) {

-             // TODO Update replica config entry, do not delete the real repl mgr entry

- 

-             // Update HTML

-             repl_mgr_dn.remove();

-             check_repl_binddn_list();

+             // Update replica config entry, do not delete the real repl mgr entry

+            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'set', '--suffix="' + suffix + '"', "--repl-remove-bind-dn=" + repl_mgr_dn.val() ];

+            console.log("CMD: Setting replication configuration: " + cmd.join(' '));

+            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+                // Update HTML

+                repl_mgr_dn.remove();

+                // Just refresh the entire config

+                get_and_set_repl_config();

+                popup_success("Successfully updated replication configuration");

+              }).fail( function(err) {

+                popup_err("Failed to remove the replication manager from the replication configuration", data.message);

+              });

            }

          });

        }

      });

  

-     // Add repl manager modal

+     /*

+      * Add repl manager modal

+      */

      $("#add-repl-manager").on("click", function() {

        clear_repl_mgr_form();

        $("#add-repl-mgr-form").css('display', 'block');

      });

-     $("#add-repl-mgr-close").on("click", function() {

-       $("#add-repl-mgr-form").css('display', 'none');

-     });

-     $("#add-repl-mgr-cancel").on("click", function() {

-       $("#add-repl-mgr-form").css('display', 'none');

-     });

+ 

      $("#add-repl-mgr-save").on("click", function() {

+       var suffix = $("#select-repl-cfg-suffix").val();

        var repl_dn = $("#add-repl-mgr-dn").val();

+       var repl_pw = "";

        if (repl_dn == ""){

          popup_msg("Attention!", "Replication Manager DN is required");

          return;

        }

        if ( $("#add-repl-mgr-checkbox").is(":checked") ){

          // Confirm passwords match

-         var agmt_bindpw = $("#add-repl-pw").val();

-         var agmt_bindpw_confirm = $("#add-repl-pw-confirm").val();

-         if (agmt_bindpw != agmt_bindpw_confirm) {

+         repl_pw = $("#add-repl-pw").val();

+         var repl_pw_confirm = $("#add-repl-pw-confirm").val();

+         if (repl_pw != repl_pw_confirm) {

            popup_msg("Attention!", "Passwords do not match");

            $("#add-repl-pw").val("");

            $("#add-repl-pw-confirm").val("");

            return;

          }

        }

- 

-       console.log("Validate dn...");

        if (!valid_dn(repl_dn)){

          popup_msg("Attention!", "Invalid DN for Replication Manager");

          return;

        }

  

+       // If we are creating the entry do it now

+       if (repl_pw != ""){

+         var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'create-manager', '--name=' + repl_dn, '--passwd=' + repl_pw ];

+         console.log("CMD: Creating replication manager: " + cmd.join(' '));

+         cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+           /*

+            * Success, now update the repl config

+            */

+           var update_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'set', '--repl-add-bind-dn=' + repl_dn, '--suffix=' + suffix];

+           console.log("CMD: Adding replication manager to configuration: " + update_cmd.join(' '));

+           cockpit.spawn(update_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+             // Update html

+             get_and_set_repl_config();

+             popup_success("Success created replication manager and added it to the replication configuration");

+             $("#add-repl-mgr-form").modal('toggle');

+           }).fail( function(err) {

+             popup_err("Failed to add replication manager to configuration", err.message);

+             $("#add-repl-mgr-form").modal('toggle');

+           });

+         }).fail( function(err) {

+           popup_err("Failed to create replication manager entry", err.message);

+           $("#add-repl-mgr-form").modal('toggle');

+         });

+       } else {

+         // Just update repl config

+         var update_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','replication', 'set', '--repl-add-bind-dn=' + repl_dn, '--suffix=' + suffix];

+         console.log("CMD: Adding replication manager to configuration: " + update_cmd.join(' '));

+         cockpit.spawn(update_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+           // Update html

+           get_and_set_repl_config();

+           popup_success("Success created replication manager and added it to the replication configuration");

+           $("#add-repl-mgr-form").modal('toggle');

+         }).fail( function(err) {

+           popup_err("Failed to add replication manager to replication configuration", err.message);

+           $("#add-repl-mgr-form").modal('toggle');

+         });

+       }

+     });

  

-       // Do the actual save in DS

  

-       // Update html

+     $(document).on('click', '.abort-cleanallruv-btn', function(e) {

+        // TODO - abort the cleantask - update table (remove or update existing clean task?)

+     });

  

-       add_repl_mgr(repl_dn);

+     /* Send update now */

+     $(document).on('click', '.agmt-send-updates-btn', function(e) {

+       var suffix = $("#select-repl-agmt-suffix").val();

+       var data = repl_agmt_table.row( $(this).parents('tr') ).data();

+       var update_agmt_name = data[0];

+ 

+       var update_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'poke', update_agmt_name, '--suffix=' + suffix];

+       console.log("CMD: Trigger send updates now: " + update_cmd.join(' '));

+       cockpit.spawn(update_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+         popup_success("Triggered replication updates");

+       }).fail( function(err) {

+         popup_err("Failed to send updates", err.message);

+       });

+     });

  

+     /* Send update now (winsync) */

+     $(document).on('click', '.winsync-agmt-send-updates-btn', function(e) {

+       var suffix = $("#select-repl-winsync-suffix").val();

+       var data = repl_winsync_agmt_table.row( $(this).parents('tr') ).data();

+       var update_agmt_name = data[0];

+ 

+       var update_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'poke', update_agmt_name, '--suffix=' + suffix];

+       console.log("CMD: Trigger send updates now: " + update_cmd.join(' '));

+       cockpit.spawn(update_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+         popup_success("Kick started replication");

+       }).fail( function(err) {

+         popup_err("Failed to send updates", err.message);

+       });

+     });

  

-       $("#add-repl-mgr-form").modal('toggle');

  

+     /*

+      * Enable/Disable repl agmt

+      */

+     $(document).on('click', '.agmt-enable-btn', function(e) {

+       var suffix = $("#select-repl-agmt-suffix").val();

+       var data = repl_agmt_table.row( $(this).parents('tr') ).data();

+       var enable_agmt_name = data[0];

+       var agmt_state = data[3];  // 4th column in table

+       if (agmt_state.toLowerCase() == "enabled") {

+         // We must be trying to disable this agreement - confirm it

+         popup_confirm("Are you sure you want to disable replication agreement: <b>" + enable_agmt_name + "</b>", "Confirmation", function (yes) {

+           if (yes) {

+             var disable_cmd =  [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'disable', enable_agmt_name, '--suffix=' + suffix];

+             console.log("CMD: Disable replication agmt: " + disable_cmd.join(' '));

+             cockpit.spawn(disable_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+               get_and_set_repl_agmts();

+               popup_success("The replication agreement has been disabled.");

+             }).fail( function(err) {

+               popup_err("Failed to disable agreement", err.message);

+             });

+           }

+         });

+       } else {

+         // Enabling agreement - confirm it

+         popup_confirm("Are you sure you want to enable replication agreement: <b>" + enable_agmt_name + "</b>", "Confirmation", function (yes) {

+           if (yes) {

+             var enable_cmd =  [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-agmt', 'enable', enable_agmt_name, '--suffix=' + suffix];

+             console.log("CMD: Enable replication agmt: " + enable_cmd.join(' '));

+             cockpit.spawn(enable_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+               get_and_set_repl_agmts();

+               popup_success("The replication agreement has been enabled.");

+             }).fail( function(err) {

+               popup_err("Failed to enable agreement", err.message);

+             });

+           }

+         });

+       }

      });

  

- 

-     $(document).on('click', '.abort-cleanallruv-btn', function(e) {

-        // TODO - abort the cleantask - update table (remove or update existing clean task?)

+     /*

+      * Enable/Disable winsync repl agmt

+      */

+     $(document).on('click', '.winsync-agmt-enable-btn', function(e) {

+       var suffix = $("#select-repl-winsync-suffix").val();

+       var data = repl_winsync_agmt_table.row( $(this).parents('tr') ).data();

+       var enable_agmt_name = data[0];

+       var agmt_state = data[3];  // 4th column in table

+       if (agmt_state.toLowerCase() == "enabled") {

+         // We must be trying to disable this agreement - confirm it

+         popup_confirm("Are you sure you want to disable replication agreement: <b>" + enable_agmt_name + "</b>", "Confirmation", function (yes) {

+           if (yes) {

+             var disable_cmd =  [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'disable', enable_agmt_name, '--suffix=' + suffix];

+             console.log("CMD: Disable winsync agmt: " + disable_cmd.join(' '));

+             cockpit.spawn(disable_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+               get_and_set_repl_winsync_agmts();

+               popup_success("The replication agreement has been disabled.");

+             }).fail( function(err) {

+               popup_err("Failed to disable agreement", err.message);

+             });

+           }

+         });

+       } else {

+         // Enabling agreement - confirm it

+         popup_confirm("Are you sure you want to enable replication agreement: <b>" + enable_agmt_name + "</b>", "Confirmation", function (yes) {

+           if (yes) {

+             var enable_cmd =  [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','repl-winsync-agmt', 'enable', enable_agmt_name, '--suffix=' + suffix];

+             console.log("CMD: Enable winsync agmt: " + enable_cmd.join(' '));

+             cockpit.spawn(enable_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

+               get_and_set_repl_winsync_agmts();

+               popup_success("The replication agreement has been enabled.");

+             }).fail( function(err) {

+               popup_err("Failed to enable agreement", err.message);

+             });

+           }

+         });

+       }

      });

  

      // Page is loaded, mark it as so...

@@ -59,6 +59,7 @@ 

  

  function load_schema_objects_to_select(object, select_id) {

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', object, 'list'];

+   console.log("CMD: Get schema: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      var data = []
@@ -84,17 +85,21 @@ 

  }

  

  function get_and_set_schema_tables() {

-   load_schema_objects_to_select('matchingrules', 'attr-eq-mr-select')

-   load_schema_objects_to_select('matchingrules', 'attr-order-mr-select')

-   load_schema_objects_to_select('matchingrules', 'attr-sub-mr-select')

-   load_schema_objects_to_select('attributetypes', 'schema-list')

-   load_schema_objects_to_select('objectclasses', 'oc-parent')

+   console.log("Loading schema...");

  

    // Load syntaxes

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', "attributetypes", 'get_syntaxes'];

+   console.log("CMD: Get syntaxes: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      var data = []

+ 

+     load_schema_objects_to_select('matchingrules', 'attr-eq-mr-select')

+     load_schema_objects_to_select('matchingrules', 'attr-order-mr-select')

+     load_schema_objects_to_select('matchingrules', 'attr-sub-mr-select')

+     load_schema_objects_to_select('attributetypes', 'schema-list')

+     load_schema_objects_to_select('objectclasses', 'oc-parent')

+ 

      for (var idx in obj['items']) {

        item = obj['items'][idx];

        data.push.apply(data, [item]);
@@ -106,6 +111,7 @@ 

              text : item.name + " (" + item.id + ")"

          }));

      });

+     console.log("Finished loading schema.");

    }).fail(function(data) {

        console.log("failed: " + data.message);

        check_inst_alive(1);
@@ -113,6 +119,7 @@ 

  

    // Setup the tables: standard, custom, and Matching Rules

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', 'objectclasses', 'list'];

+   console.log("CMD: Get objectclasses: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      var data = [];
@@ -149,6 +156,7 @@ 

    });

  

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', 'attributetypes', 'list'];

+   console.log("CMD: Get attributes: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      var data = [];
@@ -197,6 +205,7 @@ 

    });

  

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', 'matchingrules', 'list'];

+   console.log("CMD: Get matching rules: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      var data = [];
@@ -221,7 +230,7 @@ 

      });

  

    }).fail(function(data) {

-       console.log("failed: " + data.cmd);

+       console.log("failed: " + data.message);

        check_inst_alive(1);

    });

  }
@@ -287,6 +296,7 @@ 

        cmd.push.apply(cmd, ["--may", oc_allowed_list]);

  

        $("#save-oc-spinner").show();

+       console.log("CMD: Save objectclass: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

        done(function(data) {

          $("#save-oc-spinner").hide();
@@ -435,6 +445,7 @@ 

        cmd.push.apply(cmd, ["--substr", order_mr]);

        cmd.push.apply(cmd, ["--ordering", sub_mr]);

        $("#save-attr-spinner").show();

+       console.log("CMD: Save attribute: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

        done(function(data) {

          $("#save-attr-spinner").hide();
@@ -526,6 +537,7 @@ 

        popup_confirm("Are you sure you want to delete attribute: <b>" + del_attr_name + "</b>", "Confirmation", function (yes) {

          if (yes) {

            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', 'attributetypes', 'remove', del_attr_name];

+           console.log("CMD: remove attribute: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              popup_success("Attribute was successfully removed!")

              schema_at_table.row( at_row.parents('tr') ).remove().draw( false );
@@ -584,6 +596,7 @@ 

        popup_confirm("Are you sure you want to delete objectclass: <b>" + del_oc_name + "</b>", "Confirmation", function (yes) {

          if (yes) {

            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket', 'schema', 'objectclasses', 'remove', del_oc_name];

+           console.log("CMD: Remove objectclass: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              popup_success("ObjectClass was successfully removed!")

              schema_oc_table.row( oc_row.parents('tr') ).remove().draw( false );

@@ -157,11 +157,14 @@ 

  

  function get_and_set_config () {

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','config', 'get'];

+   console.log("Loading server configuration.");

+   console.log("CMD: get config: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      // Reset tables before populating them

      $(".ds-accesslog-table").prop('checked', false);

      $(".ds-errorlog-table").prop('checked', false);

+     config_values = {};

  

      for (var attr in obj['attrs']) {

        var val = obj['attrs'][attr][0];
@@ -196,9 +199,11 @@ 

          }

        }

      }

+     console.log("Finished loading server configuration.");

+     config_loaded = 1;

      check_inst_alive();

    }).fail(function(data) {

-       console.log("failed: " + data.message);

+       popup_err("Error", "Failed to set config\n" + data.message);

        check_inst_alive(1);

    });

  }
@@ -209,6 +214,7 @@ 

                       'monitor-repl-backend-list'];

  

      var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','backend', 'list', '--suffix'];

+     console.log("CMD: Get backends: " + cmd.join(' '));

      cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

        // Clear all the dropdowns first

        for (var idx in dropdowns) {
@@ -221,13 +227,23 @@ 

            $("#" + dropdowns[list]).append('<option value="' + obj['items'][idx] + '" selected="selected">' + obj['items'][idx] +'</option>');

          }

        }

+   }).fail(function(data) {

+       if (quiet === undefined) {

+         popup_err("Error", "Failed to get backend suffix list\n" + data.message);

+       }

+       check_inst_alive(1);

    });

  }

  

- function get_and_set_localpwp () {

+ function get_and_set_localpwp (quiet) {

    // Now populate the table

+   console.log("Loading local password policies...");

    var suffix = $('#local-pwp-suffix').val();

+   if (suffix == null){

+     return;

+   }

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','localpwp', 'list', suffix ];

+   console.log("CMD: Get local password policies: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

      // Empty table
@@ -241,18 +257,25 @@ 

          local_pwp_html,]

        ).draw( false );

      }

+     console.log("Finished loading password policies.");

+   }).fail(function(data) {

+     popup_err("Error", "Failed to get password policy configuration\n" + data.message);

+     check_inst_alive(1);

    });

  }

  

  function get_and_set_sasl () {

    // First empty the table

-   sasl_table.clear().draw();

+   console.log("Loading SASL configuration...");

  

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'list'];

+   console.log("CMD: get SASL mappings: " + cmd.join(' '));

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

      var obj = JSON.parse(data);

+     sasl_table.clear().draw();

      for (var idx in obj['items']) {

        var map_cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'get', obj['items'][idx] ];

+       console.log("CMD: get SASL mapping: " + map_cmd.join(' '));

        cockpit.spawn(map_cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          var map_obj = JSON.parse(data);

  
@@ -271,8 +294,9 @@ 

          ] ).draw( false );

        });

      }

+     console.log("Finished loading SASL configuration.");

    }).fail(function(data) {

-       console.log("failed: " + data.message);

+       popup_err("Failed to SASL configuration", data.message);

        check_inst_alive(1);

    });

  }
@@ -286,13 +310,12 @@ 

    }

    var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','config', 'replace'];

    cmd.push(mod.attr + "=" + mod.val);

- 

    cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).then(function() {

      config_values[mod.attr] = mod.val;

      // Continue with next mods (if any))

      apply_mods(mods);

    }, function(ex) {

-      popup_err("Error", "Failed to update attribute: " + mod.attr + "\n\n" +  ex);

+      popup_err("Failed to update attribute: " + mod.attr, ex.message);

       // Reset HTML for remaining values that have not been processed

       $("#" + mod.attr).val(config_values[mod.attr]);

       for (remaining in mods) {
@@ -380,7 +403,10 @@ 

    }

  }

  

- // load the server config pages

+ 

+ /*

+  * load the server config pages

+  */

  $(document).ready( function() {

  

    // Set an interval event to wait for all the pages to load, then load the config
@@ -390,10 +416,11 @@ 

            monitor_page_loaded == 1)

        {

          get_insts();

-         console.log("Loaded configuration.");

          clearInterval(init_config);

        }

-   }, 200);

+   }, 250);

+ 

+   console.log("Loading Server Page...");

  

    $("#main-banner").load("banner.html");

    check_for_389();
@@ -631,12 +658,12 @@ 

          popup_confirm("Are you sure you want to delete sasl mapping: <b>" + del_sasl_name + "</b>", "Confirmation", function (yes) {

          if (yes) {

            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'delete', del_sasl_name];

+           console.log("CMD: delete SASL mapping: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              sasl_table.row( sasl_row.parents('tr') ).remove().draw( false );

              popup_success("Removed SASL mapping <b>" + del_sasl_name + "</b>");

            }).fail(function(data) {

-             popup_err("Failure Deleting SASL Mapping",

-                       "Failed To Delete SASL Mapping: <b>" + del_sasl_name + "</b>: \n" + data.message);

+             popup_err("Failed To Delete SASL Mapping: <b>" + del_sasl_name + "</b>", data.message);

            });

          }

        });
@@ -1007,6 +1034,7 @@ 

        if ( edit ) {

          var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','localpwp', 'set', policy_name];

          cmd = cmd.concat(arg_list);

+         console.log("CMD: Set local password policy: " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

            popup_success('Successfully edited local password policy');

            $("#local-pwp-form").modal('toggle')
@@ -1021,6 +1049,7 @@ 

          }

          var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','localpwp', action, policy_name];

          cmd = cmd.concat(arg_list);

+         console.log("CMD: Add local password policy: " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

            pwp_table.row.add( [

                policy_name,
@@ -1046,12 +1075,13 @@ 

          if (yes) {

            // Delete pwp from DS

            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','localpwp', 'remove', del_pwp_name];

+           console.log("CMD: Remove local password policy: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              // Update html table

              pwp_table.row( pwp_row.parents('tr') ).remove().draw( false );

              popup_success('Successfully deleted local password policy');

            }).fail(function(data) {

-               popup_err("Failed to delete local password policy\n" + data.message);

+               popup_err("Failed to delete local password policy", data.message);

            });

          }

        });
@@ -1106,6 +1136,7 @@ 

          // Create new mapping and update table

          var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'create',

                     sasl_name_cmd, sasl_regex_cmd, sasl_base_cmd, sasl_filter_cmd, sasl_priority_cmd];

+         console.log("CMD: Create SASL mapping: " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

            // Update html table

            sasl_table.row.add( [
@@ -1119,13 +1150,13 @@ 

            popup_success("Successfully added new SASL mapping");

            $("#sasl-map-form").modal('toggle');

          }).fail(function(data) {

-           popup_err("Failure Adding SASL Mapping",

-                     "Failed To Add SASL Mapping: <b>" + sasl_map_name + "</b>: \n" + data.message);

+           popup_err("Failed To Add SASL Mapping: " + sasl_map_name, data.message);

            $("#sasl-map-form").modal("toggle");

          });

        } else {

          // Editing mapping.  First delete the old mapping

          var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'delete', sasl_map_name];

+         console.log("CMD: Delete SASL mapping: " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

            // Remove row from old

            sasl_table.rows( function ( idx, data, node ) {
@@ -1135,6 +1166,7 @@ 

            // Then add new mapping and update table

            var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','sasl', 'create',

                       sasl_name_cmd, sasl_regex_cmd, sasl_base_cmd, sasl_filter_cmd, sasl_priority_cmd];

+           console.log("CMD: create SASL mapping: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function() {

              // Update html table

              sasl_table.row.add( [
@@ -1167,13 +1199,14 @@ 

        $("#ds-start-inst").html("<span class=\"spinner spinner-xs spinner-inline\"></span> Starting instance <b>" + server_id + "</b>...");

        $("#start-instance-form").modal('toggle');

        var cmd = [DSCTL, server_inst, 'start'];

+       console.log("CMD: Start instance: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          $("#start-instance-form").modal('toggle');

          load_config();

          popup_success("Started instance \"" + server_id + "\"");

        }).fail(function(data) {

          $("#start-instance-form").modal('toggle');

-         popup_err("Error", "Failed to start instance \"" + server_id + "\"\n" + data.message);

+         popup_err("Failed to start instance \"" + server_id,  data.message);

        });

      });

  
@@ -1181,13 +1214,14 @@ 

        $("#ds-stop-inst").html("<span class=\"spinner spinner-xs spinner-inline\"></span> Stopping instance <b>" + server_id + "</b>...");

        $("#stop-instance-form").modal('toggle');

        var cmd = [DSCTL, server_inst, 'stop'];

+       console.log("CMD: Stop instance: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          $("#stop-instance-form").modal('toggle');

          popup_success("Stopped instance \"" + server_id + "\"");

          check_inst_alive();

        }).fail(function(data) {

          $("#stop-instance-form").modal('toggle');

-         popup_err("Error", "Failed to stop instance \"" + server_id + "\"\n" + data.message);

+         popup_err("Error", "Failed to stop instance \"" + server_id+ "\"", data.message);

          check_inst_alive();

        });

      });
@@ -1196,13 +1230,14 @@ 

        $("#ds-restart-inst").html("<span class=\"spinner spinner-xs spinner-inline\"></span> Retarting instance <b>" + server_id + "</b>...");

        $("#restart-instance-form").modal('toggle');

        var cmd = [DSCTL, server_inst, 'restart'];

+       console.log("CMD: Restart instance: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          $("#restart-instance-form").modal('toggle');

          load_config();

          popup_success("Restarted instance \"" + server_id + "\"");

        }).fail(function(data) {

          $("#restart-instance-form").modal('toggle');

-         popup_err("Error", "Failed to restart instance \"" + server_id + "\"\n" + data.message);

+         popup_err("Failed to restart instance \"" + server_id + "\"", data.message);

        });

      });

  
@@ -1227,6 +1262,7 @@ 

        cockpit.spawn(cmd, { superuser: true}).

        done(function() {

          var cmd = [DSCONF, server_inst, 'backup', 'create',  backup_name];

+         console.log("CMD: Backup database: " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

          done(function(data) {

            $("#backup-spinner").hide();
@@ -1235,11 +1271,12 @@ 

          }).

          fail(function(data) {

            $("#backup-spinner").hide();

-           popup_err("Error", "Failed to backup the server\n" + data.message);

+           popup_err("Failed to backup the server", data.message);

          })

        }).

        fail(function() {

          var cmd = [DSCTL, server_inst, 'db2bak', backup_name];

+         console.log("CMD: Backup database(offline): " + cmd.join(' '));

          cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

          done(function(data) {

            $("#backup-spinner").hide();
@@ -1248,7 +1285,7 @@ 

          }).

          fail(function(data) {

            $("#backup-spinner").hide();

-           popup_err("Error", "Failed to backup the server\n" + data.message);

+           popup_err("Failed to backup the server", data.message);

          });

        });

      });
@@ -1260,6 +1297,7 @@ 

      /* Restore.  load restore table with current backups */

      $("#restore-server-btn").on('click', function () {

        var cmd = [DSCTL, server_id, '-j', 'backups'];

+       console.log("CMD: Resotre database(offline): " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          var backup_btn = "<button class=\"btn btn-default restore-btn\" type=\"button\">Restore</button>";

          var del_btn =  "<button title=\"Delete backup directory\" class=\"btn btn-default ds-del-backup-btn\" type=\"button\"><span class='glyphicon glyphicon-trash'></span></button>";
@@ -1272,7 +1310,7 @@ 

            backup_table.row.add([backup_name, backup_date, backup_size, backup_btn, del_btn]).draw( false );

          }

        }).fail(function(data) {

-         popup_err("Error", "Failed to get list of backups\n" + data.message);

+         popup_err("Failed to get list of backups", data.message);

        });

      });

  
@@ -1288,6 +1326,7 @@ 

            cockpit.spawn(cmd, { superuser: true}).

            done(function() {

              var cmd = [DSCONF, server_inst, 'backup', 'restore',  restore_name];

+             console.log("CMD: Restore database(online): " + cmd.join(' '));

              cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

              done(function(data) {

                $("#restore-spinner").hide();
@@ -1296,11 +1335,12 @@ 

              }).

              fail(function(data) {

                $("#restore-spinner").hide();

-               popup_err("Error", "Failed to restore from the backup\n" + data.message);

+               popup_err("Failed to restore from the backup", data.message);

              });

            }).

            fail(function() {

              var cmd = [DSCTL, server_inst, 'bak2db', restore_name];

+             console.log("CMD: Restore database (offline): " + cmd.join(' '));

              cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).

              done(function(data) {

                $("#restore-spinner").hide();
@@ -1309,7 +1349,7 @@ 

              }).

              fail(function(data) {

                $("#restore-spinner").hide();

-               popup_err("Error", "Failed to restore from the backup\n" + data.message);

+               popup_err("Failed to restore from the backup", data.message);

              });

            });

          }
@@ -1326,13 +1366,14 @@ 

          if (yes) {

            var cmd = [DSCTL, server_inst, 'backups', '--delete', restore_name];

            $("#restore-spinner").show();

+           console.log("CMD: Delete backup: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              $("#restore-spinner").hide();

              backup_table.row( backup_row.parents('tr') ).remove().draw( false );

              popup_success("The backup has been deleted");

            }).fail(function(data) {

              $("#restore-spinner").hide();

-             popup_err("Error", "Failed to delete the backup\n" + data.message);

+             popup_err("Failed to delete the backup", data.message);

            });

          }

        });
@@ -1347,12 +1388,13 @@ 

          var cmd = [DSCONF, server_id, 'schema', 'reload', '--wait'];

        }

        $("#reload-spinner").show();

+       console.log("CMD: Reload schema files: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

-         popup_msg("Success", "Successfully reloaded schema");  // TODO use timed interval success msg (waiting for another PR top be merged before we can add it)

+         popup_success("Successfully reloaded schema");  // TODO use timed interval success msg (waiting for another PR top be merged before we can add it)

          $("#schema-reload-form").modal('toggle');

          $("#reload-spinner").hide();

        }).fail(function(data) {

-         popup_err("Error", "Failed to reload schema files\n" + data.message);

+         popup_err("Failed to reload schema files", data.message);

          $("#reload-spinner").hide();

        });

      });
@@ -1365,13 +1407,14 @@ 

            var cmd = [DSCTL, server_id, "remove", "--doit"];

            $("#ds-remove-inst").html("<span class=\"spinner spinner-xs spinner-inline\"></span> Removing instance <b>" + server_id + "</b>...");

            $("#remove-instance-form").modal('toggle');

+           console.log("CMD: Delete instance: " + cmd.join(' '));

            cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

              $("#remove-instance-form").modal('toggle');

-             popup_msg("Success", "Instance has been deleted");

+             popup_success("Instance has been deleted");

              get_insts();

            }).fail(function(data) {

              $("#remove-instance-form").modal('toggle');

-             popup_err("Error", "Failed to remove instance\n" + data.message);

+             popup_err("Failed to remove instance", data.message);

            });

          }

        });
@@ -1550,13 +1593,15 @@ 

                  $("#server-list-menu").attr('disabled', false);

                  $("#no-instances").hide();

                  get_insts();  // Refresh server list

-                 popup_msg("Success!", "Successfully created instance:  <b>slapd-" + new_server_id + "</b>", );

+                 popup_success("Successfully created instance:  <b>slapd-" + new_server_id + "</b>");

                  $("#create-inst-form").modal('toggle');

                });

              });

              $("#create-inst-spinner").show();

            });

          });

+       }).fail(function(data) {

+         console.log("failed: " + data.message);

        });

      });

  
@@ -1610,6 +1655,7 @@ 

  

        // lookup the entry, and get the current settings

        var cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id + '.socket','localpwp', 'get', policy_name];

+       console.log("CMD: Get local password policy: " + cmd.join(' '));

        cockpit.spawn(cmd, { superuser: true, "err": "message", "environ": [ENV]}).done(function(data) {

          localpwp_values = {};  // Clear it out

          var obj = JSON.parse(data);

@@ -1,21 +0,0 @@ 

- $('.tab-list').each(function(){                   // Find lists of tabs

-   var $this = $(this);                            // Store this list

-   var $tab = $this.find('li.active');             // Get the active list item

-   var $link = $tab.find('a');                     // Get link from active tab

-   var $panel = $($link.attr('href'));             // Get active panel

- 

-   $this.on('click', '.tab-control', function(e) { // When click on a tab

-     e.preventDefault();                           // Prevent link behavior

-     var $link = $(this);                          // Store the current link

-     var id = this.hash;                           // Get href of clicked tab

- 

-     if (id && !$link.is('.active')) {             // If not currently active

-       $panel.removeClass('active');               // Make panel inactive

-       $tab.removeClass('active');                 // Make tab inactive

- 

-       $panel = $(id).addClass('active');          // Make new panel active

-       $tab = $link.parent().addClass('active');   // Make new tab active

-     }

-   });

- });

- 

@@ -1,90 +1,87 @@ 

  

- 

- 

- 

- 

    <div id="monitor-server-page" class="all-pages" hidden>

-     <h3 class="ds-config-header">Server Statistics</h3>

-     <div class="ds-inline">

-       <div>

-         <label for="monitor-serverid" class="ds-label-sm">Server Instance</label><input type="text" 

-           class="ds-ro-input" id="monitor-serverid" value="slapd-localhost" size="30" readOnly/>

-       </div>

-       <div>

-         <label for="monitor-product" class="ds-label-sm">Product</label><input type="text" 

-           class="ds-ro-input" id="monitor-product" value="389-directory" size="30" readOnly/>

-       </div>

-       <div>

-         <label for="monitor-version" class="ds-label-sm">Version</label><input type="text" 

-           class="ds-ro-input" id="monitor-version" value="1.4.0.5.20180220gitfeb11dc33" size="30" readOnly/>

-       </div>

-       <div>

-         <label for="monitor-build" class="ds-label-sm">Build Number</label><input type="text" 

-           class="ds-ro-input" id="monitor-build" value="B2018.051.1911" size="30" readOnly/>

+     <h3 class="ds-config-header">Server Information</h3>

+     <div class="ds-container">

+       <div class="ds-inline">

+         <div>

+           <label for="monitor-serverid" class="ds-label-xsm">Server Instance</label><input type="text"

+             class="ds-ro-input" id="monitor-serverid" value="slapd-localhost" size="30" readOnly/>

+         </div>

+         <div>

+           <label for="monitor-status" class="ds-label-xsm">Server Status</label><input type="text"

+             class="ds-ro-input" id="monitor-status" value="Started" size="30" readOnly/>

+         </div>

        </div>

-       <div>

-         <label for="monitor-status" class="ds-label-sm">Server Status</label><input type="text" 

-           class="ds-ro-input" id="monitor-status" value="Started" size="30" readOnly/>

+       <div class="ds-divider"></div>

+       <div class="ds-inline">

+         <div>

+           <label for="monitor-version" class="ds-label-xsm">Version</label><input type="text"

+             class="ds-ro-input" id="monitor-version" value="1.4.0.5.20180220gitfeb11dc33" size="30" readOnly/>

+         </div>

+         <div>

+           <label for="monitor-build" class="ds-label-xsm">Build Number</label><input type="text"

+             class="ds-ro-input" id="monitor-build" value="B2018.051.1911" size="30" readOnly/>

+         </div>

        </div>

      </div>

      <hr>

+     <h3 class="ds-config-header">Server Statistics</h3>

      <div class="ds-container">

        <div class="ds-inline">

          <div>

-           <label for="monitor-server-dtablesize" class="ds-label-med">Max File Descriptors</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-dtablesize" value="1024" size="30" readOnly/>

+           <label for="monitor-server-dtablesize" class="ds-monitor-label">Max File Descriptors</label><input type="text"

+             class="ds-ro-input" id="monitor-server-dtablesize" value="1024" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-threads" class="ds-label-med">Threads</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-threads" value="24" size="30" readOnly/>

+           <label for="monitor-server-threads" class="ds-monitor-label">Threads</label><input type="text"

+             class="ds-ro-input" id="monitor-server-threads" value="24" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-totalconnections" class="ds-label-med">Total Connections</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-totalconnections" value="101" size="30" readOnly/>

+           <label for="monitor-server-totalconnections" class="ds-monitor-label">Total Connections</label><input type="text"

+             class="ds-ro-input" id="monitor-server-totalconnections" value="101" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-currentconnections" class="ds-label-med">Current Conections</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-currentconnections" value="4" size="30" readOnly/>

+           <label for="monitor-server-currentconnections" class="ds-monitor-label">Current Conections</label><input type="text"

+             class="ds-ro-input" id="monitor-server-currentconnections" value="4" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-currentconnectionsatmaxthreads" class="ds-label-med">Conns At Max Threads</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-currentconnectionsatmaxthreads" value="0" size="30" readOnly/>

+           <label for="monitor-server-currentconnectionsatmaxthreads" class="ds-monitor-label">Conns At Max Threads</label><input type="text"

+             class="ds-ro-input" id="monitor-server-currentconnectionsatmaxthreads" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-maxthreadsperconnhits" class="ds-label-med">Connections Hit Max Threads</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-maxthreadsperconnhits" value="0" size="30" readOnly/>

+           <label for="monitor-server-maxthreadsperconnhits" class="ds-monitor-label">Conns Hit Max Threads</label><input type="text"

+             class="ds-ro-input" id="monitor-server-maxthreadsperconnhits" value="0" size="12" readOnly/>

+         </div>

+         <div>

+           <label for="monitor-server-readwaiters" class="ds-monitor-label">Threads Waiting To Read</label><input type="text"

+             class="ds-ro-input" id="monitor-server-readwaiters" value="0" size="12" readOnly/>

          </div>

        </div>

        <div class="ds-divider"></div>

-       <div class="ds-divider"></div>

        <div class="ds-inline">

          <div>

-           <label for="monitor-server-opsinitiated" class="ds-label-med">Operations Started</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-opsinitiated" value="0" size="30" readOnly/>

-         </div>

-         <div>

-           <label for="monitor-server-opscompleted" class="ds-label-med">Operations Completed</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-opscompleted" value="0" size="30" readOnly/>

+           <label for="monitor-server-opsinitiated" class="ds-monitor-label-med">Operations Started</label><input type="text"

+             class="ds-ro-input" id="monitor-server-opsinitiated" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-readwaiters" class="ds-label-med">Threads Waiting To Read</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-readwaiters" value="0" size="30" readOnly/>

+           <label for="monitor-server-opscompleted" class="ds-monitor-label-med">Operations Completed</label><input type="text"

+             class="ds-ro-input" id="monitor-server-opscompleted" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-entriessent" class="ds-label-med">Entries Returned To Clients</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-entriessent" value="0" size="30" readOnly/>

+           <label for="monitor-server-entriessent" class="ds-monitor-label-med">Entries Returned To Clients</label><input type="text"

+             class="ds-ro-input" id="monitor-server-entriessent" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-bytessent" class="ds-label-med">Bytes Sent to Clients</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-bytessent" value="0" size="30" readOnly/>

+           <label for="monitor-server-bytessent" class="ds-monitor-label-med">Bytes Sent to Clients</label><input type="text"

+             class="ds-ro-input" id="monitor-server-bytessent" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-starttime" class="ds-label-med">Server Started</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-starttime" value="0" size="30" readOnly/>

+           <label for="monitor-server-starttime" class="ds-monitor-label-med">Server Started</label><input type="text"

+             class="ds-ro-input" id="monitor-server-starttime" value="0" size="12" readOnly/>

          </div>

          <div>

-           <label for="monitor-server-uptime" class="ds-label-med">Server Uptime</label><input type="text" 

-             class="ds-ro-input" id="monitor-server-uptime" value="0" size="30" readOnly/>

+           <label for="monitor-server-uptime" class="ds-monitor-label-med">Server Uptime</label><input type="text"

+             class="ds-ro-input" id="monitor-server-uptime" value="0" size="12" readOnly/>

          </div>

        </div>

      </div>
@@ -127,7 +124,7 @@ 

        <p></p>

      </div>

    </div>

-   

+ 

    <div id="monitor-db-page" class="all-pages" hidden>

      <h3 class="ds-config-header">Database Monitoring</h3>

      <div class="ds-container">
@@ -136,7 +133,7 @@ 

          <ul>

            <li class="jstree-open ds-treenode" data-jstree='{"icon":"glyphicon glyphicon-tasks", "opened":true, "selected":true}' id="monitor-db-main">Database Performance

              <ul>

-               <li title="suffix" id="monitor-suffix-dc=red,dc=hat,dc=com,dc=lab,dc=example,dc=com" 

+               <li title="suffix" id="monitor-suffix-dc=red,dc=hat,dc=com,dc=lab,dc=example,dc=com"

                     data-jstree='{"icon":"glyphicon glyphicon-tree-conifer"}'>dc=red,dc=hat,dc=com,dc=lab,dc=example,dc=com

                  <ul>

                    <li title="sub suffix" id="monitor-suffix-ou=People,dc=example,dc=com" data-jstree='{"icon":"glyphicon glyphicon-leaf"}'>ou=People,dc=example,dc=com</li>
@@ -164,43 +161,43 @@ 

                    </span>

                  </div>

                </div>

-       

+ 

                <hr class="ds-hr">

                <div class="ds-inline">

                  <div>

-                   <label for="monitor-db-dbcachehitratio" class="ds-monitor-label">Database Cache Hit Ratio</label><input type="text" 

+                   <label for="monitor-db-dbcachehitratio" class="ds-monitor-label">Database Cache Hit Ratio</label><input type="text"

                      class="ds-input" id="monitor-db-dbcachehitratio" value="99%" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcachetries" class="ds-monitor-label">Database Cache Tries</label><input type="text" 

+                   <label for="monitor-db-dbcachetries" class="ds-monitor-label">Database Cache Tries</label><input type="text"

                      class="ds-input" id="monitor-db-dbcachetries" value="19541" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcachehits" class="ds-monitor-label">Database Cache Hits</label><input type="text" 

+                   <label for="monitor-db-dbcachehits" class="ds-monitor-label">Database Cache Hits</label><input type="text"

                      class="ds-input" id="monitor-db-dbcachehits" value="19507" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcachepagein" class="ds-monitor-label">Cache Pages Read</label><input type="text" 

+                   <label for="monitor-db-dbcachepagein" class="ds-monitor-label">Cache Pages Read</label><input type="text"

                      class="ds-input" id="monitor-db-dbcachepagein" value="34" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcachepageout" class="ds-monitor-label">Cache Pages Written</label><input type="text" 

+                   <label for="monitor-db-dbcachepageout" class="ds-monitor-label">Cache Pages Written</label><input type="text"

                      class="ds-input" id="monitor-db-dbcachepageout" value="35" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcacheroevict" class="ds-monitor-label">Read-Only Page Evictions</label><input type="text" 

+                   <label for="monitor-db-dbcacheroevict" class="ds-monitor-label">Read-Only Page Evictions</label><input type="text"

                      class="ds-input" id="monitor-db-dbcacheroevict" value="0" size="20" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-db-dbcacherwevict" class="ds-monitor-label">Read-Write Page Evictions</label><input type="text" 

+                   <label for="monitor-db-dbcacherwevict" class="ds-monitor-label">Read-Write Page Evictions</label><input type="text"

                      class="ds-input" id="monitor-db-dbcacherwevict" value="0" size="20" readOnly/>

                  </div>

                </div>

              </div>

-       

+ 

              <div class="ds-divider"></div>

              <div class="ds-divider"></div>

-       

+ 

              <div>

                <div class="pct-donut-chart-pf example-donut-chart-utilization ds-container">

                  <div class="pct-donut-chart-pf-chart ds-chart-left">
@@ -220,46 +217,46 @@ 

                <hr class="ds-hr">

                <div class="ds-inline">

                  <div>

-                   <label title ="Normalized DN Cache hit ratio" for="monitor-db-normalizeddncachehitratio" class="ds-monitor-label">NDN Cache Hit Ratio</label><input type="text" 

+                   <label title ="Normalized DN Cache hit ratio" for="monitor-db-normalizeddncachehitratio" class="ds-monitor-label">NDN Cache Hit Ratio</label><input type="text"

                      class="ds-input" id="monitor-db-normalizeddncachehitratio" value="83%" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache tries" for="monitor-db-normalizeddncachetries" class="ds-monitor-label">NDN Cache Tries</label><input type="text" 

+                   <label title ="Normalized DN Cache tries" for="monitor-db-normalizeddncachetries" class="ds-monitor-label">NDN Cache Tries</label><input type="text"

                      class="ds-input" id="monitor-db-normalizeddncachetries" value="7680" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache hits" for="monitor-db-normalizeddncachehits" class="ds-monitor-label">NDN Cache Hits</label><input type="text" 

+                   <label title ="Normalized DN Cache hits" for="monitor-db-normalizeddncachehits" class="ds-monitor-label">NDN Cache Hits</label><input type="text"

                      class="ds-input" id="monitor-db-normalizeddncachehits" value="6302" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache evictions" for="monitor-db-normalizeddncacheevictions" class="ds-monitor-label">NDN Cache Evictions</label><input type="text" 

+                   <label title ="Normalized DN Cache evictions" for="monitor-db-normalizeddncacheevictions" class="ds-monitor-label">NDN Cache Evictions</label><input type="text"

                      class="ds-input" id="monitor-db-normalizeddncacheevictions" value="0" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache max size in bytes" for="monitor-db-maxnormalizeddncachesize" class="ds-monitor-label">NDN Cache Max Size</label><input type="text" 

+                   <label title ="Normalized DN Cache max size in bytes" for="monitor-db-maxnormalizeddncachesize" class="ds-monitor-label">NDN Cache Max Size</label><input type="text"

                      class="ds-input" id="monitor-db-maxnormalizeddncachesize" value="25165824" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache current size of the cache in bytes" for="monitor-db-currentnormalizeddncachesize" class="ds-monitor-label">NDN Current Cache Size</label><input type="text" 

+                   <label title ="Normalized DN Cache current size of the cache in bytes" for="monitor-db-currentnormalizeddncachesize" class="ds-monitor-label">NDN Current Cache Size</label><input type="text"

                      class="ds-input" id="monitor-db-currentnormalizeddncachesize" value="19891200" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache DN count" for="monitor-db-currentnormalizeddncachecount" class="ds-monitor-label">NDN Cache DN Count</label><input type="text" 

+                   <label title ="Normalized DN Cache DN count" for="monitor-db-currentnormalizeddncachecount" class="ds-monitor-label">NDN Cache DN Count</label><input type="text"

                      class="ds-input" id="monitor-db-currentnormalizeddncachecount" value="1276" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache thread size in bytes" for="monitor-db-normalizeddncachethreadsize" class="ds-monitor-label">NDN Cache Thread Size</label><input type="text" 

+                   <label title ="Normalized DN Cache thread size in bytes" for="monitor-db-normalizeddncachethreadsize" class="ds-monitor-label">NDN Cache Thread Size</label><input type="text"

                      class="ds-input" id="monitor-db-normalizedndncachethreadsize" value="1048576" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="Normalized DN Cache thread slot size" for="monitor-db-normalizeddnslots" class="ds-monitor-label">NDN Cache Thread Slots</label><input type="text" 

+                   <label title ="Normalized DN Cache thread slot size" for="monitor-db-normalizeddnslots" class="ds-monitor-label">NDN Cache Thread Slots</label><input type="text"

                      class="ds-input" id="monitor-db-normalizeddnslots" value="8192" size="30" readOnly/>

                  </div>

                </div>

              </div>

            </div>

          </div>

-     

+ 

          <!-- Suffix page -->

          <div id="monitor-suffix-page" class="ds-tree-content" hidden>

            <h3 class="ds-config-header" id="monitor-suffix-header"></h3>
@@ -286,31 +283,31 @@ 

                <hr class="ds-hr">

                <div class="ds-inline">

                  <div>

-                   <label for="monitor-be-entrycachehitratio" class="ds-label-med">Entry Cache Hit Ratio</label><input type="text" 

+                   <label for="monitor-be-entrycachehitratio" class="ds-label-med">Entry Cache Hit Ratio</label><input type="text"

                      class="ds-ro-input" id="monitor-be-entrycachehitratio" value="99%" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-entrycachetries" class="ds-label-med">Entry Cache Tries</label><input type="text" 

+                   <label for="monitor-be-entrycachetries" class="ds-label-med">Entry Cache Tries</label><input type="text"

                      class="ds-ro-input" id="monitor-be-entrycachetries" value="3058" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-entrycachehits" class="ds-label-med">Database Cache Hits</label><input type="text" 

+                   <label for="monitor-be-entrycachehits" class="ds-label-med">Database Cache Hits</label><input type="text"

                      class="ds-ro-input" id="monitor-be-entrycachehits" value="3001" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-maxentrycachesize" class="ds-label-med">Entry Cache Max Size</label><input type="text" 

+                   <label for="monitor-be-maxentrycachesize" class="ds-label-med">Entry Cache Max Size</label><input type="text"

                      class="ds-ro-input" id="monitor-be-maxentrycachesize" value="512000" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-currententrycachesize" class="ds-label-med">Entry Cache Current Size</label><input type="text" 

+                   <label for="monitor-be-currententrycachesize" class="ds-label-med">Entry Cache Current Size</label><input type="text"

                      class="ds-ro-input" id="monitor-be-currententrycachesize" value="389000" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-maxentrycachecount" class="ds-label-med">Entry Cache Max Entries</label><input type="text" 

+                   <label for="monitor-be-maxentrycachecount" class="ds-label-med">Entry Cache Max Entries</label><input type="text"

                      class="ds-ro-input" id="monitor-be-maxentrycachecount" value="-1" size="30" readOnly/>

                  </div>

                  <div>

-                   <label for="monitor-be-currententrycachecount" class="ds-label-med">Entry Cache Count</label><input type="text" 

+                   <label for="monitor-be-currententrycachecount" class="ds-label-med">Entry Cache Count</label><input type="text"

                      class="ds-ro-input" id="monitor-be-currententrycachecount" value="105" size="30" readOnly/>

                  </div>

                </div>
@@ -327,7 +324,7 @@ 

                  </div>

                  <div class="pct-donut-chart-pf-chart ds-chart-right">

                    <div title="How much of the allocated cache space is used (max size vs current size).  If the chart is RED then you should to increase the max cache size because the cache hit ratio is below 90%"

-                     

+ 

                      id="monitor-dn-cache-util-chart"></div>

                    <span class="pct-donut-chart-pf-label">

                      <b>DN Cache Utilization</b>
@@ -338,31 +335,31 @@ 

                <hr class="ds-hr">

                <div class="ds-inline">

                  <div>

-                   <label title ="" for="monitor-be-dncachehitratio" class="ds-label-med">DN Cache Hit Ratio</label><input type="text" 

+                   <label title ="" for="monitor-be-dncachehitratio" class="ds-label-med">DN Cache Hit Ratio</label><input type="text"

                      class="ds-ro-input" id="monitor-be-dncachehitratio" value="100%" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-dncachetries" class="ds-label-med">DN Cache Tries</label><input type="text" 

+                   <label title ="" for="monitor-be-dncachetries" class="ds-label-med">DN Cache Tries</label><input type="text"

                      class="ds-ro-input" id="monitor-be-dncachetries" value="105" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-dncachehits" class="ds-label-med">DN Cache Hits</label><input type="text" 

+                   <label title ="" for="monitor-be-dncachehits" class="ds-label-med">DN Cache Hits</label><input type="text"

                      class="ds-ro-input" id="monitor-be-dncachehits" value="105" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-maxdncachesize" class="ds-label-med">DN Cache Max Size</label><input type="text" 

+                   <label title ="" for="monitor-be-maxdncachesize" class="ds-label-med">DN Cache Max Size</label><input type="text"

                      class="ds-ro-input" id="monitor-be-maxdncachesize" value="16777216" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-currentdncachesize" class="ds-label-med">DN Cache Current Size</label><input type="text" 

+                   <label title ="" for="monitor-be-currentdncachesize" class="ds-label-med">DN Cache Current Size</label><input type="text"

                      class="ds-ro-input" id="monitor-be-currentdncachesize" value="16809" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-maxdncachecount" class="ds-label-med">DN Cache Max Count</label><input type="text" 

+                   <label title ="" for="monitor-be-maxdncachecount" class="ds-label-med">DN Cache Max Count</label><input type="text"

                      class="ds-ro-input" id="monitor-be-maxdncachecount" value="-1" size="30" readOnly/>

                  </div>

                  <div>

-                   <label title ="" for="monitor-be-currentdncachecount" class="ds-label-med">DN Cache Current Count</label><input type="text" 

+                   <label title ="" for="monitor-be-currentdncachecount" class="ds-label-med">DN Cache Current Count</label><input type="text"

                      class="ds-ro-input" id="monitor-be-currentdncachecount" value="105" size="30" readOnly/>

                  </div>

                </div>
@@ -414,55 +411,55 @@ 

      <div class="ds-container">

        <div class="ds-inline">

          <div>

-           <label for="monitor-snmp-anonymousbinds" class="ds-label-med">Anonymous Binds</label><input type="text" 

+           <label for="monitor-snmp-anonymousbinds" class="ds-label-med">Anonymous Binds</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-anonymousbinds" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-unauthbinds" class="ds-label-med">Unauthenticated Binds</label><input type="text" 

+           <label for="monitor-snmp-unauthbinds" class="ds-label-med">Unauthenticated Binds</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-unauthbinds" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-simpleauthbinds" class="ds-label-med">Simple Auth Binds</label><input type="text" 

+           <label for="monitor-snmp-simpleauthbinds" class="ds-label-med">Simple Auth Binds</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-simpleauthbinds" value="77" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-strongauthbinds" class="ds-label-med">Strong Auth Binds</label><input type="text" 

+           <label for="monitor-snmp-strongauthbinds" class="ds-label-med">Strong Auth Binds</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-strongauthbinds" value="0" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-inops" class="ds-label-med">Initiated Operations</label><input type="text" 

+           <label for="monitor-snmp-inops" class="ds-label-med">Initiated Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-inops" value="818" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-compareops" class="ds-label-med">Compare Operations</label><input type="text" 

+           <label for="monitor-snmp-compareops" class="ds-label-med">Compare Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-compareops" value="1" size="30" readOnly/>

          </div>

          <div>

-           <label for="mnitor-snmp-addentryops" class="ds-label-med">Add Operations</label><input type="text" 

+           <label for="mnitor-snmp-addentryops" class="ds-label-med">Add Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-addentryops" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-removeentryops" class="ds-label-med">Delete Operations</label><input type="text" 

+           <label for="monitor-snmp-removeentryops" class="ds-label-med">Delete Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-removeentryops" value="50" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-modifyentryops" class="ds-label-med">Modify Operations</label><input type="text" 

+           <label for="monitor-snmp-modifyentryops" class="ds-label-med">Modify Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-modifyentryops" value="501" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-modifyrdnops" class="ds-label-med">ModRDN Operations</label><input type="text" 

+           <label for="monitor-snmp-modifyrdnops" class="ds-label-med">ModRDN Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-modifyrdnops" value="0" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-searchops" class="ds-label-med">Search Operations</label><input type="text" 

+           <label for="monitor-snmp-searchops" class="ds-label-med">Search Operations</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-searchops" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-onelevelsearchops" class="ds-label-med">One Level Searches</label><input type="text" 

+           <label for="monitor-snmp-onelevelsearchops" class="ds-label-med">One Level Searches</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-onelevelsearchops" value="2" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-wholesubtreesearchops" class="ds-label-med">Whole Tree Searches</label><input type="text" 

+           <label for="monitor-snmp-wholesubtreesearchops" class="ds-label-med">Whole Tree Searches</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-wholesubtreesearchops" value="5" size="30" readOnly/>

          </div>

        </div>
@@ -470,58 +467,58 @@ 

        <div class="ds-divider"></div>

        <div class="ds-inline">

          <div>

-           <label for="monitor-snmp-referrals" class="ds-label-med">Referrals</label><input type="text" 

+           <label for="monitor-snmp-referrals" class="ds-label-med">Referrals</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-referrals" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-referralsreturned" class="ds-label-med">Returned Referrals</label><input type="text" 

+           <label for="monitor-snmp-referralsreturned" class="ds-label-med">Returned Referrals</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-referralsreturned" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-bindsecurityerrors" class="ds-label-med">Bind Security Errors</label><input type="text" 

+           <label for="monitor-snmp-bindsecurityerrors" class="ds-label-med">Bind Security Errors</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-bindsecurityerrors" value="0" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-securityerrors" class="ds-label-med">Security Errors</label><input type="text" 

+           <label for="monitor-snmp-securityerrors" class="ds-label-med">Security Errors</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-securityerrors" value="0" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-errors" class="ds-label-med">Errors</label><input type="text" 

+           <label for="monitor-snmp-errors" class="ds-label-med">Errors</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-errors" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-connections" class="ds-label-med">Current Connections</label><input type="text" 

+           <label for="monitor-snmp-connections" class="ds-label-med">Current Connections</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-connections" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-connectionseq" class="ds-label-med">Total Connections</label><input type="text" 

+           <label for="monitor-snmp-connectionseq" class="ds-label-med">Total Connections</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-connectionseq" value="50001" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-connectionsinmaxthreads" class="ds-label-med">Conns in Max Threads</label><input type="text" 

+           <label for="monitor-snmp-connectionsinmaxthreads" class="ds-label-med">Conns in Max Threads</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-connectionsinmaxthreads" value="0" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-connectionsmaxthreadscount" class="ds-label-med">Conns Hit Max Threads</label><input type="text" 

+           <label for="monitor-snmp-connectionsmaxthreadscount" class="ds-label-med">Conns Hit Max Threads</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-connectionsmaxthreadscount" value="5" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-bytesrecv" class="ds-label-med">Bytes Received</label><input type="text" 

+           <label for="monitor-snmp-bytesrecv" class="ds-label-med">Bytes Received</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-bytesrecv" value="4563" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-bytessent" class="ds-label-med">Bytes Sent</label><input type="text" 

+           <label for="monitor-snmp-bytessent" class="ds-label-med">Bytes Sent</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-bytessent" value="993068" size="30" readOnly/>

          </div>

          <div>

-           <label for="monitor-snmp-entriesreturned" class="ds-label-med">Entries Sent</label><input type="text" 

+           <label for="monitor-snmp-entriesreturned" class="ds-label-med">Entries Sent</label><input type="text"

              class="ds-ro-input" id="monitor-snmp-entriesreturned" value="5" size="30" readOnly/>

          </div>

        </div>

      </div>

      <p></p>

    </div>

-   

+ 

    <div id="monitor-log-access-page" class="all-pages" hidden>

      <h3>Access Log</h3>

      <hr>
@@ -601,8 +598,8 @@ 

        <option>5000</option>

        <option>10000</option>

      </select><button id="errorslog-refresh-btn" class="ds-adj-btn">Refresh</button><label

-       class="ds-left-margin">Continuously Refresh<input type="checkbox" class="ds-sm-left-margin" id="errorslog-cont-refresh"></label><div 

-       class="dropdown ds-float-right"><label 

+       class="ds-left-margin">Continuously Refresh<input type="checkbox" class="ds-sm-left-margin" id="errorslog-cont-refresh"></label><div

+       class="dropdown ds-float-right"><label

        for="errorslog-sev-level">Filter Logging By Severity Level</label><select

          class="btn btn-default dropdown ds-left-margin" id="errorslog-sev-level">

            <option>Everything</option>
@@ -626,7 +623,7 @@ 

  

  

    <div id="monitor-repl-page" class="all-pages" hidden>

-     <h3>Replication Monitoring for <select class="btn btn-default dropdown ds-select" id="monitor-repl-backend-list">

+     <h3>Replication Monitoring for <select class="btn btn-default dropdown" id="monitor-repl-backend-list">

        <option>dc=example,dc=com</option></select></h3>

      <hr>

      <h4>Replication Agreements</h4>
@@ -697,7 +694,7 @@ 

            <td>cn=users,dc=example,dc=com</td>

            <td>ou=people,dc=example,dc=com</td>

            <td data-sort="good"><div class="ds-repl-state-good"><span class="glyphicon glyphicon-thumbs-up"></span></div></td>

-           <td><button class="btn btn-default ds-agmt-dropdown-button repl-winsync-detail-btn" data-toggle="modal" 

+           <td><button class="btn btn-default ds-agmt-dropdown-button repl-winsync-detail-btn" data-toggle="modal"

              data-target="#monitor-winsync-agmt-form" type="button">View Details</button></td>

          </tr>

        </tbody>
@@ -802,7 +799,7 @@ 

        </div>

      </div>

    </div>

-   

+ 

  

    <!-- WINSYNC Agmt detail modal -->

  

@@ -3,31 +3,35 @@ 

  <div id="repl-config" class="all-pages" hidden>

    <h3 class="ds-config-header">Replication Configuration Settings</h3>

  

-   <label class="ds-config-label-med" for="select-repl-role">Database Suffix</Label> <select 

-     class="btn btn-default dropdown ds-select" id="select-repl-cfg-suffix">

+   <label class="ds-config-label-med" for="select-repl-role">Database Suffix</Label> <select

+     class="btn btn-default dropdown" id="select-repl-cfg-suffix">

      <option>dc=example,dc=com</option>

      <option>o=ipaca</option>

    </select>

  

    <div>

-     <label class="ds-config-label-med" for="select-repl-role">Replication Role</Label> <select class="btn btn-default dropdown ds-select-sm" id="select-repl-role">

+     <label class="ds-config-label-med" for="select-repl-role">Replication Role</Label> <select class="btn btn-default dropdown" id="select-repl-role">

          <option>Disabled</option>

          <option>Master</option>

          <option>Hub</option>

          <option>Consumer</option>

      </select>

+     <p></p>

+     <label for="nsds5replicaid" class="ds-config-label-med" title=

+       "The replica identifier for Master/Supplier (nsds5ReplicaId).">

+       Replica ID</label><input class="ds-input" type="text" id="nsds5replicaid" size="15"/>

+ 

+     <p></p>

    </div>

-   

+ 

    <div id="repl-config-content">

      <hr>

-     <div>

-       <label for="nsds5replicaid" class="ds-config-label-med" title=

-         "The replica identifier for Master/Supplier (nsds5ReplicaId).">

-         Replica ID</label><input class="ds-input" type="text" id="nsds5replicaid" size="15"/>

-     </div>

-     <p></p>

- 

-     <div>

+     <div class="ds-repl-mgr">

+       <div class="ds-inline ds-repl-mgr">

+         <label for="nsds5replicabinddngroup" title=

+           "The DN of a group that contains entries that are allowed to make replication updates (nsDS5ReplicaBindDnGroup).">Bind DN Group</label><input

+           class="ds-input-max" type="text" id="nsds5replicabinddngroup"/>

+       </div>

        <table class="table table-bordered ds-mgr-table" id="repl-mgr-table"

          title="Specifies entries that can perform replication updates on this server.  Also known as supplier DN, update DN, or Replication Manager">

          <thead>
@@ -37,13 +41,6 @@ 

            </tr>

          </thead>

          <tbody>

-           <tr>

-             <td class="ds-td">cn=replication manager,cn=config</td>

-             <td class="ds-center">

-              <button type="button" class="btn btn-default ds-table-btn del-repl-mgr">

-                <span class="glyphicon glyphicon-trash"></span> Remove

-              </button></td>

-           </tr>

          </tbody>

        </table>

        <button class="btn btn-default ds-repl-managers-button"  data-toggle="modal" data-target="#add-repl-mgr-form" id="add-repl-manager">Add Replication Manager</button>
@@ -70,6 +67,10 @@ 

              <label for="nsds5replicaprecisetombstonepurging" class="ds-config-label" title=

                "NEEDS WORK (nsds5ReplicaPreciseTombstonePurging).">Precise Tombstone Purging</label><input class="ds-input" type="text" id="nsds5replicaprecisetombstonepurging" size="15"/>

            </div>

+           <div>

+             <label for="nsds5replicabinddngroupcheckinterval" class="ds-config-label" title=

+             "NEEDS WORK (nsDS5ReplicaBindDnGroupCheckInterval).">Bind DN Group Check Interval</label><input class="ds-input" type="text" id="nsds5replicabinddngroupcheckinterval" size="15"/>

+           </div>

          </div>

          <div class="ds-divider"></div>

          <div class="ds-inline">
@@ -93,59 +94,67 @@ 

        </div>

        <hr>

        <div>

-         <label for="nsds5replicabinddngroup" class="ds-config-label" title="NEEDS WORK (nsDS5ReplicaBindDnGroup).">Bind DN Group</label><input 

-           class="ds-input-long" type="text" id="nsds5replicabinddngroup"/>

-       </div>

-       <div>

-         <label for="nsds5replicabinddngroupcheckinterval" class="ds-config-label" title=

-           "NEEDS WORK (nsDS5ReplicaBindDnGroupCheckInterval).">Bind DN Group Check Interval</label><input class="ds-input" type="text" id="nsds5replicabinddngroupcheckinterval" size="15"/>

+         <label for="nsslapd-changelogdir" class="ds-config-label" title="The location on the filesystem for the replication changelog database (nsslapd-changelogdir).">Changelog Location</label><input

+           class="ds-input-long ds-cl" type="text" id="nsslapd-changelogdir"/>

        </div>

-       <hr>

        <div class="ds-container">

          <div name="changelog" class="ds-line">

            <div>

              <label for="nsslapd-changelogmaxentries" class="ds-config-label" title=

                "Changelog trimming parameter.  Set the maximum number of changelog entries (nsslapd-changelogmaxentries).">

-               Changelog Maximum Entries</label><input class="ds-input" type="text" id="nsslapd-changelogmaxentries" size="15"/>

+               Changelog Maximum Entries</label><input class="ds-input ds-cl" type="text" id="nsslapd-changelogmaxentries" size="15"/>

            </div>

            <div>

              <label for="nsslapd-changelogmaxage" class="ds-config-label" title=

                "Changelog trimming parameter.  This set the maximum age of a changelog entry.  It is recommended to use the same value as the ReplicationPurgeDelay.  (nsslapd-changelogmaxage).">

-               Changelog Maximum Age</label><input class="ds-input" type="text" id="nsslapd-changelogmaxage" size="15"/>

+               Changelog Maximum Age</label><input class="ds-input ds-cl" type="text" id="nsslapd-changelogmaxage" size="15"/>

+           </div>

+           <div>

+             <label for="nsslapd-changelogtrim-interval" class="ds-config-label" title=

+               "The changelog trimming internal.  Set how often the changelog checks if there are entries that can be purged from the changelog based on the trimming parameters (nsslapd-changelogtrim-interval).">

+               Changelog Trim Interval</label><input class="ds-input ds-cl" type="text" id="nsslapd-changelogtrim-interval" size="15"/>

            </div>

+           <p></p>

          </div>

          <div class="ds-divider"></div>

          <div class="ds-inline">

            <div>

-             <label for="nsslapd-changelogtrim-interval" class="ds-config-label" title=

-               "The changelog trimming internal.  Set how often the changelog checks if there are entries that can be purged from the changelog based on the trimming parameters (nsslapd-changelogtrim-interval).">

-               Changelog Trim Interval</label><input class="ds-input" type="text" id="nsslapd-changelogtrim-interval" size="15"/>

+             <label for="nsslapd-changelogcompactdb-interval" class="ds-config-label" title=

+               "The changelog compaction internal.  Set how often the changelog will compact itself, meaning remove empty/trimmed database slots (nsslapd-changelogcompactdb-interval).">

+               Changelog Compaction Interval</label><input class="ds-input ds-cl" type="text" id="nsslapd-changelogcompactdb-interval" size="15"/>

            </div>

            <div>

              <label for="nsslapd-encryptionalgorithm" class="ds-config-label" title=

-               "Encryption algorithm used to encrypt the changelog (AES or DES3).  Requires thathe server is already has TLS configured (nsslapd-encryptionalgorithm).">

-               Changelog Encryption Algorithm</label><input class="ds-input" type="text" id="nsslapd-encryptionalgorithm" size="15"/>

-             <p></p>

+               "Encryption algorithm used to encrypt the changelog (AES or DES3).  Requires that the server is already has TLS configured (nsslapd-encryptionalgorithm).">

+               Changelog Encryption Algorithm</label><input class="ds-input ds-cl" type="text" id="nsslapd-encryptionalgorithm" size="15"/>

            </div>

          </div>

        </div>

+ 

+       <!-- Buttons to create and delete changelog -->

+       <div id="cl-create-div">

+         <button class="btn btn-default" id="create-cl-btn">Create Changelog</button>

+       </div>

+       <div id ="cl-del-div" hidden>

+         <button class="btn btn-default" id="delete-cl-btn">Delete Changelog</button>

+       </div>

        <p></p>

      </div>

-     <div class="ds-footer">

-       <button class="btn btn-primary save-button">Save</button>

-     </div>

+   </div>

+   <div class="ds-footer">

+     <button class="btn btn-primary" id="repl-config-save">Save</button>

    </div>

  </div>

  

-   

+ 

  <!-- -----------------------------

  

  Replication Agreements

  

  -------------------------------- -->

  <div id="repl-agmts" class="all-pages" hidden>

-   <h3 class="ds-config-header">Replication Agreements for <select 

-     class="btn btn-default dropdown ds-select" id="select-repl-agmt-suffix">

+   <h3 class="ds-config-header">Replication Agreements for <select

+     class="btn btn-default dropdown" id="select-repl-agmt-suffix">

      <option>dc=example,dc=com</option>

      <option>o=ipaca</option>

    </select></h3>
@@ -158,52 +167,12 @@ 

            <th>Host</th>

            <th>Port</th>

            <th>State</th>

+           <th>Last Update Status</th>

+           <th>Last Init Status</th>

            <th>Actions</th>

          </tr>

        </thead>

        <tbody id="agmt-body">

-         <tr>

-           <td>me2beaker</td>

-           <td>beaker.host.com</td>

-           <td>3890</td>

-           <td>Enabled</td>

-           <td>

-             <div class="dropdown">

-               <button class="btn btn-default dropdown-toggle ds-agmt-dropdown-button" type="button" data-toggle="dropdown">Choose Action...

-                 <span class="caret"></span></button>

-               <ul id="test-drop" class="dropdown-menu ds-agmt-dropdown" role="menu" aria-labelledby="menu1">

-                 <li><a class="agmt-edit-btn">View/Edit Agreement</a></li>

-                 <li><a>Initialize Consumer (online)</a></li>

-                 <li><a>Initialize Consumer (ldif)</a></li>

-                 <li><a>Send Updates Now</a></li>

-                 <li><a>Enable/Disable Agreement</a></li>

-                 <li><a class="agmt-del-btn">Delete Agreement</a></li>

-               </ul>

-             </div>

-           </td>

-         </tr>

-         <tr class="">

-           <td>me2beaker2</td>

-           <td>beaker2.host.com</td>

-           <td>389</td>

-           <td>Enabled</td>

-           <td>

-             <div class="dropdown">

-               <button class="btn btn-default dropdown-toggle ds-agmt-dropdown-button" type="button" data-toggle="dropdown">

-                 Choose Action...

-                 <span class="caret"></span>

-               </button>

-               <ul class="dropdown-menu ds-agmt-dropdown" role="menu">

-                 <li><a class="agmt-edit-btn">View/Edit Agreement</a></li>

-                 <li><a>Initialize Consumer (online)</a></li>

-                 <li><a>Initialize Consumer (ldif)</a></li>

-                 <li><a>Send Updates Now</a></li>

-                 <li><a>Enable/Disable Agreement</a></li>

-                 <li><a class="agmt-del-btn" href="#">Delete Agreement</a></li>

-               </ul>

-             </div>

-           </td>

-         </tr>

        </tbody>

      </table>

      <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#agmt-form" id="create-agmt">Create Replication Agreement</button>
@@ -217,8 +186,8 @@ 

  

  -------------------------------- -->

  <div id="repl-winsync" class="all-pages" hidden>

-   <h3 class="ds-config-header">Windows Synchronization Agreements for <select 

-     class="btn btn-default dropdown ds-select" id="select-repl-winsync-suffix">

+   <h3 class="ds-config-header">Windows Synchronization Agreements for <select

+     class="btn btn-default dropdown" id="select-repl-winsync-suffix">

      <option>dc=example,dc=com</option>

      <option>o=ipaca</option>

    </select></h3>
@@ -229,12 +198,13 @@ 

            <th>Agreement Name</th>

            <th>Windows Host</th>

            <th>Port</th>

-           <th>DS Subtree</th>

-           <th>Windows Subtree</th>

+           <th>State</th>

+           <th>Last Update Status</th>

+           <th>Last Init Status</th>

            <th>Actions</th>

          </tr>

        </thead>

-       <tbody id="agmt-body">

+       <tbody id="winsync-agmt-body">

        </tbody>

      </table>

      <button class="btn btn-primary" data-toggle="modal" data-target="#winsync-agmt-form"  type="button" id="winsync-create-agmt">Create Winsync Agreement</button>
@@ -250,26 +220,30 @@ 

  <div id="repl-cleanallruv" class="all-pages" hidden>

    <h3 class="ds-config-header">CleanAllRUV Tasks</h3>

    <div class="ds-page-content">

-     <table id="repl-clean-table" class="display ds-repl-table" cellspacing="0" width="100%">

-       <thead>

-         <tr class="ds-table-header">

-           <th>Creation Time</th>

-           <th>Replica ID</th>

-           <th>Status</th>

-           <th>Actions</th>

-         </tr>

-       </thead>

-       <tbody>

-         <tr>

-           <td>2017023402340234Z</td>

-           <td>222</td>

-           <td>Waiting for replica (host.domain.com) to be online...Long long long kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk</td>

-           <td><button class="btn btn-default ds-agmt-dropdown-button" type="button" class="abort-cleanallruv-btn">Abort Task</button></td>

-         </tr>

-       </tbody>

-     </table>

-     <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#cleanallruv-form" id="create-cleanallruv-btn">Create CleanAllRUV Task</button>

+ 

+     <div>

+       <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#cleanallruv-form" id="create-cleanallruv-btn">Create CleanAllRUV Task</button><div

+         class="ds-float-right"><button class="btn btn-default ds-float-right" type="button" id="refresh-cleanlist-btn">Refresh Task List</button></div>

+     </div>

      <p></p>

+     <div>

+       <p></p>

+       <table id="repl-clean-table" class="display ds-repl-table" cellspacing="0" width="100%">

+         <caption class="ds-center"><b>Running CleanAllRUV Tasks</caption>

+         <thead>

+           <tr class="ds-table-header">

+             <th>Task Name</th>

+             <th>Creation Time</th>

+             <th>Suffix</th>

+             <th>Replica ID</th>

+             <th>Last Update Status</th>

+             <th></th>

+           </tr>

+         </thead>

+         <tbody>

+         </tbody>

+       </table>

+     </div>

    </div>

  </div>

  
@@ -281,8 +255,6 @@ 

  

    ----------------------------------------------------------- -->

  

- 

- 

    <div class="modal fade" id="agmt-form" data-backdrop="static" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="agmt-wizard-title" aria-hidden="true">

      <div class="modal-dialog">

        <div class="modal-content">
@@ -297,59 +269,60 @@ 

              <div class="ds-container">

                <div class="ds-inline">

                  <div>

-                   <label for="agmt-cn" class="ds-config-label" title="Agreement name (cn).">Agreement Name</label><input

-                     class="ds-input" type="text" placeholder="Agreement name" id="agmt-cn" name="name"  size="40" required>

+                   <label for="agmt-cn" class="ds-config-label agmt-form-input" title="Agreement name (cn).">Agreement Name</label><input

+                     class="ds-input" type="text" placeholder="Agreement name" id="agmt-cn" name="name"  size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicahost" class="ds-config-label" title="Agreement name (nsDS5ReplicaHost).">Consumer Host</label><input

-                     class="ds-input" type="text" placeholder="Consumer hostname" id="nsds5replicahost" name="port" size="40" required>

+                   <label for="nsds5replicahost" class="ds-config-label agmt-form-input" title="Agreement name (nsDS5ReplicaHost).">Consumer Host</label><input

+                     class="ds-input" type="text" placeholder="Consumer hostname" id="nsds5replicahost" name="port" size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicaport" class="ds-config-label" title="Agreement name (nsDS5ReplicaPort).">Consumer Port</label><input

-                     class="ds-input" type="text" placeholder="Consumer port number" id="nsds5replicaport" name="name" size="40" required>

+                   <label for="nsds5replicaport" class="ds-config-label agmt-form-input" title="Agreement name (nsDS5ReplicaPort).">Consumer Port</label><input

+                     class="ds-input" type="text" placeholder="Consumer port number" id="nsds5replicaport" name="name" size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicabinddn" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaBindDN).">Replication Bind DN</label><input

-                     class="ds-input" type="text" placeholder="Bind DN" id="nsds5replicabinddn" name="name" size="40" required>

+                   <label for="nsds5replicabinddn" class="ds-config-label agmt-form-input" title="Replication Bind DN (nsDS5ReplicaBindDN).">Replication Bind DN</label><input

+                     class="ds-input" type="text" autocomplete="username" placeholder="Bind DN" id="nsds5replicabinddn" name="name" size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicacredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Replication Bind DN Credentials</label><input

-                     class="ds-input" type="password" placeholder="Enter password" id="nsds5replicacredentials" name="name" size="40" required>

+                   <label for="nsds5replicacredentials" class="ds-config-label agmt-form-input" title="Replication Bind DN (nsDS5ReplicaCredentials).">Replication Bind DN Credentials</label><input

+                     class="ds-input" type="password" autocomplete="new-password" placeholder="Enter password" id="nsds5replicacredentials" name="name" size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicacredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

-                     class="ds-input" type="password" placeholder="Confirm password" id="nsds5replicacredentials-confirm" name="name" size="40" required>

+                   <label for="nsds5replicacredentials-confirm" class="ds-config-label agmt-form-input" title="Confirm password">Confirm Password</label><input

+                     class="ds-input" type="password" autocomplete="new-password" placeholder="Confirm password" id="nsds5replicacredentials-confirm" name="name" size="35" required>

                  </div>

                  <div>

-                   <label for="nsds5replicatransportinfo" class="ds-config-label" title="The protocol used to connect to the replica  (nsDS5ReplicaTransportInfo).">Connection Protocol</label><select

+                   <label for="nsds5replicatransportinfo" class="ds-config-label agmt-form-input" title="The protocol used to connect to the replica  (nsDS5ReplicaTransportInfo).">Connection Protocol</label><select

                      class="btn btn-default dropdown ds-agmt-wiz-dropdown" id="nsds5replicatransportinfo">

                        <option>LDAP</option>

                        <option>LDAPS</option>

-                       <option>Start TLS</option>

+                       <option>StartTLS</option>

                      </select>

                  </div>

                  <div>

-                   <label for="nsds5replicabindmethod" class="ds-config-label" title="The authentication method (nsDS5ReplicaBindMethod).">Bind Method</label><select

+                   <label for="nsds5replicabindmethod" class="ds-config-label agmt-form-input" title="The authentication method (nsDS5ReplicaBindMethod).">Bind Method</label><select

                      class="btn btn-default dropdown ds-agmt-wiz-dropdown" id="nsds5replicabindmethod">

-                       <option>Simple</option>

+                       <option>SIMPLE</option>

+                       <option>SSLCLIENTAUTH</option>

                        <option>SASL/DIGEST-MD5</option>

                        <option>SASL/GSSAPI</option>

                      </select>

                  </div>

-                 <div>

-                   <label for="init-options" class="ds-config-label">Initialize Consumer</label><select 

+                 <div id="init-agmt-dropdown">

+                   <label for="init-options" class="ds-config-label">Initialize Consumer</label><select

                      class="btn btn-default dropdown ds-agmt-wiz-dropdown ds-agmt-init-dropdown" id="init-options">

                      <option id="init-nothing" value="noinit">Do Not Initialize</option>

-                     <option id="init-online"  value="online-init">Online Initialization</option>

-                     <option id="init-offline" value="offline-init">Offline Initialization</option>

+                     <option id="init-online"  value="online-init">Do Online Initialization</option>

+                     <option id="init-offline" value="offline-init">Create Initialization LDIF File</option>

                    </select>

                  </div>

                </div>

              </div>

-     

+ 

              <!-- Fractional settings -->

              <p></p>

-             <button class="accordion ds-accordion" id="frac-accordion" type="button">&#9658 Show Fractional Settings</button>

+             <button class="accordion ds-wiz-accordion" id="frac-accordion" type="button">&#9658 Show Fractional Settings</button>

              <div class="ds-accordion-panel">

                <p><b>Excluded Attributes</b></p>

                <div class="ds-container">
@@ -389,7 +362,7 @@ 

                    </div>

                  </div>

                </div>

-     

+ 

                <hr>

                <p><b>Strip Attributes</b></p>

                <div class="ds-container">
@@ -410,10 +383,10 @@ 

                  </div>

                </div>

              </div>

-     

+ 

              <!-- Schedule settings -->

  

-             <button class="accordion ds-accordion" id="schedule-accordion" type="button">&#9658 Show Scheduling Settings</button>

+             <button class="accordion ds-wiz-accordion" id="schedule-accordion" type="button">&#9658 Show Scheduling Settings</button>

              <div class="ds-accordion-panel">

                <input type="checkbox" class="ds-repl-manager-checkbox" id="agmt-schedule-checkbox" checked><label

                  for="agmt-schedule-checkbox" class="ds-label"> Always keep directories in sync </label>
@@ -478,7 +451,7 @@ 

            </div>

          <div class="modal-footer ds-modal-footer">

            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id="agmt-save">Create Agreement</button>

+           <button type="button" class="btn btn-primary" id="agmt-save">Save Agreement</button>

          </div>

        </div>

      </div>
@@ -487,14 +460,14 @@ 

  

    <!-- Winsync Agreement Wizard  -->

  

-   <div class="modal fade" id="winsync-agmt-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="winsync-label" aria-hidden="true">

+   <div class="modal fade" id="winsync-agmt-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="winsync-agmt-wizard-title" aria-hidden="true">

      <div class="modal-dialog ds-modal-wide">

        <div class="modal-content">

          <div class="modal-header">

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

              <span class="pficon pficon-close"></span>

            </button>

-           <h4 class="modal-title" id="winsync-label">Create Winsync Agreement</h4>

+           <h4 class="modal-title" id="winsync-agmt-wizard-title">Create Winsync Agreement</h4>

          </div>

          <div class="modal-body">

            <form class="form-horizontal">
@@ -505,8 +478,8 @@ 

                      class="ds-input" type="text" placeholder="Agreement name" id="winsync-agmt-cn" name="name" required>

                  </div>

                  <div>

-                   <label for="nsds7windowsdomain" class="ds-config-label" title="Agreement name (nsds7WindowsDomain).">Windows Domain Name</label><input

-                     class="ds-input" type="text" placeholder="Windows Domain Name, example:  mydomain.com" id="nsds7windowsdomain" name="name" required>

+                   <label for="winsync-nsds7windowsdomain" class="ds-config-label" title="Agreement name (nsds7WindowsDomain).">Windows Domain Name</label><input

+                     class="ds-input" type="text" placeholder="Windows Domain Name, example:  mydomain.com" id="winsync-nsds7windowsdomain" name="name" required>

                  </div>

                  <div>

                    <label for="winsync-nsds5replicahost" class="ds-config-label" title="Agreement name (nsDS5ReplicaHost).">Windows Host</label><input
@@ -517,42 +490,46 @@ 

                      class="ds-input" type="text" placeholder="Windows server port number" id="winsync-nsds5replicaport" name="name" required>

                  </div>

                  <div>

-                   <label for="nsds7windowsreplicasubtree" class="ds-config-label" title="Agreement name (nsds7WindowsReplicaSubtree).">Windows Subtree</label><input

-                     class="ds-input" type="text" placeholder="Active Directory subtree" id="nsds7windowsreplicasubtree" name="name" required>

+                   <label for="winsync-nsds7windowsreplicasubtree" class="ds-config-label" title="Agreement name (nsds7WindowsReplicaSubtree).">Windows Subtree</label><input

+                     class="ds-input" type="text" placeholder="Active Directory subtree" id="winsync-nsds7windowsreplicasubtree" name="name" required>

                  </div>

                  <div>

-                   <label for="nsds7directoryreplicasubtree" class="ds-config-label" title="Agreement name (nsds7DirectoryReplicaSubtree).">Directory Server Subtree</label><input

-                     class="ds-input" type="text" placeholder="The local Directory Server subtree" id="nsds7directoryreplicasubtree" name="name" required>

+                   <label for="winsync-nsds7directoryreplicasubtree" class="ds-config-label" title="Agreement name (nsds7DirectoryReplicaSubtree).">Directory Server Subtree</label><input

+                     class="ds-input" type="text" placeholder="The local Directory Server subtree" id="winsync-nsds7directoryreplicasubtree" name="name" required>

                  </div>

                  <div>

-                   <input type="checkbox" class="ds-config-checkbox" id="nsds7newwinusersyncenabled-checkbox" checked><label

-                     for="nsds7newwinusersyncenabled-checkbox" class="ds-label" title=

+                   <input type="checkbox" class="ds-config-checkbox" id="winsync-nsds7newwinusersyncenabled-checkbox" checked><label

+                     for="winsync-nsds7newwinusersyncenabled-checkbox" class="ds-label" title=

                      "Add new user to Directory Server when it is added to Active Directory (nsds7NewWinUserSyncEnabled)."> Sync New Windows Users</label>

                  </div>

                  <div>

-                   <input type="checkbox" class="ds-config-checkbox" id="nsds7newwingroupsyncenabled-checkbox" checked><label

-                     for="nsds7newwingroupsyncenabled-checkbox" class="ds-label" title=

+                   <input type="checkbox" class="ds-config-checkbox" id="winsync-nsds7newwingroupsyncenabled-checkbox" checked><label

+                     for="winsync-nsds7newwingroupsyncenabled-checkbox" class="ds-label" title=

                      "Add new group to Directory Server when it is added to Active Directory (nsds7NewWinGroupSyncEnabled)."> Sync New Windows Groups</label>

                  </div>

+                 <div id="winsync-init-chbx">

+                   <input type="checkbox" class="ds-config-checkbox" id="winsync-init-checkbox" checked><label

+                     for="winsync-init-checkbox" class="ds-label" title=

+                     "Do a full synchronization after creating winsync agreement."> Initiate Full Synchronization</label>

+                 </div>

                  <div>

                    <hr class="ds-hr">

                    <label for="winsync-nsds5replicabinddn" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaBindDN).">Replication Bind DN</label><input

-                     class="ds-input" type="text" placeholder="Bind DN" id="winsync-nsds5replicabinddn" name="name" required>

+                     class="ds-input" type="text" autocomplete="username" placeholder="Bind DN" id="winsync-nsds5replicabinddn" name="name" required>

                  </div>

                  <div>

                    <label for="winsync-nsds5replicacredentials" class="ds-config-label" title="Replication Bind DN (nsDS5ReplicaCredentials).">Replication Bind DN Credentials</label><input

-                     class="ds-input" type="password" placeholder="Enter password" id="winsync-nsds5replicacredentials" name="name" required>

+                     class="ds-input" type="password" autocomplete="new-password" placeholder="Enter password" id="winsync-nsds5replicacredentials" name="name" required>

                  </div>

                  <div>

                    <label for="winsync-nsds5replicacredentials-confirm" class="ds-config-label" title="Confirm password">Confirm Password</label><input

-                     class="ds-input" type="password" placeholder="Confirm password" id="winsync-nsds5replicacredentials-confirm" name="name" required>

+                     class="ds-input" type="password"autocomplete="new-password" placeholder="Confirm password" id="winsync-nsds5replicacredentials-confirm" name="name" required>

                  </div>

                  <div>

-                   <label for="winsync-nsds5replicabindmethod" class="ds-config-label" title="The protocol used to connect to the replica (nsds5replicabindmethod).">Connection Protocol</label><select

-                     class="btn btn-default dropdown ds-agmt-wiz-dropdown" id="winsync-nsds5replicabindmethod">

-                       <option>LDAP</option>

+                   <label for="winsync-nsds5replicatransportinfo" class="ds-config-label" title="The protocol used to connect to the replica (nsDS5ReplicaTransportInfo).">Connection Protocol</label><select

+                     class="btn btn-default dropdown ds-agmt-wiz-dropdown" id="winsync-nsds5replicatransportinfo">

                        <option>LDAPS</option>

-                       <option>Start TLS</option>

+                       <option>StartTLS</option>

                      </select>

                  </div>

                </div>
@@ -561,13 +538,43 @@ 

          </div>

          <div class="modal-footer ds-modal-footer">

            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

-           <button type="button" class="btn btn-primary" id="winsync-agmt-save">Create Agreement</button>

+           <button type="button" class="btn btn-primary" id="winsync-agmt-save">Save Agreement</button>

+         </div>

+       </div>

+     </div>

+   </div>

+ 

+ 

+   <!-- Remove repl manager -->

+   <div class="modal fade" id="del-repl-mgr-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="rm-mgr-label" aria-hidden="true">

+     <div class="modal-dialog ds-modal">

+       <div class="modal-content">

+         <div class="modal-header">

+           <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

+             <span class="pficon pficon-close"></span>

+           </button>

+           <h4 class="modal-title" id="rm-mgr-label">Remove Replication Manager</h4>

+         </div>

+         <div class="modal-body">

+           <form class="form-horizontal">

+             <p>Are you sure you want to remove this Replication Manager from the replication configuration?</p>

+             <div>

+               <input type="checkbox" class="ds-config-checkbox" id="delete-mgr-checkbox"><label

+                 for="delete-mgr-checkbox" class="ds-label" title=

+                 "In addition to removing the manager from the configuration, also delete the manager entry from the server"> Delete the manager entry</label>

+             </div>

+           </form>

+         </div>

+         <div class="modal-footer ds-modal-footer">

+           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+           <button type="button" class="btn btn-primary" id="remove-mgr-btn">Remove Manager</button>

          </div>

        </div>

      </div>

    </div>

  

  

+ 

    <!-- CleanAllRUV Form -->

  

    <div class="modal fade" id="cleanallruv-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="cleanall-label" aria-hidden="true">
@@ -585,11 +592,17 @@ 

                <p>The CleanAllRUV task will clean up traces of a deleted replica from

                   the database and changelog.  The task follows the replication agreements

                   so the cleaning task propagates itself to all the replication servers.</p>

+               <hr>

+               <div>

+                 <label for="cleanallruv-suffix" class="ds-cleanallruv-label"><b>Replication Suffix</b></label><select

+                   class="btn btn-default dropdown" id="cleanallruv-suffix">

+                 </select>

+               </div>

                <p></p>

                <div>

-                 <label for="cleanallruv-rid" class="" title=

+                 <label for="cleanallruv-rid" class="ds-cleanallruv-label" title=

                    "The Replica ID of a deleted replica (replica-id)"><b

-                   >Replica ID</label><input class="ds-form-input" type="text" id="cleanallruv-rid" size="5"/>

+                   >Replica ID</label><input type="text" id="cleanallruv-rid" size="5"/>

                </div>

                <div>

                  <input type="checkbox" class="ds-config-checkbox" id="force-clean" checked><label
@@ -607,6 +620,9 @@ 

      </div>

    </div>

  

+ 

+ 

+ 

    <!-- Add replication manager Form -->

  

    <div class="modal fade" id="add-repl-mgr-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="repl-mgr-label" aria-hidden="true">
@@ -624,7 +640,7 @@ 

                <div>

                  <label for="add-repl-mgr-dn" class="" title=

                    "The DN of the replication manager (nsds5replicabinddn)"><b

-                   >Replication Manager DN</label><input class="ds-form-input" type="text" id="add-repl-mgr-dn" size="60"/>

+                   >Replication Manager DN</label><input class="ds-form-input" type="text" autocomplete="username" id="add-repl-mgr-dn" size="60"/>

                </div>

                <div>

                  <input type="checkbox" class="ds-config-checkbox" id="add-repl-mgr-checkbox"><label
@@ -634,11 +650,11 @@ 

                  <div id="add-repl-mgr-passwd" class="ds-indent" hidden>

                    <div>

                      <label for="add-repl-pw" class="ds-label-sm" title="Replication manager password (userpassword).">Bind DN Credentials</label><input

-                       class="ds-input" type="password" placeholder="Enter credentials" id="add-repl-pw" name="name" required>

+                       class="ds-input" type="password" autocomplete="new-password" placeholder="Enter credentials" id="add-repl-pw" name="name" required>

                    </div>

                    <div>

                      <label for="add-repl-pw-confirm" class="ds-label-sm" title="Confirm password">Confirm Credentials</label><input

-                       class="ds-input" type="password" placeholder="Confirm credentials" id="add-repl-pw-confirm" name="name" required>

+                       class="ds-input" type="password" autocomplete="new-password" placeholder="Confirm credentials" id="add-repl-pw-confirm" name="name" required>

                    </div>

                  </div>

                </div>
@@ -653,6 +669,7 @@ 

      </div>

    </div>

  

+   <!-- Select an attribute for repl agmt forms -->

    <div class="modal fade" id="select-attr-form" data-backdrop="static" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="attr-header" aria-hidden="true">

      <div class="modal-dialog ds-modal">

        <div class="modal-content ds-nested-modal">
@@ -662,18 +679,15 @@ 

            </button>

            <h4 class="modal-title" id="attr-header">Choose Attributes...</h4>

          </div>

+         <input class="ds-input" type="text" id="attr-form-id" value="" hidden>

          <div class="modal-body">

            <form class="form-horizontal">

              <select id="select-attr-list" class="ds-attr-select" multiple>

-               <option value="cn">cn</option>

-               <option value="uid">uid</option>

-               <option value="sn">sn</option>

-               <option value="description">description</option>

              </select>

            </form>

          </div>

          <div class="modal-footer ds-modal-footer">

-           <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>

+           <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

            <button type="button" class="btn btn-primary" id="select-attr-save">Add Attributes</button>

          </div>

        </div>

@@ -133,36 +133,38 @@ 

  

       <hr>

       <div class="ds-inline">

-        <div>

-          <label for="nsslapd-rootdn" class="ds-config-label" title="The DN of the unrestricted directory manager (nsslapd-rootdn).">Directory Manager DN</label><input

-            class="ds-input" type="text" id="nsslapd-rootdn" placeholder="cn=directory manager" value="cn=Directory Manager" size="40"/>

-        </div>

-        <div>

-          <label for="nsslapd-rootpw" class="ds-config-label" title="The Directory Manager password (nsslapd-rootpw).">Directory Manager Password</label><input

-            class="ds-input" type="password" id="nsslapd-rootpw" size="40"/>

-        </div>

-        <div>

-          <label for="nsslapd-rootpw-confirm" class="ds-config-label" title="Confirm directory manager password.">Confirm Password</label><input

-            class="ds-input" type="password" id="nsslapd-rootpw-confirm" size="40"/>

-        </div>

-        <div>

-          <label for="nsslapd-rootpwstoragescheme" class="ds-config-label" title="Set the Directory Manager password storage scheme (nsslapd-rootpwstoragescheme).">Password Storage Scheme</label><select

-            class="btn btn-default dropdown" id="nsslapd-rootpwstoragescheme">

-              <option>PBKDF2_SHA256</option>

-              <option>SSHA512</option>

-              <option>SSHA384</option>

-              <option>SSHA256</option>

-              <option>SSHA</option>

-              <option>NS-MTA-MD5</option>

-              <option>MD5</option>

-              <option>SMD5</option>

-              <option>CRYPT-MD5</option>

-              <option>CRYPT-SHA512</option>

-              <option>CRYPT-SHA256</option>

-              <option>CRYPT</option>

-              <option>CLEAR</option>

-            </select>

-         </div>

+        <form>

+          <div>

+            <label for="nsslapd-rootdn" class="ds-config-label" title="The DN of the unrestricted directory manager (nsslapd-rootdn).">Directory Manager DN</label><input

+              class="ds-input" type="text" autocomplete="username" id="nsslapd-rootdn" placeholder="cn=directory manager" value="cn=Directory Manager" size="40"/>

+          </div>

+          <div>

+            <label for="nsslapd-rootpw" class="ds-config-label" title="The Directory Manager password (nsslapd-rootpw).">Directory Manager Password</label><input

+              class="ds-input" type="password" autocomplete="new-password" id="nsslapd-rootpw" size="40"/>

+          </div>

+          <div>

+            <label for="nsslapd-rootpw-confirm" class="ds-config-label" title="Confirm directory manager password.">Confirm Password</label><input

+              class="ds-input" type="password" autocomplete="new-password" id="nsslapd-rootpw-confirm" size="40"/>

+          </div>

+          <div>

+            <label for="nsslapd-rootpwstoragescheme" class="ds-config-label" title="Set the Directory Manager password storage scheme (nsslapd-rootpwstoragescheme).">Password Storage Scheme</label><select

+              class="btn btn-default dropdown" id="nsslapd-rootpwstoragescheme">

+                <option>PBKDF2_SHA256</option>

+                <option>SSHA512</option>

+                <option>SSHA384</option>

+                <option>SSHA256</option>

+                <option>SSHA</option>

+                <option>NS-MTA-MD5</option>

+                <option>MD5</option>

+                <option>SMD5</option>

+                <option>CRYPT-MD5</option>

+                <option>CRYPT-SHA512</option>

+                <option>CRYPT-SHA256</option>

+                <option>CRYPT</option>

+                <option>CLEAR</option>

+              </select>

+           </div>

+         </form>

        </div>

      </div>

      <p></p>
@@ -462,7 +464,7 @@ 

      <div id="local-password-policy" class="all-pages" hidden>

        <h3 class="ds-config-header">Local Password Policies  </h3>

        <label class="ds-config-label-med" for="local-pwp-suffix">Database Suffix</Label> <select

-         class="btn btn-default dropdown ds-select" id="local-pwp-suffix">

+         class="btn btn-default dropdown" id="local-pwp-suffix">

          <option>dc=example,dc=com</option>

          <option>o=ipaca</option>

        </select>
@@ -593,8 +595,8 @@ 

              class="ds-input" type="text" id="nsslapd-auditlog" size="40"/>

          </div>

          <div>

-           <input type="checkbox" class="ds-server-checkbox" id="nsslapd-auditfaillog-logging-enabled2"><label

-             for="nsslapd-auditfaillog-logging-enabled2" class="ds-label" title="Log failed operations in the audit log (nsslapd-auditfaillog-logging-enabled).">

+           <input type="checkbox" class="ds-server-checkbox" id="nsslapd-auditfaillog-logging-enabled"><label

+             for="nsslapd-auditfaillog-logging-enabled" class="ds-label" title="Log failed operations in the audit log (nsslapd-auditfaillog-logging-enabled).">

              Log Failed Operations</label>

          </div>

        </div>
@@ -1069,8 +1071,8 @@ 

  

    <!-- Create Local Password Policy -->

    <div class="modal fade" id="local-pwp-form" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="local-pwp-header" aria-hidden="true">

-     <div class="modal-dialog ds-modal-wide">

-       <div class="modal-content">

+     <div class="modal-dialog">

+       <div class="modal-content ds-modal-wide">

          <div class="modal-header">

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">

              <span class="pficon pficon-close"></span>

file modified
-1
@@ -140,7 +140,6 @@ 

  

      # Done!

      log.debug("dsconf is brought to you by the letter H and the number 25.")

- 

      if result is False:

          sys.exit(1)

  

@@ -14,6 +14,7 @@ 

  from lib389.utils import is_a_dn

  from lib389.replica import Replicas, BootstrapReplicationManager

  from lib389.tasks import CleanAllRUVTask, AbortCleanAllRUVTask

+ from lib389._mapped_object import DSLdapObjects

  

  

  arg_to_attr = {
@@ -29,6 +30,7 @@ 

          'repl_backoff_max': 'nsds5replicabackoffmax',

          'repl_release_timeout': 'nsds5replicareleasetimeout',

          # Changelog

+         'cl_dir': 'nsslapd-changelogdir',

          'max_entries': 'nsslapd-changelogmaxentries',

          'max_age': 'nsslapd-changelogmaxage',

          'compact_interval': 'nsslapd-changelogcompactdb-interval',
@@ -69,7 +71,7 @@ 

  

  

  def get_agmt(inst, args, winsync=False):

-     agmt_name = args.AGMT_NAME[0]

+     agmt_name = get_agmt_name(args)

      replicas = Replicas(inst)

      replica = replicas.get(args.suffix)

      agmts = replica.get_agreements(winsync=winsync)
@@ -80,6 +82,14 @@ 

      return agmt

  

  

+ def get_agmt_name(args):

+     agmt_name = args.AGMT_NAME[0]

+     if agmt_name.startswith('"') and agmt_name.endswith('"'):

+         # Remove quotes from quoted value

+         agmt_name = agmt_name[1:-1]

+     return agmt_name

+ 

+ 

  def _args_to_attrs(args):

      attrs = {}

      for arg in vars(args):
@@ -116,6 +126,7 @@ 

          'nsDS5ReplicaRoot': repl_root,

          'nsDS5Flags': repl_flag,

          'nsDS5ReplicaType': repl_type,

+         'nsDS5ReplicaId': '65535'

          }

  

      # Validate master settings
@@ -129,14 +140,14 @@ 

          try:

              rid_num = int(rid)

          except ValueError:

-             raise ValueError("--rid expects a number between 1 and 65534")

+             raise ValueError("--replica-id expects a number between 1 and 65534")

  

          # Is it in range?

          if rid_num < 1 or rid_num > 65534:

              raise ValueError("--replica-id expects a number between 1 and 65534")

  

          # rid is good add it to the props

-         repl_properties['nsDS5ReplicaId'] = rid

+         repl_properties['nsDS5ReplicaId'] = args.replica_id

  

      # Bind DN or Bind DN Group?

      if args.bind_group_dn:
@@ -181,7 +192,7 @@ 

  

      if role == 'master':

          newrole = ReplicaRole.MASTER

-         if args.rreplica_idid is None:

+         if args.replica_id is None:

              raise ValueError("You need to provide a replica ID (--replica-id) to promote replica to a master")

      elif role == 'hub':

          newrole = ReplicaRole.HUB
@@ -221,38 +232,45 @@ 

      replicas = Replicas(inst)

      replica = replicas.get(args.suffix)

      attrs = _args_to_attrs(args)

-     op_count = 0

+     did_something = False

  

      # Add supplier DNs

      if args.repl_add_bind_dn is not None:

-         if not is_a_dn(repl_add_bind_dn):

+         if not is_a_dn(args.repl_add_bind_dn):

              raise ValueError("The replica bind DN is not a valid DN")

          replica.add('nsds5ReplicaBindDN', args.repl_add_bind_dn)

-         op_count += 1

+         did_something = True

  

      # Remove supplier DNs

      if args.repl_del_bind_dn is not None:

          replica.remove('nsds5ReplicaBindDN', args.repl_del_bind_dn)

-         op_count += 1

+         did_something = True

  

      # Add referral

      if args.repl_add_ref is not None:

          replica.add('nsDS5ReplicaReferral', args.repl_add_ref)

-         op_count += 1

+         did_something = True

  

      # Remove referral

      if args.repl_del_ref is not None:

          replica.remove('nsDS5ReplicaReferral', args.repl_del_ref)

-         op_count += 1

+         did_something = True

  

      # Handle the rest of the changes that use mod_replace

-     modlist = []

+     replace_list = []

+ 

      for attr, value in attrs.items():

-         modlist.append((attr, value))

-     if len(modlist) > 0:

-         replica.replace_many(*modlist)

-     elif op_count == 0:

+         if value == "":

+             # Delete value

+             replica.remove_all(attr)

+             did_something = True

+         else:

+             replace_list.append((attr, value))

+     if len(replace_list) > 0:

+         replica.replace_many(*replace_list)

+     elif not did_something:

          raise ValueError("There are no changes to set in the replica")

+ 

      print("Successfully updated replication configuration")

  

  
@@ -280,13 +298,19 @@ 

  def set_cl(inst, basedn, log, args):

      cl = Changelog5(inst)

      attrs = _args_to_attrs(args)

-     modlist = []

+     replace_list = []

+     did_something = False

      for attr, value in attrs.items():

-         modlist.append((attr, value))

-     if len(modlist) > 0:

-         cl.replace_many(*modlist)

-     else:

+         if value == "":

+             cl.remove_all(attr)

+             did_something = True

+         else:

+             replace_list.append((attr, value))

+     if len(replace_list) > 0:

+         cl.replace_many(*replace_list)

+     elif not did_something:

          raise ValueError("There are no changes to set for the replication changelog")

+ 

      print("Successfully updated replication changelog")

  

  
@@ -342,7 +366,7 @@ 

  

  

  def del_repl_manager(inst, basedn, log, args):

-     if is_a_dn(agmt.name):

+     if is_a_dn(args.name):

          manager_dn = args.name

      else:

          manager_dn = "cn={},cn=config".format(args.name)
@@ -394,9 +418,9 @@ 

  

      # Required properties

      properties = {

-             'cn': args.AGMT_NAME[0],

+             'cn': get_agmt_name(args),

              'nsDS5ReplicaRoot': repl_root,

-             'description': args.AGMT_NAME[0],

+             'description': get_agmt_name(args),

              'nsDS5ReplicaHost': args.host,

              'nsDS5ReplicaPort': args.port,

              'nsDS5ReplicaBindMethod': bind_method,
@@ -429,7 +453,7 @@ 

      except ldap.ALREADY_EXISTS:

          raise ValueError("A replication agreement with the same name already exists")

  

-     print("Successfully created replication agreement \"{}\"".format(args.AGMT_NAME[0]))

+     print("Successfully created replication agreement \"{}\"".format(get_agmt_name(args)))

      if args.init:

          init_agmt(inst, basedn, log, args)

  
@@ -478,12 +502,20 @@ 

      agmt = get_agmt(inst, args)

      attrs = _args_to_attrs(args)

      modlist = []

+     did_something = False

      for attr, value in attrs.items():

-         modlist.append((attr, value))

+         if value == "":

+             # Delete value

+             agmt.remove_all(attr)

+             did_something = True

+         else:

+             modlist.append((attr, value))

+ 

      if len(modlist) > 0:

          agmt.replace_many(*modlist)

-     else:

+     elif not did_something:

          raise ValueError("There are no changes to set in the agreement")

+ 

      print("Successfully updated agreement")

  

  
@@ -551,9 +583,9 @@ 

  

      # Required properties

      properties = {

-             'cn': args.AGMT_NAME[0],

+             'cn': get_agmt_name(args),

              'nsDS5ReplicaRoot': args.suffix,

-             'description': args.AGMT_NAME[0],

+             'description': get_agmt_name(args),

              'nsDS5ReplicaHost': args.host,

              'nsDS5ReplicaPort': args.port,

              'nsDS5ReplicaTransportInfo': args.conn_protocol,
@@ -590,7 +622,7 @@ 

      except ldap.ALREADY_EXISTS:

          raise ValueError("A replication agreement with the same name already exists")

  

-     print("Successfully created winsync replication agreement \"{}\"".format(args.AGMT_NAME[0]))

+     print("Successfully created winsync replication agreement \"{}\"".format(get_agmt_name(args)))

      if args.init:

          init_winsync_agmt(inst, basedn, log, args)

  
@@ -606,12 +638,19 @@ 

  

      attrs = _args_to_attrs(args)

      modlist = []

-     for attr, value in attrs.items():

-         modlist.append((attr, value))

+     did_something = False

+     for attr, value in list(attrs.items()):

+         if value == "":

+             # Delete value

+             agmt.remove_all(attr)

+             did_something = True

+         else:

+             modlist.append((attr, value))

      if len(modlist) > 0:

          agmt.replace_many(*modlist)

-     else:

+     elif not did_something:

          raise ValueError("There are no changes to set in the agreement")

+ 

      print("Successfully updated agreement")

  

  
@@ -678,16 +717,44 @@ 

      properties = {'replica-base-dn': args.suffix,

                    'replica-id': args.replica_id}

      if args.force_cleaning:

-         properties['replica-force-cleaning'] = args.force_cleaning

+         properties['replica-force-cleaning'] = 'yes'

      clean_task = CleanAllRUVTask(inst)

      clean_task.create(properties=properties)

+     rdn = clean_task.rdn

+     if args.json:

+         print(json.dumps(rdn))

+     else:

+         print('Created task ' + rdn)

+ 

+ 

+ def list_cleanallruv(inst, basedn, log, args):

+     tasksobj = DSLdapObjects(inst)

+     tasksobj._basedn = "cn=cleanallruv, cn=tasks, cn=config"

+     tasksobj._scope = ldap.SCOPE_ONELEVEL

+     tasksobj._objectclasses = ['top']

+     tasks = tasksobj.list()

+     result = {"type": "list", "items": []}

+     tasks_found = False

+     for task in tasks:

+         tasks_found = True

+         if args.json:

+             entry = task.get_all_attrs_json()

+             # Append decoded json object, because we are going to dump it later

+             result['items'].append(json.loads(entry))

+         else:

+             print(task.display())

+     if args.json:

+         print(json.dumps(result))

+     else:

+         if not tasks_found:

+             print("No CleanAllRUV tasks found")

  

  

  def abort_cleanallruv(inst, basedn, log, args):

      properties = {'replica-base-dn': args.suffix,

                    'replica-id': args.replica_id}

      if args.certify:

-         properties['replica-certify-all'] = args.certify

+         properties['replica-certify-all'] = 'yes'

      clean_task = AbortCleanAllRUVTask(inst)

      clean_task.create(properties=properties)

  
@@ -747,6 +814,7 @@ 

  

      repl_set_cl = repl_subcommands.add_parser('set-changelog', help='Delete the replication changelog.  This will invalidate any existing replication agreements')

      repl_set_cl.set_defaults(func=set_cl)

+     repl_set_cl.add_argument('--cl-dir', help="The replication changelog location on the filesystem")

      repl_set_cl.add_argument('--max-entries', help="The maximum number of entries to get in the replication changelog")

      repl_set_cl.add_argument('--max-age', help="The maximum age of a replication changelog entry")

      repl_set_cl.add_argument('--compact-interval', help="The replication changelog compaction interval")
@@ -1035,6 +1103,9 @@ 

      task_cleanallruv.add_argument('--force-cleaning', action='store_true', default=False,

                                    help="Ignore errors and do a best attempt to clean all the replicas")

  

+     task_cleanallruv_list = task_subcommands.add_parser('list-cleanallruv', help='List all the running CleanAllRUV Tasks')

+     task_cleanallruv_list.set_defaults(func=list_cleanallruv)

+ 

      # Abort cleanallruv

      task_abort_cleanallruv = task_subcommands.add_parser('abort-cleanallruv', help='Set an attribute in the replication winsync agreement')

      task_abort_cleanallruv.set_defaults(func=abort_cleanallruv)

file modified
+6 -2
@@ -1012,9 +1012,13 @@ 

          :raises: ValueError - If replica is not promoted

          """

  

- 

+         # Set the bind dn, use the existing one if it exists

          if binddn is None and binddn_group is None:

-             binddn = defaultProperties[REPLICATION_BIND_DN]

+             curr_dn = self.get_attr_val(REPL_BINDDN)

+             if curr_dn is None:

+                 binddn = defaultProperties[REPLICATION_BIND_DN]

+             else:

+                 binddn = curr_dn

  

          # Check the role type

          replicarole = self.get_role()

Description:

Add replication functionality to UI.

Cleaned up various UI interactions and page loading

Added console logging for all CLI commands

https://pagure.io/389-ds-base/issue/49926

Reviewed by: ?

rebased onto f286478110659aac2719af884ff219e7acf66c2f

5 years ago

If I put insts there and uncomment valid_num and valid_dn functions, the web page is not loaded when we don't have any instances.

As proposed by Mark (and I agree with him), we can merge it so it will get into next build but we should fix the minor issues first because it stops UI from loading when a user doesn't have any instances.

The rest can be fixed in the following PR. I will put more comments later after the detailed review.

I think it can be done as a one instruction:

agmt_name = agmt_name[1:-1]

We have from lib389.tasks import CleanAllRUVTask which is DSLdapObject for "cn=cleanallruv, cn=tasks, cn=config".
I think it is better to use it here instead of constructing naked DSLdapObjects only for list().
You can add 'list' method to tasks.py to Task(DSLdapObject). So we can list the active tasks in the future for any Task object instance.

It's defined in ds.js, am I missing something?

Looks like it is commented out (at least I see it like this, maybe bad rebase)

Where do you see it commented out? What file/line?

Okay, it is my mistake. I commented it out accidently with '/*' while changing back to 'var DSCONF = "dsconf"'... Sorry

rebased onto cf68341

5 years ago

Pull-Request has been merged by mreynolds

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3035

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago