MB-8780: don't purge deletions that are not yet indexed

Change-Id: I4854626a4bf7a6e0d5f429999a72701c09b050cf
Reviewed-on: http://review.couchbase.org/28036
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-8351: Expose optimistic XDCR stats on UI

This commit will add a new XDCR stat in outbound XDCR
stat section showing the number of docs that have been
replicated optimistically to remote cluster. It is an
aggregated stat from stat reported by each vb replicator.

Change-Id: I194ddf1cd5c823f599372a206372fce218f8a691
Reviewed-on: http://review.couchbase.org/28106
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Junyi Xie <junyi.couchbase@gmail.com>
MB-8661: implemented ui auth via 10-minute token

UI is now doing POST to /uilogin on login. Which sets 10 minute cookie
with token identifying authorized user.

Auth tokens are stored and managed per-node in new menelaus_ui_auth
service. They are not replicated.

Long-polling pool-details replies also check if token is about to
expire and if so it generates new token that's set into updated cookie.

{auth_cookie, is replaced with normal auth because normal auth is now
cookie-based.

Change-Id: If0b91428a9e6435104c9afdf314c2fd67b4a3ceb
Reviewed-on: http://review.couchbase.org/28019
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-100: don't crash UI when /pools auth doesn't work

Logout does not remove auth cookie. That causes /pools request right
after logout to fail with 401. But despite that
UpdatesNotificationsSection still tries to render prettified version
which doesn't exist yet.

Change-Id: I1a49f55947b010f58101de09fbbc300a7f0ff930
Reviewed-on: http://review.couchbase.org/28020
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-8145: added description text for read-only user form

Change-Id: Id67858797019e9a848f5ee1ce133207362b57106
Reviewed-on: http://review.couchbase.org/28081
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-8713: set replica building vbuckets to state pending

As requested by ep-engine folks. So that they can preserve resident
ratio of future-master vbuckets.

Change-Id: I846ef2c7dd5ab39f9f7a6b52e1d1db1f5699fe02
Reviewed-on: http://review.couchbase.org/28086
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-8662: changed default deletions purge interval to 3

As requested by Anil

Change-Id: I631257f0fb6f866b1c6f05be21bc2ab6fa8be4a9
Reviewed-on: http://review.couchbase.org/28088
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
MB-8145: do not allow read-only user name to be same as admin

Change-Id: I3711c5a38f3192f02e04c2f49743b1dc42a710aa
Reviewed-on: http://review.couchbase.org/28082
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Merge remote-tracking branch 'couchbase/2.2.0'

* couchbase/2.2.0:
  MB-8145: do not allow read-only user name to be same as admin
  MB-8662: changed default deletions purge interval to 3
  MB-8713: set replica building vbuckets to state pending
  MB-8145: added description text for read-only user form
  MB-100: don't crash UI when /pools auth doesn't work
  MB-8661: implemented ui auth via 10-minute token
  MB-8351: Expose optimistic XDCR stats on UI
  MB-8780: don't purge deletions that are not yet indexed

Change-Id: I6a8e88e352ba6392247af17fdf5e19c36565b95f