Setting crypto params from admin panel pt II
This commit is contained in:
@@ -55,4 +55,11 @@
|
||||
#user_sql .msg.waiting {
|
||||
background-color: #ff8f00;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
#user_sql .loading {
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
margin: 5px 0;
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
@@ -62,15 +62,17 @@ user_sql.adminSettingsUI = function () {
|
||||
var cryptoChanged = function () {
|
||||
var div = $("#opt-crypto_params");
|
||||
div.empty();
|
||||
div.append("<span class=\"icon loading\"></span>");
|
||||
|
||||
var cryptoClass = $("#opt-crypto_class").val();
|
||||
$.get(OC.generateUrl("/apps/user_sql/settings/crypto/params"), cryptoClass, function (data) {
|
||||
div.empty();
|
||||
if (data.status === "success") {
|
||||
for (var index = 0, length = data.data.length; index < length; ++index) {
|
||||
div.append("<div><label for=\"opt-crypto_param_"
|
||||
+ index
|
||||
+ "\"><span>"
|
||||
+ data.data[index]["visible_name"]
|
||||
+ data.data[index]["name"]
|
||||
+ "</span><input type=\"number\" id=\"opt-crypto_param_"
|
||||
+ index
|
||||
+ "\" name=\"opt-crypto_param_"
|
||||
@@ -80,7 +82,7 @@ user_sql.adminSettingsUI = function () {
|
||||
+ "\" max=\""
|
||||
+ data.data[index]["max"]
|
||||
+ "\" value=\""
|
||||
+ data.data[index]["default"] // TODO set current
|
||||
+ data.data[index]["value"]
|
||||
+ "\"></label></div>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,25 +375,25 @@ class SettingsController extends Controller
|
||||
*/
|
||||
public function cryptoParams()
|
||||
{
|
||||
sleep(3);
|
||||
// TODO implement
|
||||
// TODO add current values
|
||||
return [
|
||||
"status" => "success",
|
||||
"data" => [
|
||||
[
|
||||
"name" => "memoryCost",
|
||||
"visible_name" => "Memory cost (KiB)",
|
||||
"default" => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
|
||||
"name" => "Memory cost (KiB)",
|
||||
"value" => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
|
||||
"min" => 1, "max" => 1048576
|
||||
],
|
||||
[
|
||||
"name" => "timeCost", "visible_name" => "Time cost",
|
||||
"default" => PASSWORD_ARGON2_DEFAULT_TIME_COST, "min" => 1,
|
||||
"name" => "Time cost",
|
||||
"value" => PASSWORD_ARGON2_DEFAULT_TIME_COST, "min" => 1,
|
||||
"max" => 1024
|
||||
],
|
||||
[
|
||||
"name" => "threads", "visible_name" => "Threads",
|
||||
"default" => PASSWORD_ARGON2_DEFAULT_THREADS, "min" => 1,
|
||||
"name" => "Threads",
|
||||
"value" => PASSWORD_ARGON2_DEFAULT_THREADS, "min" => 1,
|
||||
"max" => 1024
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user