github.com/minio/console@v1.4.1/web-app/src/screens/Console/License/utils.tsx (about)

     1  // This file is part of MinIO Console Server
     2  // Copyright (c) 2022 MinIO, Inc.
     3  //
     4  // This program is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Affero 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  // This program 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 Affero General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Affero General Public License
    15  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    16  
    17  import LicenseLink from "./LicenseLink";
    18  import { openFAQModal } from "./licenseSlice";
    19  import store from "../../../store";
    20  import FAQModal from "./FAQModal";
    21  import { Box } from "mds";
    22  
    23  export const LICENSE_PLANS = {
    24    COMMUNITY: "community",
    25    STANDARD: "standard",
    26    ENTERPRISE: "enterprise",
    27  };
    28  
    29  type FeatureItem = {
    30    label?: any;
    31    isHeader?: boolean;
    32    style?: any;
    33    desc?: any;
    34    featureTitleRow?: boolean;
    35  };
    36  
    37  const FeatureLink = ({ text, anchor }: { text: string; anchor: string }) => {
    38    return (
    39      <a
    40        href={`https://min.io/product/subnet?ref=con#${anchor}`}
    41        className={"link-text"}
    42        target="_blank"
    43        rel="noopener "
    44        style={{
    45          color: "#2781B0",
    46        }}
    47      >
    48        {text}
    49      </a>
    50    );
    51  };
    52  
    53  export const FEATURE_ITEMS: FeatureItem[] = [
    54    {
    55      label: "License ",
    56      isHeader: true,
    57    },
    58    {
    59      label: "",
    60      isHeader: false,
    61      style: {
    62        height: "400px",
    63        verticalAlign: "top",
    64        alignItems: "start",
    65      },
    66    },
    67    {
    68      desc: "Features",
    69      featureTitleRow: true,
    70    },
    71    {
    72      desc: "Unit Price",
    73    },
    74    {
    75      desc: () => {
    76        return (
    77          <FeatureLink
    78            anchor={"sa-long-term-support"}
    79            text={"Software Release"}
    80          />
    81        );
    82      },
    83    },
    84    {
    85      desc: "SLA",
    86    },
    87    {
    88      desc: "Support",
    89    },
    90    {
    91      desc: "Critical Security and Bug Detection",
    92    },
    93    {
    94      desc: () => {
    95        return <FeatureLink anchor={"sa-panic-button"} text={"Panic Button"} />;
    96      },
    97    },
    98    {
    99      desc: () => {
   100        return (
   101          <FeatureLink anchor={"sa-healthcheck"} text={"Health Diagnostics"} />
   102        );
   103      },
   104    },
   105    {
   106      desc: "Annual Architecture Review",
   107    },
   108    {
   109      desc: "Annual Performance Review",
   110    },
   111    {
   112      desc: "Indemnification",
   113    },
   114    {
   115      desc: "Security and Policy Review",
   116    },
   117  ];
   118  
   119  export const COMMUNITY_PLAN_FEATURES = [
   120    {
   121      label: "Community",
   122      isHeader: true,
   123      style: {
   124        borderBottom: 0,
   125      },
   126    },
   127    {
   128      label: () => {
   129        return (
   130          <Box
   131            sx={{
   132              textAlign: "left",
   133            }}
   134          >
   135            <span>
   136              Designed for developers who are building open source applications in
   137              compliance with the <LicenseLink /> license, MinIO Trademarks and
   138              are able to self support themselves. It is fully featured. If you
   139              distribute, host or create derivative works of the MinIO software
   140              over the network, the <LicenseLink /> license requires that you also
   141              distribute the complete, corresponding source code of the combined
   142              work under the same <LicenseLink /> license. This requirement
   143              applies whether or not you modified MinIO.
   144              <br />
   145              <br />
   146              <span
   147                className="link-text"
   148                onClick={() => {
   149                  store.dispatch(openFAQModal());
   150                }}
   151              >
   152                Compliance FAQ
   153              </span>
   154              <FAQModal />
   155            </span>
   156          </Box>
   157        );
   158      },
   159      isHeader: false,
   160      style: {
   161        height: "400px",
   162        borderBottom: 0,
   163      },
   164    },
   165    {
   166      id: "com_feat_title",
   167      featureTitleRow: true,
   168    },
   169    {
   170      id: "com_license_cost",
   171    },
   172    {
   173      id: "com_release",
   174      label: "Upstream",
   175    },
   176    {
   177      id: "com_sla",
   178      label: "No SLA",
   179    },
   180    {
   181      id: "com_support",
   182      label: "Community:",
   183      detail: "Slack + GitHub",
   184    },
   185    {
   186      id: "com_security",
   187      label: "Self",
   188    },
   189    {
   190      id: "com_panic",
   191      xsLabel: "N/A",
   192    },
   193    {
   194      id: "com_diag",
   195      xsLabel: "N/A",
   196    },
   197    {
   198      id: "com_arch",
   199      xsLabel: "N/A",
   200    },
   201    {
   202      id: "com_perf",
   203      xsLabel: "N/A",
   204    },
   205    {
   206      id: "com_indemnity",
   207      xsLabel: "N/A",
   208    },
   209    {
   210      id: "com_sec_policy",
   211      xsLabel: "N/A",
   212    },
   213  ];
   214  
   215  export const STANDARD_PLAN_FEATURES = [
   216    {
   217      label: "Standard",
   218      isHeader: true,
   219      style: {
   220        borderBottom: 0,
   221      },
   222    },
   223    {
   224      isHeader: false,
   225      label: () => {
   226        return (
   227          <Box
   228            sx={{
   229              marginTop: "-85px",
   230              textAlign: "left",
   231            }}
   232          >
   233            <span>
   234              Designed for customers who require a commercial license and can
   235              mostly self-support but want the peace of mind that comes with the
   236              MinIO Subscription Network’s suite of operational capabilities and
   237              direct-to-engineer interaction. The Standard version is fully
   238              featured but with SLA limitations. <br /> <br /> To learn more about
   239              the MinIO Subscription Network
   240            </span>{" "}
   241            <a
   242              href="https://min.io/product/subnet?ref=con"
   243              className={"link-text"}
   244              target="_blank"
   245              rel="noopener"
   246            >
   247              click here
   248            </a>
   249            .
   250          </Box>
   251        );
   252      },
   253      style: {
   254        height: "400px",
   255        borderBottom: 0,
   256      },
   257    },
   258    {
   259      id: "std_feat_title",
   260      featureTitleRow: true,
   261    },
   262    {
   263      id: "std_license_cost",
   264      label: () => (
   265        <Box
   266          sx={{
   267            fontSize: "16px",
   268            fontWeight: 600,
   269          }}
   270        >
   271          $10 per TiB per month
   272        </Box>
   273      ),
   274      detail: () => (
   275        <Box
   276          sx={{
   277            fontSize: "14px",
   278            fontWeight: 400,
   279            marginBottom: "5px",
   280          }}
   281        >
   282          (Minimum of 200TiB)
   283        </Box>
   284      ),
   285    },
   286    {
   287      id: "std_release",
   288      label: "1 Year Long Term Support",
   289    },
   290    {
   291      id: "std_sla",
   292      label: "<48 Hours",
   293      detail: "(Local Business Hours)",
   294    },
   295    {
   296      id: "std_support",
   297      label: "L4 Direct Engineering",
   298      detail: "support via SUBNET",
   299    },
   300    {
   301      id: "std_security",
   302      label: "Continuous Scan and Alert",
   303    },
   304    {
   305      id: "std_panic",
   306      label: "1 Per year",
   307    },
   308    {
   309      id: "std_diag",
   310      label: "24/7/365",
   311    },
   312    {
   313      id: "std_arch",
   314      xsLabel: "N/A",
   315    },
   316    {
   317      id: "std_perf",
   318      xsLabel: "N/A",
   319    },
   320    {
   321      id: "std_indemnity",
   322      xsLabel: "N/A",
   323    },
   324    {
   325      id: "std_sec_policy",
   326      xsLabel: "N/A",
   327    },
   328  ];
   329  
   330  export const ENTERPRISE_PLAN_FEATURES = [
   331    {
   332      label: "Enterprise",
   333      isHeader: true,
   334      style: {
   335        borderBottom: 0,
   336      },
   337    },
   338    {
   339      isHeader: false,
   340      label: () => {
   341        return (
   342          <Box
   343            sx={{
   344              marginTop: "-135px",
   345              textAlign: "left",
   346            }}
   347          >
   348            <span>
   349              Designed for mission critical environments where both a license and
   350              strict SLAs are required. The Enterprise version is fully featured
   351              but comes with additional capabilities. <br /> <br /> To learn more
   352              about the MinIO Subscription Network
   353            </span>{" "}
   354            <a
   355              href="https://min.io/product/subnet?ref=con"
   356              className={"link-text"}
   357              target="_blank"
   358              rel="noopener"
   359            >
   360              click here
   361            </a>
   362            .
   363          </Box>
   364        );
   365      },
   366      style: {
   367        height: "400px",
   368        borderBottom: 0,
   369      },
   370    },
   371    {
   372      id: "end_feat_title",
   373      featureTitleRow: true,
   374    },
   375    {
   376      id: "ent_license_cost",
   377      label: () => (
   378        <Box
   379          sx={{
   380            fontSize: "16px",
   381            fontWeight: 600,
   382          }}
   383        >
   384          $20 per TiB per month
   385        </Box>
   386      ),
   387      detail: () => (
   388        <Box
   389          sx={{
   390            fontSize: "14px",
   391            fontWeight: 400,
   392            marginBottom: "5px",
   393          }}
   394        >
   395          (Minimum of 100TiB)
   396        </Box>
   397      ),
   398    },
   399    {
   400      id: "ent_release",
   401      label: "5 Years Long Term Support",
   402    },
   403    {
   404      id: "ent_sla",
   405      label: "<1 hour",
   406    },
   407    {
   408      id: "ent_support",
   409      label: "L4 Direct Engineering support via",
   410      detail: "SUBNET, Phone, Web Conference",
   411    },
   412    {
   413      id: "ent_security",
   414      label: "Continuous Scan and Alert",
   415    },
   416    {
   417      id: "ent_panic",
   418      label: "Unlimited",
   419    },
   420    {
   421      id: "ent_diag",
   422      label: "24/7/365",
   423    },
   424    {
   425      id: "ent_arch",
   426      yesIcon: true,
   427    },
   428    {
   429      id: "ent_perf",
   430      yesIcon: true,
   431    },
   432    {
   433      id: "ent_indemnity",
   434      yesIcon: true,
   435    },
   436    {
   437      id: "ent_sec_policy",
   438      yesIcon: true,
   439    },
   440  ];
   441  
   442  export const PAID_PLANS = [LICENSE_PLANS.STANDARD, LICENSE_PLANS.ENTERPRISE];
   443  
   444  export const getRenderValue = (val: any) => {
   445    return typeof val === "function" ? val() : val;
   446  };
   447  
   448  export const LICENSE_CONSENT_STORE_KEY = "agpl_minio_license_consent";
   449  export const setLicenseConsent = () => {
   450    localStorage.setItem(LICENSE_CONSENT_STORE_KEY, "true");
   451  };
   452  
   453  export const getLicenseConsent = () => {
   454    return localStorage.getItem(LICENSE_CONSENT_STORE_KEY) === "true";
   455  };