Front end should be solid even when bcak end is giving bad data. Fixed issue where breakdowns were not disappearing when they are the current scene.
This commit is contained in:
parent
6f573685e5
commit
8c300cc72a
@ -29,7 +29,22 @@ function show_breakdown(scene) {
|
|||||||
Array.from(document.getElementById("breakdown-list").children).forEach(
|
Array.from(document.getElementById("breakdown-list").children).forEach(
|
||||||
(breakdown) => {
|
(breakdown) => {
|
||||||
if (breakdown.id == `${scene}-breakdown`) {
|
if (breakdown.id == `${scene}-breakdown`) {
|
||||||
|
console.log(
|
||||||
|
`${
|
||||||
|
document
|
||||||
|
.getElementById("breakdown-current")
|
||||||
|
.querySelector(".breakdown-block-title").textContent
|
||||||
|
}, ${scene}`
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
!(
|
||||||
|
document
|
||||||
|
.getElementById("breakdown-current")
|
||||||
|
.querySelector(".breakdown-block-title").textContent == scene
|
||||||
|
)
|
||||||
|
) {
|
||||||
breakdown.classList.remove("hidden");
|
breakdown.classList.remove("hidden");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
breakdown.classList.add("hidden");
|
breakdown.classList.add("hidden");
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ defaults = {
|
|||||||
'backend_filepath': '',
|
'backend_filepath': '',
|
||||||
'backend_filepath_updated': False,
|
'backend_filepath_updated': False,
|
||||||
}
|
}
|
||||||
# default_address = 'http://localhost:8000/'
|
|
||||||
# logging.basicConfig(encoding='utf-8', level=logging.DEBUG)
|
# logging.basicConfig(encoding='utf-8', level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
@ -40,7 +39,14 @@ def index(request):
|
|||||||
try:
|
try:
|
||||||
request_data = requests.get(
|
request_data = requests.get(
|
||||||
f'{listen_address}spoiler', timeout=5, verify=True).text
|
f'{listen_address}spoiler', timeout=5, verify=True).text
|
||||||
logger.info(f'{request_data}')
|
if (loads(request_data)['Scenes'] == None):
|
||||||
|
with open('empty_spoiler.json', 'r') as t:
|
||||||
|
try:
|
||||||
|
request_data = t.read()
|
||||||
|
is_hidden = False
|
||||||
|
|
||||||
|
except:
|
||||||
|
return
|
||||||
except:
|
except:
|
||||||
with open('empty_spoiler.json', 'r') as t:
|
with open('empty_spoiler.json', 'r') as t:
|
||||||
try:
|
try:
|
||||||
@ -65,6 +71,7 @@ def index(request):
|
|||||||
'R', '➡️').strip() for k, l in temp_codes[x].items()} for x in temp_codes.keys()}
|
'R', '➡️').strip() for k, l in temp_codes[x].items()} for x in temp_codes.keys()}
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
tracker_debug = tracker_output['Debug']
|
tracker_debug = tracker_output['Debug']
|
||||||
tracker_totals = tracker_output['Totals']
|
tracker_totals = tracker_output['Totals']
|
||||||
tracker_current_scene = tracker_output['Current']['Scene']
|
tracker_current_scene = tracker_output['Current']['Scene']
|
||||||
@ -85,6 +92,7 @@ def index(request):
|
|||||||
server_address_form.fields['server_address_form'].initial = listen_address
|
server_address_form.fields['server_address_form'].initial = listen_address
|
||||||
backend_filepath_form = BackendFilepathForm()
|
backend_filepath_form = BackendFilepathForm()
|
||||||
backend_filepath_form.fields['backend_filepath_form'].initial = backend_filepath
|
backend_filepath_form.fields['backend_filepath_form'].initial = backend_filepath
|
||||||
|
logging.info(tracker_scenes)
|
||||||
context = {
|
context = {
|
||||||
'backend_filepath': backend_filepath,
|
'backend_filepath': backend_filepath,
|
||||||
'server_address': listen_address,
|
'server_address': listen_address,
|
||||||
|
Loading…
Reference in New Issue
Block a user