Implement support for calculating disk usage per tenant (#5969)

Fixes #5961
This commit is contained in:
Harshavardhana authored and Nitish Tiwari committed 2018-05-23 15:41:29 +05:30
1 parent 483fe4bed5
commit e6ec645035
23 files changed
+328 -81

No files matched your search

+4 -5
View File
@@ -25,19 +25,18 @@ export class StorageInfo extends React.Component {
fetchStorageInfo() fetchStorageInfo()
} }
render() { render() {
const { total, free } = this.props.storageInfo const { total, used } = this.props.storageInfo
const used = total - free
const usedPercent = used / total * 100 + "%" const usedPercent = used / total * 100 + "%"
const freePercent = free * 100 / total const freePercent = (total - used) * 100 / total
return ( return (
<div className="feh-usage"> <div className="feh-used">
<div className="fehu-chart"> <div className="fehu-chart">
<div style={{ width: usedPercent }} /> <div style={{ width: usedPercent }} />
</div> </div>
<ul> <ul>
<li> <li>
<span>Used: </span> <span>Used: </span>
{humanize.filesize(total - free)} {humanize.filesize(used)}
</li> </li>
<li className="pull-right"> <li className="pull-right">
<span>Free: </span> <span>Free: </span>
@@ -22,7 +22,7 @@ describe("StorageInfo", () => {
it("should render without crashing", () => { it("should render without crashing", () => {
shallow( shallow(
<StorageInfo <StorageInfo
storageInfo={{ total: 100, free: 60 }} storageInfo={{ total: 100, used: 60 }}
fetchStorageInfo={jest.fn()} fetchStorageInfo={jest.fn()}
/> />
) )
@@ -32,7 +32,7 @@ describe("StorageInfo", () => {
const fetchStorageInfo = jest.fn() const fetchStorageInfo = jest.fn()
shallow( shallow(
<StorageInfo <StorageInfo
storageInfo={{ total: 100, free: 60 }} storageInfo={{ total: 100, used: 60 }}
fetchStorageInfo={fetchStorageInfo} fetchStorageInfo={fetchStorageInfo}
/> />
) )
@@ -20,7 +20,7 @@ import * as actionsCommon from "../actions"
jest.mock("../../web", () => ({ jest.mock("../../web", () => ({
StorageInfo: jest.fn(() => { StorageInfo: jest.fn(() => {
return Promise.resolve({ storageInfo: { Total: 100, Free: 60 } }) return Promise.resolve({ storageInfo: { Total: 100, Used: 60 } })
}), }),
ServerInfo: jest.fn(() => { ServerInfo: jest.fn(() => {
return Promise.resolve({ return Promise.resolve({
@@ -40,7 +40,7 @@ describe("Common actions", () => {
it("creates common/SET_STORAGE_INFO after fetching the storage details ", () => { it("creates common/SET_STORAGE_INFO after fetching the storage details ", () => {
const store = mockStore() const store = mockStore()
const expectedActions = [ const expectedActions = [
{ type: "common/SET_STORAGE_INFO", storageInfo: { total: 100, free: 60 } } { type: "common/SET_STORAGE_INFO", storageInfo: { total: 100, used: 60 } }
] ]
return store.dispatch(actionsCommon.fetchStorageInfo()).then(() => { return store.dispatch(actionsCommon.fetchStorageInfo()).then(() => {
const actions = store.getActions() const actions = store.getActions()
+1 -1
View File
@@ -34,7 +34,7 @@ export const fetchStorageInfo = () => {
return web.StorageInfo().then(res => { return web.StorageInfo().then(res => {
const storageInfo = { const storageInfo = {
total: res.storageInfo.Total, total: res.storageInfo.Total,
free: res.storageInfo.Free used: res.storageInfo.Used
} }
dispatch(setStorageInfo(storageInfo)) dispatch(setStorageInfo(storageInfo))
}) })
+2 -2
View File
@@ -44,9 +44,9 @@
/*-------------------------- /*--------------------------
Disk usage Disk used
----------------------------*/ ----------------------------*/
.feh-usage { .feh-used {
margin-top: 12px; margin-top: 12px;
max-width: 285px; max-width: 285px;
+24 -24
View File
@@ -4,7 +4,7 @@
// production/favicon.ico // production/favicon.ico
// production/firefox.png // production/firefox.png
// production/index.html // production/index.html
// production/index_bundle-2018-04-16T18-35-51Z.js // production/index_bundle-2018-05-23T09-12-50Z.js
// production/loader.css // production/loader.css
// production/logo.svg // production/logo.svg
// production/safari.png // production/safari.png
@@ -65,7 +65,7 @@ func productionChromePng() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -82,7 +82,7 @@ func productionFaviconIco() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -99,7 +99,7 @@ func productionFirefoxPng() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -156,8 +156,8 @@ var _productionIndexHTML = []byte(`<!DOCTYPE html>
</div> </div>
<![endif]--> <![endif]-->
<script>currentUiVersion = '2018-04-16T18:35:51Z'</script> <script>currentUiVersion = '2018-05-23T09:12:50Z'</script>
<script src="index_bundle-2018-04-16T18-35-51Z.js"></script> <script src="index_bundle-2018-05-23T09-12-50Z.js"></script>
</body> </body>
</html> </html>
`) `)
@@ -172,17 +172,17 @@ func productionIndexHTML() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/index.html", size: 1954, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/index.html", size: 1954, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
var _productionIndex_bundle20180416t183551zJs = []byte(`!function(A){function t(e){if(M[e])return M[e].exports;var I=M[e]={i:e,l:!1,exports:{}};return A[e].call(I.exports,I,I.exports,t),I.l=!0,I.exports}var M={};t.m=A,t.c=M,t.d=function(A,M,e){t.o(A,M)||Object.defineProperty(A,M,{configurable:!1,enumerable:!0,get:e})},t.n=function(A){var M=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(M,"a",M),M},t.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},t.p="",t(t.s=316)}([function(A,t,M){"use strict";A.exports=M(522)},function(A,t,M){var e=M(11),I=M(50),g=M(29),i=M(30),n=M(51),o=function(A,t,M){var E,c,T,N,a=A&o.F,r=A&o.G,C=A&o.S,D=A&o.P,B=A&o.B,s=r?e:C?e[t]||(e[t]={}):(e[t]||{}).prototype,Q=r?I:I[t]||(I[t]={}),u=Q.prototype||(Q.prototype={});r&&(M=t);for(E in M)c=!a&&s&&void 0!==s[E],T=(c?s:M)[E],N=B&&c?n(T,e):D&&"function"==typeof T?n(Function.call,T):T,s&&i(s,E,T,A&o.U),Q[E]!=T&&g(Q,E,N),D&&u[E]!=T&&(u[E]=T)};e.core=I,o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,A.exports=o},function(A,t,M){"use strict";t.__esModule=!0,t.default=function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}},function(A,t,M){"use strict";t.__esModule=!0;var e=M(185),I=function(A){return A&&A.__esModule?A:{default:A}}(e);t.default=function(A,t){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,I.default)(t))&&"function"!=typeof t?A:t}},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}t.__esModule=!0;var I=M(649),g=e(I),i=M(653),n=e(i),o=M(185),E=e(o);t.default=function(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,E.default)(t)));A.prototype=(0,n.default)(t&&t.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),t&&(g.default?(0,g.default)(A,t):A.__proto__=t)}},function(A,t,M){var e,I;/*! var _productionIndex_bundle20180523t091250zJs = []byte(`!function(A){function t(e){if(M[e])return M[e].exports;var I=M[e]={i:e,l:!1,exports:{}};return A[e].call(I.exports,I,I.exports,t),I.l=!0,I.exports}var M={};t.m=A,t.c=M,t.d=function(A,M,e){t.o(A,M)||Object.defineProperty(A,M,{configurable:!1,enumerable:!0,get:e})},t.n=function(A){var M=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(M,"a",M),M},t.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},t.p="",t(t.s=316)}([function(A,t,M){"use strict";A.exports=M(522)},function(A,t,M){var e=M(11),I=M(50),g=M(29),i=M(30),n=M(51),o=function(A,t,M){var E,c,T,N,a=A&o.F,r=A&o.G,C=A&o.S,D=A&o.P,B=A&o.B,s=r?e:C?e[t]||(e[t]={}):(e[t]||{}).prototype,Q=r?I:I[t]||(I[t]={}),u=Q.prototype||(Q.prototype={});r&&(M=t);for(E in M)c=!a&&s&&void 0!==s[E],T=(c?s:M)[E],N=B&&c?n(T,e):D&&"function"==typeof T?n(Function.call,T):T,s&&i(s,E,T,A&o.U),Q[E]!=T&&g(Q,E,N),D&&u[E]!=T&&(u[E]=T)};e.core=I,o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,A.exports=o},function(A,t,M){"use strict";t.__esModule=!0,t.default=function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}},function(A,t,M){"use strict";t.__esModule=!0;var e=M(185),I=function(A){return A&&A.__esModule?A:{default:A}}(e);t.default=function(A,t){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,I.default)(t))&&"function"!=typeof t?A:t}},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}t.__esModule=!0;var I=M(649),g=e(I),i=M(653),n=e(i),o=M(185),E=e(o);t.default=function(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,E.default)(t)));A.prototype=(0,n.default)(t&&t.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),t&&(g.default?(0,g.default)(A,t):A.__proto__=t)}},function(A,t,M){var e,I;/*!
Copyright (c) 2016 Jed Watson. Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames http://jedwatson.github.io/classnames
*/ */
!function(){"use strict";function M(){for(var A=[],t=0;t<arguments.length;t++){var e=arguments[t];if(e){var I=typeof e;if("string"===I||"number"===I)A.push(e);else if(Array.isArray(e))A.push(M.apply(null,e));else if("object"===I)for(var i in e)g.call(e,i)&&e[i]&&A.push(i)}}return A.join(" ")}var g={}.hasOwnProperty;void 0!==A&&A.exports?A.exports=M:(e=[],void 0!==(I=function(){return M}.apply(t,e))&&(A.exports=I))}()},function(A,t,M){"use strict";t.__esModule=!0;var e=M(258),I=function(A){return A&&A.__esModule?A:{default:A}}(e);t.default=I.default||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A}},function(A,t,M){"use strict";t.__esModule=!0,t.default=function(A,t){var M={};for(var e in A)t.indexOf(e)>=0||Object.prototype.hasOwnProperty.call(A,e)&&(M[e]=A[e]);return M}},function(A,t,M){A.exports=M(565)()},function(A,t,M){"use strict";function e(A){return function(){for(var t=arguments.length,M=Array(t),e=0;e<t;e++)M[e]=arguments[e];return"function"==typeof M[M.length-1]?A.apply(void 0,M):function(t){return A.apply(void 0,M.concat([t]))}}}function I(A,t){var M=(A.bsClass||"").trim();return null==M&&D()(!1),M+(t?"-"+t:"")}function g(A){var t,M=(t={},t[I(A)]=!0,t);if(A.bsSize){M[I(A,Q.b[A.bsSize]||A.bsSize)]=!0}return A.bsStyle&&(M[I(A,A.bsStyle)]=!0),M}function i(A){return{bsClass:A.bsClass,bsSize:A.bsSize,bsStyle:A.bsStyle,bsRole:A.bsRole}}function n(A){return"bsClass"===A||"bsSize"===A||"bsStyle"===A||"bsRole"===A}function o(A){var t={};return N()(A).forEach(function(A){var M=A[0],e=A[1];n(M)||(t[M]=e)}),[i(A),t]}function E(A,t){var M={};t.forEach(function(A){M[A]=!0});var e={};return N()(A).forEach(function(A){var t=A[0],I=A[1];n(t)||M[t]||(e[t]=I)}),[i(A),e]}function c(A){for(var t=arguments.length,M=Array(t>1?t-1:0),e=1;e<t;e++)M[e-1]=arguments[e];l(M,A)}Object.defineProperty(t,"__esModule",{value:!0}),t.prefix=I,M.d(t,"bsClass",function(){return u}),M.d(t,"bsStyles",function(){return l}),M.d(t,"bsSizes",function(){return y}),t.getClassSet=g,t.splitBsProps=o,t.splitBsPropsAndOmit=E,t.addStyle=c,M.d(t,"_curry",function(){return x});var T=M(191),N=M.n(T),a=M(6),r=M.n(a),C=M(23),D=M.n(C),B=M(8),s=M.n(B),Q=M(25),u=e(function(A,t){var M=t.propTypes||(t.propTypes={}),e=t.defaultProps||(t.defaultProps={});return M.bsClass=s.a.string,e.bsClass=A,t}),l=e(function(A,t,M){"string"!=typeof t&&(M=t,t=void 0);var e=M.STYLES||[],I=M.propTypes||{};A.forEach(function(A){-1===e.indexOf(A)&&e.push(A)});var g=s.a.oneOf(e);if(M.STYLES=e,g._values=e,M.propTypes=r()({},I,{bsStyle:g}),void 0!==t){(M.defaultProps||(M.defaultProps={})).bsStyle=t}return M}),y=e(function(A,t,M){"string"!=typeof t&&(M=t,t=void 0);var e=M.SIZES||[],I=M.propTypes||{};A.forEach(function(A){-1===e.indexOf(A)&&e.push(A)});var g=[];e.forEach(function(A){var t=Q.b[A];t&&t!==A&&g.push(t),g.push(A)});var i=s.a.oneOf(g);return i._values=g,M.SIZES=e,M.propTypes=r()({},I,{bsSize:i}),void 0!==t&&(M.defaultProps||(M.defaultProps={}),M.defaultProps.bsSize=t),M}),x=e},function(A,t,M){var e=M(16);A.exports=function(A){if(!e(A))throw TypeError(A+" is not an object!");return A}},function(A,t){var M=A.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=M)},function(A,t){A.exports=function(A){try{return!!A()}catch(A){return!0}}},function(A,t,M){"use strict";var e=function(){};A.exports=e},function(A,t,M){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=M(564),I=M(246),g=M(569);M.d(t,"Provider",function(){return e.b}),M.d(t,"createProvider",function(){return e.a}),M.d(t,"connectAdvanced",function(){return I.a}),M.d(t,"connect",function(){return g.a})},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}function I(A,t,M,e,I){var i=A[t],o=void 0===i?"undefined":g(i);return n.default.isValidElement(i)?new Error("Invalid "+e+" ` + "`" + `"+I+"` + "`" + ` of type ReactElement supplied to ` + "`" + `"+M+"` + "`" + `, expected an element type (a string or a ReactClass)."):"function"!==o&&"string"!==o?new Error("Invalid "+e+" ` + "`" + `"+I+"` + "`" + ` of value ` + "`" + `"+i+"` + "`" + ` supplied to ` + "`" + `"+M+"` + "`" + `, expected an element type (a string or a ReactClass)."):null}Object.defineProperty(t,"__esModule",{value:!0});var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},i=M(0),n=e(i),o=M(106),E=e(o);t.default=(0,E.default)(I),A.exports=t.default},function(A,t){A.exports=function(A){return"object"==typeof A?null!==A:"function"==typeof A}},function(A,t,M){var e=M(110)("wks"),I=M(63),g=M(11).Symbol,i="function"==typeof g;(A.exports=function(A){return e[A]||(e[A]=i&&g[A]||(i?g:I)("Symbol."+A))}).store=e},function(A,t,M){A.exports=!M(12)(function(){return 7!=ObjLine truncated !function(){"use strict";function M(){for(var A=[],t=0;t<arguments.length;t++){var e=arguments[t];if(e){var I=typeof e;if("string"===I||"number"===I)A.push(e);else if(Array.isArray(e))A.push(M.apply(null,e));else if("object"===I)for(var i in e)g.call(e,i)&&e[i]&&A.push(i)}}return A.join(" ")}var g={}.hasOwnProperty;void 0!==A&&A.exports?A.exports=M:(e=[],void 0!==(I=function(){return M}.apply(t,e))&&(A.exports=I))}()},function(A,t,M){"use strict";t.__esModule=!0;var e=M(258),I=function(A){return A&&A.__esModule?A:{default:A}}(e);t.default=I.default||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A}},function(A,t,M){"use strict";t.__esModule=!0,t.default=function(A,t){var M={};for(var e in A)t.indexOf(e)>=0||Object.prototype.hasOwnProperty.call(A,e)&&(M[e]=A[e]);return M}},function(A,t,M){A.exports=M(565)()},function(A,t,M){"use strict";function e(A){return function(){for(var t=arguments.length,M=Array(t),e=0;e<t;e++)M[e]=arguments[e];return"function"==typeof M[M.length-1]?A.apply(void 0,M):function(t){return A.apply(void 0,M.concat([t]))}}}function I(A,t){var M=(A.bsClass||"").trim();return null==M&&D()(!1),M+(t?"-"+t:"")}function g(A){var t,M=(t={},t[I(A)]=!0,t);if(A.bsSize){M[I(A,Q.b[A.bsSize]||A.bsSize)]=!0}return A.bsStyle&&(M[I(A,A.bsStyle)]=!0),M}function i(A){return{bsClass:A.bsClass,bsSize:A.bsSize,bsStyle:A.bsStyle,bsRole:A.bsRole}}function n(A){return"bsClass"===A||"bsSize"===A||"bsStyle"===A||"bsRole"===A}function o(A){var t={};return N()(A).forEach(function(A){var M=A[0],e=A[1];n(M)||(t[M]=e)}),[i(A),t]}function E(A,t){var M={};t.forEach(function(A){M[A]=!0});var e={};return N()(A).forEach(function(A){var t=A[0],I=A[1];n(t)||M[t]||(e[t]=I)}),[i(A),e]}function c(A){for(var t=arguments.length,M=Array(t>1?t-1:0),e=1;e<t;e++)M[e-1]=arguments[e];l(M,A)}Object.defineProperty(t,"__esModule",{value:!0}),t.prefix=I,M.d(t,"bsClass",function(){return u}),M.d(t,"bsStyles",function(){return l}),M.d(t,"bsSizes",function(){return y}),t.getClassSet=g,t.splitBsProps=o,t.splitBsPropsAndOmit=E,t.addStyle=c,M.d(t,"_curry",function(){return x});var T=M(191),N=M.n(T),a=M(6),r=M.n(a),C=M(23),D=M.n(C),B=M(8),s=M.n(B),Q=M(25),u=e(function(A,t){var M=t.propTypes||(t.propTypes={}),e=t.defaultProps||(t.defaultProps={});return M.bsClass=s.a.string,e.bsClass=A,t}),l=e(function(A,t,M){"string"!=typeof t&&(M=t,t=void 0);var e=M.STYLES||[],I=M.propTypes||{};A.forEach(function(A){-1===e.indexOf(A)&&e.push(A)});var g=s.a.oneOf(e);if(M.STYLES=e,g._values=e,M.propTypes=r()({},I,{bsStyle:g}),void 0!==t){(M.defaultProps||(M.defaultProps={})).bsStyle=t}return M}),y=e(function(A,t,M){"string"!=typeof t&&(M=t,t=void 0);var e=M.SIZES||[],I=M.propTypes||{};A.forEach(function(A){-1===e.indexOf(A)&&e.push(A)});var g=[];e.forEach(function(A){var t=Q.b[A];t&&t!==A&&g.push(t),g.push(A)});var i=s.a.oneOf(g);return i._values=g,M.SIZES=e,M.propTypes=r()({},I,{bsSize:i}),void 0!==t&&(M.defaultProps||(M.defaultProps={}),M.defaultProps.bsSize=t),M}),x=e},function(A,t,M){var e=M(16);A.exports=function(A){if(!e(A))throw TypeError(A+" is not an object!");return A}},function(A,t){var M=A.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=M)},function(A,t){A.exports=function(A){try{return!!A()}catch(A){return!0}}},function(A,t,M){"use strict";var e=function(){};A.exports=e},function(A,t,M){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=M(564),I=M(246),g=M(569);M.d(t,"Provider",function(){return e.b}),M.d(t,"createProvider",function(){return e.a}),M.d(t,"connectAdvanced",function(){return I.a}),M.d(t,"connect",function(){return g.a})},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}function I(A,t,M,e,I){var i=A[t],o=void 0===i?"undefined":g(i);return n.default.isValidElement(i)?new Error("Invalid "+e+" ` + "`" + `"+I+"` + "`" + ` of type ReactElement supplied to ` + "`" + `"+M+"` + "`" + `, expected an element type (a string or a ReactClass)."):"function"!==o&&"string"!==o?new Error("Invalid "+e+" ` + "`" + `"+I+"` + "`" + ` of value ` + "`" + `"+i+"` + "`" + ` supplied to ` + "`" + `"+M+"` + "`" + `, expected an element type (a string or a ReactClass)."):null}Object.defineProperty(t,"__esModule",{value:!0});var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},i=M(0),n=e(i),o=M(106),E=e(o);t.default=(0,E.default)(I),A.exports=t.default},function(A,t){A.exports=function(A){return"object"==typeof A?null!==A:"function"==typeof A}},function(A,t,M){var e=M(110)("wks"),I=M(63),g=M(11).Symbol,i="function"==typeof g;(A.exports=function(A){return e[A]||(e[A]=i&&g[A]||(i?g:I)("Symbol."+A))}).store=e},function(A,t,M){A.exports=!M(12)(function(){return 7!=ObjLine truncated
* Programatically add the following * Programatically add the following
*/ */
for(I=97;I<123;I++)M[String.fromCharCode(I)]=I-32;for(var I=48;I<58;I++)M[I-48]=I;for(I=1;I<13;I++)M["f"+I]=I+111;for(I=0;I<10;I++)M["numpad "+I]=I+96;var g=t.names=t.title={};for(I in M)g[M[I]]=I;for(var i in e)M[i]=e[i]},function(A,t,M){"use strict";function e(A){function t(t,M,e,I,g,i){var n=I||"<<anonymous>>",o=i||e;if(null==M[e])return t?new Error("Required "+g+" ` + "`" + `"+o+"` + "`" + ` was not specified in ` + "`" + `"+n+"` + "`" + `."):null;for(var E=arguments.length,c=Array(E>6?E-6:0),T=6;T<E;T++)c[T-6]=arguments[T];return A.apply(void 0,[M,e,n,g,o].concat(c))}var M=t.bind(null,!1);return M.isRequired=t.bind(null,!0),M}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";function e(A){return function(t,M,e,I,g){var i=e||"<<anonymous>>",n=g||M;if(null==t[M])return new Error("The "+I+" ` + "`" + `"+n+"` + "`" + ` is required to make ` + "`" + `"+i+"` + "`" + ` accessible for users of assistive technologies such as screen readers.");for(var o=arguments.length,E=Array(o>5?o-5:0),c=5;c<o;c++)E[c-5]=arguments[c];return A.apply(void 0,[t,M,e,I,g].concat(E))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";function e(A){return A&&A.ownerDocument||document}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";var e=M(62),I=M.n(e),g=M(7),i=M.n(g),n=M(6),o=M.n(n),E=M(2),c=M.n(E),T=M(3),N=M.n(T),a=M(4),r=M.n(a),C=M(5),D=M.n(C),B=M(0),s=M.n(B),Q=M(8),u=M.n(Q),l=M(15),y=M.n(l),x=M(9),j=M(25),w=M(40),d={active:u.a.bool,disabled:u.a.bool,block:u.a.bool,onClick:u.a.func,componentClass:y.a,href:u.a.string,type:u.a.oneOf(["button","reset","submit"])},Y={active:!1,block:!1,disabled:!1},h=function(A){function t(){return c()(this,t),N()(this,A.apply(this,arguments))}return r()(t,A),t.prototype.renderAnchor=function(A,t){return s.a.createElement(w.a,o()({},A,{className:D()(t,A.disabled&&"disabled")}))},t.prototype.renderButton=function(A,t){var M=A.componentClass,e=i()(A,["componentClass"]),I=M||"button";return s.a.createElement(I,o()({},e,{type:e.type||"button",className:t}))},t.prototype.render=function(){var A,t=this.props,M=t.active,e=t.block,I=t.className,g=i()(t,["active","block","className"]),n=Object(x.splitBsProps)(g),E=n[0],c=n[1],T=o()({},Object(x.getClassSet)(E),(A={active:M},A[Object(x.prefix)(E,"block")]=e,A)),N=D()(I,T);return c.href?this.renderAnchor(c,N):this.renderButton(c,N)},t}(s.a.Component);h.propTypes=d,h.defaultProps=Y,t.a=Object(x.bsClass)("btn",Object(x.bsSizes)([j.c.LARGE,j.c.SMALL,j.c.XSMALL],Object(x.bsStyles)([].concat(I()(j.d),[j.e.DEFAULT,j.e.PRIMARY,j.e.LINK]),j.e.DEFAULT,h)))},function(A,t,M){var e=M(11),I=e["__core-js_shared__"]||(e["__core-js_shared__"]={});A.exports=function(A){return I[A]||(I[A]={})}},function(A,t,M){var e=M(32),I=M(22),g=M(66);A.exports=function(A){return function(t,M,i){var n,o=e(t),E=I(o.length),c=g(i,E);if(A&&M!=M){for(;E>c;)if((n=o[c++])!=n)return!0}else for(;E>c;c++)if((A||c in o)&&o[c]===M)return A||c||0;return!A&&-1}}},function(A,t){t.f=Object.getOwnPropertySymbols},function(A,t){A.exports=function(A,t,M){var e=void 0===M;switch(t.length){case 0:return e?A():A.call(M);case 1:return e?A(t[0]):A.call(M,t[0]);case 2:return e?A(t[0],t[1]):A.call(M,t[0],t[1]);case 3:return e?A(t[0],t[1],t[2]):A.call(M,t[0],t[1],t[2]);case 4:return e?A(t[0],t[1],t[2],t[3]):A.call(M,t[0],t[1],t[2],t[3])}return A.apply(M,t)}},function(A,t,M){var e=M(16),I=M(37),g=M(17)("match");A.exports=function(A){var t;return e(A)&&(void 0!==(t=A[g])?!!t:"RegExp"==I(A))}},function(A,t,M){var e=M(17)("iterator"),I=!1;try{var g=[7][e]();g.return=function(){I=!0},Array.from(g,function(){throw 2})}catch(A){}A.exports=function(A,t){if(!t&&!I)return!1;var M=!1;try{var g=[7],i=g[e]();i.next=function(){return{done:M=!0}},g[e]=function(){return i},A(g)}catch(A){}return M}},function(A,t,M){"use strict";var e=M(10);A.exports=function(){var A=e(this),t="";return A.global&&(t+="g"),A.ignoreCase&&(t+="i"),A.multiline&&(t+="m"),A.unicode&&(t+="u"),A.sticky&&(t+="y"),t}},function(A,t,M){"use strict";var e=M(29),I=M(30),g=M(12),i=M(38),n=M(17);A.exports=function(A,t,M){var o=n(A),E=M(i,o,""[A]),c=E[0],T=E[1];g(function(){var t={};return t[o]=function(){return 7},7!=""[A](t)})&&(I(String.prototype,A,c),e(RegExp.prototype,o,2==t?function(A,t){return T.call(A,this,t)}:function(A){return T.call(A,this)}))}},function(A,t,M){"use strict";var e=M(11),I=M(1),g=M(30),i=M(71),n=M(55),o=M(80),E=M(70),c=M(16),T=M(12),N=M(115),a=M(76),r=M(143);A.exports=function(A,t,M,C,D,B){var s=e[A],Q=s,u=D?"set":"add",l=Q&&Q.prototype,y={},x=function(A){var t=l[A];g(l,A,"delete"==A?function(A){return!(B&&!c(A))&&t.call(this,0===A?0:A)}:"has"==A?function(A){return!(B&&!c(A))&&t.call(this,0===A?0:A)}:"get"==A?function(A){return B&&!c(A)?void 0:t.call(this,0===A?0:A)}:"add"==A?function(A){return t.call(this,0===A?0:A),this}:function(A,M){return t.call(this,0===A?0Line truncated for(I=97;I<123;I++)M[String.fromCharCode(I)]=I-32;for(var I=48;I<58;I++)M[I-48]=I;for(I=1;I<13;I++)M["f"+I]=I+111;for(I=0;I<10;I++)M["numpad "+I]=I+96;var g=t.names=t.title={};for(I in M)g[M[I]]=I;for(var i in e)M[i]=e[i]},function(A,t,M){"use strict";function e(A){function t(t,M,e,I,g,i){var n=I||"<<anonymous>>",o=i||e;if(null==M[e])return t?new Error("Required "+g+" ` + "`" + `"+o+"` + "`" + ` was not specified in ` + "`" + `"+n+"` + "`" + `."):null;for(var E=arguments.length,c=Array(E>6?E-6:0),T=6;T<E;T++)c[T-6]=arguments[T];return A.apply(void 0,[M,e,n,g,o].concat(c))}var M=t.bind(null,!1);return M.isRequired=t.bind(null,!0),M}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";function e(A){return function(t,M,e,I,g){var i=e||"<<anonymous>>",n=g||M;if(null==t[M])return new Error("The "+I+" ` + "`" + `"+n+"` + "`" + ` is required to make ` + "`" + `"+i+"` + "`" + ` accessible for users of assistive technologies such as screen readers.");for(var o=arguments.length,E=Array(o>5?o-5:0),c=5;c<o;c++)E[c-5]=arguments[c];return A.apply(void 0,[t,M,e,I,g].concat(E))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";function e(A){return A&&A.ownerDocument||document}Object.defineProperty(t,"__esModule",{value:!0}),t.default=e,A.exports=t.default},function(A,t,M){"use strict";var e=M(62),I=M.n(e),g=M(7),i=M.n(g),n=M(6),o=M.n(n),E=M(2),c=M.n(E),T=M(3),N=M.n(T),a=M(4),r=M.n(a),C=M(5),D=M.n(C),B=M(0),s=M.n(B),Q=M(8),u=M.n(Q),l=M(15),y=M.n(l),x=M(9),j=M(25),w=M(40),d={active:u.a.bool,disabled:u.a.bool,block:u.a.bool,onClick:u.a.func,componentClass:y.a,href:u.a.string,type:u.a.oneOf(["button","reset","submit"])},Y={active:!1,block:!1,disabled:!1},h=function(A){function t(){return c()(this,t),N()(this,A.apply(this,arguments))}return r()(t,A),t.prototype.renderAnchor=function(A,t){return s.a.createElement(w.a,o()({},A,{className:D()(t,A.disabled&&"disabled")}))},t.prototype.renderButton=function(A,t){var M=A.componentClass,e=i()(A,["componentClass"]),I=M||"button";return s.a.createElement(I,o()({},e,{type:e.type||"button",className:t}))},t.prototype.render=function(){var A,t=this.props,M=t.active,e=t.block,I=t.className,g=i()(t,["active","block","className"]),n=Object(x.splitBsProps)(g),E=n[0],c=n[1],T=o()({},Object(x.getClassSet)(E),(A={active:M},A[Object(x.prefix)(E,"block")]=e,A)),N=D()(I,T);return c.href?this.renderAnchor(c,N):this.renderButton(c,N)},t}(s.a.Component);h.propTypes=d,h.defaultProps=Y,t.a=Object(x.bsClass)("btn",Object(x.bsSizes)([j.c.LARGE,j.c.SMALL,j.c.XSMALL],Object(x.bsStyles)([].concat(I()(j.d),[j.e.DEFAULT,j.e.PRIMARY,j.e.LINK]),j.e.DEFAULT,h)))},function(A,t,M){var e=M(11),I=e["__core-js_shared__"]||(e["__core-js_shared__"]={});A.exports=function(A){return I[A]||(I[A]={})}},function(A,t,M){var e=M(32),I=M(22),g=M(66);A.exports=function(A){return function(t,M,i){var n,o=e(t),E=I(o.length),c=g(i,E);if(A&&M!=M){for(;E>c;)if((n=o[c++])!=n)return!0}else for(;E>c;c++)if((A||c in o)&&o[c]===M)return A||c||0;return!A&&-1}}},function(A,t){t.f=Object.getOwnPropertySymbols},function(A,t){A.exports=function(A,t,M){var e=void 0===M;switch(t.length){case 0:return e?A():A.call(M);case 1:return e?A(t[0]):A.call(M,t[0]);case 2:return e?A(t[0],t[1]):A.call(M,t[0],t[1]);case 3:return e?A(t[0],t[1],t[2]):A.call(M,t[0],t[1],t[2]);case 4:return e?A(t[0],t[1],t[2],t[3]):A.call(M,t[0],t[1],t[2],t[3])}return A.apply(M,t)}},function(A,t,M){var e=M(16),I=M(37),g=M(17)("match");A.exports=function(A){var t;return e(A)&&(void 0!==(t=A[g])?!!t:"RegExp"==I(A))}},function(A,t,M){var e=M(17)("iterator"),I=!1;try{var g=[7][e]();g.return=function(){I=!0},Array.from(g,function(){throw 2})}catch(A){}A.exports=function(A,t){if(!t&&!I)return!1;var M=!1;try{var g=[7],i=g[e]();i.next=function(){return{done:M=!0}},g[e]=function(){return i},A(g)}catch(A){}return M}},function(A,t,M){"use strict";var e=M(10);A.exports=function(){var A=e(this),t="";return A.global&&(t+="g"),A.ignoreCase&&(t+="i"),A.multiline&&(t+="m"),A.unicode&&(t+="u"),A.sticky&&(t+="y"),t}},function(A,t,M){"use strict";var e=M(29),I=M(30),g=M(12),i=M(38),n=M(17);A.exports=function(A,t,M){var o=n(A),E=M(i,o,""[A]),c=E[0],T=E[1];g(function(){var t={};return t[o]=function(){return 7},7!=""[A](t)})&&(I(String.prototype,A,c),e(RegExp.prototype,o,2==t?function(A,t){return T.call(A,this,t)}:function(A){return T.call(A,this)}))}},function(A,t,M){"use strict";var e=M(11),I=M(1),g=M(30),i=M(71),n=M(55),o=M(80),E=M(70),c=M(16),T=M(12),N=M(115),a=M(76),r=M(143);A.exports=function(A,t,M,C,D,B){var s=e[A],Q=s,u=D?"set":"add",l=Q&&Q.prototype,y={},x=function(A){var t=l[A];g(l,A,"delete"==A?function(A){return!(B&&!c(A))&&t.call(this,0===A?0:A)}:"has"==A?function(A){return!(B&&!c(A))&&t.call(this,0===A?0:A)}:"get"==A?function(A){return B&&!c(A)?void 0:t.call(this,0===A?0:A)}:"add"==A?function(A){return t.call(this,0===A?0:A),this}:function(A,M){return t.call(this,0===A?0Line truncated
@@ -190,7 +190,7 @@ object-assign
(c) Sindre Sorhus (c) Sindre Sorhus
@license MIT @license MIT
*/ */
var I=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;A.exports=function(){try{if(!Object.assign)return!1;var A=new String("abc");if(A[5]="de","5"===Object.getOwnPropertyNames(A)[0])return!1;for(var t={},M=0;M<10;M++)t["_"+String.fromCharCode(M)]=M;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(A){return t[A]}).join(""))return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(A){e[A]=A}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},e)).join("")}catch(A){return!1}}()?Object.assign:function(A,t){for(var M,n,o=e(A),E=1;E<arguments.length;E++){M=Object(arguments[E]);for(var c in M)g.call(M,c)&&(o[c]=M[c]);if(I){n=I(M);for(var T=0;T<n.length;T++)i.call(M,n[T])&&(o[n[T]]=M[n[T]])}}return o}},function(A,t,M){"use strict";var e={};A.exports=e},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}t.__esModule=!0;var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},g=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},i=M(13),n=e(i),o=M(23),E=e(o),c=M(164),T=M(94),N=M(165),a=e(N),r=M(239),C=function(){try{return window.history.state||{}}catch(A){return{}}},D=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,E.default)(r.canUseDOM,"Browser history needs a DOM");var t=window.history,M=(0,r.supportsHistory)(),e=!(0,r.supportsPopStateOnHashChange)(),i=A.forceRefresh,o=void 0!==i&&i,N=A.getUserConfirmation,D=void 0===N?r.getConfirmation:N,B=A.keyLength,s=void 0===B?6:B,Q=A.basename?(0,T.stripTrailingSlash)((0,T.addLeadingSlash)(A.basename)):"",u=function(A){var t=A||{},M=t.key,e=t.state,I=window.location,g=I.pathname,i=I.search,o=I.hash,E=g+i+o;return(0,n.default)(!Q||(0,T.hasBasename)(E,Q),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+E+'" to begin with "'+Q+'".'),Q&&(E=(0,T.stripBasename)(E,Q)),(0,c.createLocation)(E,e,M)},l=function(){return Math.random().toString(36).substr(2,s)},y=(0,a.default)(),x=function(A){g(J,A),J.length=t.length,y.notifyListeners(J.location,J.action)},j=function(A){(0,r.isExtraneousPopstateEvent)(A)||Y(u(A.state))},w=function(){Y(u(C()))},d=!1,Y=function(A){if(d)d=!1,x();else{y.confirmTransitionTo(A,"POP",D,function(t){t?x({action:"POP",location:A}):h(A)})}},h=function(A){var t=J.location,M=S.indexOf(t.key);-1===M&&(M=0);var e=S.indexOf(A.key);-1===e&&(e=0);var I=M-e;I&&(d=!0,f(I))},L=u(C()),S=[L.key],z=function(A){return Q+(0,T.createPath)(A)},U=function(A,e){(0,n.default)(!("object"===(void 0===A?"undefined":I(A))&&void 0!==A.state&&void 0!==e),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var g=(0,c.createLocation)(A,e,l(),J.location);y.confirmTransitionTo(g,"PUSH",D,function(A){if(A){var e=z(g),I=g.key,i=g.state;if(M)if(t.pushState({key:I,state:i},null,e),o)window.location.href=e;else{var E=S.indexOf(J.location.key),c=S.slice(0,-1===E?0:E+1);c.push(g.key),S=c,x({action:"PUSH",location:g})}else(0,n.default)(void 0===i,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=e}})},p=function(A,e){(0,n.default)(!("object"===(void 0===A?"undefined":I(A))&&void 0!==A.state&&void 0!==e),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var g=(0,c.createLocation)(A,e,l(),J.location);y.confirmTransitionTo(g,"REPLACE",D,function(A){if(A){var e=z(g),I=g.key,i=g.state;if(M)if(t.replaceState({key:I,state:i},null,e),o)window.location.replace(e);else{var E=S.indexOf(J.location.key);-1!==E&&(S[E]=g.key),x({action:"REPLACE",location:g})}else(0,n.default)(void 0===i,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(e)}})},f=function(A){t.go(A)},F=function(){return f(-1)},m=function(){return f(1)},O=0,R=function(A){O+=A,1===O?((0,r.addEventListener)(window,"popstate",j),e&&(0,r.addEventListener)(window,"hashchange",w)):0===O&&((0,r.removeEventListener)(window,"popstate",j),e&&(0,r.removeEventListener)(window,"hashchange",w))},k=!1,G=function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=y.setPrompt(A);return k||(R(1),k=!0),function(){return k&&(k=!1,R(-1)),t()}},b=function(A){var t=y.appendListener(A);return R(1),function(){R(-1),t()}},J={length:t.length,action:"POP",location:L,createHref:z,push:U,replace:p,go:f,goBack:F,goForward:m,block:G,listen:b};return J};t.default=D},function(A,t,M){"use strict";function e(A){return"/"===A.charAt(0)}function I(A,t){for(var M=t,e=M+1,I=A.length;e<I;M+=1,e+=1)A[M]=A[e];A.pop()}fLine truncated var I=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;A.exports=function(){try{if(!Object.assign)return!1;var A=new String("abc");if(A[5]="de","5"===Object.getOwnPropertyNames(A)[0])return!1;for(var t={},M=0;M<10;M++)t["_"+String.fromCharCode(M)]=M;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(A){return t[A]}).join(""))return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(A){e[A]=A}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},e)).join("")}catch(A){return!1}}()?Object.assign:function(A,t){for(var M,n,o=e(A),E=1;E<arguments.length;E++){M=Object(arguments[E]);for(var c in M)g.call(M,c)&&(o[c]=M[c]);if(I){n=I(M);for(var T=0;T<n.length;T++)i.call(M,n[T])&&(o[n[T]]=M[n[T]])}}return o}},function(A,t,M){"use strict";var e={};A.exports=e},function(A,t,M){"use strict";function e(A){return A&&A.__esModule?A:{default:A}}t.__esModule=!0;var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},g=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},i=M(13),n=e(i),o=M(23),E=e(o),c=M(164),T=M(94),N=M(165),a=e(N),r=M(239),C=function(){try{return window.history.state||{}}catch(A){return{}}},D=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,E.default)(r.canUseDOM,"Browser history needs a DOM");var t=window.history,M=(0,r.supportsHistory)(),e=!(0,r.supportsPopStateOnHashChange)(),i=A.forceRefresh,o=void 0!==i&&i,N=A.getUserConfirmation,D=void 0===N?r.getConfirmation:N,B=A.keyLength,s=void 0===B?6:B,Q=A.basename?(0,T.stripTrailingSlash)((0,T.addLeadingSlash)(A.basename)):"",u=function(A){var t=A||{},M=t.key,e=t.state,I=window.location,g=I.pathname,i=I.search,o=I.hash,E=g+i+o;return(0,n.default)(!Q||(0,T.hasBasename)(E,Q),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+E+'" to begin with "'+Q+'".'),Q&&(E=(0,T.stripBasename)(E,Q)),(0,c.createLocation)(E,e,M)},l=function(){return Math.random().toString(36).substr(2,s)},y=(0,a.default)(),x=function(A){g(J,A),J.length=t.length,y.notifyListeners(J.location,J.action)},j=function(A){(0,r.isExtraneousPopstateEvent)(A)||Y(u(A.state))},w=function(){Y(u(C()))},d=!1,Y=function(A){if(d)d=!1,x();else{y.confirmTransitionTo(A,"POP",D,function(t){t?x({action:"POP",location:A}):h(A)})}},h=function(A){var t=J.location,M=S.indexOf(t.key);-1===M&&(M=0);var e=S.indexOf(A.key);-1===e&&(e=0);var I=M-e;I&&(d=!0,f(I))},L=u(C()),S=[L.key],z=function(A){return Q+(0,T.createPath)(A)},U=function(A,e){(0,n.default)(!("object"===(void 0===A?"undefined":I(A))&&void 0!==A.state&&void 0!==e),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var g=(0,c.createLocation)(A,e,l(),J.location);y.confirmTransitionTo(g,"PUSH",D,function(A){if(A){var e=z(g),I=g.key,i=g.state;if(M)if(t.pushState({key:I,state:i},null,e),o)window.location.href=e;else{var E=S.indexOf(J.location.key),c=S.slice(0,-1===E?0:E+1);c.push(g.key),S=c,x({action:"PUSH",location:g})}else(0,n.default)(void 0===i,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=e}})},p=function(A,e){(0,n.default)(!("object"===(void 0===A?"undefined":I(A))&&void 0!==A.state&&void 0!==e),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var g=(0,c.createLocation)(A,e,l(),J.location);y.confirmTransitionTo(g,"REPLACE",D,function(A){if(A){var e=z(g),I=g.key,i=g.state;if(M)if(t.replaceState({key:I,state:i},null,e),o)window.location.replace(e);else{var E=S.indexOf(J.location.key);-1!==E&&(S[E]=g.key),x({action:"REPLACE",location:g})}else(0,n.default)(void 0===i,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(e)}})},f=function(A){t.go(A)},F=function(){return f(-1)},m=function(){return f(1)},O=0,R=function(A){O+=A,1===O?((0,r.addEventListener)(window,"popstate",j),e&&(0,r.addEventListener)(window,"hashchange",w)):0===O&&((0,r.removeEventListener)(window,"popstate",j),e&&(0,r.removeEventListener)(window,"hashchange",w))},k=!1,G=function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=y.setPrompt(A);return k||(R(1),k=!0),function(){return k&&(k=!1,R(-1)),t()}},b=function(A){var t=y.appendListener(A);return R(1),function(){R(-1),t()}},J={length:t.length,action:"POP",location:L,createHref:z,push:U,replace:p,go:f,goBack:F,goForward:m,block:G,listen:b};return J};t.default=D},function(A,t,M){"use strict";function e(A){return"/"===A.charAt(0)}function I(A,t){for(var M=t,e=M+1,I=A.length;e<I;M+=1,e+=1)A[M]=A[e];A.pop()}fLine truncated
* react.production.min.js * react.production.min.js
* *
* Copyright (c) 2013-present, Facebook, Inc. * Copyright (c) 2013-present, Facebook, Inc.
@@ -212,7 +212,7 @@ var sM=M(0),QM=M(524),uM=M(234),lM=M(121),yM=M(525),xM=M(526),jM=M(527),wM=M(528
* Copyright(c) 2015 Douglas Christopher Wilson * Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed * MIT Licensed
*/ */
t.parse=e,t.serialize=I;var i=decodeURIComponent,n=encodeURIComponent,o=/; */,E=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},function(A,t,M){"use strict";function e(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var I=function(){function A(A,t){for(var M=0;M<t.length;M++){var e=t[M];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(A,e.key,e)}}return function(t,M,e){return M&&A(t.prototype,M),e&&A(t,e),t}}(),g=function(){function A(){e(this,A),this._data={}}return I(A,[{key:"getItem",value:function(A){return this._data.hasOwnProperty(A)?this._data[A]:void 0}},{key:"setItem",value:function(A,t){return this._data[A]=String(t)}},{key:"removeItem",value:function(A){return delete this._data[A]}},{key:"clear",value:function(){return this._data={}}}]),A}();t.default=g},function(A,t,M){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=M(45),I=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(e),g={show:!1,type:"danger"};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments[1];switch(t.type){case I.SET:return{show:!0,id:t.alert.id,type:t.alert.type,message:t.alert.message};case I.CLEAR:return t.alert&&t.alert.id!=A.id?A:g;default:return A}}},function(A,t,M){"use strict";function e(A){if(Array.isArray(A)){for(var t=0,M=Array(A.length);t<A.length;t++)M[t]=A[t];return M}return Array.from(A)}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},g=M(46),i=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(g),n=function(A,t){var M=A.findIndex(function(A){return A===t.bucket});return-1==M?A:[].concat(e(A.slice(0,M)),e(A.slice(M+1)))};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[],filter:"",currentBucket:"",showMakeBucketModal:!1,policies:[],showBucketPolicy:!1},t=arguments[1];switch(t.type){case i.SET_LIST:return I({},A,{list:t.buckets});case i.ADD:return I({},A,{list:[t.bucket].concat(e(A.list))});case i.REMOVE:return I({},A,{list:n(A.list,t)});case i.SET_FILTER:return I({},A,{filter:t.filter});case i.SET_CURRENT_BUCKET:return I({},A,{currentBucket:t.bucket});case i.SHOW_MAKE_BUCKET_MODAL:return I({},A,{showMakeBucketModal:t.show});case i.SET_POLICIES:return I({},A,{policies:t.policies});case i.SHOW_BUCKET_POLICY:return I({},A,{showBucketPolicy:t.show});default:return A}}},function(A,t,M){"use strict";function e(A){if(Array.isArray(A)){for(var t=0,M=Array(A.length);t<A.length;t++)M[t]=A[t];return M}return Array.from(A)}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},g=M(36),i=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(g),n=function(A,t,M){var I=A.findIndex(function(A){return M(A)===t});return-1==I?A:[].concat(e(A.slice(0,I)),e(A.slice(I+1)))};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[],sortBy:"",sortOrder:!1,currentPrefix:"",marker:"",isTruncated:!1,prefixWritable:!1,shareObject:{show:!1,object:"",url:""},checkedList:[]},t=arguments[1];switch(t.type){case i.SET_LIST:return I({},A,{list:t.objects,marker:t.marker,isTruncated:t.isTruncated});case i.APPEND_LIST:return I({},A,{list:[].concat(e(A.list),e(t.objects)),marker:t.marker,isTruncated:t.isTruncated});case i.REMOVE:return I({},A,{list:n(A.list,t.object,function(A){return A.name})});case i.SET_SORT_BY:return I({},A,{sortBy:t.sortBy});case i.SET_SORT_ORDER:return I({},A,{sortOrder:t.sortOrder});case i.SET_CURRENT_PREFIX:return I({},A,{currentPrefix:t.prefix,marker:"",isTruncated:!1});case i.SET_PREFIX_WRITABLE:return I({},A,{prefixWritable:t.prefixWritable});case i.SET_SHARE_OBJECT:return I({},A,{shareObject:{show:t.show,object:t.object,url:t.url}});case i.CHECKED_LIST_ADD:return I({},A,{checkedList:[].concat(e(A.checkedList),[t.object])});case i.CHECKED_LIST_REMOVE:return I({},A,{checkedList:n(A.checkedList,t.object,function(A){return A})});case i.CHECKED_LIST_RESET:return I({},A,{checkedList:[]});default:return A}}},function(A,t,M){"use strict";function e(A,t,M){return t in A?Object.defineProperty(A,t,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[t]=M,A}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[Line truncated t.parse=e,t.serialize=I;var i=decodeURIComponent,n=encodeURIComponent,o=/; */,E=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},function(A,t,M){"use strict";function e(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var I=function(){function A(A,t){for(var M=0;M<t.length;M++){var e=t[M];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(A,e.key,e)}}return function(t,M,e){return M&&A(t.prototype,M),e&&A(t,e),t}}(),g=function(){function A(){e(this,A),this._data={}}return I(A,[{key:"getItem",value:function(A){return this._data.hasOwnProperty(A)?this._data[A]:void 0}},{key:"setItem",value:function(A,t){return this._data[A]=String(t)}},{key:"removeItem",value:function(A){return delete this._data[A]}},{key:"clear",value:function(){return this._data={}}}]),A}();t.default=g},function(A,t,M){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=M(45),I=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(e),g={show:!1,type:"danger"};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments[1];switch(t.type){case I.SET:return{show:!0,id:t.alert.id,type:t.alert.type,message:t.alert.message};case I.CLEAR:return t.alert&&t.alert.id!=A.id?A:g;default:return A}}},function(A,t,M){"use strict";function e(A){if(Array.isArray(A)){for(var t=0,M=Array(A.length);t<A.length;t++)M[t]=A[t];return M}return Array.from(A)}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},g=M(46),i=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(g),n=function(A,t){var M=A.findIndex(function(A){return A===t.bucket});return-1==M?A:[].concat(e(A.slice(0,M)),e(A.slice(M+1)))};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[],filter:"",currentBucket:"",showMakeBucketModal:!1,policies:[],showBucketPolicy:!1},t=arguments[1];switch(t.type){case i.SET_LIST:return I({},A,{list:t.buckets});case i.ADD:return I({},A,{list:[t.bucket].concat(e(A.list))});case i.REMOVE:return I({},A,{list:n(A.list,t)});case i.SET_FILTER:return I({},A,{filter:t.filter});case i.SET_CURRENT_BUCKET:return I({},A,{currentBucket:t.bucket});case i.SHOW_MAKE_BUCKET_MODAL:return I({},A,{showMakeBucketModal:t.show});case i.SET_POLICIES:return I({},A,{policies:t.policies});case i.SHOW_BUCKET_POLICY:return I({},A,{showBucketPolicy:t.show});default:return A}}},function(A,t,M){"use strict";function e(A){if(Array.isArray(A)){for(var t=0,M=Array(A.length);t<A.length;t++)M[t]=A[t];return M}return Array.from(A)}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[e])}return A},g=M(36),i=function(A){if(A&&A.__esModule)return A;var t={};if(null!=A)for(var M in A)Object.prototype.hasOwnProperty.call(A,M)&&(t[M]=A[M]);return t.default=A,t}(g),n=function(A,t,M){var I=A.findIndex(function(A){return M(A)===t});return-1==I?A:[].concat(e(A.slice(0,I)),e(A.slice(I+1)))};t.default=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[],sortBy:"",sortOrder:!1,currentPrefix:"",marker:"",isTruncated:!1,prefixWritable:!1,shareObject:{show:!1,object:"",url:""},checkedList:[]},t=arguments[1];switch(t.type){case i.SET_LIST:return I({},A,{list:t.objects,marker:t.marker,isTruncated:t.isTruncated});case i.APPEND_LIST:return I({},A,{list:[].concat(e(A.list),e(t.objects)),marker:t.marker,isTruncated:t.isTruncated});case i.REMOVE:return I({},A,{list:n(A.list,t.object,function(A){return A.name})});case i.SET_SORT_BY:return I({},A,{sortBy:t.sortBy});case i.SET_SORT_ORDER:return I({},A,{sortOrder:t.sortOrder});case i.SET_CURRENT_PREFIX:return I({},A,{currentPrefix:t.prefix,marker:"",isTruncated:!1});case i.SET_PREFIX_WRITABLE:return I({},A,{prefixWritable:t.prefixWritable});case i.SET_SHARE_OBJECT:return I({},A,{shareObject:{show:t.show,object:t.object,url:t.url}});case i.CHECKED_LIST_ADD:return I({},A,{checkedList:[].concat(e(A.checkedList),[t.object])});case i.CHECKED_LIST_REMOVE:return I({},A,{checkedList:n(A.checkedList,t.object,function(A){return A})});case i.CHECKED_LIST_RESET:return I({},A,{checkedList:[]});default:return A}}},function(A,t,M){"use strict";function e(A,t,M){return t in A?Object.defineProperty(A,t,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[t]=M,A}Object.defineProperty(t,"__esModule",{value:!0});var I=Object.assign||function(A){for(var t=1;t<arguments.length;t++){var M=arguments[t];for(var e in M)Object.prototype.hasOwnProperty.call(M,e)&&(A[e]=M[Line truncated
* mime-types * mime-types
* Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson * Copyright(c) 2015 Douglas Christopher Wilson
@@ -225,17 +225,17 @@ var n=M(831),o=M(833).extname,E=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;t.charset
*/ */
A.exports=M(832)},function(A,t){A.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iaLine truncated A.exports=M(832)},function(A,t){A.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana"},"application/3gpp-ims+xml":{source:"iana"},"application/a2l":{source:"iana"},"application/activemessage":{source:"iana"},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana"},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",extensions:["atomsvc"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana"},"application/bacnet-xdd+zip":{source:"iana"},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana"},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana"},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/cbor":{source:"iana"},"application/ccmp+xml":{source:"iana"},"application/ccxml+xml":{source:"iana",extensions:["ccxml"]},"application/cdfx+xml":{source:"iana"},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana"},"application/cellml+xml":{source:"iana"},"application/cfw":{source:"iana"},"application/clue_info+xml":{source:"iana"},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana"},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana"},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana"},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana"},"application/cstadata+xml":{source:"iana"},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",extensions:["mpd"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana"},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana"},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/docbook+xml":{source:"apache",extensions:["dbk"]},"application/dskpp+xml":{source:"iana"},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/emergencycalldata.comment+xml":{source:"iana"},"application/emergencycalldata.control+xml":{source:"iana"},"application/emergencycalldata.deviceinfo+xml":{source:"iana"},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana"},"application/emergencycalldata.serviceinfo+xml":{source:"iana"},"application/emergencycalldata.subscriberinfo+xml":{source:"iana"},"application/emergencycalldata.veds+xml":{source:"iaLine truncated
func productionIndex_bundle20180416t183551zJsBytes() ([]byte, error) { func productionIndex_bundle20180523t091250zJsBytes() ([]byte, error) {
return _productionIndex_bundle20180416t183551zJs, nil return _productionIndex_bundle20180523t091250zJs, nil
} }
func productionIndex_bundle20180416t183551zJs() (*asset, error) { func productionIndex_bundle20180523t091250zJs() (*asset, error) {
bytes, err := productionIndex_bundle20180416t183551zJsBytes() bytes, err := productionIndex_bundle20180523t091250zJsBytes()
if err != nil { if err != nil {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/index_bundle-2018-04-16T18-35-51Z.js", size: 2806985, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/index_bundle-2018-05-23T09-12-50Z.js", size: 2806972, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -350,7 +350,7 @@ func productionLoaderCss() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/loader.css", size: 1738, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/loader.css", size: 1738, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -382,7 +382,7 @@ func productionLogoSvg() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/logo.svg", size: 1972, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/logo.svg", size: 1972, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -399,7 +399,7 @@ func productionSafariPng() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "production/safari.png", size: 4971, mode: os.FileMode(420), modTime: time.Unix(1523903781, 0)} info := bindataFileInfo{name: "production/safari.png", size: 4971, mode: os.FileMode(436), modTime: time.Unix(1527066786, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@@ -460,7 +460,7 @@ var _bindata = map[string]func() (*asset, error){
"production/favicon.ico": productionFaviconIco, "production/favicon.ico": productionFaviconIco,
"production/firefox.png": productionFirefoxPng, "production/firefox.png": productionFirefoxPng,
"production/index.html": productionIndexHTML, "production/index.html": productionIndexHTML,
"production/index_bundle-2018-04-16T18-35-51Z.js": productionIndex_bundle20180416t183551zJs, "production/index_bundle-2018-05-23T09-12-50Z.js": productionIndex_bundle20180523t091250zJs,
"production/loader.css": productionLoaderCss, "production/loader.css": productionLoaderCss,
"production/logo.svg": productionLogoSvg, "production/logo.svg": productionLogoSvg,
"production/safari.png": productionSafariPng, "production/safari.png": productionSafariPng,
@@ -512,7 +512,7 @@ var _bintree = &bintree{nil, map[string]*bintree{
"favicon.ico": {productionFaviconIco, map[string]*bintree{}}, "favicon.ico": {productionFaviconIco, map[string]*bintree{}},
"firefox.png": {productionFirefoxPng, map[string]*bintree{}}, "firefox.png": {productionFirefoxPng, map[string]*bintree{}},
"index.html": {productionIndexHTML, map[string]*bintree{}}, "index.html": {productionIndexHTML, map[string]*bintree{}},
"index_bundle-2018-04-16T18-35-51Z.js": {productionIndex_bundle20180416t183551zJs, map[string]*bintree{}}, "index_bundle-2018-05-23T09-12-50Z.js": {productionIndex_bundle20180523t091250zJs, map[string]*bintree{}},
"loader.css": {productionLoaderCss, map[string]*bintree{}}, "loader.css": {productionLoaderCss, map[string]*bintree{}},
"logo.svg": {productionLogoSvg, map[string]*bintree{}}, "logo.svg": {productionLogoSvg, map[string]*bintree{}},
"safari.png": {productionSafariPng, map[string]*bintree{}}, "safari.png": {productionSafariPng, map[string]*bintree{}},
@@ -576,6 +576,6 @@ func assetFS() *assetfs.AssetFS {
panic("unreachable") panic("unreachable")
} }
var UIReleaseTag = "RELEASE.2018-04-16T18-35-51Z" var UIReleaseTag = "RELEASE.2018-05-23T09-12-50Z"
var UICommitID = "ed5f2d899d914bf79f083d6b8efd8c13316b3374" var UICommitID = "c6429e7b0f050683636b4d247b361896f32b71df"
var UIVersion = "2018-04-16T18:35:51Z" var UIVersion = "2018-05-23T09:12:50Z"
+1 -1
View File
@@ -777,7 +777,7 @@ func (c cacheObjects) StorageInfo(ctx context.Context) (storageInfo StorageInfo)
if cfs == nil { if cfs == nil {
continue continue
} }
info, err := getDiskInfo((cfs.fsPath)) info, err := getDiskInfo(cfs.fsPath)
logger.GetReqInfo(ctx).AppendTags("cachePath", cfs.fsPath) logger.GetReqInfo(ctx).AppendTags("cachePath", cfs.fsPath)
logger.LogIf(ctx, err) logger.LogIf(ctx, err)
total += info.Total total += info.Total
+59
View File
@@ -0,0 +1,59 @@
/*
* Minio Cloud Storage, (C) 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cmd
import (
"context"
"time"
)
const (
usageCheckInterval = 12 * time.Hour // 12 hours
)
// getDiskUsage walks the file tree rooted at root, calling usageFn
// for each file or directory in the tree, including root.
func getDiskUsage(ctx context.Context, root string, usageFn usageFunc) error {
return walk(ctx, root+slashSeparator, usageFn)
}
type usageFunc func(ctx context.Context, entry string) error
// walk recursively descends path, calling walkFn.
func walk(ctx context.Context, path string, usageFn usageFunc) error {
if err := usageFn(ctx, path); err != nil {
return err
}
if !hasSuffix(path, slashSeparator) {
return nil
}
entries, err := readDir(path)
if err != nil {
return usageFn(ctx, path)
}
for _, entry := range entries {
fname := pathJoin(path, entry)
if err = walk(ctx, fname, usageFn); err != nil {
return err
}
}
return nil
}
+1 -1
View File
@@ -80,7 +80,7 @@ func TestNewMultipartUploadFaultyDisk(t *testing.T) {
} }
// Test with disk removed. // Test with disk removed.
fs.fsPath = filepath.Join(globalTestTmpDir, "minio-"+nextSuffix()) os.RemoveAll(disk)
if _, err := fs.NewMultipartUpload(context.Background(), bucketName, objectName, map[string]string{"X-Amz-Meta-xid": "3f"}); err != nil { if _, err := fs.NewMultipartUpload(context.Background(), bucketName, objectName, map[string]string{"X-Amz-Meta-xid": "3f"}); err != nil {
if !isSameType(err, BucketNotFound{}) { if !isSameType(err, BucketNotFound{}) {
t.Fatal("Unexpected error ", err) t.Fatal("Unexpected error ", err)
+61 -4
View File
@@ -26,6 +26,7 @@ import (
"sort" "sort"
"strings" "strings"
"sync" "sync"
"sync/atomic"
"time" "time"
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
@@ -63,6 +64,10 @@ type FSObjects struct {
// To manage the appendRoutine go-routines // To manage the appendRoutine go-routines
nsMutex *nsLockMap nsMutex *nsLockMap
// Disk usage metrics
totalUsed uint64
usageCheckInterval time.Duration
} }
// Represents the background append file. // Represents the background append file.
@@ -129,9 +134,10 @@ func NewFSObjectLayer(fsPath string) (ObjectLayer, error) {
rwPool: &fsIOPool{ rwPool: &fsIOPool{
readersMap: make(map[string]*lock.RLockedFile), readersMap: make(map[string]*lock.RLockedFile),
}, },
nsMutex: newNSLock(false), nsMutex: newNSLock(false),
listPool: newTreeWalkPool(globalLookupTimeout), listPool: newTreeWalkPool(globalLookupTimeout),
appendFileMap: make(map[string]*fsAppendFile), appendFileMap: make(map[string]*fsAppendFile),
usageCheckInterval: usageCheckInterval,
} }
// Once the filesystem has initialized hold the read lock for // Once the filesystem has initialized hold the read lock for
@@ -150,6 +156,7 @@ func NewFSObjectLayer(fsPath string) (ObjectLayer, error) {
return nil, uiErrUnableToReadFromBackend(err).Msg("Unable to initialize policy system") return nil, uiErrUnableToReadFromBackend(err).Msg("Unable to initialize policy system")
} }
go fs.diskUsage(globalServiceDoneCh)
go fs.cleanupStaleMultipartUploads(ctx, globalMultipartCleanupInterval, globalMultipartExpiry, globalServiceDoneCh) go fs.cleanupStaleMultipartUploads(ctx, globalMultipartCleanupInterval, globalMultipartExpiry, globalServiceDoneCh)
// Return successfully initialized object layer. // Return successfully initialized object layer.
@@ -164,14 +171,64 @@ func (fs *FSObjects) Shutdown(ctx context.Context) error {
return fsRemoveAll(ctx, pathJoin(fs.fsPath, minioMetaTmpBucket, fs.fsUUID)) return fsRemoveAll(ctx, pathJoin(fs.fsPath, minioMetaTmpBucket, fs.fsUUID))
} }
// diskUsage returns du information for the posix path, in a continuous routine.
func (fs *FSObjects) diskUsage(doneCh chan struct{}) {
ticker := time.NewTicker(fs.usageCheckInterval)
defer ticker.Stop()
var usage uint64
usageFn := func(ctx context.Context, entry string) error {
if hasSuffix(entry, slashSeparator) {
return nil
}
fi, err := fsStatFile(ctx, entry)
if err != nil {
return err
}
usage = usage + uint64(fi.Size())
return nil
}
if err := getDiskUsage(context.Background(), fs.fsPath, usageFn); err != nil {
return
}
atomic.StoreUint64(&fs.totalUsed, usage)
for {
select {
case <-doneCh:
return
case <-ticker.C:
usage = 0
usageFn = func(ctx context.Context, entry string) error {
if hasSuffix(entry, slashSeparator) {
return nil
}
fi, err := fsStatFile(ctx, entry)
if err != nil {
return err
}
usage = usage + uint64(fi.Size())
return nil
}
if err := getDiskUsage(context.Background(), fs.fsPath, usageFn); err != nil {
continue
}
atomic.StoreUint64(&fs.totalUsed, usage)
}
}
}
// StorageInfo - returns underlying storage statistics. // StorageInfo - returns underlying storage statistics.
func (fs *FSObjects) StorageInfo(ctx context.Context) StorageInfo { func (fs *FSObjects) StorageInfo(ctx context.Context) StorageInfo {
info, err := getDiskInfo((fs.fsPath)) info, err := getDiskInfo(fs.fsPath)
logger.GetReqInfo(ctx).AppendTags("path", fs.fsPath) logger.GetReqInfo(ctx).AppendTags("path", fs.fsPath)
logger.LogIf(ctx, err) logger.LogIf(ctx, err)
storageInfo := StorageInfo{ storageInfo := StorageInfo{
Total: info.Total, Total: info.Total,
Free: info.Free, Free: info.Free,
Used: atomic.LoadUint64(&fs.totalUsed),
} }
storageInfo.Backend.Type = FS storageInfo.Backend.Type = FS
return storageInfo return storageInfo
+1 -3
View File
@@ -18,8 +18,6 @@ package cmd
import ( import (
"sync" "sync"
"github.com/minio/minio/pkg/disk"
) )
// naughtyDisk wraps a POSIX disk and returns programmed errors // naughtyDisk wraps a POSIX disk and returns programmed errors
@@ -74,7 +72,7 @@ func (d *naughtyDisk) calcError() (err error) {
return nil return nil
} }
func (d *naughtyDisk) DiskInfo() (info disk.Info, err error) { func (d *naughtyDisk) DiskInfo() (info DiskInfo, err error) {
if err := d.calcError(); err != nil { if err := d.calcError(); err != nil {
return info, err return info, err
} }
+4 -4
View File
@@ -39,10 +39,10 @@ const (
// StorageInfo - represents total capacity of underlying storage. // StorageInfo - represents total capacity of underlying storage.
type StorageInfo struct { type StorageInfo struct {
// Total disk space. Total uint64 // Total disk space.
Total uint64 Free uint64 // Free available space.
// Free available disk space. Used uint64 // Used total used per tenant.
Free uint64
// Backend type. // Backend type.
Backend struct { Backend struct {
// Represents various backend types, currently on FS and Erasure. // Represents various backend types, currently on FS and Erasure.
+91 -2
View File
@@ -29,6 +29,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"syscall" "syscall"
"time"
humanize "github.com/dustin/go-humanize" humanize "github.com/dustin/go-humanize"
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
@@ -47,6 +48,11 @@ type posix struct {
diskPath string diskPath string
pool sync.Pool pool sync.Pool
connected bool connected bool
// Disk usage metrics
stopUsageCh chan struct{}
totalUsage uint64
usageCheckInterval time.Duration
} }
// checkPathLength - returns error if given path name length more than 255 // checkPathLength - returns error if given path name length more than 255
@@ -128,6 +134,7 @@ func isDirEmpty(dirname string) bool {
return false return false
} }
defer f.Close() defer f.Close()
// List one entry. // List one entry.
_, err = f.Readdirnames(1) _, err = f.Readdirnames(1)
if err != io.EOF { if err != io.EOF {
@@ -157,9 +164,14 @@ func newPosix(path string) (StorageAPI, error) {
return &b return &b
}, },
}, },
stopUsageCh: make(chan struct{}),
usageCheckInterval: usageCheckInterval,
} }
st.connected = true st.connected = true
go st.diskUsage()
// Success. // Success.
return st, nil return st, nil
} }
@@ -242,6 +254,7 @@ func (s *posix) String() string {
} }
func (s *posix) Close() error { func (s *posix) Close() error {
close(s.stopUsageCh)
s.connected = false s.connected = false
return nil return nil
} }
@@ -250,10 +263,26 @@ func (s *posix) IsOnline() bool {
return s.connected return s.connected
} }
// DiskInfo is an extended type which returns current
// disk usage per path.
type DiskInfo struct {
Total uint64
Free uint64
Used uint64
}
// DiskInfo provides current information about disk space usage, // DiskInfo provides current information about disk space usage,
// total free inodes and underlying filesystem. // total free inodes and underlying filesystem.
func (s *posix) DiskInfo() (info disk.Info, err error) { func (s *posix) DiskInfo() (info DiskInfo, err error) {
return getDiskInfo((s.diskPath)) di, err := getDiskInfo(s.diskPath)
if err != nil {
return info, err
}
return DiskInfo{
Total: di.Total,
Free: di.Free,
Used: atomic.LoadUint64(&s.totalUsage),
}, nil
} }
// getVolDir - will convert incoming volume names to // getVolDir - will convert incoming volume names to
@@ -285,6 +314,66 @@ func (s *posix) checkDiskFound() (err error) {
return err return err
} }
// diskUsage returns du information for the posix path, in a continuous routine.
func (s *posix) diskUsage() {
ticker := time.NewTicker(s.usageCheckInterval)
defer ticker.Stop()
var usage uint64
usageFn := func(ctx context.Context, entry string) error {
select {
case <-s.stopUsageCh:
return errWalkAbort
default:
if hasSuffix(entry, slashSeparator) {
return nil
}
fi, err := os.Stat(entry)
if err != nil {
return err
}
usage = usage + uint64(fi.Size())
return nil
}
}
if err := getDiskUsage(context.Background(), s.diskPath, usageFn); err != nil {
return
}
atomic.StoreUint64(&s.totalUsage, usage)
for {
select {
case <-s.stopUsageCh:
return
case <-globalServiceDoneCh:
return
case <-ticker.C:
usage = 0
usageFn = func(ctx context.Context, entry string) error {
select {
case <-s.stopUsageCh:
return errWalkAbort
default:
if hasSuffix(entry, slashSeparator) {
return nil
}
fi, err := os.Stat(entry)
if err != nil {
return err
}
usage = usage + uint64(fi.Size())
return nil
}
}
if err := getDiskUsage(context.Background(), s.diskPath, usageFn); err != nil {
continue
}
atomic.StoreUint64(&s.totalUsage, usage)
}
}
}
// Make a volume entry. // Make a volume entry.
func (s *posix) MakeVol(volume string) (err error) { func (s *posix) MakeVol(volume string) (err error) {
defer func() { defer func() {
+1 -3
View File
@@ -18,8 +18,6 @@ package cmd
import ( import (
"io" "io"
"github.com/minio/minio/pkg/disk"
) )
// StorageAPI interface. // StorageAPI interface.
@@ -30,7 +28,7 @@ type StorageAPI interface {
// Storage operations. // Storage operations.
IsOnline() bool // Returns true if disk is online. IsOnline() bool // Returns true if disk is online.
Close() error Close() error
DiskInfo() (info disk.Info, err error) DiskInfo() (info DiskInfo, err error)
// Volume operations. // Volume operations.
MakeVol(volume string) (err error) MakeVol(volume string) (err error)
+2 -4
View File
@@ -23,8 +23,6 @@ import (
"net/rpc" "net/rpc"
"path" "path"
"strings" "strings"
"github.com/minio/minio/pkg/disk"
) )
type networkStorage struct { type networkStorage struct {
@@ -164,10 +162,10 @@ func (n *networkStorage) call(handler string, args interface {
} }
// DiskInfo - fetch disk information for a remote disk. // DiskInfo - fetch disk information for a remote disk.
func (n *networkStorage) DiskInfo() (info disk.Info, err error) { func (n *networkStorage) DiskInfo() (info DiskInfo, err error) {
args := AuthRPCArgs{} args := AuthRPCArgs{}
if err = n.call("Storage.DiskInfoHandler", &args, &info); err != nil { if err = n.call("Storage.DiskInfoHandler", &args, &info); err != nil {
return disk.Info{}, err return DiskInfo{}, err
} }
return info, nil return info, nil
} }
+1 -2
View File
@@ -24,7 +24,6 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/disk"
) )
// Storage server implements rpc primitives to facilitate exporting a // Storage server implements rpc primitives to facilitate exporting a
@@ -39,7 +38,7 @@ type storageServer struct {
/// Storage operations handlers. /// Storage operations handlers.
// DiskInfoHandler - disk info handler is rpc wrapper for DiskInfo operation. // DiskInfoHandler - disk info handler is rpc wrapper for DiskInfo operation.
func (s *storageServer) DiskInfoHandler(args *AuthRPCArgs, reply *disk.Info) error { func (s *storageServer) DiskInfoHandler(args *AuthRPCArgs, reply *DiskInfo) error {
if err := args.IsAuthenticated(); err != nil { if err := args.IsAuthenticated(); err != nil {
return err return err
} }
+1 -3
View File
@@ -19,8 +19,6 @@ package cmd
import ( import (
"os" "os"
"testing" "testing"
"github.com/minio/minio/pkg/disk"
) )
type testStorageRPCServer struct { type testStorageRPCServer struct {
@@ -91,7 +89,7 @@ func TestStorageRPCInvalidToken(t *testing.T) {
Vol: "myvol", Vol: "myvol",
} }
// 1. DiskInfoHandler // 1. DiskInfoHandler
diskInfoReply := &disk.Info{} diskInfoReply := &DiskInfo{}
err = storageRPC.DiskInfoHandler(&badAuthRPCArgs, diskInfoReply) err = storageRPC.DiskInfoHandler(&badAuthRPCArgs, diskInfoReply)
errorIfInvalidToken(t, err) errorIfInvalidToken(t, err)
+1
View File
@@ -282,6 +282,7 @@ func (s *xlSets) StorageInfo(ctx context.Context) StorageInfo {
lstorageInfo := set.StorageInfo(ctx) lstorageInfo := set.StorageInfo(ctx)
storageInfo.Total = storageInfo.Total + lstorageInfo.Total storageInfo.Total = storageInfo.Total + lstorageInfo.Total
storageInfo.Free = storageInfo.Free + lstorageInfo.Free storageInfo.Free = storageInfo.Free + lstorageInfo.Free
storageInfo.Used = storageInfo.Used + lstorageInfo.Used
storageInfo.Backend.OnlineDisks = storageInfo.Backend.OnlineDisks + lstorageInfo.Backend.OnlineDisks storageInfo.Backend.OnlineDisks = storageInfo.Backend.OnlineDisks + lstorageInfo.Backend.OnlineDisks
storageInfo.Backend.OfflineDisks = storageInfo.Backend.OfflineDisks + lstorageInfo.Backend.OfflineDisks storageInfo.Backend.OfflineDisks = storageInfo.Backend.OfflineDisks + lstorageInfo.Backend.OfflineDisks
} }
+12 -6
View File
@@ -23,7 +23,6 @@ import (
"github.com/minio/minio/cmd/logger" "github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/bpool" "github.com/minio/minio/pkg/bpool"
"github.com/minio/minio/pkg/disk"
) )
// XL constants. // XL constants.
@@ -118,7 +117,7 @@ func (xl xlObjects) ClearLocks(ctx context.Context, volLocks []VolumeLockInfo) e
} }
// byDiskTotal is a collection satisfying sort.Interface. // byDiskTotal is a collection satisfying sort.Interface.
type byDiskTotal []disk.Info type byDiskTotal []DiskInfo
func (d byDiskTotal) Len() int { return len(d) } func (d byDiskTotal) Len() int { return len(d) }
func (d byDiskTotal) Swap(i, j int) { d[i], d[j] = d[j], d[i] } func (d byDiskTotal) Swap(i, j int) { d[i], d[j] = d[j], d[i] }
@@ -127,8 +126,8 @@ func (d byDiskTotal) Less(i, j int) bool {
} }
// getDisksInfo - fetch disks info across all other storage API. // getDisksInfo - fetch disks info across all other storage API.
func getDisksInfo(disks []StorageAPI) (disksInfo []disk.Info, onlineDisks int, offlineDisks int) { func getDisksInfo(disks []StorageAPI) (disksInfo []DiskInfo, onlineDisks int, offlineDisks int) {
disksInfo = make([]disk.Info, len(disks)) disksInfo = make([]DiskInfo, len(disks))
for i, storageDisk := range disks { for i, storageDisk := range disks {
if storageDisk == nil { if storageDisk == nil {
// Storage disk is empty, perhaps ignored disk or not available. // Storage disk is empty, perhaps ignored disk or not available.
@@ -154,8 +153,8 @@ func getDisksInfo(disks []StorageAPI) (disksInfo []disk.Info, onlineDisks int, o
// returns sorted disksInfo slice which has only valid entries. // returns sorted disksInfo slice which has only valid entries.
// i.e the entries where the total size of the disk is not stated // i.e the entries where the total size of the disk is not stated
// as 0Bytes, this means that the disk is not online or ignored. // as 0Bytes, this means that the disk is not online or ignored.
func sortValidDisksInfo(disksInfo []disk.Info) []disk.Info { func sortValidDisksInfo(disksInfo []DiskInfo) []DiskInfo {
var validDisksInfo []disk.Info var validDisksInfo []DiskInfo
for _, diskInfo := range disksInfo { for _, diskInfo := range disksInfo {
if diskInfo.Total == 0 { if diskInfo.Total == 0 {
continue continue
@@ -201,6 +200,13 @@ func getStorageInfo(disks []StorageAPI) StorageInfo {
Free: validDisksInfo[0].Free * availableDataDisks, Free: validDisksInfo[0].Free * availableDataDisks,
} }
// Combine all disks to get total usage.
var used uint64
for _, di := range validDisksInfo {
used = used + di.Used
}
storageInfo.Used = used
storageInfo.Backend.Type = Erasure storageInfo.Backend.Type = Erasure
storageInfo.Backend.OnlineDisks = onlineDisks storageInfo.Backend.OnlineDisks = onlineDisks
storageInfo.Backend.OfflineDisks = offlineDisks storageInfo.Backend.OfflineDisks = offlineDisks
+6 -8
View File
@@ -21,8 +21,6 @@ import (
"os" "os"
"reflect" "reflect"
"testing" "testing"
"github.com/minio/minio/pkg/disk"
) )
// TestStorageInfo - tests storage info. // TestStorageInfo - tests storage info.
@@ -55,18 +53,18 @@ func TestStorageInfo(t *testing.T) {
// Sort valid disks info. // Sort valid disks info.
func TestSortingValidDisks(t *testing.T) { func TestSortingValidDisks(t *testing.T) {
testCases := []struct { testCases := []struct {
disksInfo []disk.Info disksInfo []DiskInfo
validDisksInfo []disk.Info validDisksInfo []DiskInfo
}{ }{
// One of the disks is offline. // One of the disks is offline.
{ {
disksInfo: []disk.Info{ disksInfo: []DiskInfo{
{Total: 150, Free: 10}, {Total: 150, Free: 10},
{Total: 0, Free: 0}, {Total: 0, Free: 0},
{Total: 200, Free: 10}, {Total: 200, Free: 10},
{Total: 100, Free: 10}, {Total: 100, Free: 10},
}, },
validDisksInfo: []disk.Info{ validDisksInfo: []DiskInfo{
{Total: 100, Free: 10}, {Total: 100, Free: 10},
{Total: 150, Free: 10}, {Total: 150, Free: 10},
{Total: 200, Free: 10}, {Total: 200, Free: 10},
@@ -74,13 +72,13 @@ func TestSortingValidDisks(t *testing.T) {
}, },
// All disks are online. // All disks are online.
{ {
disksInfo: []disk.Info{ disksInfo: []DiskInfo{
{Total: 150, Free: 10}, {Total: 150, Free: 10},
{Total: 200, Free: 10}, {Total: 200, Free: 10},
{Total: 100, Free: 10}, {Total: 100, Free: 10},
{Total: 115, Free: 10}, {Total: 115, Free: 10},
}, },
validDisksInfo: []disk.Info{ validDisksInfo: []DiskInfo{
{Total: 100, Free: 10}, {Total: 100, Free: 10},
{Total: 115, Free: 10}, {Total: 115, Free: 10},
{Total: 150, Free: 10}, {Total: 150, Free: 10},
+3
View File
@@ -28,4 +28,7 @@ type Info struct {
Files uint64 Files uint64
Ffree uint64 Ffree uint64
FSType string FSType string
// Usage is calculated per tenant.
Usage uint64
} }
+44
View File
@@ -0,0 +1,44 @@
// +build ignore
/*
* Minio Cloud Storage, (C) 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package main
import (
"log"
"github.com/minio/minio/pkg/madmin"
)
func main() {
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
// dummy values, please replace them with original values.
// API requests are secure (HTTPS) if secure=true and insecure (HTTPS) otherwise.
// New returns an Minio Admin client object.
madmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true)
if err != nil {
log.Fatalln(err)
}
st, err := madmClnt.ServerInfo()
if err != nil {
log.Fatalln(err)
}
log.Println(st)
}
+4 -4
View File
@@ -44,10 +44,10 @@ type DriveInfo HealDriveInfo
// StorageInfo - represents total capacity of underlying storage. // StorageInfo - represents total capacity of underlying storage.
type StorageInfo struct { type StorageInfo struct {
// Total disk space. Total uint64 // Total disk space.
Total int64 Free uint64 // Free space available.
// Free available disk space. Used uint64 // Total used spaced per tenant.
Free int64
// Backend type. // Backend type.
Backend struct { Backend struct {
// Represents various backend types, currently on FS and Erasure. // Represents various backend types, currently on FS and Erasure.