文件操作 - ApiKeysPage.2427a858f877b88b2243.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/build/ApiKeysPage.2427a858f877b88b2243.js
编辑文件内容
/*! For license information please see ApiKeysPage.2427a858f877b88b2243.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"1LJY":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return e.timeZone}},IDhZ:function(e,t,n){"use strict";var r=n("MgzW"),a=n("q1tI");function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i="function"==typeof Symbol&&Symbol.for,l=i?Symbol.for("react.portal"):60106,u=i?Symbol.for("react.fragment"):60107,c=i?Symbol.for("react.strict_mode"):60108,s=i?Symbol.for("react.profiler"):60114,f=i?Symbol.for("react.provider"):60109,p=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.concurrent_mode"):60111,h=i?Symbol.for("react.forward_ref"):60112,m=i?Symbol.for("react.suspense"):60113,y=i?Symbol.for("react.suspense_list"):60120,v=i?Symbol.for("react.memo"):60115,g=i?Symbol.for("react.lazy"):60116,w=i?Symbol.for("react.fundamental"):60117,b=i?Symbol.for("react.scope"):60119,x=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case u:return"Fragment";case l:return"Portal";case s:return"Profiler";case c:return"StrictMode";case m:return"Suspense";case y:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case p:return"Context.Consumer";case f:return"Context.Provider";case h:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case v:return E(e.type);case g:if(e=1===e._status?e._result:null)return E(e)}return null}x.hasOwnProperty("ReactCurrentDispatcher")||(x.ReactCurrentDispatcher={current:null}),x.hasOwnProperty("ReactCurrentBatchConfig")||(x.ReactCurrentBatchConfig={suspense:null});var k={};function S(e,t){for(var n=0|e._threadCount;n<=t;n++)e[n]=e._currentValue2,e._threadCount=n+1}for(var A=new Uint16Array(16),C=0;15>C;C++)A[C]=C+1;A[15]=0;var N=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,O=Object.prototype.hasOwnProperty,F={},I={};function D(e){return!!O.call(I,e)||!O.call(F,e)&&(N.test(e)?I[e]=!0:(F[e]=!0,!1))}function _(e,t,n,r,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){P[e]=new _(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];P[t]=new _(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){P[e]=new _(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){P[e]=new _(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){P[e]=new _(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){P[e]=new _(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){P[e]=new _(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){P[e]=new _(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){P[e]=new _(e,5,!1,e.toLowerCase(),null,!1)}));var K=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(K,j);P[t]=new _(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(K,j);P[t]=new _(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(K,j);P[t]=new _(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){P[e]=new _(e,1,!1,e.toLowerCase(),null,!1)})),P.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){P[e]=new _(e,1,!1,e.toLowerCase(),null,!0)}));var T=/["'&<>]/;function R(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=T.exec(e);if(t){var n,r="",a=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==n&&(r+=e.substring(a,n)),a=n+1,r+=t}e=a!==n?r+e.substring(a,n):r}return e}function L(e,t){var n,r=P.hasOwnProperty(e)?P[e]:null;return(n="style"!==e)&&(n=null!==r?0===r.type:2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])),n||function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(e,t,r,!1)?"":null!==r?(e=r.attributeName,3===(n=r.type)||4===n&&!0===t?e+'=""':(r.sanitizeURL&&(t=""+t),e+'="'+R(t)+'"')):D(e)?e+'="'+R(t)+'"':""}var M="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},z=null,V=null,W=null,U=!1,q=!1,H=null,$=0;function Q(){if(null===z)throw Error(o(321));return z}function B(){if(0<$)throw Error(o(312));return{memoizedState:null,queue:null,next:null}}function Z(){return null===W?null===V?(U=!1,V=W=B()):(U=!0,W=V):null===W.next?(U=!1,W=W.next=B()):(U=!0,W=W.next),W}function G(e,t,n,r){for(;q;)q=!1,$+=1,W=null,n=e(t,r);return V=z=null,$=0,W=H=null,n}function Y(e,t){return"function"==typeof t?t(e):t}function J(e,t,n){if(z=Q(),W=Z(),U){var r=W.queue;if(t=r.dispatch,null!==H&&void 0!==(n=H.get(r))){H.delete(r),r=W.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return W.memoizedState=r,[r,t]}return[W.memoizedState,t]}return e=e===Y?"function"==typeof t?t():t:void 0!==n?n(t):t,W.memoizedState=e,e=(e=W.queue={last:null,dispatch:null}).dispatch=X.bind(null,z,e),[W.memoizedState,e]}function X(e,t,n){if(!(25>$))throw Error(o(301));if(e===z)if(q=!0,e={action:n,next:null},null===H&&(H=new Map),void 0===(n=H.get(t)))H.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function ee(){}var te=0,ne={readContext:function(e){var t=te;return S(e,t),e[t]},useContext:function(e){Q();var t=te;return S(e,t),e[t]},useMemo:function(e,t){if(z=Q(),t=void 0===t?null:t,null!==(W=Z())){var n=W.memoizedState;if(null!==n&&null!==t){e:{var r=n[1];if(null===r)r=!1;else{for(var a=0;a<r.length&&a<t.length;a++)if(!M(t[a],r[a])){r=!1;break e}r=!0}}if(r)return n[0]}}return e=e(),W.memoizedState=[e,t],e},useReducer:J,useRef:function(e){z=Q();var t=(W=Z()).memoizedState;return null===t?(e={current:e},W.memoizedState=e):t},useState:function(e){return J(Y,e)},useLayoutEffect:function(){},useCallback:function(e){return e},useImperativeHandle:ee,useEffect:ee,useDebugValue:ee,useResponder:function(e,t){return{props:t,responder:e}},useDeferredValue:function(e){return Q(),e},useTransition:function(){return Q(),[function(e){e()},!1]}},re="http://www.w3.org/1999/xhtml";function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var oe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ie=r({menuitem:!0},oe),le={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ue=["Webkit","ms","Moz","O"];Object.keys(le).forEach((function(e){ue.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),le[t]=le[e]}))}));var ce=/([A-Z])/g,se=/^ms-/,fe=a.Children.toArray,pe=x.ReactCurrentDispatcher,de={listing:!0,pre:!0,textarea:!0},he=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,me={},ye={};var ve=Object.prototype.hasOwnProperty,ge={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function we(e,t){if(void 0===e)throw Error(o(152,E(t)||"Component"))}function be(e,t,n){function i(a,i){var l=i.prototype&&i.prototype.isReactComponent,u=function(e,t,n,r){if(r&&("object"==typeof(r=e.contextType)&&null!==r))return S(r,n),r[n];if(e=e.contextTypes){for(var a in n={},e)n[a]=t[a];t=n}else t=k;return t}(i,t,n,l),c=[],s=!1,f={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){s=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(l){if(l=new i(a.props,u,f),"function"==typeof i.getDerivedStateFromProps){var p=i.getDerivedStateFromProps.call(null,a.props,l.state);null!=p&&(l.state=r({},l.state,p))}}else if(z={},l=i(a.props,u,f),null==(l=G(i,a.props,l,u))||null==l.render)return void we(e=l,i);if(l.props=a.props,l.context=u,l.updater=f,void 0===(f=l.state)&&(l.state=f=null),"function"==typeof l.UNSAFE_componentWillMount||"function"==typeof l.componentWillMount)if("function"==typeof l.componentWillMount&&"function"!=typeof i.getDerivedStateFromProps&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&"function"!=typeof i.getDerivedStateFromProps&&l.UNSAFE_componentWillMount(),c.length){f=c;var d=s;if(c=null,s=!1,d&&1===f.length)l.state=f[0];else{p=d?f[0]:l.state;var h=!0;for(d=d?1:0;d<f.length;d++){var m=f[d];null!=(m="function"==typeof m?m.call(l,p,a.props,u):m)&&(h?(h=!1,p=r({},p,m)):r(p,m))}l.state=p}}else c=null;if(we(e=l.render(),i),"function"==typeof l.getChildContext&&"object"==typeof(a=i.childContextTypes)){var y=l.getChildContext();for(var v in y)if(!(v in a))throw Error(o(108,E(i)||"Unknown",v))}y&&(t=r({},t,y))}for(;a.isValidElement(e);){var l=e,u=l.type;if("function"!=typeof u)break;i(l,u)}return{child:e,context:t}}var xe=function(){function e(e,t){a.isValidElement(e)?e.type!==u?e=[e]:(e=e.props.children,e=a.isValidElement(e)?[e]:fe(e)):e=fe(e),e={type:null,domNamespace:re,children:e,childIndex:0,context:k,footer:""};var n=A[0];if(0===n){var r=A,i=2*(n=r.length);if(!(65536>=i))throw Error(o(304));var l=new Uint16Array(i);for(l.set(r),(A=l)[0]=n+1,r=n;r<i-1;r++)A[r]=r+1;A[i-1]=0}else A[0]=A[n];this.threadID=n,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=t,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}var t=e.prototype;return t.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var e=this.threadID;A[e]=A[0],A[0]=e}},t.pushProvider=function(e){var t=++this.contextIndex,n=e.type._context,r=this.threadID;S(n,r);var a=n[r];this.contextStack[t]=n,this.contextValueStack[t]=a,n[r]=e.props.value},t.popProvider=function(){var e=this.contextIndex,t=this.contextStack[e],n=this.contextValueStack[e];this.contextStack[e]=null,this.contextValueStack[e]=null,this.contextIndex--,t[this.threadID]=n},t.clearProviders=function(){for(var e=this.contextIndex;0<=e;e--)this.contextStack[e][this.threadID]=this.contextValueStack[e]},t.read=function(e){if(this.exhausted)return null;var t=te;te=this.threadID;var n=pe.current;pe.current=ne;try{for(var r=[""],a=!1;r[0].length<e;){if(0===this.stack.length){this.exhausted=!0;var i=this.threadID;A[i]=A[0],A[0]=i;break}var l=this.stack[this.stack.length-1];if(a||l.childIndex>=l.children.length){var u=l.footer;if(""!==u&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===l.type)this.currentSelectValue=null;else if(null!=l.type&&null!=l.type.type&&l.type.type.$$typeof===f)this.popProvider(l.type);else if(l.type===m){this.suspenseDepth--;var c=r.pop();if(a){a=!1;var s=l.fallbackFrame;if(!s)throw Error(o(303));this.stack.push(s),r[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}r[this.suspenseDepth]+=c}r[this.suspenseDepth]+=u}else{var p=l.children[l.childIndex++],d="";try{d+=this.render(p,l.context,l.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(o(294));throw e}r.length<=this.suspenseDepth&&r.push(""),r[this.suspenseDepth]+=d}}return r[0]}finally{pe.current=n,te=t}},t.render=function(e,t,n){if("string"==typeof e||"number"==typeof e)return""===(n=""+e)?"":this.makeStaticMarkup?R(n):this.previousWasTextNode?"\x3c!-- --\x3e"+R(n):(this.previousWasTextNode=!0,R(n));if(e=(t=be(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!a.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((n=e.$$typeof)===l)throw Error(o(257));throw Error(o(258,n.toString()))}return e=fe(e),this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),""}var i=e.type;if("string"==typeof i)return this.renderDOM(e,t,n);switch(i){case c:case d:case s:case y:case u:return e=fe(e.props.children),this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),"";case m:throw Error(o(294))}if("object"==typeof i&&null!==i)switch(i.$$typeof){case h:z={};var x=i.render(e.props,e.ref);return x=G(i.render,e.props,x,e.ref),x=fe(x),this.stack.push({type:null,domNamespace:n,children:x,childIndex:0,context:t,footer:""}),"";case v:return e=[a.createElement(i.type,r({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),"";case f:return n={type:e,domNamespace:n,children:i=fe(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(n),"";case p:i=e.type,x=e.props;var E=this.threadID;return S(i,E),i=fe(x.children(i[E])),this.stack.push({type:e,domNamespace:n,children:i,childIndex:0,context:t,footer:""}),"";case w:throw Error(o(338));case g:switch(function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i=e.type),i._status){case 1:return e=[a.createElement(i._result,r({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:n,children:e,childIndex:0,context:t,footer:""}),"";case 2:throw i._result;default:throw Error(o(295))}case b:throw Error(o(343))}throw Error(o(130,null==i?i:typeof i,""))},t.renderDOM=function(e,t,n){var i=e.type.toLowerCase();if(n===re&&ae(i),!me.hasOwnProperty(i)){if(!he.test(i))throw Error(o(65,i));me[i]=!0}var l=e.props;if("input"===i)l=r({type:void 0},l,{defaultChecked:void 0,defaultValue:void 0,value:null!=l.value?l.value:l.defaultValue,checked:null!=l.checked?l.checked:l.defaultChecked});else if("textarea"===i){var u=l.value;if(null==u){u=l.defaultValue;var c=l.children;if(null!=c){if(null!=u)throw Error(o(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(o(93));c=c[0]}u=""+c}null==u&&(u="")}l=r({},l,{value:void 0,children:""+u})}else if("select"===i)this.currentSelectValue=null!=l.value?l.value:l.defaultValue,l=r({},l,{value:void 0});else if("option"===i){c=this.currentSelectValue;var s=function(e){if(null==e)return e;var t="";return a.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(l.children);if(null!=c){var f=null!=l.value?l.value+"":s;if(u=!1,Array.isArray(c)){for(var p=0;p<c.length;p++)if(""+c[p]===f){u=!0;break}}else u=""+c===f;l=r({selected:void 0,children:void 0},l,{selected:u,children:s})}}if(u=l){if(ie[i]&&(null!=u.children||null!=u.dangerouslySetInnerHTML))throw Error(o(137,i,""));if(null!=u.dangerouslySetInnerHTML){if(null!=u.children)throw Error(o(60));if(!("object"==typeof u.dangerouslySetInnerHTML&&"__html"in u.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=u.style&&"object"!=typeof u.style)throw Error(o(62,""))}for(b in u=l,c=this.makeStaticMarkup,s=1===this.stack.length,f="<"+e.type,u)if(ve.call(u,b)){var d=u[b];if(null!=d){if("style"===b){p=void 0;var h="",m="";for(p in d)if(d.hasOwnProperty(p)){var y=0===p.indexOf("--"),v=d[p];if(null!=v){if(y)var g=p;else if(g=p,ye.hasOwnProperty(g))g=ye[g];else{var w=g.replace(ce,"-$1").toLowerCase().replace(se,"-ms-");g=ye[g]=w}h+=m+g+":",m=p,h+=y=null==v||"boolean"==typeof v||""===v?"":y||"number"!=typeof v||0===v||le.hasOwnProperty(m)&&le[m]?(""+v).trim():v+"px",m=";"}}d=h||null}p=null;e:if(y=i,v=u,-1===y.indexOf("-"))y="string"==typeof v.is;else switch(y){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":y=!1;break e;default:y=!0}y?ge.hasOwnProperty(b)||(p=D(p=b)&&null!=d?p+'="'+R(d)+'"':""):p=L(b,d),p&&(f+=" "+p)}}c||s&&(f+=' data-reactroot=""');var b=f;u="",oe.hasOwnProperty(i)?b+="/>":(b+=">",u="</"+e.type+">");e:{if(null!=(c=l.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"==typeof(c=l.children)||"number"==typeof c){c=R(c);break e}c=null}return null!=c?(l=[],de[i]&&"\n"===c.charAt(0)&&(b+="\n"),b+=c):l=fe(l.children),e=e.type,n=null==n||"http://www.w3.org/1999/xhtml"===n?ae(e):"http://www.w3.org/2000/svg"===n&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":n,this.stack.push({domNamespace:n,type:i,children:l,childIndex:0,context:t,footer:u}),this.previousWasTextNode=!1,b},e}(),Ee={renderToString:function(e){e=new xe(e,!1);try{return e.read(1/0)}finally{e.destroy()}},renderToStaticMarkup:function(e){e=new xe(e,!0);try{return e.read(1/0)}finally{e.destroy()}},renderToNodeStream:function(){throw Error(o(207))},renderToStaticNodeStream:function(){throw Error(o(208))},version:"16.12.0"},ke={default:Ee},Se=ke&&Ee||ke;e.exports=Se.default||Se},KAy6:function(e,t,n){"use strict";e.exports=n("IDhZ")},Q1xo:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var r=function(e){return e.keys.length},a=function(e){var t=RegExp(e.searchQuery,"i");return e.keys.filter((function(e){return t.test(e.name)||t.test(e.role)}))}},m0s0:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n("NXk7"),a=n("Gz/h");function o(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function l(e){o(i,r,a,l,u,"next",e)}function u(e){o(i,r,a,l,u,"throw",e)}l(void 0)}))}}function l(e,t,n){return function(){var o=i(regeneratorRuntime.mark((function o(i){var l;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(r.c)().post("/api/auth/keys",e);case 2:l=o.sent,i(Object(a.c)("")),i(u(n)),t(l.key);case 6:case"end":return o.stop()}}),o)})));return function(e){return o.apply(this,arguments)}}()}function u(e){return function(){var t=i(regeneratorRuntime.mark((function t(n){var o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(r.c)().get("/api/auth/keys?includeExpired="+e);case 2:o=t.sent,n(Object(a.a)(o));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}function c(e,t){return function(){var n=i(regeneratorRuntime.mark((function n(a){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:Object(r.c)().delete("/api/auth/keys/".concat(e)).then((function(){return a(u(t))}));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}},pSIq:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ApiKeysPage",(function(){return V}));var r=n("q1tI"),a=n.n(r),o=n("KAy6"),i=n.n(o),l=n("/MKj"),u=n("0cfB"),c=n("GQ3c"),s=n("lzJ5"),f=n("Q1xo"),p=n("m0s0"),d=n("ZGyg"),h=n("BVom"),m=n("qx0y"),y=n("ZFWI"),v=n("Xmxp"),g=n("QQVG"),w=n("kDLi"),b=n("Obii"),x=n("EKT6"),E=n("iODs"),k=n("PbtU"),S=n("1LJY"),A=n("Gz/h");function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function I(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){F(o,r,a,i,l,"next",e)}function l(e){F(o,r,a,i,l,"throw",e)}i(void 0)}))}}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T,R=w.LegacyForms.Input,L=w.LegacyForms.Switch,M=j({},w.EventsWithValidation.onBlur,[{rule:function(e){if(!e)return!0;try{return k.a.interval_to_seconds(e),!0}catch(e){return!1}},errorMessage:"Not a valid duration"}]);!function(e){e.Name="name",e.Role="role",e.SecondsToLive="secondsToLive"}(T||(T={}));var z={name:"",role:c.OrgRole.Viewer,secondsToLive:""},V=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=_(this,P(t).call(this,e))).onSearchQueryChange=function(e){n.props.setSearchQuery(e)},n.onIncludeExpiredChange=function(e){n.setState({hasFetched:!1,includeExpired:e},n.fetchApiKeys)},n.onToggleAdding=function(){n.setState({isAdding:!n.state.isAdding})},n.onAddApiKey=function(){var e=I(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),r=function(e){var t=window.location.origin+y.b.appSubUrl,n=i.a.renderToString(a.a.createElement(m.a,{apiKey:e,rootPath:t}));v.b.emit(c.CoreEvents.showModal,{templateHtml:n})},o=n.state.newApiKey.secondsToLive,n.state.newApiKey.secondsToLive=o?k.a.interval_to_seconds(o):null,n.props.addApiKey(n.state.newApiKey,r,n.props.includeExpired),n.setState((function(e){return O({},e,{newApiKey:z,isAdding:!1})}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.onApiKeyStateUpdate=function(e,t){var r=e.currentTarget.value;n.setState((function(e){var n=O({},e.newApiKey);return n[t]=r,O({},e,{newApiKey:n})}))},n.state={isAdding:!1,newApiKey:z,includeExpired:!1},n}var n,r,o,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&K(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.fetchApiKeys()}},{key:"fetchApiKeys",value:(l=I(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.loadApiKeys(this.state.includeExpired);case 2:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"onDeleteApiKey",value:function(e){this.props.deleteApiKey(e.id,this.props.includeExpired)}},{key:"renderEmptyList",value:function(){var e=this.state.isAdding;return a.a.createElement(a.a.Fragment,null,!e&&a.a.createElement(g.a,{title:"You haven't added any API Keys yet.",buttonIcon:"key-skeleton-alt",buttonLink:"#",onClick:this.onToggleAdding,buttonTitle:" New API Key",proTip:"Remember you can provide view-only API access to other applications."}),this.renderAddApiKeyForm())}},{key:"formatDate",value:function(e,t){if(!e)return"No expiration date";var n=Object(S.a)(E.d.getState().user);return Object(b.dateTimeFormat)(e,{format:t,timeZone:n})}},{key:"renderAddApiKeyForm",value:function(){var e=this,t=this.state,n=t.newApiKey,r=t.isAdding;return a.a.createElement(h.a,{in:r},a.a.createElement("div",{className:"cta-form"},a.a.createElement(w.IconButton,{name:"times",className:"cta-form__close btn btn-transparent",onClick:this.onToggleAdding}),a.a.createElement("h5",null,"Add API Key"),a.a.createElement("form",{className:"gf-form-group",onSubmit:this.onAddApiKey},a.a.createElement("div",{className:"gf-form-inline"},a.a.createElement("div",{className:"gf-form max-width-21"},a.a.createElement("span",{className:"gf-form-label"},"Key name"),a.a.createElement(R,{type:"text",className:"gf-form-input",value:n.name,placeholder:"Name",onChange:function(t){return e.onApiKeyStateUpdate(t,T.Name)}})),a.a.createElement("div",{className:"gf-form"},a.a.createElement("span",{className:"gf-form-label"},"Role"),a.a.createElement("span",{className:"gf-form-select-wrapper"},a.a.createElement("select",{className:"gf-form-input gf-size-auto",value:n.role,onChange:function(t){return e.onApiKeyStateUpdate(t,T.Role)}},Object.keys(c.OrgRole).map((function(e){return a.a.createElement("option",{key:e,label:e,value:e},e)}))))),a.a.createElement("div",{className:"gf-form max-width-21"},a.a.createElement(w.InlineFormLabel,{tooltip:"The api key life duration. For example 1d if your key is going to last for one day. All the supported units are: s,m,h,d,w,M,y"},"Time to live"),a.a.createElement(R,{type:"text",className:"gf-form-input",placeholder:"1d",validationEvents:M,value:n.secondsToLive,onChange:function(t){return e.onApiKeyStateUpdate(t,T.SecondsToLive)}})),a.a.createElement("div",{className:"gf-form"},a.a.createElement("button",{className:"btn gf-form-btn btn-primary"},"Add"))))))}},{key:"renderApiKeyList",value:function(){var e=this,t=this.state.isAdding,n=this.props,r=n.apiKeys,o=n.searchQuery,i=n.includeExpired;return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"page-action-bar"},a.a.createElement("div",{className:"gf-form gf-form--grow"},a.a.createElement(x.a,{labelClassName:"gf-form--has-input-icon gf-form--grow",inputClassName:"gf-form-input",placeholder:"Search keys",value:o,onChange:this.onSearchQueryChange})),a.a.createElement("div",{className:"page-action-bar__spacer"}),a.a.createElement("button",{className:"btn btn-primary pull-right",onClick:this.onToggleAdding,disabled:t},"Add API key")),this.renderAddApiKeyForm(),a.a.createElement("h3",{className:"page-heading"},"Existing Keys"),a.a.createElement(L,{label:"Show expired",checked:i,onChange:function(t){e.onIncludeExpiredChange(t.target.checked)}}),a.a.createElement("table",{className:"filter-table"},a.a.createElement("thead",null,a.a.createElement("tr",null,a.a.createElement("th",null,"Name"),a.a.createElement("th",null,"Role"),a.a.createElement("th",null,"Expires"),a.a.createElement("th",{style:{width:"34px"}}))),r.length>0?a.a.createElement("tbody",null,r.map((function(t){return a.a.createElement("tr",{key:t.id},a.a.createElement("td",null,t.name),a.a.createElement("td",null,t.role),a.a.createElement("td",null,e.formatDate(t.expiration)),a.a.createElement("td",null,a.a.createElement(w.DeleteButton,{size:"sm",onConfirm:function(){return e.onDeleteApiKey(t)}})))}))):null))}},{key:"render",value:function(){var e=this.props,t=e.hasFetched,n=e.navModel,r=e.apiKeysCount;return a.a.createElement(d.a,{navModel:n},a.a.createElement(d.a.Contents,{isLoading:!t},t&&(r>0?this.renderApiKeyList():this.renderEmptyList())))}}])&&D(n.prototype,r),o&&D(n,o),t}(r.PureComponent);var W={loadApiKeys:p.c,deleteApiKey:p.b,setSearchQuery:A.c,addApiKey:p.a};t.default=Object(u.hot)(e)(Object(l.connect)((function(e){return{navModel:Object(s.a)(e.navIndex,"apikeys"),apiKeys:Object(f.a)(e.apiKeys),searchQuery:e.apiKeys.searchQuery,includeExpired:e.includeExpired,apiKeysCount:Object(f.b)(e.apiKeys),hasFetched:e.apiKeys.hasFetched}}),W)(V))}.call(this,n("3UD+")(e))},qx0y:function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r),o=n("kDLi");t.a=function(e){return a.a.createElement("div",{className:"modal-body"},a.a.createElement("div",{className:"modal-header"},a.a.createElement("h2",{className:"modal-header-title"},a.a.createElement(o.Icon,{name:"key-skeleton-alt",size:"lg"}),a.a.createElement("span",{className:"p-l-1"},"API Key Created")),a.a.createElement("a",{className:"modal-header-close","ng-click":"dismiss();"},a.a.createElement(o.Icon,{name:"times"}))),a.a.createElement("div",{className:"modal-content"},a.a.createElement("div",{className:"gf-form-group"},a.a.createElement("div",{className:"gf-form"},a.a.createElement("span",{className:"gf-form-label"},"Key"),a.a.createElement("span",{className:"gf-form-label"},e.apiKey))),a.a.createElement("div",{className:"grafana-info-box",style:{border:0}},"You will only be able to view this key here once! It is not stored in this form. So be sure to copy it now.",a.a.createElement("br",null),a.a.createElement("br",null),"You can authenticate request using the Authorization HTTP header, example:",a.a.createElement("br",null),a.a.createElement("br",null),a.a.createElement("pre",{className:"small"},'curl -H "Authorization: Bearer ',e.apiKey,'" ',e.rootPath,"/api/dashboards/home"))))}}}]); //# sourceMappingURL=ApiKeysPage.2427a858f877b88b2243.js.map
修改文件时间
将文件时间修改为当前时间的前一年
删除文件