Added buttons, fixed some visuals, added History bar

master
Davide Bongiovanni 8 years ago
parent d7a0c99984
commit e4d5c9c1fa

@ -3,6 +3,18 @@
{
"selected_items":
[
[
"mar",
"margin-top"
],
[
"ta",
"text-align"
],
[
"col",
"color"
],
[
"ROS",
"ROS_INFO"
@ -191,10 +203,6 @@
"p",
"position"
],
[
"ta",
"ta-c\ttext-align: center;"
],
[
"fon",
"font-size"
@ -275,6 +283,41 @@
},
"buffers":
[
{
"file": "static/script.js",
"settings":
{
"buffer_size": 1375,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "templates/status.html",
"settings":
{
"buffer_size": 1499,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "static/style.css",
"settings":
{
"buffer_size": 1891,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "static/colors",
"settings":
{
"buffer_size": 69,
"line_ending": "Unix"
}
}
],
"build_system": "",
"build_system_choices":
@ -284,9 +327,13 @@
"command_palette":
{
"height": 368.0,
"last_filter": "",
"last_filter": "re",
"selected_items":
[
[
"re",
"Indentation: Reindent Lines"
],
[
"prv",
"PackageResourceViewer: Open Resource"
@ -308,7 +355,7 @@
"Indentation: Reindent Lines"
]
],
"width": 453.0
"width": 417.0
},
"console":
{
@ -329,10 +376,15 @@
},
"expanded_folders":
[
"/home/davide/fridge_lock"
"/home/davide/fridge_lock",
"/home/davide/fridge_lock/static",
"/home/davide/fridge_lock/templates"
],
"file_history":
[
"/home/davide/fridge_lock/sstart.sh",
"/home/davide/fridge_lock/sftp-config.json",
"/home/davide/fridge_lock/history.json",
"/home/davide/catkin_ws/src/sftp-config.json",
"/home/davide/catkin_ws/src/ras_uarm_controller/src/uarm_controller.cpp",
"/home/davide/catkin_ws/src/ras_uarm_controller/CMakeLists.txt",
@ -347,7 +399,6 @@
"/home/davide/fridge_lock/static/style.css",
"/home/davide/fridge_lock/static/script.js",
"/home/davide/fridge_lock/server.py",
"/home/davide/fridge_lock/history.json",
"/home/davide/fridge_lock/cards/2924385363.json",
"/home/davide/fridge_lock/cards/0967437296.json",
"/home/davide/.config/sublime-text-3/Packages/User/Preferences.sublime-settings",
@ -384,6 +435,7 @@
"case_sensitive": false,
"find_history":
[
"D7E2E2",
"toPos",
"moveTo",
"cv_ptr",
@ -410,8 +462,139 @@
"groups":
[
{
"selected": 1,
"sheets":
[
{
"buffer": 0,
"file": "static/script.js",
"semi_transient": false,
"settings":
{
"buffer_size": 1375,
"regions":
{
},
"selection":
[
[
1375,
1375
]
],
"settings":
{
"color_scheme": "Packages/User/Color Highlighter/themes/predawn.tmTheme",
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/JavaScript/JavaScript.sublime-syntax",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 3,
"type": "text"
},
{
"buffer": 1,
"file": "templates/status.html",
"semi_transient": false,
"settings":
{
"buffer_size": 1499,
"regions":
{
},
"selection":
[
[
883,
883
]
],
"settings":
{
"color_scheme": "Packages/User/Color Highlighter/themes/predawn.tmTheme",
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/HTML/HTML.sublime-syntax",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 330.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
},
{
"buffer": 2,
"file": "static/style.css",
"semi_transient": false,
"settings":
{
"buffer_size": 1891,
"regions":
{
},
"selection":
[
[
228,
228
]
],
"settings":
{
"color_scheme": "Packages/User/Color Highlighter/themes/predawn.tmTheme",
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/CSS/CSS.sublime-syntax",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 132.0,
"zoom_level": 1.0
},
"stack_index": 1,
"type": "text"
},
{
"buffer": 3,
"file": "static/colors",
"semi_transient": true,
"settings":
{
"buffer_size": 69,
"regions":
{
},
"selection":
[
[
15,
15
]
],
"settings":
{
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/Text/Plain text.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 2,
"type": "text"
}
]
}
],
@ -452,7 +635,7 @@
},
"output.sftp":
{
"height": 0.0
"height": 152.0
},
"pinned_build_system": "",
"project": "fridge_lock.sublime-project",

@ -1,31 +1 @@
[
{
"time": 1475424208.055737,
"name": "Davide Bon",
"cardID": "2924385363"
},
{
"cardID": "0861643457",
"name": "",
"time": 1475424209.151567},
{
"time": 1475424209.758858,
"name": "Davide Bon",
"cardID": "2924385363"
},
{
"cardID": "2924385363",
"name": "Davide Bon",
"time": 1475424211.022202
},
{
"time": 1475424212.244935,
"name": "",
"cardID": "0861643457"
},
{
"cardID": "0861643457",
"name": "",
"time": 1475424213.343284
}
]
[{"cardID": "2924385363", "name": "Davide Bon", "time": 1475424208.055737}, {"time": 1475424209.151567, "name": "", "cardID": "0861643457"}, {"cardID": "2924385363", "name": "Davide Bon", "time": 1475424209.758858}, {"time": 1475424211.022202, "name": "Davide Bon", "cardID": "2924385363"}, {"cardID": "0861643457", "name": "", "time": 1475424212.244935}, {"time": 1475424213.343284, "name": "", "cardID": "0861643457"}]

@ -17,6 +17,14 @@ def somehtml():
event['time'] = epochFormat(event['time'])
return render_template('status.html', events = history[::-1])
@app.route('/users')
def users():
return 'You have reached Users'
@app.route('/history')
def history():
return 'You have reached history'
@app.route('/getcardinfo/<cardID>')
def getCardInfo(cardID):
return send_from_directory('cards', cardID + '.json')

Binary file not shown.

@ -0,0 +1,45 @@
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "130.237.3.207",
"user": "pi",
//"password": "password",
"port": "11111",
"remote_path": "/home/pi/fridge_lock",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}

@ -9,7 +9,7 @@ while getopts "ln" opt; do
\?) echo "Invalid argument" ;;
esac
done
if $aflag; then
if $loc; then
if $noh; then
nohup flask run&
else

@ -15,6 +15,7 @@ html {
.event {
font-size: 12pt;
padding: 0 6pt 0 6pt;
margin-left: 8pt;
transition: 0.4s;
width: 100%;
}
@ -24,6 +25,15 @@ html {
width: 105%;
}
.history-header {
background-color: #013A3A;
color: #D7E2E2;
margin: 0 -10pt 12pt 10pt;
padding: 10pt 0 10pt 0;
text-align: center;
font-size: 16pt;
}
.time {
padding: 6pt 0 6pt 0;
display: inline-block;
@ -48,6 +58,7 @@ html {
left: 30%;
top: 0;
position: absolute;
text-align: center;
}
h1 {
@ -55,6 +66,23 @@ h1 {
font-weight: 300;
}
.big-button {
display: inline-block;
background-color: #013A3A;
color: #D7E2E2;
text-align: center;
font-size: 12pt;
padding: 10pt;
margin: 6pt 0 10pt 0;
width: 120pt;
border-radius: 2pt;
transition: 0.2s;
}
.big-button:hover {
background-color: #226666;
}
.button {
width: 50%;
background-color: #013A3A;
@ -63,6 +91,7 @@ h1 {
text-align: center;
font-size: 16pt;
margin: 16pt 0 16pt 0;
transition: 0.2s;
}
.separator {
@ -75,7 +104,7 @@ h1 {
background-color: #5E9292;
position: absolute;
top: 0;
left: 35%;
left: 33%;
z-index: 100;
}
@ -102,6 +131,7 @@ h1 {
top: -70%;
width: 30%;
z-index: 201;
border-radius: 2pt;
}
.card-id {

@ -13,6 +13,7 @@
</head>
<body>
<div class="recent">
<div class="history-header">History</div>
{% for event in events %}
<div class="event" card-id="{{event.cardID}}">
<div class="time">{{event.time}}</div>
@ -26,9 +27,12 @@
</div>
{% endfor %}
</div>
<div class="vertical-separator"></div>
<div class="everything-else">
<h1 id="myBtn">Card access manager</h1>
<h1>Card access manager</h1>
<br>
<a href="/users"><div class="big-button">Users list</div></a>
<br>
<a href="/history"><div class="big-button">Full history</div></a>
</div>
<div class="shadow" onclick="overlay_out()"></div>
<div class="overlay">

Loading…
Cancel
Save