All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.6e61897c-116.472622149827c1587209.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
{"version":3,"sources":["webpack:///./src/pages/StartPage.jsx"],"names":["CurrentUserStore","StoreProvider","getStore","GettingStartedStore","GettingStartedActions","ActionsProvider","getActions","StartPage","createReactClass","displayName","mixins","Reflux","connect","listenTo","getInitialState","gettingStarted","undefined","componentDidMount","getStatus","reload","componentDidUpdate","this","_isLoading","_redirectToStartpage","onGettingStartedUpdate","state","setState","status","_redirect","page","history","replace","currentUser","startpage","permissions","PermissionsMixin","isPermitted","show","Routes","GETTING_STARTED","Object","keys","length","type","stream_search","id","dashboard_show","SEARCH","render"],"mappings":"8GAAA,sLA2BMA,EAAmBC,IAAcC,SAAS,eAC1CC,EAAsBF,IAAcC,SAAS,kBAC7CE,EAAwBC,IAAgBC,WAAW,kBAEnDC,EAAYC,IAAiB,CACjCC,YAAa,YACbC,OAAQ,CAACC,IAAOC,QAAQZ,GAAmBW,IAAOE,SAASV,EAAqB,2BAEhFW,gBAJiC,WAK/B,MAAO,CACLC,oBAAgBC,IAIpBC,kBAViC,WAW/Bb,EAAsBc,YACtBlB,EAAiBmB,UAGnBC,mBAfiC,WAgB1BC,KAAKC,cACRD,KAAKE,wBAITC,uBArBiC,SAqBVC,GACrBJ,KAAKK,SAAS,CAAEX,eAAgBU,EAAME,UAGxCC,UAzBiC,SAyBvBC,GACRC,IAAQC,QAAQF,IAGlBN,qBA7BiC,WA6BV,MAC+CF,KAAKI,MADpD,IACbO,YAAeC,EADF,EACEA,UAAWC,EADb,EACaA,YAAenB,EAD5B,EAC4BA,eAG7CoB,IAAiBC,YAAYF,EAAa,CAAC,mBACzCnB,EAAesB,KACjBhB,KAAKO,UAAUU,IAAOC,iBAOR,OAAdN,GAAsBO,OAAOC,KAAKR,GAAWS,OAAS,EACjC,WAAnBT,EAAUU,KACZtB,KAAKO,UAAUU,IAAOM,cAAcX,EAAUY,KAE9CxB,KAAKO,UAAUU,IAAOQ,eAAeb,EAAUY,KAMnDxB,KAAKO,UAAUU,IAAOS,SAGxBzB,WAvDiC,WAuDpB,MAC6BD,KAAKI,MAArCO,EADG,EACHA,YAAajB,EADV,EACUA,eAErB,OAAQiB,IAAgBjB,GAG1BiC,OA7DiC,WA8D/B,OAAO,kBAAC,KAAD,SAIIzC","file":"6e61897c-116.472622149827c1587209.js","sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\nimport createReactClass from 'create-react-class';\nimport Reflux from 'reflux';\n\nimport { Spinner } from 'components/common';\nimport Routes from 'routing/Routes';\nimport history from 'util/History';\nimport PermissionsMixin from 'util/PermissionsMixin';\nimport StoreProvider from 'injection/StoreProvider';\nimport ActionsProvider from 'injection/ActionsProvider';\n\nconst CurrentUserStore = StoreProvider.getStore('CurrentUser');\nconst GettingStartedStore = StoreProvider.getStore('GettingStarted');\nconst GettingStartedActions = ActionsProvider.getActions('GettingStarted');\n\nconst StartPage = createReactClass({\n  displayName: 'StartPage',\n  mixins: [Reflux.connect(CurrentUserStore), Reflux.listenTo(GettingStartedStore, 'onGettingStartedUpdate')],\n\n  getInitialState() {\n    return {\n      gettingStarted: undefined,\n    };\n  },\n\n  componentDidMount() {\n    GettingStartedActions.getStatus();\n    CurrentUserStore.reload();\n  },\n\n  componentDidUpdate() {\n    if (!this._isLoading()) {\n      this._redirectToStartpage();\n    }\n  },\n\n  onGettingStartedUpdate(state) {\n    this.setState({ gettingStarted: state.status });\n  },\n\n  _redirect(page) {\n    history.replace(page);\n  },\n\n  _redirectToStartpage() {\n    const { currentUser: { startpage, permissions }, gettingStarted } = this.state;\n\n    // Show getting started page if user is an admin and getting started wasn't dismissed\n    if (PermissionsMixin.isPermitted(permissions, ['inputs:create'])) {\n      if (gettingStarted.show) {\n        this._redirect(Routes.GETTING_STARTED);\n\n        return;\n      }\n    }\n\n    // Show custom startpage if it was set\n    if (startpage !== null && Object.keys(startpage).length > 0) {\n      if (startpage.type === 'stream') {\n        this._redirect(Routes.stream_search(startpage.id));\n      } else {\n        this._redirect(Routes.dashboard_show(startpage.id));\n      }\n\n      return;\n    }\n\n    this._redirect(Routes.SEARCH);\n  },\n\n  _isLoading() {\n    const { currentUser, gettingStarted } = this.state;\n\n    return !currentUser || !gettingStarted;\n  },\n\n  render() {\n    return ;\n  },\n});\n\nexport default StartPage;\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy