Common.jsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2017 The go-ethereum Authors
  2. // This file is part of the go-ethereum library.
  3. //
  4. // The go-ethereum library is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // The go-ethereum library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
  16. // isNullOrUndefined returns true if the given variable is null or undefined.
  17. export const isNullOrUndefined = variable => variable === null || typeof variable === 'undefined';
  18. export const LIMIT = {
  19. memory: 200, // Maximum number of memory data samples.
  20. traffic: 200, // Maximum number of traffic data samples.
  21. log: 200, // Maximum number of logs.
  22. };
  23. // The sidebar menu and the main content are rendered based on these elements.
  24. export const TAGS = (() => {
  25. const T = {
  26. home: { title: "Home", },
  27. chain: { title: "Chain", },
  28. transactions: { title: "Transactions", },
  29. network: { title: "Network", },
  30. system: { title: "System", },
  31. logs: { title: "Logs", },
  32. };
  33. // Using the key is circumstantial in some cases, so it is better to insert it also as a value.
  34. // This way the mistyping is prevented.
  35. for(let key in T) {
  36. T[key]['id'] = key;
  37. }
  38. return T;
  39. })();
  40. export const DATA_KEYS = (() => {
  41. const DK = {};
  42. ["memory", "traffic", "logs"].map(key => {
  43. DK[key] = key;
  44. });
  45. return DK;
  46. })();
  47. // Temporary - taken from Material-UI
  48. export const DRAWER_WIDTH = 240;