Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
postbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wen Wei Li
postbox
Commits
f4ad973c
Commit
f4ad973c
authored
Mar 27, 2020
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pincode layout
parent
0da28b71
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
17 deletions
+38
-17
__pycache__/wifi_utils.cpython-36.pyc
__pycache__/wifi_utils.cpython-36.pyc
+0
-0
app.py
app.py
+3
-3
static/css/main.css
static/css/main.css
+5
-1
static/js/pincode.js
static/js/pincode.js
+22
-5
templates/demo.html
templates/demo.html
+1
-1
templates/pincode.html
templates/pincode.html
+7
-7
No files found.
__pycache__/wifi_utils.cpython-36.pyc
0 → 100644
View file @
f4ad973c
File added
app.py
View file @
f4ad973c
...
...
@@ -7,7 +7,7 @@ from wifi_utils import *
from
flask_bootstrap
import
Bootstrap
# wifi device name
# wifi device name
WIFI_DEVICE
=
'wlan0'
app
=
Flask
(
__name__
)
...
...
@@ -60,7 +60,7 @@ def wifi_scan():
def
wifi_pass
(
ssid
):
global
wifi_list
delete_connection
(
ssid
)
print
(
"Ready for Connecting to {}"
.
format
(
ssid
))
print
(
"Ready for Connecting to {}"
.
format
(
ssid
))
if
wifi_list
==
None
:
wifi_list
=
scan_wifi
()
for
i
in
wifi_list
:
...
...
@@ -74,7 +74,7 @@ def wifi_pass(ssid):
@
app
.
route
(
'/wifi_conn'
,
methods
=
[
"POST"
])
def
wifi_conn
():
def
wifi_conn
():
ssid
=
request
.
form
.
get
(
'ssid'
)
passwd
=
request
.
form
.
get
(
'password'
)
print
(
"{} : {}"
.
format
(
ssid
,
passwd
))
...
...
static/css/main.css
View file @
f4ad973c
...
...
@@ -10,5 +10,9 @@ input:focus{
color
:
blue
;
}
td
{
cursor
:
pointer
;
cursor
:
pointer
;
}
input
.input_margin
{
margin-right
:
6%
;
}
static/js/pincode.js
View file @
f4ad973c
...
...
@@ -16,18 +16,35 @@ let myKeyboard = new Keyboard({
});
let
ary_input
=
[];
let
index
=
1
let
index
=
1
;
function
onChange
(
input
)
{
if
(
ary_input
.
length
>
6
){
ary_input
.
pop
();
}
console
.
log
(
"
Input changed
"
,
ary_input
);
}
function
onKeyPress
(
button
)
{
console
.
log
(
"
index :
"
,
index
);
n
=
"
slot-
"
+
index
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
'
1
'
;
index
=
index
+
1
;
ary_input
.
push
(
button
)
if
(
String
(
button
)
==
"
{bksp}
"
&&
index
>
1
){
index
=
index
-
1
;
n
=
"
slot-
"
+
index
;
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
''
;
ary_input
.
pop
();
}
else
if
(
String
(
button
)
==
"
{bksp}
"
&&
index
==
1
){
console
.
log
(
"
back to the first pin code
"
);
}
else
if
(
index
<
7
){
n
=
"
slot-
"
+
index
;
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
button
;
index
=
index
+
1
;
ary_input
.
push
(
button
);
}
else
{
console
.
log
(
"
index over 6
"
);
}
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
focus
();
console
.
log
(
"
Button pressed
"
,
button
);
}
templates/demo.html
View file @
f4ad973c
...
...
@@ -4,7 +4,7 @@
<link
href=
"http://code.jquery.com/ui/1.9.0/themes/ui-darkness/jquery-ui.css"
rel=
"stylesheet"
>
<link
href=
"../static/css/keyboard.css"
rel=
"stylesheet"
>
<link
href=
"../static/css/style.css"
rel=
"stylesheet"
>
{% endblock %}
{% endblock %}
{% block content %}
<body
>
<div
class=
"page-wrap"
>
...
...
templates/pincode.html
View file @
f4ad973c
...
...
@@ -26,18 +26,18 @@
$
(
document
).
ready
(
function
()
{
document
.
getElementById
(
"
keyboard
"
).
style
.
visibility
=
'
visible
'
;
});
</script>
{% endblock head %}
{% block content%}
<body
class=
"bg-light m-5"
>
<h2
class=
"text-muted text-center m-5"
>
PinCode Setup
</h2>
<body
class=
"
container mx-auto
bg-light m-5"
>
<h2
class=
"text-muted text-center m-5"
>
PinCode Setup
</h2>
<center>
<div
class=
"
col align-items-center
m-5 col-8"
>
<div
class=
"col-
10 inline
"
>
<div
class=
"
row col mx-auto
m-5 col-8"
>
<div
class=
"col-
sm
"
>
{% for i in range(6) %}
<input
type=
"password"
class=
"form-control input
"
id=
"slot-{{loop.index}}"
maxlength=
"1"
>
<input
type=
"password"
class=
"form-control input
float-left col-sm-1 text-center input_margin"
id=
"slot-{{loop.index}}"
disabled=
"true"
maxlength=
"1"
>
{% endfor %}
</div>
<div
class=
"col-2 inline"
>
...
...
@@ -53,7 +53,7 @@
<script
src=
"{{url_for('static', filename='js/keyboard.min.js')}}"
></script>
<script
src=
"{{url_for('static', filename='js/pincode.js')}}"
></script>
<script>
</script>
<!-- keyboard js-->
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment