let's go ca marche je pense

This commit is contained in:
piair 2023-08-26 13:14:32 +02:00
parent 6e25dcd115
commit fd8f972cf8
3 changed files with 6 additions and 11 deletions

View File

@ -4,9 +4,7 @@ function addline(ligne){
}
function change_discord(value) {
data = JSON.parse('{{data|tojson}}'); //convertit le dictionnaire data en JSON
function change_discord(value, data) {
if (value == "{{len}}"){
document.getElementById("name").value = "";
document.getElementById("submit").value = "Create !";
@ -26,8 +24,7 @@ function change_discord(value) {
}
}
function change_config(value) {
data = JSON.parse('{{data|tojson}}'); //convertit le dictionnaire data en JSON
function change_config(value, data) {
document.getElementById("delete").style.visibility = "hidden";
if (value == "{{len}}"){
document.getElementById("submit").value = "Create !";
@ -73,6 +70,5 @@ function change_proxy(value, data) {
function change_logs(value) {
console.log(value);
document.getElementById("embed").src = "/static/logs/" + value + ".txt";
}

View File

@ -42,17 +42,16 @@
{% block content %}
<script>data = JSON.parse('{{data|tojson}}'); </script>
{%if not current_user.is_authenticated %}
<button class="unselected" onclick="location.href = '/login';">login</button>
{% else %}
<form method="post" action="/config/">
<table>
<tr>
<td style="width: 10%;">config : </td>
<td style="width: 40%;">
<select onchange="change_config(this.value)" name="config">
<select onchange="change_config(this.value, data)" name="config">
<option id="config" value="{{len}}">New config</option>
{% for i in configs %}
<option id="{{configs[i]['name']}}" value="{{i}}">{{configs[i]['name']}}</option>

View File

@ -40,7 +40,7 @@
</table>
{% endblock %}
{% block content %}
<script>data = JSON.parse('{{data|tojson}}'); </script>
{%if not current_user.is_authenticated %}
<button class="unselected" onclick="location.href = '/login';">login</button>
{% else %}
@ -49,7 +49,7 @@
<tr>
<td></td>
<td>
<select name="select" onchange="change_discord(this.value)">
<select name="select" onchange="change_discord(this.value, data)">
<option selected id="new" value="{{ len }}">Create new Discord config</option>
{% for i in data %}
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>