Commit c0cff6d1 authored by ibuler's avatar ibuler

[Update] 修复创建资产是协议bug

parent e2f1754a
...@@ -164,9 +164,15 @@ $(document).ready(function () { ...@@ -164,9 +164,15 @@ $(document).ready(function () {
if (protocol === "") { if (protocol === "") {
return return
} }
if (protocolLen === 0) { var formNameNum = [0];
protocolLen = protocolsRef.length; protocolsRef.children().find("select").each(function (i, v) {
} var fieldName = $(v).attr("name");
var num = fieldName.split('-')[1];
formNameNum.push(parseInt(num));
});
var protocolLenLast = Math.max(...formNameNum);
protocolLen = protocolLenLast + 1;
var selectName = "form-" + protocolLen + "-name"; var selectName = "form-" + protocolLen + "-name";
var selectId = "id_" + selectName; var selectId = "id_" + selectName;
var portName = "form-" + protocolLen + "-port"; var portName = "form-" + protocolLen + "-port";
......
...@@ -1216,7 +1216,7 @@ msgstr "连接" ...@@ -1216,7 +1216,7 @@ msgstr "连接"
#: assets/serializers/asset.py:21 #: assets/serializers/asset.py:21
msgid "Protocol format should {}/{}" msgid "Protocol format should {}/{}"
msgstr "" msgstr "协议格式 {}/{}"
#: assets/serializers/asset.py:38 #: assets/serializers/asset.py:38
msgid "Protocol duplicate: {}" msgid "Protocol duplicate: {}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment