hsluoyz commented on code in PR #461: URL: https://github.com/apache/casbin-website/pull/461#discussion_r3069506309
########## blog/2023-12-08-understanding-casbin-matching-in-detail.md: ########## @@ -56,7 +56,7 @@ m = r.sub == p.sub && r.obj == p.obj && r.act == p.act ### Try it in the Casbin editor -Open the [Casbin editor](https://casbin.org/editor) and paste the model above into the Model editor. +Open the [Casbin editor](/editor) and paste the model above into the Model editor. Review Comment: The new link doesn't work ########## docs/Benchmark.mdx: ########## @@ -124,14 +124,29 @@ Results from running `luajit bench.lua` (op = one `enforce()` call, ms = millise ## Benchmark monitoring -The embedded page below displays Casbin's performance across commits. +The live monitoring dashboard is hosted separately so the ASF website does not embed third-party resources. Direct access: [https://v1.casbin.org/casbin/benchmark-monitoring](https://v1.casbin.org/casbin/benchmark-monitoring) <div - style={{margin:"(0 auto)", transform:"scale(0.85)", width:"1000px", boxShadow:"0 0 50px grey", borderRadius:"20px"}}> - <iframe - src="https://v1.casbin.org/casbin/benchmark-monitoring" - style={{width: "1000px", height: "700px", borderRadius: "20px"}}> - </iframe> + style={{ Review Comment: What's this? ########## src/components/EditorPreview/index.js: ########## @@ -1,48 +1,58 @@ import React from "react"; -import {useColorMode} from "@docusaurus/theme-common"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import Link from "@docusaurus/Link"; import Translate from "@docusaurus/Translate"; import styles from "./styles.module.css"; function EditorPreview() { - const {colorMode} = useColorMode(); - const {i18n} = useDocusaurusContext(); - const currentLanguage = i18n.currentLocale; - - // Compute editor URL reactively to avoid unnecessary reloads - const editorUrl = `https://editor.casbin.org/?theme=${colorMode}&lang=${currentLanguage}`; - return ( <div className={styles.editorSection}> <div className="container"> - <div className={styles.editorHeader}> - <h2 className={styles.editorTitle}> - <Translate>Try the Apache Casbin Online Editor</Translate> - </h2> - <p className={styles.editorDescription}> - <Translate> - Write and test your Apache Casbin model and policy in real-time with the interactive online editor. - Try different access control models and see results instantly. - </Translate> - </p> - </div> - <div className={styles.editorContainer}> + <div className={styles.previewShell}> + <div className={styles.editorHeader}> + <h2 className={styles.editorTitle}> + <Translate>Explore the Apache Casbin Online Editor</Translate> + </h2> + <p className={styles.editorDescription}> + <Translate> + The full editor is hosted separately so the ASF website does not embed third-party resources. Review Comment: What's this? ########## src/components/EditorPreview/styles.module.css: ########## @@ -5,14 +5,15 @@ background-color: var(--ifm-color-emphasis-100); } -/* Override Docusaurus container max-width so the editor area can use a wider layout */ -.editorSection :global(.container) { - max-width: 1600px; +.previewShell { Review Comment: What's this? ########## src/pages/gallery.js: ########## @@ -1,45 +1,28 @@ -import React, {useEffect, useState} from "react"; +import React from "react"; import Layout from "@theme/Layout"; -import Giscus from "@giscus/react"; -import {useColorMode} from "@docusaurus/theme-common"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import ExternalToolPage from "../components/ExternalToolPage"; +import FeedbackLinks from "../components/FeedbackLinks"; function GalleryContent() { - const {colorMode} = useColorMode(); - const {i18n} = useDocusaurusContext(); - const currentLanguage = i18n.currentLocale; - const [galleryUrl, setGalleryUrl] = useState(""); - - useEffect(() => { - setGalleryUrl(`https://editor.casbin.org/gallery?theme=${colorMode}&lang=${currentLanguage}`); - }, [colorMode, currentLanguage]); - return ( <> - <div className="editor-container"> - <iframe - src={galleryUrl} - className="editor-iframe" - title="Apache Casbin Gallery" - /> - </div> - <div className="comments-container"> - <Giscus - id="comments" - repo="casbin/casbin" - repoId="MDEwOlJlcG9zaXRvcnk4NzYxNzUwOA==" - category="Docs comments" - categoryId="DIC_kwDOBTjv5M4CRIiA" - mapping="pathname" - strict="0" - reactionsEnabled="1" - emitMetadata="0" - inputPosition="top" - theme={colorMode} - lang={currentLanguage} - loading="lazy" - /> - </div> + <ExternalToolPage Review Comment: What's this? ########## src/components/ExternalToolPage/index.jsx: ########## @@ -0,0 +1,56 @@ +import React from "react"; Review Comment: What's this? ########## docusaurus.config.js: ########## @@ -233,81 +223,53 @@ module.exports = { ], }, { - title: "More", + title: "Projects", items: [ { - html: ` - <a href="https://github.com/casbin/casbin" target="_blank"> - <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/casbin/casbin?label=Casbin&style=social"> - </a> - - <a href="https://github.com/casbin/jcasbin" target="_blank"> - <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/casbin/jcasbin?label=jCasbin&style=social"> - </a> - `, + label: "Casbin", + href: "https://github.com/casbin/casbin", Review Comment: Any alternatives to show stars? ########## docusaurus.config.js: ########## @@ -26,12 +26,6 @@ module.exports = { "An authorization library that supports access control models like ACL, RBAC, ABAC, ReBAC, PBAC, OrBAC, BLP, Biba, LBAC, UCON for Golang, Java, C/C++, Node.js, Javascript, PHP, Laravel, Python, .NET (C#), Delphi, Rust, Ruby, Swift (Objective-C), Lua (OpenResty), Dart (Flutter) and Elixir", }, ], - algolia: { Review Comment: Can't use algolia? then how to search? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
