Jeremy Zheng 3 лет назад
Родитель
Сommit
f0996c0307

+ 10 - 0
dashboard-fluent/.env.orig

@@ -0,0 +1,10 @@
+GENERATE_SOURCEMAP=false
+BROWSER=none
+PUBLIC_URL=/my
+HOST=0.0.0.0
+PORT=20080
+
+#REACT_APP_GRPC_HOST=http://127.0.0.1:10012
+REACT_APP_DEFAULT_LOCALE=zh-Hans
+REACT_APP_LANGUAGES=en-US,zh-Hans,zh-Hant
+REACT_APP_API_HOST=https://jeremy.spring.wikipali.org

+ 12 - 0
dashboard-fluent/.gitignore

@@ -0,0 +1,12 @@
+/node_modules/
+/yarn.lock
+
+# production
+/build/
+
+# misc
+.env
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local

+ 87 - 0
dashboard-fluent/package.json

@@ -0,0 +1,87 @@
+{
+  "name": "dashboard",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "@fluentui/react": "^8.98.7",
+    "@fortawesome/fontawesome-free": "^6.2.0",
+    "@reduxjs/toolkit": "^1.8.6",
+    "@testing-library/jest-dom": "^5.14.1",
+    "@testing-library/react": "^13.0.0",
+    "@testing-library/user-event": "^13.2.1",
+    "@types/google-protobuf": "^3.15.6",
+    "@types/jest": "^27.0.1",
+    "@types/js-cookie": "^3.0.2",
+    "@types/node": "^16.7.13",
+    "@types/react": "^18.0.0",
+    "@types/react-big-calendar": "^0.38.2",
+    "@types/react-color": "^3.0.6",
+    "@types/react-copy-to-clipboard": "^5.0.4",
+    "@types/react-dom": "^18.0.0",
+    "@types/react-pdf": "^5.7.2",
+    "@uiw/react-md-editor": "^3.19.1",
+    "dayjs": "^1.11.6",
+    "dinero.js": "^2.0.0-alpha.8",
+    "emoji-mart": "^5.2.2",
+    "famfamfam-flags": "^1.0.0",
+    "famfamfam-mini": "^1.0.0",
+    "famfamfam-silk": "^1.0.0",
+    "filesize": "^10.0.5",
+    "google-map-react": "^2.2.0",
+    "google-protobuf": "^3.21.2",
+    "grpc-web": "^1.4.1",
+    "js-cookie": "^3.0.1",
+    "jwt-decode": "^3.1.2",
+    "qrcode.react": "^3.1.0",
+    "react": "^18.2.0",
+    "react-big-calendar": "^1.5.0",
+    "react-color": "^2.19.3",
+    "react-copy-to-clipboard": "^5.1.0",
+    "react-dom": "^18.2.0",
+    "react-draggable": "^4.4.5",
+    "react-dropzone": "^14.2.3",
+    "react-highlight-words": "^0.18.0",
+    "react-hook-form": "^7.38.0",
+    "react-image-crop": "^10.0.8",
+    "react-intl": "^6.2.1",
+    "react-json-view": "^1.21.3",
+    "react-markdown": "^8.0.3",
+    "react-number-format": "^5.1.0",
+    "react-pdf": "^5.7.2",
+    "react-player": "^2.11.0",
+    "react-quill": "^2.0.0",
+    "react-redux": "^8.0.4",
+    "react-router-dom": "^6.4.2",
+    "react-scripts": "5.0.1",
+    "react-sparklines": "^1.7.0",
+    "react-syntax-highlighter": "^15.5.0",
+    "timezones-list": "^3.0.1",
+    "typescript": "^4.4.2",
+    "video.js": "^7.20.3",
+    "web-vitals": "^2.1.0"
+  },
+  "scripts": {
+    "start": "react-scripts start",
+    "build": "react-scripts build",
+    "test": "react-scripts test",
+    "eject": "react-scripts eject"
+  },
+  "eslintConfig": {
+    "extends": [
+      "react-app",
+      "react-app/jest"
+    ]
+  },
+  "browserslist": {
+    "production": [
+      ">0.2%",
+      "not dead",
+      "not op_mini all"
+    ],
+    "development": [
+      "last 1 chrome version",
+      "last 1 firefox version",
+      "last 1 safari version"
+    ]
+  }
+}

BIN
dashboard-fluent/public/favicon.ico


+ 43 - 0
dashboard-fluent/public/index.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <meta name="theme-color" content="#000000" />
+    <meta
+      name="description"
+      content="Web site created using create-react-app"
+    />
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
+    <!--
+      manifest.json provides metadata used when your web app is installed on a
+      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
+    -->
+    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
+    <!--
+      Notice the use of %PUBLIC_URL% in the tags above.
+      It will be replaced with the URL of the `public` folder during the build.
+      Only files inside the `public` folder can be referenced from the HTML.
+
+      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
+      work correctly both with client-side routing and a non-root public URL.
+      Learn how to configure a non-root public URL by running `npm run build`.
+    -->
+    <title>React App</title>
+  </head>
+  <body>
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+    <div id="root"></div>
+    <!--
+      This HTML file is a template.
+      If you open it directly in the browser, you will see an empty page.
+
+      You can add webfonts, meta tags, or analytics to this file.
+      The build step will place the bundled scripts into the <body> tag.
+
+      To begin the development, run `npm start` or `yarn start`.
+      To create a production bundle, use `npm run build` or `yarn build`.
+    -->
+  </body>
+</html>

BIN
dashboard-fluent/public/logo192.png


BIN
dashboard-fluent/public/logo512.png


+ 25 - 0
dashboard-fluent/public/manifest.json

@@ -0,0 +1,25 @@
+{
+  "short_name": "React App",
+  "name": "Create React App Sample",
+  "icons": [
+    {
+      "src": "favicon.ico",
+      "sizes": "64x64 32x32 24x24 16x16",
+      "type": "image/x-icon"
+    },
+    {
+      "src": "logo192.png",
+      "type": "image/png",
+      "sizes": "192x192"
+    },
+    {
+      "src": "logo512.png",
+      "type": "image/png",
+      "sizes": "512x512"
+    }
+  ],
+  "start_url": ".",
+  "display": "standalone",
+  "theme_color": "#000000",
+  "background_color": "#ffffff"
+}

+ 3 - 0
dashboard-fluent/public/robots.txt

@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:

+ 6 - 0
dashboard-fluent/src/App.css

@@ -0,0 +1,6 @@
+@import "~react-quill/dist/quill.snow.css";
+
+body {
+  margin: 0;
+  padding: 0;
+}

+ 9 - 0
dashboard-fluent/src/App.test.tsx

@@ -0,0 +1,9 @@
+import React from 'react';
+import { render, screen } from '@testing-library/react';
+import App from './App';
+
+test('renders learn react link', () => {
+  render(<App />);
+  const linkElement = screen.getByText(/learn react/i);
+  expect(linkElement).toBeInTheDocument();
+});

+ 9 - 0
dashboard-fluent/src/App.tsx

@@ -0,0 +1,9 @@
+import React from "react";
+
+import "./App.css";
+
+function App() {
+  return <div className="App"></div>;
+}
+
+export default App;

+ 15 - 0
dashboard-fluent/src/index.tsx

@@ -0,0 +1,15 @@
+import React from "react";
+import ReactDOM from "react-dom/client";
+
+import App from "./App";
+import reportWebVitals from "./reportWebVitals";
+
+const root = ReactDOM.createRoot(
+  document.getElementById("root") as HTMLElement
+);
+root.render(<App />);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+reportWebVitals();

+ 1 - 0
dashboard-fluent/src/react-app-env.d.ts

@@ -0,0 +1 @@
+/// <reference types="react-scripts" />

+ 15 - 0
dashboard-fluent/src/reportWebVitals.ts

@@ -0,0 +1,15 @@
+import { ReportHandler } from 'web-vitals';
+
+const reportWebVitals = (onPerfEntry?: ReportHandler) => {
+  if (onPerfEntry && onPerfEntry instanceof Function) {
+    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+      getCLS(onPerfEntry);
+      getFID(onPerfEntry);
+      getFCP(onPerfEntry);
+      getLCP(onPerfEntry);
+      getTTFB(onPerfEntry);
+    });
+  }
+};
+
+export default reportWebVitals;

+ 5 - 0
dashboard-fluent/src/setupTests.ts

@@ -0,0 +1,5 @@
+// jest-dom adds custom jest matchers for asserting on DOM nodes.
+// allows you to do things like:
+// expect(element).toHaveTextContent(/react/i)
+// learn more: https://github.com/testing-library/jest-dom
+import '@testing-library/jest-dom';

+ 26 - 0
dashboard-fluent/tsconfig.json

@@ -0,0 +1,26 @@
+{
+  "compilerOptions": {
+    "target": "es5",
+    "lib": [
+      "dom",
+      "dom.iterable",
+      "esnext"
+    ],
+    "allowJs": true,
+    "skipLibCheck": true,
+    "esModuleInterop": true,
+    "allowSyntheticDefaultImports": true,
+    "strict": true,
+    "forceConsistentCasingInFileNames": true,
+    "noFallthroughCasesInSwitch": true,
+    "module": "esnext",
+    "moduleResolution": "node",
+    "resolveJsonModule": true,
+    "isolatedModules": true,
+    "noEmit": true,
+    "jsx": "react-jsx"
+  },
+  "include": [
+    "src"
+  ]
+}