Skip to content

Commit

Permalink
Pagina Web
Browse files Browse the repository at this point in the history
Aggiornamento pagina web (settings)
  • Loading branch information
MainKronos committed Feb 17, 2021
1 parent c7c86de commit a956fc4
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 142 deletions.
7 changes: 3 additions & 4 deletions config/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def delete_anime():
@app.route('/settings')
def settings():
setts = ReadSettings()
return render_template('settings.html', settings=setts)
env = getmyenv()
return render_template('settings.html', settings=setts, env=env)

@app.route('/settings_update', methods=['POST'])
def settings_update():
Expand All @@ -62,8 +63,7 @@ def settings_update():
def index():

anime = readData()
env = getmyenv()
return render_template('index.html', infos=anime, env=env)
return render_template('index.html', infos=anime)



Expand Down Expand Up @@ -123,7 +123,6 @@ def myOrder(serieInfo):
def getmyenv():
env = {}

env["ANIME_PATH"] = os.getenv('ANIME_PATH') # cartella dove si trovano gli anime
env["SONARR_URL"] = os.getenv('SONARR_URL') # Indirizzo ip + porta di sonarr
env["API_KEY"] = os.getenv('API_KEY') # Chiave api di sonarr
env["CHAT_ID"] = os.getenv('CHAT_ID') # telegramm
Expand Down
8 changes: 8 additions & 0 deletions config/app/static/css/my.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ input{
color: rgba(255,255,255,0.5) !important;
}

.card .card-image img{
max-height: 84px !important;
object-fit: cover;
}

[type="radio"]:checked+span:after,
[type="radio"].with-gap:checked+span:before,
Expand All @@ -218,3 +222,7 @@ input{
.switch label .lever:after{
background-color: #8f97c4 !important;
}

.switch label .lever:before{
background-color: rgba(159, 168, 218, 0.2) !important;
}
Binary file added config/app/static/images/card-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 2 additions & 25 deletions config/app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<nav class="nav-extended dark">
<div class="nav-wrapper">
<a href="#!" class="brand-logo center dark">Tabella Di Conversione</a>
<a class="btn-floating waves-effect waves-light btn-small modal-trigger dark left info" href="#info">
<i class="material-icons">info</i>
<a class="btn-floating waves-effect waves-light btn-small dark left info" href="/settings">
<i class="material-icons">settings</i>
</a>
</div>
<div class="nav-content">
Expand All @@ -44,29 +44,6 @@ <h5>Aggiungi un Anime</h5>
</div>
</div>

<!-- Modal Structure -->
<div id="info" class="modal dark">
<div class="modal-content">
<h4>Variabili d'Ambiente</h4>
<br>
<table>
<thead>
</thead>
<tbody>
{% for var in env %}
<tr>
<td>{{ var }}</td>
<td>{{ env[var] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="modal-footer">
<a class="modal-close btn waves-effect waves-light dark">Close</a>
</div>
</div>

<!-- Modal Structure -->
<div id="append_anime_modal" class="modal dark">
<form class="col s12" method="post" action="/append_anime">
Expand Down
199 changes: 86 additions & 113 deletions config/app/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
<div class="nav-wrapper">
<a href="index" class="brand-logo center dark">Settings</a>
</div>
<div class="nav-content">
<span class="nav-title hide-on-med-and-up"></span>
</div>
</nav>

<div class="container">
Expand All @@ -38,78 +35,82 @@
<div class="row">
<div class="col s12">
<form class="card dark-back" method="post" action="/settings_update">
<div class="card-content row">

<div class="col s6 m4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Livello del Log</span>
<p>
<label for="DEBUG">
<input class="with-gap" id="DEBUG" value="DEBUG" name="LogLevel" type="radio" {% if settings.LogLevel == 'DEBUG' %}checked{%endif%}/>
<span>DEBUG</span>
</label>
</p>
<p>
<label for="INFO">
<input class="with-gap" id="INFO" value="INFO" name="LogLevel" type="radio" {% if settings.LogLevel == 'INFO' %}checked{%endif%}/>
<span>INFO</span>
</label>
</p>
<p>
<label for="WARNING">
<input class="with-gap" id="WARNING" value="WARNING" name="LogLevel" type="radio" {% if settings.LogLevel == 'WARNING' %}checked{%endif%}/>
<span>WARNING</span>
</label>
</p>
<p>
<label for="ERROR">
<input class="with-gap" id="ERROR" value="ERROR" name="LogLevel" type="radio" {% if settings.LogLevel == 'ERROR' %}checked{%endif%}/>
<span>ERROR</span>
</label>
</p>
<p>
<label for="CRITICAL">
<input class="with-gap" id="CRITICAL" value="CRITICAL" name="LogLevel" type="radio" {% if settings.LogLevel == 'CRITICAL' %}checked{%endif%}/>
<span>CRITICAL</span>
</label>
</p>
<div class="card-image">
<img src="static/images/card-background.png">
<span class="card-title">Impostazioni</span>
</div>
<div class="card-content">
<div class="row">
<div class="col s12 m6 l4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Livello del Log</span>
<p>
<label for="DEBUG">
<input class="with-gap" id="DEBUG" value="DEBUG" name="LogLevel" type="radio" {% if settings.LogLevel == 'DEBUG' %}checked{%endif%}/>
<span>DEBUG</span>
</label>
</p>
<p>
<label for="INFO">
<input class="with-gap" id="INFO" value="INFO" name="LogLevel" type="radio" {% if settings.LogLevel == 'INFO' %}checked{%endif%}/>
<span>INFO</span>
</label>
</p>
<p>
<label for="WARNING">
<input class="with-gap" id="WARNING" value="WARNING" name="LogLevel" type="radio" {% if settings.LogLevel == 'WARNING' %}checked{%endif%}/>
<span>WARNING</span>
</label>
</p>
<p>
<label for="ERROR">
<input class="with-gap" id="ERROR" value="ERROR" name="LogLevel" type="radio" {% if settings.LogLevel == 'ERROR' %}checked{%endif%}/>
<span>ERROR</span>
</label>
</p>
<p>
<label for="CRITICAL">
<input class="with-gap" id="CRITICAL" value="CRITICAL" name="LogLevel" type="radio" {% if settings.LogLevel == 'CRITICAL' %}checked{%endif%}/>
<span>CRITICAL</span>
</label>
</p>

</div>

</div>

</div>
</div>
<div class="col s6 m4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Rinomina Episodi</span>
<div class="switch">
<label for="RenameEp">
Off
<input id='RenameEp' name='RenameEp' type="checkbox" value='True' {% if settings.RenameEp %}checked{%endif%}>
<span class="lever"></span>
On
</label>
<div class="col s12 m6 l4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Rinomina Episodi</span>
<div class="switch">
<label for="RenameEp">
Off
<input id='RenameEp' name='RenameEp' type="checkbox" value='True' {% if settings.RenameEp %}checked{%endif%}>
<span class="lever"></span>
On
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col s6 m4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Sposta Episodi</span>
<div class="switch">
<label for="MoveEp">
Off
<input id='MoveEp' name='MoveEp' type="checkbox" value='True' {% if settings.MoveEp %}checked{%endif%}>
<span class="lever"></span>
On
</label>
<div class="col s12 m6 l4">
<div class="card dark" method="post" action="/settings_update">
<div class="card-content">
<span class="card-title">Sposta Episodi</span>
<div class="switch">
<label for="MoveEp">
Off
<input id='MoveEp' name='MoveEp' type="checkbox" value='True' {% if settings.MoveEp %}checked{%endif%}>
<span class="lever"></span>
On
</label>
</div>
</div>
</div>
</div>
</div>

</div>
<div class="card-action">
<button class="btn waves-effect waves-light dark" type="submit">Save
Expand All @@ -119,59 +120,31 @@
</form>
</div>


<div class="col s12">
<div class="card dark-back">
<div class="card-image">
<img src="static/images/card-background.png">
<span class="card-title">Variabili d'Ambiente</span>
</div>
<div class="card-content">
<table>
<tbody>
{% for var in env %}
<tr>
<td>{{ var }}</td>
<td>{{ env[var] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>


</div>





















<!-- <form class="col s12" method="post" action="/settings_update">
<div class="modal-content">
<h4>Settings</h4>
<div class="row">
<div class="input-field col s6">
<select>
<option value="" disabled selected>Seleziona il livello</option>
<option value="DEBUG">DEBUG</option>
<option value="INFO">INFO</option>
<option value="WARNING">WARNING</option>
<option value="ERROR">ERROR</option>
<option value="CRITICAL">CRITICAL</option>
</select>
<label>Livello del Log</label>
</div>
<div class="input-field col s6">
{{ settings.LogLevel }}
</div>
</div>
</div>
<div class="modal-footer row">
<div class="col s12 right-align">
<button class="btn waves-effect waves-light dark" type="submit">Save
<i class="material-icons right">save</i>
</button>
</div>
</div>
</form> -->
</div>
</div>
</div>
Expand Down

0 comments on commit a956fc4

Please sign in to comment.