Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
06eb4de7
Commit
06eb4de7
authored
May 03, 2017
by
fv3rdugo
Browse files
Fix list networks
Polish requires_password column, now show icons
parent
ddb1242c
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Network.pm
View file @
06eb4de7
...
...
@@ -50,13 +50,15 @@ sub BUILD {
my
$description
=
$_
[
0
]
->
{
description
};
my
$all_domains
=
$_
[
0
]
->
{
all_domains
}
?
1
:
0
;
#when checkbox is not checked is NULL, change to 0
my
$no_domains
=
$_
[
0
]
->
{
no_domains
}
?
1
:
0
;
my
$n_order
=
$_
[
0
]
->
{
n_order
};
my
$requires_password
=
$_
[
0
]
->
{
requires_password
}
?
1
:
0
;
$name
=
""
unless
defined
$name
;
_init_connector
();
if
(
$name
ne
''
)
{
my
$row
=
$self
->
_select_net_db
(
$name
,
$address
,
$description
,
$all_domains
,
$no_domains
);
my
$row
=
$self
->
_select_net_db
(
$name
,
$address
,
$description
,
$all_domains
,
$no_domains
,
$n_order
,
$requires_password
);
};
}
=head2 allowed
...
...
@@ -197,13 +199,15 @@ sub _insert_net_db {
my
$description
=
shift
;
my
$all_domains
=
shift
;
my
$no_domains
=
shift
;
my
$n_order
=
shift
;
my
$requires_password
=
shift
;
my
$sth
=
$$CONNECTOR
->
dbh
->
prepare
(
"
INSERT INTO networks (name, address, description, all_domains, no_domains)
"
.
"
VALUES(?,?,?,?,?)
"
"
INSERT INTO networks (name, address, description, all_domains, no_domains
, n_order, requires_password
)
"
.
"
VALUES(?,?,?,?,?
,?,?
)
"
);
$sth
->
execute
(
$name
,
$address
,
$description
,
$all_domains
,
$no_domains
);
$sth
->
execute
(
$name
,
$address
,
$description
,
$all_domains
,
$no_domains
,
$n_order
,
$requires_password
);
$sth
->
finish
;
return
$self
->
_do_select_net_db
(
$name
);
;
}
...
...
rvd_front.pl
View file @
06eb4de7
...
...
@@ -210,7 +210,9 @@ sub networks {
address
=>
$c
->
param
('
address
'),
description
=>
$c
->
param
('
description
'),
all_domains
=>
$c
->
param
('
all_domains
'),
no_domains
=>
$c
->
param
('
no_domains
')
)
no_domains
=>
$c
->
param
('
no_domains
'),
n_order
=>
$c
->
param
('
n_order
'),
requires_password
=>
$c
->
param
('
requires_password
')
)
}
push
@
{
$c
->
stash
->
{
js
}},
'
/js/admin.js
';
$c
->
render
(
template
=>
'
main/new_networks
');
...
...
templates/main/networks.html.ep
View file @
06eb4de7
...
...
@@ -30,6 +30,7 @@
<th><
%=
l
'
Description
'
%
></th>
<th><
%=
l
'
All
Domains
'
%
></th>
<th><
%=
l
'
No
Domains
'
%
></th>
<th><
%=
l
'
Requires
Passwd
'
%
></th>
</tr>
</thead>
<tbody>
...
...
@@ -39,6 +40,8 @@
<td>
{{ network.description }}
</td>
<td>
{{ network.all_domains }}
</td>
<td>
{{ network.no_domains }}
</td>
<td><p
ng-show=
"{{network.requires_password}}"
class=
"fa fa-lock"
aria-hidden=
"true"
title=
"User needed a password to connect"
>
<p
ng-show=
"{{network.requires_password!=1}}"
class=
"fa fa-unlock"
aria-hidden=
"true"
title=
"Password not required"
></td>
</tr>
</tbody>
</table>
...
...
templates/main/new_networks.html.ep
View file @
06eb4de7
...
...
@@ -51,6 +51,13 @@
</label>
</div>
<div
class=
"pure-control-group"
>
<label
class=
"pure-checkbox"
>
<input
name=
"requires_password"
id=
'requires_password'
type=
"checkbox"
value=
"1"
>
Requires password
</label>
</div>
<div
class=
"pure-controls"
>
<input
type=
"submit"
class=
"pure-button pure-button-primary"
value=
"Submit"
ng-disabled=
"frm.$invalid"
></input>
...
...
Write
Preview
Supports
Markdown
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