lots of changes - mostly cleaning

This commit is contained in:
Daniel 2019-04-27 12:57:19 +02:00
parent bb309c89a0
commit 08a58f89a0
7 changed files with 120 additions and 70 deletions

View file

@ -37,7 +37,7 @@ class Partitions(db.Model):
drive_id = db.Column(db.Integer, db.ForeignKey('drives.id'))
name = db.Column(db.String)
fs = db.Column(db.String)
size =db.Column(db.String)
size = db.Column(db.String)
uuid = db.Column(db.String)
mountpoint = db.Column(db.String)
label = db.Column(db.String)
@ -58,8 +58,12 @@ class Cleaning(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
path = db.Column(db.String)
# state 0 means inactive - do not execute
state = db.Column(db.Boolean)
# time means last execution
time = db.Column(db.DateTime(timezone=True), default=func.now())
def __init__(self, name, path):
def __init__(self, name, path, state):
self.name = name
self.path = path
self.state = state

View file

@ -1,53 +1,53 @@
body {
font-family: sans-serif;
background-color: #F9F9F9;
font-family: sans-serif;
background-color: #F9F9F9;
}
/*divs*/
.title {
text-align: center;
margin: 5em 0em 4em 0em;
text-align: center;
margin: 5em 0em 4em 0em;
}
.tablebox {
width: 50%;
margin: auto;
width: 50%;
margin: auto;
}
.ui.mymenu.menu {
background-color: #1b5e20;
color: #fff;
background-color: #1b5e20;
color: #fff;
}
/*fonts*/
t1 {
font-family: sans-serif;
font-size: 2.5em;
color: #494949;
font-family: sans-serif;
font-size: 2.5em;
color: #494949;
}
t2 {
font-family: sans-serif;
font-size: 1.5em;
color: #494949;
font-family: sans-serif;
font-size: 1.5em;
color: #494949;
}
t3 {
font-family: sans-serif;
font-size: 1em;
font-weight: bold;
color: #494949;
font-family: sans-serif;
font-size: 1em;
font-weight: bold;
color: #494949;
}
t4{
t4 {
}
tnorm {
font-family: sans-serif;
font-size: 1em;
color: #494949;
font-family: sans-serif;
font-size: 1em;
color: #494949;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% block title %}Add Cleaning{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block body %}
<div class="tablebox">
<form method="post" id="form" class="ui form">
<div class="field">
<label>Job Name</label>
<input type="text" name="jobname" placeholder="Dowloads Verzeichniss">
</div>
<div class="field">
<label>Vollständiger Pfad</label>
<input type="text" name="path" placeholder="/media/downloads/">
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="check" tabindex="0" class="hidden">
<label>Sofort aktivieren (Vorsicht!)</label>
</div>
</div>
<button class="ui button" type="submit"><i class="save icon"></i> Job speichern</button>
</form>
</div>
<script>
$(document).ready(
function () {
$('.ui.checkbox')
.checkbox()
;
});
</script>
{% endblock %}

View file

@ -1,29 +1,33 @@
<!DOCTYPE html>
<head>
{% block head %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/semantic.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/icon.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/myStyle.css') }}" />
<title>{% block title %}{% endblock %}</title>
{% endblock %}
{% block head %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/semantic.min.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/icon.min.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/myStyle.css') }}"/>
<!-- JQuery -->
<script src="{{ url_for('static', filename='js/jquery-3.1.1.min.js') }}"></script>
<!-- Semantic UI -->
<script src="{{ url_for('static', filename='js/semantic.min.js') }}"></script>
<title>{% block title %}{% endblock %}</title>
{% endblock %}
</head>
<body>
<nav class="ui mymenu inverted massive menu">
<nav class="ui mymenu inverted massive menu">
<a class="item" href="{{ url_for('index') }}">Startseite</a>
<a class="item" href="/nzbget">NZBGet</a>
<a class="item" href="{{ url_for('drives') }}">Festplatten</a>
<a class="item" href="{{ url_for('cleaning') }}">Cleaning</a>
<a class="item" href="{{ url_for('cleaning') }}">Cleaning</a>
<div class="right menu">
<a class="ui item" href="{{ url_for('about') }}">über Dirkules</a>
<a class="ui item" href="{{ url_for('about') }}">über Dirkules</a>
</div>
</nav>
{% block body %}
{% endblock %}
</nav>
{% block body %}
{% endblock %}
</body>
</html>

View file

@ -1,35 +1,35 @@
{% extends "base.html" %}
{% block title %}Dashboard{% endblock %}
{% block head %}
{{ super() }}
{{ super() }}
{% endblock %}
{% block body %}
<div class="tablebox">
<a href="{{ url_for('add_cleaning') }}">
<div class="ui button">
<i class="plus icon"></i> Ordner hinzufügen
</div>
</a>
<table class="ui celled table">
<thead>
<tr>
<th>Status</th>
<th>Service</th>
</tr>
</thead>
<div class="ui container">
<a href="{{ url_for('add_cleaning') }}">
<div class="ui primary labeled icon button">
<i class="plus icon"></i> Ordner hinzufügen
</div>
</a>
<tbody>
{% for key in service %}
<tr>
{% if service[key] %}
<td><i class="check circle icon"></i></td>
{% else %}
<td><i class="times circle icon"></i></td>
{% endif %}
<td>{{ key }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<table class="ui celled table">
<thead>
<tr>
<th>Status</th>
<th>Job Name</th>
<th>Pfad</th>
<th>Letzte Ausführung</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jill Lewis</td>
<td>May 11, 2014</td>
<td>jilsewris22@yahoo.com</td>
<td>Yes</td>
</tr>
</tbody>
</table>
</div>
{% endblock %}

View file

@ -1,4 +1,4 @@
from flask import Flask, render_template, redirect
from flask import Flask, render_template, redirect, request
from dirkules import app
import dirkules.driveManagement.driveController as drico
import dirkules.serviceManagement.serviceManager as servMan
@ -37,6 +37,10 @@ def partitions(part):
def cleaning():
return render_template('cleaning.html')
@app.route('/add_cleaning', methods=['GET'])
@app.route('/add_cleaning', methods=['GET', 'POST'])
def add_cleaning():
return redirect('/')
if request.method == 'POST':
print(request.form.getlist('jobname'))
print(request.form.getlist('path'))
print(request.form.getlist('check'))
return render_template('add_cleaning.html')