Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added control/__init__.py
Empty file.
481 changes: 234 additions & 247 deletions control/app.py

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions control/templates/install_prettypi.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@
<title>PrettyPi | Installation</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="static/dist/css/AdminLTE.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="static/plugins/iCheck/square/blue.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- Font Awesome CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- Custom CSS -->

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand All @@ -24,10 +19,22 @@
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style>
.login-box {
margin: 50px auto;
width: 300px;
}
.btn {
font-size: 18px; /* Adjust the font size as needed */
}
</style>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<b>PrettyPi v0.0.1 Installation</b>
<div class="login-logo">
<a href="/"><h1><b>Pretty</b>Pi | Install</h1></a>
</div>
<p>Enter the credentials to use for your network, then your preferred display name.</p>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
Expand All @@ -41,7 +48,7 @@
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" name="name" placeholder="Real Name">
<input type="text" class="form-control" name="name" placeholder="Display Name">
<span class="fa fa-user form-control-feedback"></span>
</div>
<div class="row">
Expand Down
16 changes: 7 additions & 9 deletions control/templates/installer_message.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="static/dist/css/AdminLTE.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="static/plugins/iCheck/square/blue.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- Font Awesome CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- Custom CSS -->

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand All @@ -29,6 +25,8 @@
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Alert!</h4>
{{ message }}
<br /><br />
<b><a href="/">Return</a></b>
</div>
<!-- /.login-box -->

Expand Down
99 changes: 39 additions & 60 deletions control/templates/login.html
Original file line number Diff line number Diff line change
@@ -1,70 +1,49 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PrettyPi | Log in</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="static/dist/css/AdminLTE.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="static/plugins/iCheck/square/blue.css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- Font Awesome CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- Custom CSS -->
<style>
.login-box {
margin: 50px auto;
width: 300px;
}
.btn {
font-size: 18px; /* Adjust the font size as needed */
}
</style>
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="/"><b>Pretty</b>Pi</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<form action="login" method="post">
<div class="form-group has-feedback">
<input type="text" class="form-control" name="username" placeholder="Username">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="password" placeholder="Password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-12">
<button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
<div class="login-box">
<div class="login-logo">
<a href="/"><h1><b>Pretty</b>Pi | Login</h1></a>
</div>
<div class="login-box-body">
<form action="login" method="post">
<div class="form-group has-feedback">
<input type="text" class="form-control" name="username" placeholder="Username">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="password" placeholder="Password">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-12">
<button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 2.2.3 -->
<script src="static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{{ url_for('static', filename='bootstrap/js/bootstrap.min.js') }}"></script>
<!-- iCheck -->
<script src="static/plugins/iCheck/icheck.min.js"></script>
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</body>
</html>
12 changes: 8 additions & 4 deletions control/templates/main_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
PrettyPi
<small>Version 0.0.1</small>
</h1>
<h1>Home</h1>
<b>Pretty</b>Pi
<small>Version 0.0.1</small>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
<br />
<br />
<div class="col-md-6">
<button onclick="location.href='/tasks'" class="btn btn-primary btn-block btn-flat">Dashboard</button>
</div>
</section>

<!-- Main content -->
Expand Down
4 changes: 4 additions & 0 deletions control/templates/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ <h1>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Alert!</h4>
{{ message }}
<br /><br />
<b><a href="/tasks">Return</a></b>
</div>
{% endif %}

Expand All @@ -29,6 +31,8 @@ <h4><i class="icon fa fa-check"></i> Alert!</h4>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-ban"></i> Alert!</h4>
{{ message }}
<br /><br />
<b><a href="/tasks">Return</a></b>
</div>
{% endif %}
</section>
Expand Down
59 changes: 29 additions & 30 deletions control/templates/tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ <h1>
<!-- Main content -->
<section class="content">

{% if workingTask != None %}
{% if working_task != None %}
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="fa fa-hourglass-half"></i></span>

<div class="info-box-content">
<span class="info-box-text">Working On</span>
<span class="info-box-text"><strong>{{ workingTask.1 }}</strong></span>
<span class="info-box-text"><strong>{{ working_task.1 }}</strong></span>
</div>
</div>
{% endif %}
Expand All @@ -47,66 +47,65 @@ <h3 class="box-title">New Task</h3>
</form>
</div>

<div class="box box-success">
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title">Done!</h3>
<h3 class="box-title">TODO</h3>
</div>
<div class="box-body no-padding">
<table class="table">
<tr>
<th style="width: 10px">#</th>
<th>Task</th>
<th>Start</th>
<th>Done</th>
<th>Delete</th>
<th>Created On</th>
<th>Done At</th>
<th>Delete</th>
</tr>
{% for doneTask in doneTasks %}
{% for task in tasks %}
<tr>
<td>{{ loop.index }}.</td>
<td>{{ doneTask.1 }}</td>
<td>{{ doneTask.2 }}</td>
<td>{{ doneTask.4 }}</td>
<td><a href="delete_task?task_id={{ doneTask.0 }}" class="btn btn-block btn-danger btn-sm">Delete</a></td>
<td>{{ task.1 }}</td>
{% if task.5 == 'N' %}
<td><a href="start_task?task_id={{ task.0 }}" class="btn btn-block btn-primary btn-sm">Start</a></td>
{% else %}
<td><a href="stop_task?task_id={{ task.0 }}" class="btn btn-block btn-warning btn-sm">Stop</a></td>
{% endif %}
<td><a href="task_done?task_id={{ task.0 }}" class="btn btn-block btn-success btn-sm">Done</a></td>
<td><a href="delete_task?task_id={{ task.0 }}" class="btn btn-block btn-danger btn-sm">Delete</a></td>
<td>{{ task.2 }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>

<div class="col-md-6">
<div class="box box-danger">
<div class="box box-success">
<div class="box-header">
<h3 class="box-title">TODO</h3>
<h3 class="box-title">Done!</h3>
</div>
<div class="box-body no-padding">
<div class="box-body no-padding">
<table class="table">
<tr>
<tr>
<th style="width: 10px">#</th>
<th>Task</th>
<th>Start</th>
<th>Done</th>
<th>Delete</th>
<th>Created On</th>
<th>Done At</th>
<th>Delete</th>
</tr>
{% for task in tasks %}
{% for done_task in done_tasks %}
<tr>
<td>{{ loop.index }}.</td>
<td>{{ task.1 }}</td>
{% if task.5 == 'N' %}
<td><a href="start_task?task_id={{ task.0 }}" class="btn btn-block btn-primary btn-sm">Start</a></td>
{% else %}
<td><a href="stop_task?task_id={{ task.0 }}" class="btn btn-block btn-warning btn-sm">Stop</a></td>
{% endif %}
<td><a href="task_done?task_id={{ task.0 }}" class="btn btn-block btn-success btn-sm">Done</a></td>
<td><a href="delete_task?task_id={{ task.0 }}" class="btn btn-block btn-danger btn-sm">Delete</a></td>
<td>{{ task.2 }}</td>
<td>{{ done_task.1 }}</td>
<td>{{ done_task.2 }}</td>
<td>{{ done_task.4 }}</td>
<td><a href="delete_task?task_id={{ done_task.0 }}" class="btn btn-block btn-danger btn-sm">Delete</a></td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>

</div>
</section>
<!-- /.content -->
Expand Down
Loading