Getting dashboard data

This commit is contained in:
Pengwius 2021-01-14 22:13:06 +01:00
parent 74d25f0ac3
commit bdeedecd4c
2 changed files with 22 additions and 8 deletions

View file

@ -31,8 +31,22 @@ def get_dashboard(register_id, register_r, s, diary_url, symbol):
}
index = requests.get(f'{diary_url}{symbol}/Start.mvc/Index', headers=headers, cookies=cookies)
permissionsValue = re.search("permissions: '(.)*'", index.text)
permissionsValue = permissionsValue.group()
print(permissionsValue)
permissions_value = re.search("permissions: '(.)*'", index.text)
permissions_value = permissions_value.group()
permissions_value = permissions_value.replace('permissions: ', '').replace("'", "")
return {"dupa": "dupa"}
json = {
"permissions": permissions_value
}
last_notes = requests.post(f'{diary_url}{symbol}/Start.mvc/GetLastNotes', headers=headers, cookies=cookies, json=json)
free_days = requests.post(f'{diary_url}{symbol}/Start.mvc/GetFreeDays', headers=headers, cookies=cookies, json=json)
lucky_number = requests.post(f'{diary_url}{symbol}/Start.mvc/GetKidsLuckyNumbers', headers=headers, cookies=cookies, json=json)
return_data = {
"last_notes": last_notes.json(),
"free_days": free_days.json(),
"lucky_number": lucky_number.json()
}
return return_data

View file

@ -42,9 +42,9 @@
<div class="background">
<img src="{% static 'images/wallpaper.jpg' %}" width="300" height="176">
</div>
<a href="#user"><img class="circle" src="{% static 'images/27146352.png' %}"></a>
<a href="#name"><span class="white-text name" id='name'>John Doe</span></a>
<a href="#email"><span class="white-text email" id='email'>jdandturk@gmail.com</span></a>
<a><img class="circle" src="{% static 'images/27146352.png' %}"></a>
<a><span class="white-text name" id='name'>Imie Imie2 Nazwisko</span></a>
<a><span class="white-text email" id='email'>E-mail</span></a>
</div></li>
<li><a id="dashboard_" class='option'><i class="material-icons">dashboard</i>Start</a></li>
<li><a id="grades_" class='option'><i class="material-icons">filter_6</i>Oceny</a></li>
@ -55,7 +55,7 @@
<li><a id="notes_" class='option'><i class="material-icons">emoji_events</i>Uwagi i Osiągnięcia</a></li>
<li><a id="mobile_access_" class='option'><i class="material-icons">devices</i>Dostęp Mobilny</a></li>
<li><a id="school_data_" class='option'><i class="material-icons">business</i>Szkoła i Nauczyciele</a></li>
<li><a id="messages_" class="dropdown-trigger" href="#!" data-target="dropdown1"><i class="material-icons">email</i>Wiadomości</a></li>
<li><a id="messages_" class="dropdown-trigger" data-target="dropdown1"><i class="material-icons">email</i>Wiadomości</a></li>
<ul id='dropdown1' class='dropdown-content'>
<li><a id='received_' class='option'>Odebrane</a></li>
<li><a id='sent_' class='option'>Wysłane</a></li>