Added @flare/js-utils + read data from CDN API
parent
6b0d77b618
commit
f674085345
1
.env
1
.env
|
@ -1,4 +1,5 @@
|
||||||
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
||||||
REACT_APP_ENABLE_TEMPLATE_CONTENT=True
|
REACT_APP_ENABLE_TEMPLATE_CONTENT=True
|
||||||
|
REACT_APP_CDN_URL=http://localhost:5050
|
||||||
|
|
||||||
#PUBLIC_URL=/cdn-admin/
|
#PUBLIC_URL=/cdn-admin/
|
|
@ -1,3 +1,4 @@
|
||||||
PUBLIC_URL=/cdn-admin/
|
PUBLIC_URL=/cdn-admin/
|
||||||
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
||||||
REACT_APP_ENABLE_TEMPLATE_CONTENT=False
|
REACT_APP_ENABLE_TEMPLATE_CONTENT=False
|
||||||
|
REACT_APP_CDN_URL=https://toodle.ddns.net/cdn
|
|
@ -0,0 +1 @@
|
||||||
|
@flare:registry=https://toodle.ddns.net/public-node-registry
|
|
@ -4,7 +4,7 @@ Built with [React](https://facebook.github.io/react/), [Material-UI](https://mat
|
||||||
|
|
||||||
**This version uses React 16.14.0, React Router v5, MaterialUI v4, built with React Hooks and React Context (No Redux)**
|
**This version uses React 16.14.0, React Router v5, MaterialUI v4, built with React Hooks and React Context (No Redux)**
|
||||||
|
|
||||||
[View Demo](https://toodle.ddns.net/cdn-admin-demo) | [Download](https://dev.azure.com/tstanciu94/CDN) | [More projects](https://toodle.ddns.net/heimdall) | [Support forum](https://toodle.ddns.net/forum)
|
[View Demo](https://toodle.ddns.net/cdn-admin/) | [Download](https://toodle.ddns.net/gitea/tudor/cdn-frontend) | [More projects](https://toodle.ddns.net/heimdall) | [Support forum](https://toodle.ddns.net/forum)
|
||||||
|
|
||||||
[![image](https://user-images.githubusercontent.com/24964748/55800639-df780300-5adc-11e9-84b7-7c2437088516.png)](https://flatlogic.com/admin-dashboards/react-material-admin/demo)
|
[![image](https://user-images.githubusercontent.com/24964748/55800639-df780300-5adc-11e9-84b7-7c2437088516.png)](https://flatlogic.com/admin-dashboards/react-material-admin/demo)
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
FROM node:12-slim as builder
|
FROM node:12-slim as builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY .npmrc .npmrc
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
RUN rm -f .npmrc
|
||||||
|
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
|
@ -1624,6 +1624,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@flare/js-utils": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://toodle.ddns.net/public-node-registry/@flare%2fjs-utils/-/js-utils-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-z0UnYo051yWwZC/2d1IuyycTdvqV5nbB6S8mio+VWIgkMAd7hVA9zUwqDxsuaI9MzRFK9mlaFCs6bQrVzlo5jA=="
|
||||||
|
},
|
||||||
"@hapi/address": {
|
"@hapi/address": {
|
||||||
"version": "2.1.4",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz",
|
||||||
|
@ -2221,6 +2226,49 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@jridgewell/gen-mapping": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
|
||||||
|
"requires": {
|
||||||
|
"@jridgewell/set-array": "^1.0.1",
|
||||||
|
"@jridgewell/sourcemap-codec": "^1.4.10",
|
||||||
|
"@jridgewell/trace-mapping": "^0.3.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@jridgewell/resolve-uri": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w=="
|
||||||
|
},
|
||||||
|
"@jridgewell/set-array": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw=="
|
||||||
|
},
|
||||||
|
"@jridgewell/source-map": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
|
||||||
|
"requires": {
|
||||||
|
"@jridgewell/gen-mapping": "^0.3.0",
|
||||||
|
"@jridgewell/trace-mapping": "^0.3.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@jridgewell/sourcemap-codec": {
|
||||||
|
"version": "1.4.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
|
||||||
|
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
|
||||||
|
},
|
||||||
|
"@jridgewell/trace-mapping": {
|
||||||
|
"version": "0.3.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz",
|
||||||
|
"integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==",
|
||||||
|
"requires": {
|
||||||
|
"@jridgewell/resolve-uri": "3.1.0",
|
||||||
|
"@jridgewell/sourcemap-codec": "1.4.14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@material-ui/core": {
|
"@material-ui/core": {
|
||||||
"version": "4.11.3",
|
"version": "4.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.11.3.tgz",
|
||||||
|
@ -3257,9 +3305,9 @@
|
||||||
"integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4="
|
"integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4="
|
||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
|
||||||
},
|
},
|
||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
|
@ -3454,9 +3502,9 @@
|
||||||
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="
|
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="
|
||||||
},
|
},
|
||||||
"async": {
|
"async": {
|
||||||
"version": "2.6.3",
|
"version": "2.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
||||||
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
|
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash": "^4.17.14"
|
"lodash": "^4.17.14"
|
||||||
}
|
}
|
||||||
|
@ -6761,12 +6809,9 @@
|
||||||
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
|
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
|
||||||
},
|
},
|
||||||
"eventsource": {
|
"eventsource": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz",
|
||||||
"integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==",
|
"integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA=="
|
||||||
"requires": {
|
|
||||||
"original": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"evp_bytestokey": {
|
"evp_bytestokey": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
|
@ -7246,9 +7291,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.14.1",
|
"version": "1.15.2",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||||
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg=="
|
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
|
||||||
},
|
},
|
||||||
"font-awesome": {
|
"font-awesome": {
|
||||||
"version": "4.7.0",
|
"version": "4.7.0",
|
||||||
|
@ -10541,9 +10586,9 @@
|
||||||
"integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw=="
|
"integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw=="
|
||||||
},
|
},
|
||||||
"loader-utils": {
|
"loader-utils": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
|
||||||
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"big.js": "^5.2.2",
|
"big.js": "^5.2.2",
|
||||||
"emojis-list": "^3.0.0",
|
"emojis-list": "^3.0.0",
|
||||||
|
@ -10908,17 +10953,17 @@
|
||||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
|
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
|
@ -11006,9 +11051,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.29.1",
|
"version": "2.29.4",
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||||
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
|
||||||
},
|
},
|
||||||
"move-concurrently": {
|
"move-concurrently": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
|
@ -11503,14 +11548,6 @@
|
||||||
"word-wrap": "^1.2.3"
|
"word-wrap": "^1.2.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"original": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==",
|
|
||||||
"requires": {
|
|
||||||
"url-parse": "^1.4.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"os-browserify": {
|
"os-browserify": {
|
||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
|
||||||
|
@ -12949,9 +12986,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"prismjs": {
|
"prismjs": {
|
||||||
"version": "1.24.0",
|
"version": "1.29.0",
|
||||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz",
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
|
||||||
"integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ=="
|
"integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q=="
|
||||||
},
|
},
|
||||||
"process": {
|
"process": {
|
||||||
"version": "0.11.10",
|
"version": "0.11.10",
|
||||||
|
@ -13308,6 +13345,16 @@
|
||||||
"slash": "^3.0.0"
|
"slash": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"loader-utils": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||||
|
"requires": {
|
||||||
|
"big.js": "^5.2.2",
|
||||||
|
"emojis-list": "^3.0.0",
|
||||||
|
"json5": "^2.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"locate-path": {
|
"locate-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||||
|
@ -13856,6 +13903,16 @@
|
||||||
"integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==",
|
"integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimatch": "3.0.4"
|
"minimatch": "3.0.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"minimatch": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"reduce-css-calc": {
|
"reduce-css-calc": {
|
||||||
|
@ -13884,13 +13941,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"refractor": {
|
"refractor": {
|
||||||
"version": "3.4.0",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/refractor/-/refractor-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz",
|
||||||
"integrity": "sha512-dBeD02lC5eytm9Gld2Mx0cMcnR+zhSnsTfPpWqFaMgUMJfC9A6bcN3Br/NaXrnBJcuxnLFR90k1jrkaSyV8umg==",
|
"integrity": "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"hastscript": "^6.0.0",
|
"hastscript": "^6.0.0",
|
||||||
"parse-entities": "^2.0.0",
|
"parse-entities": "^2.0.0",
|
||||||
"prismjs": "~1.24.0"
|
"prismjs": "~1.27.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"prismjs": {
|
||||||
|
"version": "1.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz",
|
||||||
|
"integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"regenerate": {
|
"regenerate": {
|
||||||
|
@ -14055,9 +14119,9 @@
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
},
|
},
|
||||||
"nth-check": {
|
"nth-check": {
|
||||||
"version": "2.0.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
||||||
"integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==",
|
"integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"boolbase": "^1.0.0"
|
"boolbase": "^1.0.0"
|
||||||
}
|
}
|
||||||
|
@ -15586,9 +15650,9 @@
|
||||||
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
|
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
|
||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.12",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz",
|
||||||
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
|
"integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chownr": "^2.0.0",
|
"chownr": "^2.0.0",
|
||||||
"fs-minipass": "^2.0.0",
|
"fs-minipass": "^2.0.0",
|
||||||
|
@ -15674,6 +15738,11 @@
|
||||||
"webpack-sources": "^1.4.3"
|
"webpack-sources": "^1.4.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"acorn": {
|
||||||
|
"version": "8.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
|
||||||
|
"integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA=="
|
||||||
|
},
|
||||||
"commander": {
|
"commander": {
|
||||||
"version": "2.20.3",
|
"version": "2.20.3",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
|
@ -15734,19 +15803,24 @@
|
||||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||||
},
|
},
|
||||||
"terser": {
|
"terser": {
|
||||||
"version": "5.7.1",
|
"version": "5.16.1",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz",
|
||||||
"integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
|
"integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@jridgewell/source-map": "^0.3.2",
|
||||||
|
"acorn": "^8.5.0",
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
"source-map": "~0.7.2",
|
"source-map-support": "~0.5.20"
|
||||||
"source-map-support": "~0.5.19"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"source-map": {
|
"source-map-support": {
|
||||||
"version": "0.7.3",
|
"version": "0.5.21",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
|
||||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
|
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
|
||||||
|
"requires": {
|
||||||
|
"buffer-from": "^1.0.0",
|
||||||
|
"source-map": "^0.6.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15815,9 +15889,9 @@
|
||||||
"integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA=="
|
"integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA=="
|
||||||
},
|
},
|
||||||
"tmpl": {
|
"tmpl": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
||||||
"integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE="
|
"integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="
|
||||||
},
|
},
|
||||||
"to-arraybuffer": {
|
"to-arraybuffer": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
|
@ -16193,9 +16267,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"url-parse": {
|
"url-parse": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.10",
|
||||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
||||||
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
|
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"querystringify": "^2.1.1",
|
"querystringify": "^2.1.1",
|
||||||
"requires-port": "^1.0.0"
|
"requires-port": "^1.0.0"
|
||||||
|
|
13
package.json
13
package.json
|
@ -1,6 +1,16 @@
|
||||||
{
|
{
|
||||||
"name": "cdn-admin",
|
"name": "cdn-admin",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"description": "CDN administration application",
|
||||||
|
"author": {
|
||||||
|
"name": "Tudor Stanciu",
|
||||||
|
"email": "tudor.stanciu94@gmail.com",
|
||||||
|
"url": "https://toodle.ddns.net/tsp"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://toodle.ddns.net/gitea/tudor/cdn-frontend"
|
||||||
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "./",
|
"homepage": "./",
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
@ -9,6 +19,7 @@
|
||||||
"node-fetch": "^2.6.1"
|
"node-fetch": "^2.6.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@flare/js-utils": "^1.0.0",
|
||||||
"@material-ui/core": "^4.11.3",
|
"@material-ui/core": "^4.11.3",
|
||||||
"@material-ui/icons": "^4.11.2",
|
"@material-ui/icons": "^4.11.2",
|
||||||
"@material-ui/lab": "^4.0.0-alpha.60",
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
||||||
|
@ -22,7 +33,7 @@
|
||||||
"i18next": "^19.4.4",
|
"i18next": "^19.4.4",
|
||||||
"i18next-browser-languagedetector": "^4.1.1",
|
"i18next-browser-languagedetector": "^4.1.1",
|
||||||
"i18next-http-backend": "^1.0.10",
|
"i18next-http-backend": "^1.0.10",
|
||||||
"moment": "^2.25.3",
|
"moment": "^2.29.4",
|
||||||
"mui-datatables": "^3.7.4",
|
"mui-datatables": "^3.7.4",
|
||||||
"react": "^16.14.0",
|
"react": "^16.14.0",
|
||||||
"react-apexcharts": "^1.3.7",
|
"react-apexcharts": "^1.3.7",
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
import useResourcesApi from "./useResourcesApi";
|
||||||
|
|
||||||
|
export { useResourcesApi };
|
|
@ -0,0 +1,60 @@
|
||||||
|
import { useCallback, useMemo } from "react";
|
||||||
|
import { useToast } from "../context/ToastContext";
|
||||||
|
import { get, post } from "../utils/axios";
|
||||||
|
|
||||||
|
const cdn = process.env.REACT_APP_CDN_URL;
|
||||||
|
const endpoints = {
|
||||||
|
mimeTypes: `${cdn}/admin/mime-types`,
|
||||||
|
resources: `${cdn}/admin/resources`
|
||||||
|
};
|
||||||
|
|
||||||
|
const useResourcesApi = () => {
|
||||||
|
const { error } = useToast();
|
||||||
|
|
||||||
|
const handleError = useCallback(
|
||||||
|
(err) => {
|
||||||
|
const message = `${err.title} ${err.correlationId}`;
|
||||||
|
error(message);
|
||||||
|
},
|
||||||
|
[error]
|
||||||
|
);
|
||||||
|
|
||||||
|
const defaultOptions = useMemo(
|
||||||
|
() => ({
|
||||||
|
onCompleted: () => {},
|
||||||
|
onError: handleError
|
||||||
|
}),
|
||||||
|
[handleError]
|
||||||
|
);
|
||||||
|
|
||||||
|
const call = useCallback(
|
||||||
|
async (request, options) => {
|
||||||
|
const internalOptions = { ...defaultOptions, ...options };
|
||||||
|
const { onCompleted, onError } = internalOptions;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await request();
|
||||||
|
onCompleted(result);
|
||||||
|
return result;
|
||||||
|
} catch (error) {
|
||||||
|
onError(error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[defaultOptions]
|
||||||
|
);
|
||||||
|
|
||||||
|
const getMimeTypes = useCallback(
|
||||||
|
(options = defaultOptions) => {
|
||||||
|
const promise = call(() => get(endpoints.mimeTypes), options);
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
[call, defaultOptions]
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
getMimeTypes
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useResourcesApi;
|
|
@ -13,6 +13,9 @@ import Charts from "../../pages/charts/Charts";
|
||||||
import AppearancePage from "../../pages/settings/appearance/components/AppearancePage";
|
import AppearancePage from "../../pages/settings/appearance/components/AppearancePage";
|
||||||
import ContentFooter from "./ContentFooter";
|
import ContentFooter from "./ContentFooter";
|
||||||
|
|
||||||
|
// containers
|
||||||
|
import ResourcesContainer from "../../features/resources/components/ResourcesContainer";
|
||||||
|
|
||||||
// context
|
// context
|
||||||
import { useLayoutState } from "../../context/LayoutContext";
|
import { useLayoutState } from "../../context/LayoutContext";
|
||||||
|
|
||||||
|
@ -33,6 +36,7 @@ const Content = () => {
|
||||||
<div className={classes.fakeToolbar} />
|
<div className={classes.fakeToolbar} />
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/dashboard" component={Dashboard} />
|
<Route path="/dashboard" component={Dashboard} />
|
||||||
|
<Route path="/resources" component={ResourcesContainer} />
|
||||||
<Route path="/appearance" component={AppearancePage} />
|
<Route path="/appearance" component={AppearancePage} />
|
||||||
<Route path="/typography" component={Typography} />
|
<Route path="/typography" component={Typography} />
|
||||||
<Route path="/tables" component={Tables} />
|
<Route path="/tables" component={Tables} />
|
||||||
|
|
|
@ -60,7 +60,7 @@ const ContentFooter = () => {
|
||||||
<Icon path={TwitterIcon} size={1} color="#6E6E6E99" />
|
<Icon path={TwitterIcon} size={1} color="#6E6E6E99" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={"https://dev.azure.com/tstanciu94"} target={"_blank"}>
|
<Link href={"https://toodle.ddns.net/gitea/"} target={"_blank"}>
|
||||||
<IconButton aria-label="github" style={{ marginRight: -12 }}>
|
<IconButton aria-label="github" style={{ marginRight: -12 }}>
|
||||||
<Icon path={GithubIcon} size={1} color="#6E6E6E99" />
|
<Icon path={GithubIcon} size={1} color="#6E6E6E99" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
|
@ -68,19 +68,19 @@ let menu = [
|
||||||
{
|
{
|
||||||
id: 9,
|
id: 9,
|
||||||
label: "Menu.Library",
|
label: "Menu.Library",
|
||||||
link: "https://dev.azure.com/tstanciu94/CDN",
|
link: "https://toodle.ddns.net/gitea/tudor/cdn-frontend",
|
||||||
icon: <LibraryIcon />
|
icon: <LibraryIcon />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
label: "Menu.Support",
|
label: "Menu.Support",
|
||||||
link: "https://toodle.ddns.net/forum",
|
link: "https://toodle.ddns.net/tsp",
|
||||||
icon: <SupportIcon />
|
icon: <SupportIcon />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 11,
|
id: 11,
|
||||||
label: "Menu.FAQ",
|
label: "Menu.FAQ",
|
||||||
link: "https://toodle.ddns.net/forum",
|
link: "https://toodle.ddns.net/tsp",
|
||||||
icon: <FAQIcon />
|
icon: <FAQIcon />
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { useResourcesApi } from "../../../api";
|
||||||
|
|
||||||
|
const ResourcesContainer = () => {
|
||||||
|
const [state, setState] = useState({ loaded: false });
|
||||||
|
const { getMimeTypes } = useResourcesApi();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getMimeTypes({
|
||||||
|
onCompleted: (data) => {
|
||||||
|
const dta = Object.assign(data, { loaded: true });
|
||||||
|
setState(dta);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, [getMimeTypes]);
|
||||||
|
|
||||||
|
return <div>I'm alive!</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ResourcesContainer;
|
|
@ -33,7 +33,7 @@ function Login(props) {
|
||||||
var [error, setError] = useState(null);
|
var [error, setError] = useState(null);
|
||||||
var [activeTabId, setActiveTabId] = useState(0);
|
var [activeTabId, setActiveTabId] = useState(0);
|
||||||
var [nameValue, setNameValue] = useState("");
|
var [nameValue, setNameValue] = useState("");
|
||||||
var [loginValue, setLoginValue] = useState("admin");
|
var [loginValue, setLoginValue] = useState("");
|
||||||
var [passwordValue, setPasswordValue] = useState("");
|
var [passwordValue, setPasswordValue] = useState("");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
const isArray = (parameter) => {
|
|
||||||
const _isArray = parameter.constructor === Array;
|
|
||||||
return _isArray;
|
|
||||||
};
|
|
||||||
|
|
||||||
const isObject = (parameter) => {
|
|
||||||
const _isObject = typeof parameter === "object" && parameter !== null;
|
|
||||||
|
|
||||||
return _isObject;
|
|
||||||
};
|
|
||||||
|
|
||||||
function isJson(str) {
|
|
||||||
try {
|
|
||||||
const data = JSON.parse(str);
|
|
||||||
return { data, success: true };
|
|
||||||
} catch (e) {
|
|
||||||
return { data: null, success: false };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { isArray, isObject, isJson };
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { isArray, isObject, isJson } from "./dataType";
|
import { typeValidator } from "@flare/js-utils";
|
||||||
|
|
||||||
const setItem = (key, value) => {
|
const setItem = (key, value) => {
|
||||||
|
const { isArray, isObject } = typeValidator;
|
||||||
let valueToStore = value;
|
let valueToStore = value;
|
||||||
if (isArray(value) || isObject(value)) {
|
if (isArray(value) || isObject(value)) {
|
||||||
valueToStore = JSON.stringify(value);
|
valueToStore = JSON.stringify(value);
|
||||||
|
@ -11,6 +12,7 @@ const setItem = (key, value) => {
|
||||||
|
|
||||||
const getItem = (key) => {
|
const getItem = (key) => {
|
||||||
var value = window.localStorage.getItem(key);
|
var value = window.localStorage.getItem(key);
|
||||||
|
const { isJson } = typeValidator;
|
||||||
var { data, success } = isJson(value);
|
var { data, success } = isJson(value);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|
Loading…
Reference in New Issue