diff --git a/src/components/QuestionSearchResult.js b/src/components/QuestionSearchResult.js index 065fd1b..a560c44 100644 --- a/src/components/QuestionSearchResult.js +++ b/src/components/QuestionSearchResult.js @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react' import Questions from './Questions.js' +import Sleep from '../components/sleep' import constants from '../constants.json' @@ -46,7 +47,10 @@ class QuestionSearchResult extends PureComponent { const renderCount = () => { return (
- {searchTerm ? '' : 'Kezdj el írni kereséshez!'} {results} {searchTerm ? 'találat' : 'kérdés' } {searchTerm ? subjs.length : data.Subjects.length} tárgy +
+ {searchTerm ? '' : 'Kezdj el írni kereséshez!'} {results} {searchTerm ? 'találat' : 'kérdés' } {searchTerm ? subjs.length : data.Subjects.length} tárgy +
+
) } diff --git a/src/constants.json b/src/constants.json index afc85f3..8650745 100644 --- a/src/constants.json +++ b/src/constants.json @@ -1,4 +1,5 @@ { + "siteUrl": "https://qmining.frylabs.net/", "apiUrl": "https://api.frylabs.net/", "mobileWindowWidth": 700, "maxQuestionsToRender": 250 diff --git a/src/pages/contribute.js b/src/pages/contribute.js index 6f61ef4..70cd286 100644 --- a/src/pages/contribute.js +++ b/src/pages/contribute.js @@ -1,5 +1,6 @@ import Button from '../components/Button.js' import Helps from '../components/Helps.js' +import Sleep from '../components/sleep' import styles from './contribute.module.css' import repos from '../data/repos.json' @@ -7,6 +8,7 @@ import repos from '../data/repos.json' export default function contribute (props) { return (
+
diff --git a/src/pages/index.js b/src/pages/index.js index 4d6829c..c774a65 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -5,6 +5,7 @@ import React, { useState, useEffect } from 'react' import fetch from 'unfetch' import LoadingIndicator from '../components/LoadingIndicator' +import Sleep from '../components/sleep' import styles from './index.module.css' import links from '../data/links.json' @@ -145,6 +146,7 @@ export default function Index (props) { ) })} + {renderNews()}
) diff --git a/src/pages/manual.js b/src/pages/manual.js index a8cc715..76839d6 100644 --- a/src/pages/manual.js +++ b/src/pages/manual.js @@ -1,3 +1,4 @@ +import Sleep from '../components/sleep' export default function Manual (props) { return ( @@ -13,6 +14,7 @@ function renderMaual () {

Moodle/Elearnig/KMOOC manual

+
Ez a userscript Moodle/Elearnig/KMOOC tesztek megoldása során segítséget jelenít meg.
diff --git a/src/pages/pwRequest.js b/src/pages/pwRequest.js index 9715d31..af9dddb 100644 --- a/src/pages/pwRequest.js +++ b/src/pages/pwRequest.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useState, useEffect } from 'react' import fetch from 'unfetch' import styles from './pwRequest.module.css' @@ -7,6 +7,31 @@ import constants from '../constants.json' export default function PwRequest (props) { const [result, setResult] = useState([]) const [remaining, setRemaining] = useState() + const [requestedPWS, setRequestedPWS] = useState() + const [createDate, setCreateDate] = useState() + + const [addPwPerDay, setAddPwPerDay] = useState() + const [daysAfterUserGetsPWs, setDaysAfterUserGetsPWs] = useState() + const [maxPWCount, setMaxPWCount] = useState() + + useEffect(() => { + console.info('Fetching avaible pws') + fetch(`${constants.apiUrl}avaiblePWS`, { + credentials: 'include' + }) + .then((resp) => { + return resp.json() + }) + .then((data) => { + setRemaining(data.avaiblePWS) + setCreateDate(data.userCreated) + setRequestedPWS(data.requestedPWS) + + setAddPwPerDay(data.addPWPerDay) + setDaysAfterUserGetsPWs(data.daysAfterUserGetsPWs) + setMaxPWCount(data.maxPWCount) + }) + }, []) const handleSubmit = async () => { const rawResponse = await fetch(constants.apiUrl + 'getpw', { @@ -45,10 +70,39 @@ export default function PwRequest (props) {
- Itt Egy új jelszót tudsz kérni új felhasználóknak. Korlátozott mennyiségű jelszót tudsz - csak kérni, de ez idővel visszatöltődik, szóval óvatosan. Közös jelszóhasználat nem - ajánlott, mert ha belépsz valahol akkor azonnal kijelentkeztet mindenhonnan máshonnan. - Szerintem van elég jelszó hogy ne kelljen közös + Itt új jelszavakat tudsz kérni új felhasználóknak. Közös jelszóhasználat nem ajánlott, + mert ha valaki belép azzal a jelszóval amit te használsz akkor téged kiléptet + mindenhonnan. Szerintem van elég jelszó hogy ne kelljen közös +
+
+ Minden nap + + {' ' + addPwPerDay + ' '} + + új lehetőség van jelszót generálni, maximum + + {' ' + maxPWCount + ' '} + + lehetőség gyűlhet össze. Új felhasználók + + {' ' + daysAfterUserGetsPWs + ' '} + + nap után kapnak először lehetőséget. +
+
+ Még kérhető jelszavak: + + {' ' + remaining + ' '} + + Felhasználó létrehozva: + + {' ' + createDate + ' '} + + . Eddig + + {' ' + requestedPWS + ' '} + + jelszót kértél.
) })}
: null} - {remaining ?
Még kérhető jelszavak: {remaining}
: null}
) diff --git a/src/pages/pwRequest.module.css b/src/pages/pwRequest.module.css index f494635..2ca83ba 100644 --- a/src/pages/pwRequest.module.css +++ b/src/pages/pwRequest.module.css @@ -35,13 +35,10 @@ font-weight: bold; } -.remaining { - text-align: center; - font-size: 18px; - color: white; - padding: 10px; -} - .form { margin: 0px; } + +.text span { + color: var(--text-color); +} diff --git a/src/pages/subjectBrowser.js b/src/pages/subjectBrowser.js index 64edc3e..74de442 100644 --- a/src/pages/subjectBrowser.js +++ b/src/pages/subjectBrowser.js @@ -4,6 +4,7 @@ import fetch from 'unfetch' import LoadingIndicator from '../components/LoadingIndicator.js' import Subject from '../components/Subject.js' import SubjectSelector from '../components/SubjectSelector.js' +import Sleep from '../components/sleep' import styles from './subjectBrowser.module.css' import constants from '../constants.json' @@ -67,6 +68,7 @@ export default function SubjectBrowser (props) {
{qCount} kérdés, {sCount} tárgy
+