This is an automated email from the ASF dual-hosted git repository.

lidongdai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 63e0a8732e chore: fix kapa CSP (#959)
63e0a8732e is described below

commit 63e0a8732e4b63d146cf246e3a1bf0f76fd5a749
Author: Gallardot <[email protected]>
AuthorDate: Mon May 13 11:34:43 2024 +0800

    chore: fix kapa CSP (#959)
    
    Signed-off-by: Gallardot <[email protected]>
---
 src/components/Footer/index.jsx  |   5 ++
 src/components/footer/index.jsx  | 116 ---------------------------------------
 src/components/footer/index.scss | 107 ------------------------------------
 3 files changed, 5 insertions(+), 223 deletions(-)

diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx
index c46590bb5e..899e164415 100644
--- a/src/components/Footer/index.jsx
+++ b/src/components/Footer/index.jsx
@@ -26,6 +26,11 @@ const Footer = () => {
 
     document.body.appendChild(script);
 
+    const meta = document.createElement('meta');
+    meta.httpEquiv = "Content-Security-Policy";
+    meta.content = "frame-src 'self' https://www.google.com/;";;
+    document.head.appendChild(meta);
+
     return () => {
       document.body.removeChild(script);
     }
diff --git a/src/components/footer/index.jsx b/src/components/footer/index.jsx
deleted file mode 100644
index c46590bb5e..0000000000
--- a/src/components/footer/index.jsx
+++ /dev/null
@@ -1,116 +0,0 @@
-import React, { useEffect } from 'react';
-import { Link } from "react-router-dom";
-import { Divider, Button, Space } from "antd";
-import {
-  GithubOutlined,
-  SlackOutlined,
-  TwitterOutlined,
-} from "@ant-design/icons";
-import { useTranslation } from "../../hooks";
-import { GITHUB_LINK, TWITTER_LINK, SLACK_LINK } from "../../config";
-import "./index.scss";
-
-const Footer = () => {
-  const { locale, t } = useTranslation();
-  useEffect(() => {
-    const script = document.createElement('script');
-
-    script.src = "https://widget.kapa.ai/kapa-widget.bundle.js";;
-    script.async = true;
-    script.dataset.websiteId = "e3268e5d-c0f1-4e71-819c-c60ebb2215a7";
-    script.dataset.projectName = "Apache DolphinScheduler";
-    script.dataset.projectColor = "#0097E0";
-    script.dataset.projectLogo = "images/logo_400x400.jpg";
-    script.dataset.modalDisclaimer = "This is a custom LLM for Apache 
DolphinScheduler with access to all developer Documentation, Blog, GitHub 
issues and discussions.";
-    script.dataset.modalExampleQuestions = "Why we need DolphinScheduler?,How 
to deploy DolphinScheduler?,How to submit task?,How to contribute?";
-
-    document.body.appendChild(script);
-
-    return () => {
-      document.body.removeChild(script);
-    }
-  }, []);
-  return (
-    <footer className="footer">
-      <section className="footer-content">
-        <div className="footer-links">
-          <Link className="footer-link" to={`/${locale}/download`}>
-            {t("download")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/docs`}>
-            {t("doc")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/community`}>
-            {t("community")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/events`}>
-            {t("events")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/blog`}>
-            {t("blog")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/use_case`}>
-            {t("use_case")}
-          </Link>
-          <Divider type="vertical" />
-          <Link className="footer-link" to={`/${locale}/support`}>
-            {t("support")}
-          </Link>
-        </div>
-        <div className="footer-desc">
-          <div className="footer-left">
-            <div className="footer-logo">
-              <div className="footer-logo-white"></div>
-            </div>
-            <div className="footer-copyright">
-              Copyright © 2019-{new Date().getFullYear()} The Apache Software
-              Foundation. Apache DolphinScheduler, DolphinScheduler, and its
-              feather logo are trademarks of The Apache Software Foundation.
-            </div>
-          </div>
-          <div className="footer-right">
-            <div className="footer-contacts">
-              <div className="footer-contacts-label">Contacts</div>
-              <Space>
-                <Button
-                  icon={<GithubOutlined />}
-                  type="text"
-                  size="large"
-                  shape="circle"
-                  href={GITHUB_LINK}
-                  target="_blank"
-                />
-                <Button
-                  icon={<SlackOutlined />}
-                  type="text"
-                  size="large"
-                  shape="circle"
-                  href={SLACK_LINK}
-                  target="_blank"
-                />
-                <Button
-                  icon={<TwitterOutlined />}
-                  type="text"
-                  size="large"
-                  shape="circle"
-                  href={TWITTER_LINK}
-                  target="_blank"
-                />
-              </Space>
-            </div>
-            <div className="footer-email">
-              {`${t("email")}: [email protected]`}
-            </div>
-          </div>
-        </div>
-      </section>
-    </footer>
-  );
-};
-
-export default Footer;
diff --git a/src/components/footer/index.scss b/src/components/footer/index.scss
deleted file mode 100644
index 66c8ebf9e8..0000000000
--- a/src/components/footer/index.scss
+++ /dev/null
@@ -1,107 +0,0 @@
-@import "../../styles/size.scss";
-@import "../../styles/mixin.scss";
-
-.footer {
-  width: 100%;
-  height: $footer-height;
-  background-color: rgba(14, 66, 183, 1);
-  display: flex;
-  justify-content: center;
-  color: #fff;
-  box-sizing: border-box;
-
-  @media screen and (max-width: 640px) {
-    padding-top: 40px;
-  }
-
-  &-content {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-
-    @include content-width;
-  }
-
-  &-links {
-    height: 108px;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    width: 100%;
-
-    @media screen and (max-width: 640px) {
-      display: none;
-    }
-  }
-
-  &-link {
-    color: var(--white);
-    font-size: 22px;
-    font-weight: bold;
-    text-align: center;
-    text-decoration: none;
-    // &:not(:first-child) {
-    //   padding-left: 55px;
-    // }
-    &:hover {
-      opacity: 0.6;
-    }
-
-    @media screen and (max-width: 640px) {
-      font-size: 12px;
-    }
-  }
-
-  .ant-divider {
-    background-color: var(--white);
-    // margin-right: 55px;
-  }
-
-  &-desc {
-    display: flex;
-    justify-content: space-between;
-    width: 100%;
-  }
-  &-logo-white {
-    width: 244px;
-    height: 48.67px;
-    background-image: url("../../images/logo_white.webp");
-    @include bg-100;
-  }
-  &-copyright {
-    width: 647px;
-    margin-top: 10px;
-
-    @media screen and (max-width: 640px) {
-      width: 100%;
-      font-size: 12px;
-    }
-  }
-  &-right {
-    @media screen and (max-width: 640px) {
-      display: none;
-    }
-  }
-  &-copyright,
-  &-email {
-    color: #ffffff;
-    font-size: 16px;
-    line-height: 30px;
-  }
-  &-email {
-    margin-top: 18px;
-  }
-  &-contacts {
-    display: flex;
-    align-items: center;
-    &-label {
-      font-size: 22px;
-      font-weight: bold;
-      margin-right: 20px;
-    }
-    .anticon {
-      font-size: 26px;
-      color: #fff;
-    }
-  }
-}

Reply via email to