add password reveal button + version fix

This commit is contained in:
nacho 2018-12-29 14:27:01 -07:00 committed by nachoparker
parent 363f968164
commit bc0271e359
11 changed files with 44 additions and 15 deletions

View File

@ -20,12 +20,14 @@
{
"id": "PASS",
"name": "Pass",
"value": "1234"
"value": "1234",
"type": "password"
},
{
"id": "CONFIRM",
"name": "Confirm",
"value": "1234"
"value": "1234",
"type": "password"
}
]
}

View File

@ -14,12 +14,14 @@
{
"id": "PASSWORD",
"name": "Password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
},
{
"id": "CONFIRM",
"name": "Confirm password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
}
]
}

View File

@ -14,7 +14,8 @@
{
"id": "ADMINPASS",
"name": "Admin password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
}
]
}

View File

@ -9,12 +9,14 @@
{
"id": "PASSWORD",
"name": "Password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
},
{
"id": "CONFIRM",
"name": "Confirm password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
}
]
}

View File

@ -20,7 +20,8 @@
{
"id": "PASS",
"name": "Password",
"value": "no-ip password"
"value": "no-ip password",
"type": "password"
},
{
"id": "DOMAIN",

View File

@ -15,7 +15,8 @@
{
"id": "PWD",
"name": "Password",
"value": "ownyourbits"
"value": "ownyourbits",
"type": "password"
}
]
}

View File

@ -1064,7 +1064,7 @@ select {
margin: 0 auto;
}
.table-wrapper input[type='text'] {
.table-wrapper input[type='text'], .table-wrapper input[type='password'] {
width: 100%;
}
@ -1336,3 +1336,7 @@ a#versionlink:hover {
border: none;
color: white;
}
.pwd-btn {
cursor: pointer;
}

View File

@ -36,6 +36,16 @@ HTML;
$checked = 'checked';
$ret .= "<td><input type=\"checkbox\" id=\"$ncp_app-$param[id]\" name=\"$param[name]\" value=\"$param[value]\" $checked></td>";
}
// password
else if ($param['type'] == 'password')
{
$ret .= "<td>";
$ret .= "<input type=\"password\" name=\"$param[name]\" id=\"$ncp_app-$param[id]\" value=\"$param[value]\" size=\"40\">";
$ret .= "<img class=\"pwd-btn\" title=\"show password\" src=\"../img/info.svg\">";
$ret .= "</td>";
}
$ret .= "</tr>";
}

View File

@ -72,7 +72,7 @@
<?php
exec("ncp-test-updates", $output, $ret);
if ($ret == 0) {
$version = "v0.0";
$version = "v0.0.0";
$ver_file = '/var/run/.ncp-latest-version';
if (file_exists($ver_file))
$version = file_get_contents($ver_file);

View File

@ -251,6 +251,15 @@ $(function()
}).error( errorMsg );
});
// Update notification
$( '.pwd-btn' ).on('click', function(e)
{
var input = this.trav('previousSibling', 1);
if ( input.get('.type') == 'password' )
input.set('.type', 'text');
else if ( input.get('.type') == 'text' )
input.set('.type', 'password');
});
// Update notification
$( '#notification' ).on('click', function(e)
{

5
ncp.sh
View File

@ -179,10 +179,7 @@ EOF
chmod g+w /var/run/.ncp-latest-version
# Install all ncp-apps
./update.sh || exit 1
local VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" || { echo "Invalid format"; exit 1; }
echo "$VER" > /usr/local/etc/ncp-version
bin/ncp-update $BRANCH || exit 1
# LIMIT LOG SIZE
grep -q maxsize /etc/logrotate.d/apache2 || sed -i /weekly/amaxsize2M /etc/logrotate.d/apache2