mirror of
https://gitlab.silvrtree.co.uk/martind2000/old-silvrgit.git
synced 2025-01-10 21:35:07 +00:00
Front end password generator
This commit is contained in:
parent
a75ea76571
commit
f2c628784f
48
app/app.js
48
app/app.js
@ -338,6 +338,50 @@
|
||||
});
|
||||
};
|
||||
|
||||
var formatPassword = function (data) {
|
||||
|
||||
|
||||
var dest$ = $('#passwordOut');
|
||||
var html = new EJS({url: '/template/password.ejs'}).render(data);
|
||||
|
||||
console.log(html);
|
||||
dest$.empty();
|
||||
dest$.append(html);
|
||||
dest$.show();
|
||||
};
|
||||
|
||||
|
||||
var generatePassword = function(from, to) {
|
||||
var url = '/generate';
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
data: '',
|
||||
dataType: 'json',
|
||||
|
||||
timeout: 10000,
|
||||
|
||||
//contentType: ('application/json'),
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type'
|
||||
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
|
||||
formatPassword(data);
|
||||
},
|
||||
error: function (xhr, type) {
|
||||
console.log("ajax error");
|
||||
console.log(xhr);
|
||||
console.log(type);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
tick();
|
||||
@ -369,6 +413,10 @@
|
||||
getTrains('glq','dbe');
|
||||
});
|
||||
|
||||
$('#newPassword').on('click', function() {
|
||||
generatePassword();
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
var popitout = function (url) {
|
||||
|
@ -42,6 +42,14 @@
|
||||
.nochange {
|
||||
color: #000000;
|
||||
}
|
||||
.password {
|
||||
border: 1px solid #cccccc;
|
||||
background-color: #efefef;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script>
|
||||
</head>
|
||||
@ -106,9 +114,12 @@
|
||||
<li><a href="https://howsecureismypassword.net/">Password Checker</a></li>
|
||||
<li><a href="https://archive.today">Archive Today</a></li>
|
||||
<li><a href="http://staticmapmaker.com/google/">Static Map Generator</a></li>
|
||||
<li><a href="https://httpbin.org/">AJAX Endpoints</a></li>
|
||||
<li><a href="https://tools.bartlweb.net/webssh/">WebSSH</a></li>
|
||||
<li><a href="https://httpbin.org/">AJAX Endpoints</a></li>
|
||||
<li><a href="https://tools.bartlweb.net/webssh/">WebSSH</a></li>
|
||||
|
||||
<li><span id='newPassword'>Generate Password</span></li>
|
||||
</ul>
|
||||
<div id='passwordOut' class='password' style='display:none;'></div>
|
||||
</div>
|
||||
<div class="mui-col-md-4">
|
||||
<div class="mui-text-title mui-text-black">Bitcoin <span id="btc"></span></div>
|
||||
|
2
app/template/password.ejs
Normal file
2
app/template/password.ejs
Normal file
@ -0,0 +1,2 @@
|
||||
<div>Long: <%=long%></div>
|
||||
<div>Short: <%=short%></div>
|
Loading…
Reference in New Issue
Block a user