mirror of
https://github.com/unraid/webgui.git
synced 2026-01-13 13:09:58 -06:00
Create a default name for config if it's empty
This commit is contained in:
@@ -812,6 +812,9 @@ $showAdditionalInfo = '';
|
||||
["Name","Target","Default","Mode","Description","Type","Display","Required","Mask","Value"].forEach(function(e){
|
||||
Opts[e] = getVal(Element, e);
|
||||
});
|
||||
if ( ! Opts["Name"] ){
|
||||
Opts["Name"] = makeName(Opts["Type"]);
|
||||
}
|
||||
Opts.Description = (Opts.Description.length) ? Opts.Description : "Container "+Opts.Type+": "+Opts.Target;
|
||||
if (Opts.Required == "true") {
|
||||
Opts.Buttons = "<span class='advanced'><button type='button' onclick='editConfigPopup("+confNum+")'> Edit</button> ";
|
||||
@@ -910,6 +913,11 @@ $showAdditionalInfo = '';
|
||||
$('#ConfigNum' + num).fadeOut("fast", function() { $(this).remove(); });
|
||||
}
|
||||
|
||||
function makeName(type) {
|
||||
i = $("#configLocation input[name^='confType'][value='"+type+"']").length + 1;
|
||||
return type + " "+i;
|
||||
}
|
||||
|
||||
function toggleMode(el) {
|
||||
var mode = $(el).parent().siblings('#Mode');
|
||||
var valueDiv = $(el).parent().siblings('#Value');
|
||||
|
||||
Reference in New Issue
Block a user