Ajout liste des fichiers results
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
|||||||
.log
|
.log
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
|
.env
|
||||||
@@ -16,6 +16,6 @@ COPY . /src
|
|||||||
# Exposer le port 5000 pour accéder à l'application Flask
|
# Exposer le port 5000 pour accéder à l'application Flask
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Lancer un script pour démarrer MySQL en arrière-plan puis l'application Python
|
# lancer l'application Python
|
||||||
CMD service mysql start && python3 app.py
|
CMD python3 app.py
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -1,2 +1,12 @@
|
|||||||
# FreqStats
|
# FreqStats
|
||||||
|
|
||||||
|
## Construction
|
||||||
|
|
||||||
|
docker build -t flask-web-app .
|
||||||
|
|
||||||
|
## Lancement
|
||||||
|
|
||||||
|
|
||||||
|
docker run -it -p 5000:5000 -v $(pwd)/src/:/src -v /home/jerome/Perso/freqtradeDocker/user_data/backtest_results:/mnt/external flask-web-app bash
|
||||||
|
|
||||||
|
puis : python3 app.py
|
||||||
|
|||||||
14
README.txt
14
README.txt
@@ -1,14 +0,0 @@
|
|||||||
# Construction
|
|
||||||
|
|
||||||
docker build -t flask-web-app .
|
|
||||||
|
|
||||||
# Lancement
|
|
||||||
|
|
||||||
docker run -it -p 5000:5000 -v $(pwd)/src/:/src flask-web-app bash
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
13
src/app.py
13
src/app.py
@@ -1,11 +1,18 @@
|
|||||||
# app.py
|
import os
|
||||||
from flask import Flask, render_template, request
|
from flask import Flask, render_template
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
return render_template('index.html') # Page d'accueil avec un formulaire ou autre contenu
|
# Liste les fichiers dans le répertoire monté
|
||||||
|
files = os.listdir('/mnt/external')
|
||||||
|
|
||||||
|
# Filtre pour obtenir uniquement les fichiers (pas les dossiers)
|
||||||
|
files = [f for f in files if os.path.isfile(os.path.join('/mnt/external', f))]
|
||||||
|
|
||||||
|
# Retourne le template avec la liste des fichiers
|
||||||
|
return render_template('index.html', files=files)
|
||||||
|
|
||||||
@app.route('/process', methods=['POST'])
|
@app.route('/process', methods=['POST'])
|
||||||
def process():
|
def process():
|
||||||
|
|||||||
2
src/env/env.dev
vendored
Normal file
2
src/env/env.dev
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# chemin vers les backtests
|
||||||
|
BACKTESTS=/path/to/framework
|
||||||
@@ -4,19 +4,67 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Statistiques Freqtrade</title>
|
<title>Statistiques Freqtrade</title>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.2/dist/echarts.min.js"></script>
|
<script src="{{ url_for('static', filename='js/echarts.js') }}"></script>
|
||||||
|
<style>
|
||||||
|
/* Style de la page */
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Colonne gauche pour les fichiers */
|
||||||
|
.file-list {
|
||||||
|
width: 200px;
|
||||||
|
padding: 10px;
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Colonne pour le graphique */
|
||||||
|
.graph-container {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Liste des fichiers */
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
padding: 5px;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
li:hover {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Bienvenue dans l'interface web !</h1>
|
<!-- Colonne gauche avec les fichiers -->
|
||||||
|
<div class="file-list">
|
||||||
|
<h3>Fichiers :</h3>
|
||||||
|
<ul>
|
||||||
|
{% for file in files %}
|
||||||
|
<li>{{ file }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Colonne droite avec le graphique (remplacez avec votre graphique) -->
|
||||||
|
<div class="graph-container">
|
||||||
|
<h3>Graphique</h3>
|
||||||
|
<!-- Div où le graphique sera affiché -->
|
||||||
|
<div id="chart" style="width: 600px; height: 400px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form action="/process" method="post">
|
<form action="/process" method="post">
|
||||||
<input type="text" name="data" placeholder="Entrez des données">
|
<input type="text" name="data" placeholder="Entrez des données">
|
||||||
<button type="submit">Envoyer</button>
|
<button type="submit">Envoyer</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Div où le graphique sera affiché -->
|
|
||||||
<div id="chart" style="width: 600px; height: 400px;"></div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Initialiser l'instance de graphique
|
// Initialiser l'instance de graphique
|
||||||
var chart = echarts.init(document.getElementById('chart'));
|
var chart = echarts.init(document.getElementById('chart'));
|
||||||
@@ -43,6 +91,8 @@
|
|||||||
|
|
||||||
// Utiliser les options pour afficher le graphique
|
// Utiliser les options pour afficher le graphique
|
||||||
chart.setOption(option);
|
chart.setOption(option);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user