From 3457fde522521a6c70eeb506b0b59265b09922dd Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sun, 28 Nov 2021 18:56:33 +0800 Subject: [PATCH] DBMS Submit static webpage Removed all fetch function --- web/README.md | 67 ++++------- web/src/App.css | 8 ++ web/src/App.js | 30 +++-- web/src/component/FfmpegConfig.js | 14 +-- web/src/component/FileDialog.js | 12 +- web/src/component/FileEntry.js | 2 +- web/src/component/FileInfo.js | 69 ++++++++++++ web/src/component/FilesInFolder.js | 15 +++ web/src/component/FoldersTable.js | 4 +- web/src/component/GetRandomFiles.js | 14 +-- web/src/component/Login.js | 48 ++++++++ web/src/component/Manage.js | 105 +++++++++++++++++- web/src/component/Profile.js | 37 ++++++ web/src/component/Register.js | 51 +++++++++ web/src/component/Review.js | 35 ++++++ web/src/component/ReviewEntry.js | 18 +++ web/src/component/SearchFiles.js | 34 +----- web/src/component/SearchFolders.js | 31 +----- web/src/component/Share.js | 16 +-- web/src/component/User.js | 23 ++++ .../get_ffmpeg_config_list.json | 12 ++ web/src/example-respond/get_file_info.json | 7 ++ web/src/example-respond/get_random_files.json | 74 ++++++++++++ web/src/example-respond/search_files.json | 25 +++++ web/src/example-respond/search_folders.json | 32 ++++++ 25 files changed, 613 insertions(+), 170 deletions(-) create mode 100644 web/src/component/FileInfo.js create mode 100644 web/src/component/FilesInFolder.js create mode 100644 web/src/component/Login.js create mode 100644 web/src/component/Profile.js create mode 100644 web/src/component/Register.js create mode 100644 web/src/component/Review.js create mode 100644 web/src/component/ReviewEntry.js create mode 100644 web/src/component/User.js create mode 100644 web/src/example-respond/get_ffmpeg_config_list.json create mode 100644 web/src/example-respond/get_file_info.json create mode 100644 web/src/example-respond/get_random_files.json create mode 100644 web/src/example-respond/search_files.json create mode 100644 web/src/example-respond/search_folders.json diff --git a/web/README.md b/web/README.md index 0c83cde..254f30f 100644 --- a/web/README.md +++ b/web/README.md @@ -1,6 +1,24 @@ -# Getting Started with Create React App +# msw-open-music web font-end -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +This msw-open-music project was bootstrapped with `Create React App` + +## URL References + +- `/#/` Default home page. Generate random files. +- `/#/search-files` Search files +- `/#/search-folders` Search folders +- `/#/folder/:id` Show files in the folder +- `/#/file/:id` Show file's information +- `/#/file/:id/share` Share a specific file +- `/#/file/:id/review` Review a file +- `/#/manage` Manage system setting and status +- `/#/login` Login +- `/#/register/` Register +- `/#/profile/:id` Profile of a user + +## HOW TO DEPLOY? + +Put the files under `build` folder to your HTTP server (Apache, nginx, caddy, etc.) root folder. ## Available Scripts @@ -14,11 +32,6 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - ### `npm run build` Builds the app for production to the `build` folder.\ @@ -28,43 +41,3 @@ The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/web/src/App.css b/web/src/App.css index 9cdbd75..a317991 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -15,10 +15,18 @@ body { box-shadow: 0 0 8px #393939; border-radius: 6px 6px 0 0; } +.avatar { + border-radius: 50%; + background-color: lightpink; + padding: 0.39rem; +} .title { margin-left: 1em; + margin-right: 1em; display: flex; align-items: center; + vertical-align: middle; + justify-content: space-between; } .title-text { margin-left: 1em; diff --git a/web/src/App.js b/web/src/App.js index ca6839d..a05ca01 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -1,9 +1,4 @@ -import { - HashRouter as Router, - Routes, - Route, - NavLink, -} from "react-router-dom"; +import { HashRouter as Router, Routes, Route, NavLink } from "react-router-dom"; import "./App.css"; import GetRandomFiles from "./component/GetRandomFiles"; @@ -12,10 +7,18 @@ import SearchFolders from "./component/SearchFolders"; import Manage from "./component/Manage"; import Share from "./component/Share"; import AudioPlayer from "./component/AudioPlayer"; +import FilesInFolder from "./component/FilesInFolder"; +import FileInfo from "./component/FileInfo"; +import Review from "./component/Review"; +import Profile from "./component/Profile"; +import User from "./component/User"; +import Login from "./component/Login"; +import Register from "./component/Register"; import { useState } from "react"; function App() { const [playingFile, setPlayingFile] = useState({}); + const [user, setUser] = useState(null); return (
@@ -23,6 +26,7 @@ function App() {

logo MSW Open Music Project +