mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Prettier pw request tab
This commit is contained in:
parent
0e8f6cd2d9
commit
5b1faa5687
8 changed files with 77 additions and 14 deletions
|
@ -1,6 +1,7 @@
|
||||||
import React, { PureComponent } from 'react'
|
import React, { PureComponent } from 'react'
|
||||||
|
|
||||||
import Questions from './Questions.js'
|
import Questions from './Questions.js'
|
||||||
|
import Sleep from '../components/sleep'
|
||||||
|
|
||||||
import constants from '../constants.json'
|
import constants from '../constants.json'
|
||||||
|
|
||||||
|
@ -45,9 +46,12 @@ class QuestionSearchResult extends PureComponent {
|
||||||
|
|
||||||
const renderCount = () => {
|
const renderCount = () => {
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
{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
|
||||||
</div>
|
</div>
|
||||||
|
<Sleep />
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"siteUrl": "https://qmining.frylabs.net/",
|
||||||
"apiUrl": "https://api.frylabs.net/",
|
"apiUrl": "https://api.frylabs.net/",
|
||||||
"mobileWindowWidth": 700,
|
"mobileWindowWidth": 700,
|
||||||
"maxQuestionsToRender": 250
|
"maxQuestionsToRender": 250
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Button from '../components/Button.js'
|
import Button from '../components/Button.js'
|
||||||
import Helps from '../components/Helps.js'
|
import Helps from '../components/Helps.js'
|
||||||
|
import Sleep from '../components/sleep'
|
||||||
|
|
||||||
import styles from './contribute.module.css'
|
import styles from './contribute.module.css'
|
||||||
import repos from '../data/repos.json'
|
import repos from '../data/repos.json'
|
||||||
|
@ -7,6 +8,7 @@ import repos from '../data/repos.json'
|
||||||
export default function contribute (props) {
|
export default function contribute (props) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<Sleep />
|
||||||
<Helps />
|
<Helps />
|
||||||
<hr />
|
<hr />
|
||||||
<div className={styles.description}>
|
<div className={styles.description}>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import React, { useState, useEffect } from 'react'
|
||||||
import fetch from 'unfetch'
|
import fetch from 'unfetch'
|
||||||
|
|
||||||
import LoadingIndicator from '../components/LoadingIndicator'
|
import LoadingIndicator from '../components/LoadingIndicator'
|
||||||
|
import Sleep from '../components/sleep'
|
||||||
|
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import links from '../data/links.json'
|
import links from '../data/links.json'
|
||||||
|
@ -145,6 +146,7 @@ export default function Index (props) {
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</center>
|
</center>
|
||||||
|
<Sleep />
|
||||||
{renderNews()}
|
{renderNews()}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import Sleep from '../components/sleep'
|
||||||
|
|
||||||
export default function Manual (props) {
|
export default function Manual (props) {
|
||||||
return (
|
return (
|
||||||
|
@ -13,6 +14,7 @@ function renderMaual () {
|
||||||
<center>
|
<center>
|
||||||
<h1>Moodle/Elearnig/KMOOC manual</h1>
|
<h1>Moodle/Elearnig/KMOOC manual</h1>
|
||||||
</center>
|
</center>
|
||||||
|
<Sleep />
|
||||||
<center>
|
<center>
|
||||||
Ez a userscript Moodle/Elearnig/KMOOC tesztek megoldása során segítséget jelenít meg.
|
Ez a userscript Moodle/Elearnig/KMOOC tesztek megoldása során segítséget jelenít meg.
|
||||||
</center>
|
</center>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import fetch from 'unfetch'
|
import fetch from 'unfetch'
|
||||||
|
|
||||||
import styles from './pwRequest.module.css'
|
import styles from './pwRequest.module.css'
|
||||||
|
@ -7,6 +7,31 @@ import constants from '../constants.json'
|
||||||
export default function PwRequest (props) {
|
export default function PwRequest (props) {
|
||||||
const [result, setResult] = useState([])
|
const [result, setResult] = useState([])
|
||||||
const [remaining, setRemaining] = 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 handleSubmit = async () => {
|
||||||
const rawResponse = await fetch(constants.apiUrl + 'getpw', {
|
const rawResponse = await fetch(constants.apiUrl + 'getpw', {
|
||||||
|
@ -45,10 +70,39 @@ export default function PwRequest (props) {
|
||||||
<div>
|
<div>
|
||||||
<div id='form'>
|
<div id='form'>
|
||||||
<div className={styles.text}>
|
<div className={styles.text}>
|
||||||
Itt Egy új jelszót tudsz kérni új felhasználóknak. Korlátozott mennyiségű jelszót tudsz
|
Itt új jelszavakat tudsz kérni új felhasználóknak. Közös jelszóhasználat nem ajánlott,
|
||||||
csak kérni, de ez idővel visszatöltődik, szóval óvatosan. Közös jelszóhasználat nem
|
mert ha valaki belép azzal a jelszóval amit te használsz akkor téged kiléptet
|
||||||
ajánlott, mert ha belépsz valahol akkor azonnal kijelentkeztet mindenhonnan máshonnan.
|
mindenhonnan. Szerintem van elég jelszó hogy ne kelljen közös
|
||||||
Szerintem van elég jelszó hogy ne kelljen közös
|
</div>
|
||||||
|
<div className={styles.text}>
|
||||||
|
Minden nap
|
||||||
|
<span>
|
||||||
|
{' ' + addPwPerDay + ' '}
|
||||||
|
</span>
|
||||||
|
új lehetőség van jelszót generálni, maximum
|
||||||
|
<span>
|
||||||
|
{' ' + maxPWCount + ' '}
|
||||||
|
</span>
|
||||||
|
lehetőség gyűlhet össze. Új felhasználók
|
||||||
|
<span>
|
||||||
|
{' ' + daysAfterUserGetsPWs + ' '}
|
||||||
|
</span>
|
||||||
|
nap után kapnak először lehetőséget.
|
||||||
|
</div>
|
||||||
|
<div className={styles.text}>
|
||||||
|
Még kérhető jelszavak:
|
||||||
|
<span>
|
||||||
|
{' ' + remaining + ' '}
|
||||||
|
</span>
|
||||||
|
Felhasználó létrehozva:
|
||||||
|
<span>
|
||||||
|
{' ' + createDate + ' '}
|
||||||
|
</span>
|
||||||
|
. Eddig
|
||||||
|
<span>
|
||||||
|
{' ' + requestedPWS + ' '}
|
||||||
|
</span>
|
||||||
|
jelszót kértél.
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.buttonContainer}>
|
<div className={styles.buttonContainer}>
|
||||||
<div
|
<div
|
||||||
|
@ -65,7 +119,6 @@ export default function PwRequest (props) {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}</div> : null}
|
})}</div> : null}
|
||||||
{remaining ? <div className={styles.remaining}>Még kérhető jelszavak: {remaining}</div> : null}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -35,13 +35,10 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remaining {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 18px;
|
|
||||||
color: white;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text span {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import fetch from 'unfetch'
|
||||||
import LoadingIndicator from '../components/LoadingIndicator.js'
|
import LoadingIndicator from '../components/LoadingIndicator.js'
|
||||||
import Subject from '../components/Subject.js'
|
import Subject from '../components/Subject.js'
|
||||||
import SubjectSelector from '../components/SubjectSelector.js'
|
import SubjectSelector from '../components/SubjectSelector.js'
|
||||||
|
import Sleep from '../components/sleep'
|
||||||
|
|
||||||
import styles from './subjectBrowser.module.css'
|
import styles from './subjectBrowser.module.css'
|
||||||
import constants from '../constants.json'
|
import constants from '../constants.json'
|
||||||
|
@ -67,6 +68,7 @@ export default function SubjectBrowser (props) {
|
||||||
<div>
|
<div>
|
||||||
{qCount} kérdés, {sCount} tárgy
|
{qCount} kérdés, {sCount} tárgy
|
||||||
</div>
|
</div>
|
||||||
|
<Sleep />
|
||||||
<div>
|
<div>
|
||||||
<Subject
|
<Subject
|
||||||
subj={currSubj}
|
subj={currSubj}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue