Resolve conflicts v2

This commit is contained in:
Tomasz 2021-02-05 21:27:18 +01:00
commit d19aea2989
17 changed files with 54 additions and 24 deletions

View file

@ -3,13 +3,11 @@ import json
from .generate_cookies import autogenerate_cookies
def get_attendance(register_id, students, oun, s, date):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:
headers = json.load(f)
attendance_lessons = requests.post(oun+'/FrekwencjaStatystykiPrzedmioty.mvc/Get', headers=headers, cookies=cookies)
attendance_json_id = attendance_lessons.json()['data'][0]['Id']
attendance = requests.post(oun+'/Frekwencja.mvc/Get', headers=headers, cookies=cookies, json={'idTypWpisuFrekwencji': attendance_json_id, 'data': date})

View file

@ -9,7 +9,7 @@ def get_dashboard(register_id, students, s, diary_url, symbol):
diary_url = 'http://uonetplus.vulcan.net.pl/'
else:
diary_url = 'http://uonetplus.fakelog.cf/'
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_exams(register_id, students, oun, s, date, school_year):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -9,4 +9,4 @@ def autogenerate_cookies(students, s):
"idBiezacyUczen": f"{students['data'][0]['IdUczen']}"
})
return cookies
return cookies

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_grades(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,4 +3,4 @@
"Accept": "*/*",
"Connection": "keep-alive",
"User-Agent": "Wulkanowy-web :)"
}
}

View file

@ -3,7 +3,6 @@ import json
from .generate_cookies import autogenerate_cookies
def get_homeworks(register_id, students, oun, s, date, school_year):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,6 +3,7 @@ import json
import calendar
import time
import re
from .generate_cookies import autogenerate_cookies
def get_received_messages(register_id, students, oun, s, date, school_year, symbol):
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_registered_devices(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:
@ -14,7 +13,6 @@ def get_registered_devices(register_id, students, oun, s):
return registered.json()
def register_device(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_notes(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_school_data(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_partial(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -3,7 +3,6 @@ import requests
from .generate_cookies import autogenerate_cookies
def get_student_data(register_id, students, oun, s):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -4,7 +4,6 @@ from bs4 import BeautifulSoup
from .generate_cookies import autogenerate_cookies
def get_timetable(register_id, students, oun, s, date):
cookies = autogenerate_cookies(students, s)
with open('app/API/headers.json') as f:

View file

@ -17,7 +17,7 @@ class AccountManager extends Component {
super(props)
this.handleChangeStudent = this.handleChangeStudent.bind(this)
var cookies_data = JSON.parse(sessionStorage.getItem('cookies_data'));
var students = cookies_data.data.register_r.data;
var students = cookies_data.data.students.data;
this.state.cookies_data = cookies_data;
this.state.students = students;
students.forEach((student) => {
@ -33,7 +33,7 @@ class AccountManager extends Component {
this.state.students.forEach((student) => {
if (student.UczenPelnaNazwa == this.state.student) {
console.log(this.state.cookies_data)
this.state.cookies_data.data.register_r.data = [student];
this.state.cookies_data.data.students.data = [student];
sessionStorage.setItem('cookies_data', JSON.stringify(this.state.cookies_data));
window.location.href = '/content/';
}

View file

@ -1,16 +1,51 @@
import React, { Component } from "react";
import { render } from 'react-dom'
import Dashboard from "./Dashboard";
import { render } from 'react-dom';
import { Button, ListItemText, ListItemIcon, ListItem } from '@material-ui/core';
import { Drawer } from '@material-ui/core';
import Filter6Icon from '@material-ui/icons/Filter6';
import Dashboard from '@material-ui/icons/Dashboard';
import EventNote from '@material-ui/icons/EventNote';
import Event from '@material-ui/icons/Event';
import Class from '@material-ui/icons/Class';
import DateRange from '@material-ui/icons/DateRange';
import InsertChart from '@material-ui/icons/InsertChart';
import EmojiEvents from '@material-ui/icons/EmojiEvents';
import Devices from '@material-ui/icons/Devices';
import Business from '@material-ui/icons/Business'
import AssignmentInd from '@material-ui/icons/AssignmentInd';
import InboxIcon from '@material-ui/icons/MoveToInbox';
import Divider from '@material-ui/core/Divider';
import Forward from '@material-ui/icons/Forward';
import Send from '@material-ui/icons/Send';
import Delete from '@material-ui/icons/Delete';
class Content extends Component {
iconsList = [<Dashboard />, <Filter6Icon />, <EventNote />, <Event />, <Class />, <DateRange />, <InsertChart />, <EmojiEvents />, <Devices />, <Business />, <AssignmentInd />];
iconsListMessages = [<InboxIcon />, <Forward />, <Send />, <Delete />]
render() {
return (
<Dashboard/>
<div>
<Drawer anchor="left" variant="permanent">
{['Start', 'Oceny', 'Plan Lekcji', 'Sprawdziany', 'Zadania Domowe', 'Frekwencja', 'Uczeń na Tle Klasy', 'Uwagi i Osiągnięcia', 'Dostęp Mobilny', 'Szkoła i Nauczyciele', 'Dane Ucznia'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>{this.iconsList[index]}</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
<Divider />
{['Odebrane', 'Wysłane', 'Wyślij Wiadomość', 'Usunięte'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>{this.iconsListMessages[index]}</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
</Drawer>
</div>
)
}
}
};
export default Content
export default Content;
const content = document.getElementById("content")
render(<Content />, content)
const content = document.getElementById("content");
render(<Content />, content);

View file

@ -1,4 +1,10 @@
cd frontend
start npm run dev
cd ..
<<<<<<< HEAD
python manage.py runserver
=======
cls
cd ..
python manage.py runserver
>>>>>>> feature/react