common.tsx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import aws from "../assets/aws.png";
  2. import digitalOcean from "../assets/do.png";
  3. import gcp from "../assets/gcp.png";
  4. import github from "../assets/github.png";
  5. import { InfraType } from "../shared/types";
  6. export const infraNames: any = {
  7. ecr: "Elastic Container Registry (ECR)",
  8. eks: "Elastic Kubernetes Service (EKS)",
  9. gcr: "Google Container Registry (GCR)",
  10. gke: "Google Kubernetes Engine (GKE)",
  11. docr: "Digital Ocean Container Registry",
  12. doks: "Digital Ocean Kubernetes Service"
  13. };
  14. export const integrationList: any = {
  15. kubernetes: {
  16. icon:
  17. "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
  18. label: "Kubernetes",
  19. buttonText: "Add a Cluster"
  20. },
  21. repo: {
  22. icon:
  23. "https://3.bp.blogspot.com/-xhNpNJJyQhk/XIe4GY78RQI/AAAAAAAAItc/ouueFUj2Hqo5dntmnKqEaBJR4KQ4Q2K3ACK4BGAYYCw/s1600/logo%2Bgit%2Bicon.png",
  24. label: "Git Repository",
  25. buttonText: "Link a Github Account"
  26. },
  27. registry: {
  28. icon:
  29. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  30. label: "Docker Registry",
  31. buttonText: "Add a Registry"
  32. },
  33. gke: {
  34. icon: "https://sysdig.com/wp-content/uploads/2016/08/GKE_color.png",
  35. label: "Google Kubernetes Engine (GKE)"
  36. },
  37. eks: {
  38. icon: "https://img.stackshare.io/service/7991/amazon-eks.png",
  39. label: "Amazon Elastic Kubernetes Service (EKS)"
  40. },
  41. kube: {
  42. icon:
  43. "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
  44. label: "Upload Kubeconfig"
  45. },
  46. docker: {
  47. icon:
  48. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  49. label: "Docker Hub"
  50. },
  51. gcr: {
  52. icon:
  53. "https://carlossanchez.files.wordpress.com/2019/06/21046548.png?w=640",
  54. label: "Google Container Registry (GCR)"
  55. },
  56. ecr: {
  57. icon:
  58. "https://avatars2.githubusercontent.com/u/52505464?s=400&u=da920f994c67665c7ad6c606a5286557d4f8555f&v=4",
  59. label: "Elastic Container Registry (ECR)"
  60. },
  61. aws: {
  62. icon: aws,
  63. label: "AWS"
  64. },
  65. gcp: {
  66. icon: gcp,
  67. label: "GCP"
  68. },
  69. do: {
  70. icon: digitalOcean,
  71. label: "DigitalOcean"
  72. },
  73. github: {
  74. icon: github,
  75. label: "GitHub"
  76. },
  77. gitlab: {
  78. icon: "https://about.gitlab.com/images/press/logo/png/gitlab-icon-rgb.png",
  79. label: "Gitlab"
  80. }
  81. };
  82. export const isAlphanumeric = (x: string | null) => {
  83. let re = /^[a-z0-9-]+$/;
  84. if (!x || x.length == 0 || x.search(re) === -1) {
  85. return false;
  86. }
  87. return true;
  88. };
  89. export const getIgnoreCase = (object: any, key: string) => {
  90. return object[
  91. Object.keys(object).find(k => k.toLowerCase() === key.toLowerCase())
  92. ];
  93. };