Added buttons, fixed some visuals, added History bar

master
Davide Bongiovanni 8 years ago
parent d7a0c99984
commit e4d5c9c1fa

@ -3,6 +3,18 @@
{ {
"selected_items": "selected_items":
[ [
[
"mar",
"margin-top"
],
[
"ta",
"text-align"
],
[
"col",
"color"
],
[ [
"ROS", "ROS",
"ROS_INFO" "ROS_INFO"
@ -191,10 +203,6 @@
"p", "p",
"position" "position"
], ],
[
"ta",
"ta-c\ttext-align: center;"
],
[ [
"fon", "fon",
"font-size" "font-size"
@ -275,6 +283,41 @@
}, },
"buffers": "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": "",
"build_system_choices": "build_system_choices":
@ -284,9 +327,13 @@
"command_palette": "command_palette":
{ {
"height": 368.0, "height": 368.0,
"last_filter": "", "last_filter": "re",
"selected_items": "selected_items":
[ [
[
"re",
"Indentation: Reindent Lines"
],
[ [
"prv", "prv",
"PackageResourceViewer: Open Resource" "PackageResourceViewer: Open Resource"
@ -308,7 +355,7 @@
"Indentation: Reindent Lines" "Indentation: Reindent Lines"
] ]
], ],
"width": 453.0 "width": 417.0
}, },
"console": "console":
{ {
@ -329,10 +376,15 @@
}, },
"expanded_folders": "expanded_folders":
[ [
"/home/davide/fridge_lock" "/home/davide/fridge_lock",
"/home/davide/fridge_lock/static",
"/home/davide/fridge_lock/templates"
], ],
"file_history": "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/sftp-config.json",
"/home/davide/catkin_ws/src/ras_uarm_controller/src/uarm_controller.cpp", "/home/davide/catkin_ws/src/ras_uarm_controller/src/uarm_controller.cpp",
"/home/davide/catkin_ws/src/ras_uarm_controller/CMakeLists.txt", "/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/style.css",
"/home/davide/fridge_lock/static/script.js", "/home/davide/fridge_lock/static/script.js",
"/home/davide/fridge_lock/server.py", "/home/davide/fridge_lock/server.py",
"/home/davide/fridge_lock/history.json",
"/home/davide/fridge_lock/cards/2924385363.json", "/home/davide/fridge_lock/cards/2924385363.json",
"/home/davide/fridge_lock/cards/0967437296.json", "/home/davide/fridge_lock/cards/0967437296.json",
"/home/davide/.config/sublime-text-3/Packages/User/Preferences.sublime-settings", "/home/davide/.config/sublime-text-3/Packages/User/Preferences.sublime-settings",
@ -384,6 +435,7 @@
"case_sensitive": false, "case_sensitive": false,
"find_history": "find_history":
[ [
"D7E2E2",
"toPos", "toPos",
"moveTo", "moveTo",
"cv_ptr", "cv_ptr",
@ -410,8 +462,139 @@
"groups": "groups":
[ [
{ {
"selected": 1,
"sheets": "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": "output.sftp":
{ {
"height": 0.0 "height": 152.0
}, },
"pinned_build_system": "", "pinned_build_system": "",
"project": "fridge_lock.sublime-project", "project": "fridge_lock.sublime-project",

@ -1,31 +1 @@
[ [{"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"}]
{
"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
}
]

@ -17,6 +17,14 @@ def somehtml():
event['time'] = epochFormat(event['time']) event['time'] = epochFormat(event['time'])
return render_template('status.html', events = history[::-1]) 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>') @app.route('/getcardinfo/<cardID>')
def getCardInfo(cardID): def getCardInfo(cardID):
return send_from_directory('cards', cardID + '.json') 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" ;; \?) echo "Invalid argument" ;;
esac esac
done done
if $aflag; then if $loc; then
if $noh; then if $noh; then
nohup flask run& nohup flask run&
else else

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

@ -13,6 +13,7 @@
</head> </head>
<body> <body>
<div class="recent"> <div class="recent">
<div class="history-header">History</div>
{% for event in events %} {% for event in events %}
<div class="event" card-id="{{event.cardID}}"> <div class="event" card-id="{{event.cardID}}">
<div class="time">{{event.time}}</div> <div class="time">{{event.time}}</div>
@ -26,9 +27,12 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<div class="vertical-separator"></div>
<div class="everything-else"> <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>
<div class="shadow" onclick="overlay_out()"></div> <div class="shadow" onclick="overlay_out()"></div>
<div class="overlay"> <div class="overlay">

Loading…
Cancel
Save