+
+ {/* development or production */}
+ You are running this application in {process.env.NODE_ENV}{" "}
+ mode.
+
Edit src / App.js and save to reload.{" "}
diff --git a/react-ui/src/App.test.js b/reactui/src/App.test.js
similarity index 100%
rename from react-ui/src/App.test.js
rename to reactui/src/App.test.js
diff --git a/react-ui/src/index.css b/reactui/src/index.css
similarity index 100%
rename from react-ui/src/index.css
rename to reactui/src/index.css
diff --git a/react-ui/src/index.js b/reactui/src/index.js
similarity index 100%
rename from react-ui/src/index.js
rename to reactui/src/index.js
diff --git a/react-ui/src/logo.svg b/reactui/src/logo.svg
similarity index 100%
rename from react-ui/src/logo.svg
rename to reactui/src/logo.svg
diff --git a/react-ui/src/serviceWorker.js b/reactui/src/serviceWorker.js
similarity index 100%
rename from react-ui/src/serviceWorker.js
rename to reactui/src/serviceWorker.js
diff --git a/react-ui/src/setupTests.js b/reactui/src/setupTests.js
similarity index 100%
rename from react-ui/src/setupTests.js
rename to reactui/src/setupTests.js
diff --git a/react-ui/yarn.lock b/reactui/yarn.lock
similarity index 100%
rename from react-ui/yarn.lock
rename to reactui/yarn.lock
From 9590eff0c702de646fc8e6e536a090390d2ce6b5 Mon Sep 17 00:00:00 2001
From: Grimmer
Date: Sat, 8 Feb 2020 22:31:25 +0800
Subject: [PATCH 04/21] Add django vscode debug setting
---
.vscode/launch.json | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 .vscode/launch.json
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..03996a1
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,17 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [{
+ "name": "Python:Django",
+ "type": "python",
+ "request": "launch",
+ "program": "${workspaceFolder}/manage.py",
+ "args": [
+ "runserver",
+ "--noreload"
+ ],
+ "django": true
+ }]
+}
\ No newline at end of file
From d376c3a373cd4b7f4a54261a408d4a18ecd69383 Mon Sep 17 00:00:00 2001
From: Grimmer
Date: Sat, 8 Feb 2020 22:31:44 +0800
Subject: [PATCH 05/21] Add material-ui
---
reactui/package.json | 2 +
reactui/public/index.html | 11 ++
reactui/yarn.lock | 232 +++++++++++++++++++++++++++++++++++++-
3 files changed, 243 insertions(+), 2 deletions(-)
diff --git a/reactui/package.json b/reactui/package.json
index b586b92..162013e 100644
--- a/reactui/package.json
+++ b/reactui/package.json
@@ -3,6 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
+ "@material-ui/core": "^4.9.1",
+ "@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
diff --git a/reactui/public/index.html b/reactui/public/index.html
index aa069f2..b34a410 100644
--- a/reactui/public/index.html
+++ b/reactui/public/index.html
@@ -24,6 +24,17 @@
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`.
-->
+
+
+
+
+
React App
diff --git a/reactui/yarn.lock b/reactui/yarn.lock
index 4069287..1665217 100644
--- a/reactui/yarn.lock
+++ b/reactui/yarn.lock
@@ -923,6 +923,13 @@
dependencies:
regenerator-runtime "^0.13.2"
+"@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5":
+ version "7.8.4"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308"
+ integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==
+ dependencies:
+ regenerator-runtime "^0.13.2"
+
"@babel/runtime@^7.5.1", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.3.tgz#0811944f73a6c926bb2ad35e918dcc1bfab279f1"
@@ -1014,6 +1021,11 @@
resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18"
integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==
+"@emotion/hash@^0.7.4":
+ version "0.7.4"
+ resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.7.4.tgz#f14932887422c9056b15a8d222a9074a7dfa2831"
+ integrity sha512-fxfMSBMX3tlIbKUdtGKxqB1fyrH6gVrX39Gsv3y8lRYKUqlgDt3UMqQyGnR1bQMa2B8aGnhLZokZgg8vT0Le+A==
+
"@hapi/address@2.x.x":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
@@ -1194,6 +1206,78 @@
"@types/istanbul-reports" "^1.1.1"
"@types/yargs" "^13.0.0"
+"@material-ui/core@^4.9.1":
+ version "4.9.1"
+ resolved "https://registry.yarnpkg.com/@material-ui/core/-/core-4.9.1.tgz#8e57382b12a01b35a3fa2a45424528915aef2115"
+ integrity sha512-wehQI0ahHDsZjK+uA8Q5Cs1K1/1HXYe2icwTqARaRCt7d9bTp0bJN/C9TLe/+sRWfRIkx6OIk7ABSJT1jBqxRg==
+ dependencies:
+ "@babel/runtime" "^7.4.4"
+ "@material-ui/styles" "^4.9.0"
+ "@material-ui/system" "^4.9.1"
+ "@material-ui/types" "^5.0.0"
+ "@material-ui/utils" "^4.7.1"
+ "@types/react-transition-group" "^4.2.0"
+ clsx "^1.0.2"
+ convert-css-length "^2.0.1"
+ hoist-non-react-statics "^3.3.2"
+ normalize-scroll-left "^0.2.0"
+ popper.js "^1.14.1"
+ prop-types "^15.7.2"
+ react-is "^16.8.0"
+ react-transition-group "^4.3.0"
+
+"@material-ui/icons@^4.9.1":
+ version "4.9.1"
+ resolved "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz#fdeadf8cb3d89208945b33dbc50c7c616d0bd665"
+ integrity sha512-GBitL3oBWO0hzBhvA9KxqcowRUsA0qzwKkURyC8nppnC3fw54KPKZ+d4V1Eeg/UnDRSzDaI9nGCdel/eh9AQMg==
+ dependencies:
+ "@babel/runtime" "^7.4.4"
+
+"@material-ui/styles@^4.9.0":
+ version "4.9.0"
+ resolved "https://registry.yarnpkg.com/@material-ui/styles/-/styles-4.9.0.tgz#10c31859f6868cfa9d3adf6b6c3e32c9d676bc76"
+ integrity sha512-nJHum4RqYBPWsjL/9JET8Z02FZ9gSizlg/7LWVFpIthNzpK6OQ5OSRR4T4x9/p+wK3t1qNn3b1uI4XpnZaPxOA==
+ dependencies:
+ "@babel/runtime" "^7.4.4"
+ "@emotion/hash" "^0.7.4"
+ "@material-ui/types" "^5.0.0"
+ "@material-ui/utils" "^4.7.1"
+ clsx "^1.0.2"
+ csstype "^2.5.2"
+ hoist-non-react-statics "^3.2.1"
+ jss "^10.0.3"
+ jss-plugin-camel-case "^10.0.3"
+ jss-plugin-default-unit "^10.0.3"
+ jss-plugin-global "^10.0.3"
+ jss-plugin-nested "^10.0.3"
+ jss-plugin-props-sort "^10.0.3"
+ jss-plugin-rule-value-function "^10.0.3"
+ jss-plugin-vendor-prefixer "^10.0.3"
+ prop-types "^15.7.2"
+
+"@material-ui/system@^4.9.1":
+ version "4.9.1"
+ resolved "https://registry.yarnpkg.com/@material-ui/system/-/system-4.9.1.tgz#beb6595e1b164317340bdc5a629a6798fc35f82d"
+ integrity sha512-CLrJK2aKNWNwruGVTRf+rLz96P4jmozpY2UaCE6hBTa1oGsQ396YXOQQABQ4c0igawmdyf5iQb0zs9j5zsAf1w==
+ dependencies:
+ "@babel/runtime" "^7.4.4"
+ "@material-ui/utils" "^4.7.1"
+ prop-types "^15.7.2"
+
+"@material-ui/types@^5.0.0":
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/@material-ui/types/-/types-5.0.0.tgz#26d6259dc6b39f4c2e1e9aceff7a11e031941741"
+ integrity sha512-UeH2BuKkwDndtMSS0qgx1kCzSMw+ydtj0xx/XbFtxNSTlXydKwzs5gVW5ZKsFlAkwoOOQ9TIsyoCC8hq18tOwg==
+
+"@material-ui/utils@^4.7.1":
+ version "4.7.1"
+ resolved "https://registry.yarnpkg.com/@material-ui/utils/-/utils-4.7.1.tgz#dc16c7f0d2cd02fbcdd5cfe601fd6863ae3cc652"
+ integrity sha512-+ux0SlLdlehvzCk2zdQ3KiS3/ylWvuo/JwAGhvb8dFVvwR21K28z0PU9OQW2PGogrMEdvX3miEI5tGxTwwWiwQ==
+ dependencies:
+ "@babel/runtime" "^7.4.4"
+ prop-types "^15.7.2"
+ react-is "^16.8.0"
+
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
@@ -1465,6 +1549,13 @@
dependencies:
"@types/react" "*"
+"@types/react-transition-group@^4.2.0":
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.2.3.tgz#4924133f7268694058e415bf7aea2d4c21131470"
+ integrity sha512-Hk8jiuT7iLOHrcjKP/ZVSyCNXK73wJAUz60xm0mVhiRujrdiI++j4duLiL282VGxwAgxetHQFfqA29LgEeSkFA==
+ dependencies:
+ "@types/react" "*"
+
"@types/react@*":
version "16.9.17"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.17.tgz#58f0cc0e9ec2425d1441dd7b623421a867aa253e"
@@ -2770,6 +2861,11 @@ clone-deep@^4.0.1:
kind-of "^6.0.2"
shallow-clone "^3.0.0"
+clsx@^1.0.2:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.0.tgz#62937c6adfea771247c34b54d320fb99624f5702"
+ integrity sha512-3avwM37fSK5oP6M5rQ9CNe99lwxhXDOeSWVPAOYF6OazUTgZCMb0yWlJpmdD74REy1gkEaFiub2ULv4fq9GUhA==
+
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
@@ -2951,6 +3047,11 @@ content-type@~1.0.4:
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==
+convert-css-length@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/convert-css-length/-/convert-css-length-2.0.1.tgz#90a76bde5bfd24d72881a5b45d02249b2c1d257c"
+ integrity sha512-iGpbcvhLPRKUbBc0Quxx7w/bV14AC3ItuBEGMahA5WTYqB8lq9jH0kTXFheCBASsYnqeMFZhiTruNxr1N59Axg==
+
convert-source-map@1.7.0, convert-source-map@^1.4.0, convert-source-map@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
@@ -3189,6 +3290,14 @@ css-unit-converter@^1.1.1:
resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996"
integrity sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=
+css-vendor@^2.0.7:
+ version "2.0.7"
+ resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-2.0.7.tgz#4e6d53d953c187981576d6a542acc9fb57174bda"
+ integrity sha512-VS9Rjt79+p7M0WkPqcAza4Yq1ZHrsHrwf7hPL/bjQB+c1lwmAI+1FXxYTYt818D/50fFVflw0XKleiBN5RITkg==
+ dependencies:
+ "@babel/runtime" "^7.6.2"
+ is-in-browser "^1.0.2"
+
css-what@2.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
@@ -3316,7 +3425,7 @@ cssstyle@^1.0.0, cssstyle@^1.1.1:
dependencies:
cssom "0.3.x"
-csstype@^2.2.0:
+csstype@^2.2.0, csstype@^2.5.2, csstype@^2.6.5, csstype@^2.6.7:
version "2.6.8"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431"
integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==
@@ -3580,6 +3689,14 @@ dom-converter@^0.2:
dependencies:
utila "~0.4"
+dom-helpers@^5.0.1:
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.1.3.tgz#7233248eb3a2d1f74aafca31e52c5299cc8ce821"
+ integrity sha512-nZD1OtwfWGRBWlpANxacBEZrEuLa16o1nh7YopFWeoF68Zt8GGEmzHu6Xv4F3XaFIC+YXtTLrzgqKxFgLEe4jw==
+ dependencies:
+ "@babel/runtime" "^7.6.3"
+ csstype "^2.6.7"
+
dom-serializer@0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
@@ -4844,6 +4961,13 @@ hmac-drbg@^1.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
+hoist-non-react-statics@^3.2.1, hoist-non-react-statics@^3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
+ integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
+ dependencies:
+ react-is "^16.7.0"
+
hosted-git-info@^2.1.4:
version "2.8.5"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
@@ -4998,6 +5122,11 @@ https-browserify@^1.0.0:
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
+hyphenate-style-name@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48"
+ integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ==
+
iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
@@ -5385,6 +5514,11 @@ is-glob@^4.0.0, is-glob@^4.0.1:
dependencies:
is-extglob "^2.1.1"
+is-in-browser@^1.0.2, is-in-browser@^1.1.3:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/is-in-browser/-/is-in-browser-1.1.3.tgz#56ff4db683a078c6082eb95dad7dc62e1d04f835"
+ integrity sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=
+
is-number@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
@@ -6117,6 +6251,75 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
+jss-plugin-camel-case@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-camel-case/-/jss-plugin-camel-case-10.0.4.tgz#3dedecec1e5bba0bf6141c2c05e2ab11ea4b468d"
+ integrity sha512-+wnqxJsyfUnOn0LxVg3GgZBSjfBCrjxwx7LFxwVTUih0ceGaXKZoieheNOaTo5EM4w8bt1nbb8XonpQCj67C6A==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ hyphenate-style-name "^1.0.3"
+ jss "10.0.4"
+
+jss-plugin-default-unit@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-default-unit/-/jss-plugin-default-unit-10.0.4.tgz#df03885de20f20a1fc1c21bdb7c62e865ee400d9"
+ integrity sha512-T0mhL/Ogp/quvod/jAHEqKvptLDxq7Cj3a+7zRuqK8HxUYkftptN89wJElZC3rshhNKiogkEYhCWenpJdFvTBg==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ jss "10.0.4"
+
+jss-plugin-global@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-global/-/jss-plugin-global-10.0.4.tgz#412245b56133cc88bec654a70d82d5922619f4c5"
+ integrity sha512-N8n9/GHENZce+sqE4UYiZiJtI+t+erT/BypHOrNYAfIoNEj7OYsOEKfIo2P0GpLB3QyDAYf5eo9XNdZ8veEkUA==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ jss "10.0.4"
+
+jss-plugin-nested@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-nested/-/jss-plugin-nested-10.0.4.tgz#4d15ad13995fb6e4125618006473a096d2475d75"
+ integrity sha512-QM21BKVt8LDeoRfowvAMh/s+/89VYrreIIE6ch4pvw0oAXDWw1iorUPlqLZ7uCO3UL0uFtQhJq3QMLN6Lr1v0A==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ jss "10.0.4"
+ tiny-warning "^1.0.2"
+
+jss-plugin-props-sort@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-props-sort/-/jss-plugin-props-sort-10.0.4.tgz#43c880ff8dfcf858f809f663ece5e65a1d945b5a"
+ integrity sha512-WoETdOCjGskuin/OMt2uEdDPLZF3vfQuHXF+XUHGJrq0BAapoyGQDcv37SeReDlkRAbVXkEZPsIMvYrgHSHFiA==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ jss "10.0.4"
+
+jss-plugin-rule-value-function@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.0.4.tgz#2f4cf4a86ad3eba875bb48cb9f4a7ed35cb354e7"
+ integrity sha512-0hrzOSWRF5ABJGaHrlnHbYZjU877Ofzfh2id3uLtBvemGQLHI+ldoL8/+6iPSRa7M8z8Ngfg2vfYhKjUA5gA0g==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ jss "10.0.4"
+
+jss-plugin-vendor-prefixer@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.0.4.tgz#1626ef612a4541cff17cf96815e1740155214ed2"
+ integrity sha512-4JgEbcrdeMda1qvxTm1CnxFJAWVV++VLpP46HNTrfH7VhVlvUpihnUNs2gAlKuRT/XSBuiWeLAkrTqF4NVrPig==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ css-vendor "^2.0.7"
+ jss "10.0.4"
+
+jss@10.0.4, jss@^10.0.3:
+ version "10.0.4"
+ resolved "https://registry.yarnpkg.com/jss/-/jss-10.0.4.tgz#46ebdde1c40c9a079d64f3334cb88ae28fd90bfd"
+ integrity sha512-GqHmeDK83qbqMAVjxyPfN1qJVTKZne533a9bdCrllZukUM8npG/k+JumEPI86IIB5ifaZAHG2HAsUziyxOiooQ==
+ dependencies:
+ "@babel/runtime" "^7.3.1"
+ csstype "^2.6.5"
+ is-in-browser "^1.1.3"
+ tiny-warning "^1.0.2"
+
jsx-ast-utils@^2.2.1:
version "2.2.3"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f"
@@ -6893,6 +7096,11 @@ normalize-range@^0.1.2:
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=
+normalize-scroll-left@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/normalize-scroll-left/-/normalize-scroll-left-0.2.0.tgz#9445d74275f303cc661e113329aefa492f58114c"
+ integrity sha512-t5oCENZJl8TGusJKoCJm7+asaSsPuNmK6+iEjrZ5TyBj2f02brCRsd4c83hwtu+e5d4LCSBZ0uoDlMjBo+A8yA==
+
normalize-url@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c"
@@ -7529,6 +7737,11 @@ pnp-webpack-plugin@1.5.0:
dependencies:
ts-pnp "^1.1.2"
+popper.js@^1.14.1:
+ version "1.16.1"
+ resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
+ integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==
+
portfinder@^1.0.25:
version "1.0.25"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca"
@@ -8499,7 +8712,7 @@ react-error-overlay@^6.0.4:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.4.tgz#0d165d6d27488e660bc08e57bdabaad741366f7a"
integrity sha512-ueZzLmHltszTshDMwyfELDq8zOA803wQ1ZuzCccXa1m57k1PxSHfflPD5W9YIiTXLs0JTLzoj6o1LuM5N6zzNA==
-react-is@^16.8.1, react-is@^16.8.4:
+react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4:
version "16.12.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
@@ -8564,6 +8777,16 @@ react-scripts@3.3.0:
optionalDependencies:
fsevents "2.1.2"
+react-transition-group@^4.3.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.3.0.tgz#fea832e386cf8796c58b61874a3319704f5ce683"
+ integrity sha512-1qRV1ZuVSdxPlPf4O8t7inxUGpdyO5zG9IoNfJxSO0ImU2A1YWkEQvFPuIPZmMLkg5hYs7vv5mMOyfgSkvAwvw==
+ dependencies:
+ "@babel/runtime" "^7.5.5"
+ dom-helpers "^5.0.1"
+ loose-envify "^1.4.0"
+ prop-types "^15.6.2"
+
react@^16.12.0:
version "16.12.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.12.0.tgz#0c0a9c6a142429e3614834d5a778e18aa78a0b83"
@@ -9858,6 +10081,11 @@ timsort@^0.3.0:
resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
+tiny-warning@^1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
+ integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
+
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
From 5c446538f5777665c38a18d866c446e5c308d7d8 Mon Sep 17 00:00:00 2001
From: Grimmer
Date: Sat, 8 Feb 2020 23:00:22 +0800
Subject: [PATCH 06/21] Add material-ui button and hooks example code
---
reactui/src/App.jsx | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/reactui/src/App.jsx b/reactui/src/App.jsx
index d311299..d4b3eb6 100644
--- a/reactui/src/App.jsx
+++ b/reactui/src/App.jsx
@@ -1,29 +1,23 @@
-import React from "react";
+import React, { useState } from "react";
+import Button from "@material-ui/core/Button";
+
import logo from "./logo.svg";
import "./App.css";
function App() {
+ const [count, setCount] = useState(0);
+
+ function handleClick() {
+ setCount(count + 1);
+ }
+
return (
-
{" "}
+
You clicked {count} times
+
+ You are running this application in
{process.env.NODE_ENV} mode.
);
}
From 77cc42dcd17063a9732e804007c281ee6a0a0fd8 Mon Sep 17 00:00:00 2001
From: Grimmer
Date: Sat, 8 Feb 2020 23:41:45 +0800
Subject: [PATCH 07/21] Add time url query parameters in react and django part
---
DjangoChart/view.py | 60 +++++++++++++++++++++++++++++++--------------
reactui/src/App.jsx | 18 +++++++++++++-
2 files changed, 59 insertions(+), 19 deletions(-)
diff --git a/DjangoChart/view.py b/DjangoChart/view.py
index 2fab819..37e56be 100644
--- a/DjangoChart/view.py
+++ b/DjangoChart/view.py
@@ -18,6 +18,7 @@
# 'musics': musics,
# })
+
def hello(request):
return render(request, 'hello_world.html', {
'current_time': str(datetime.now()),
@@ -34,36 +35,59 @@ class ChartView(TemplateView):
def get_context_data(self, **kwargs):
context = super(ChartView, self).get_context_data(**kwargs)
-
- x = [-2,0,4,6,7]
- y = [q**2-q+3 for q in x]
- trace1 = go.Scatter(x=x, y=y, marker={'color': 'red', 'symbol': 104, 'size': "10"},
- mode="lines", name='1st Trace')
-
- data=go.Data([trace1])
- layout=go.Layout(title="Meine Daten", xaxis={'title':'x1'}, yaxis={'title':'x2'})
- figure=go.Figure(data=data,layout=layout)
+ # print(f"Hello, {name}. You are {age}.")
+ if "time1" in self.request.GET:
+ print(self.request.GET["time1"])
+ if "time2" in self.request.GET:
+ print(self.request.GET["time2"])
+ x = [-2, 0, 4, 6, 7]
+ y = [q**2 - q + 3 for q in x]
+ trace1 = go.Scatter(x=x,
+ y=y,
+ marker={
+ 'color': 'red',
+ 'symbol': 104,
+ 'size': "10"
+ },
+ mode="lines",
+ name='1st Trace')
+
+ data = go.Data([trace1])
+ layout = go.Layout(title="Meine Daten",
+ xaxis={'title': 'x1'},
+ yaxis={'title': 'x2'})
+ figure = go.Figure(data=data, layout=layout)
div = opy.plot(figure, auto_open=False, output_type='div')
context['graph'] = div
return context
-# TODO: Extract the same code of drawing charts for reuse
+
+# TODO: Extract the same code of drawing charts for reuse
class ChartView2(TemplateView):
template_name = "chart.html"
def get_context_data(self, **kwargs):
context = super(ChartView2, self).get_context_data(**kwargs)
- x = [-2,0,4,6,7]
- y = [q**2-q+3 for q in x]
- trace1 = go.Scatter(x=x, y=y, marker={'color': 'green', 'symbol': 104, 'size': "10"},
- mode="lines", name='1st Trace')
-
- data=go.Data([trace1])
- layout=go.Layout(title="Meine Daten", xaxis={'title':'x1'}, yaxis={'title':'x2'})
- figure=go.Figure(data=data,layout=layout)
+ x = [-2, 0, 4, 6, 7]
+ y = [q**2 - q + 3 for q in x]
+ trace1 = go.Scatter(x=x,
+ y=y,
+ marker={
+ 'color': 'green',
+ 'symbol': 104,
+ 'size': "10"
+ },
+ mode="lines",
+ name='1st Trace')
+
+ data = go.Data([trace1])
+ layout = go.Layout(title="Meine Daten",
+ xaxis={'title': 'x1'},
+ yaxis={'title': 'x2'})
+ figure = go.Figure(data=data, layout=layout)
div = opy.plot(figure, auto_open=False, output_type='div')
context['graph'] = div
diff --git a/reactui/src/App.jsx b/reactui/src/App.jsx
index d4b3eb6..0bbda26 100644
--- a/reactui/src/App.jsx
+++ b/reactui/src/App.jsx
@@ -8,6 +8,23 @@ function App() {
const [count, setCount] = useState(0);
function handleClick() {
+ console.log(
+ `You are running this application in ${process.env.NODE_ENV} mode.`
+ );
+
+ const hostname = window.location.hostname; //localhost
+ console.log("window.location.hostname:", window.location.hostname); // href
+
+ const timeParameters = "?time1=10&time2=20";
+ const djangoURL = `http://${hostname}:8000/chart/mode1${timeParameters}`;
+ const debugReactURL = `http://${hostname}:3000${timeParameters}`;
+ if (process.env.NODE_ENV === "development") {
+ window.open(djangoURL);
+ window.location.href = debugReactURL;
+ } else {
+ window.location.href = djangoURL;
+ }
+
setCount(count + 1);
}
@@ -17,7 +34,6 @@ function App() {
- You are running this application in {process.env.NODE_ENV} mode.