Unverified Commit 7d4e9c56 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #3131 from jumpserver/dev

Dev
parents a5e59e67 088f815a
...@@ -110,16 +110,15 @@ function hiddenFields(){ ...@@ -110,16 +110,15 @@ function hiddenFields(){
function constructParams(data) { function constructParams(data) {
var typeList = ['chrome', 'mysql_workbench', 'vmware_client', 'custom']; var typeList = ['chrome', 'mysql_workbench', 'vmware_client', 'custom'];
var params = {}; var params = {};
for (var type in typeList){ $.each(typeList, function(index, value){
if (data.type === type){ if (data.type === value){
for (var k in data){ for (var k in data){
if (k.startsWith(data.type)){ if (k.startsWith(value)){
params[k] = data[k] params[k] = data[k]
} }
} }
break
}
} }
});
return params; return params;
} }
$(document).ready(function () { $(document).ready(function () {
......
...@@ -71,9 +71,9 @@ class AssetUserManager: ...@@ -71,9 +71,9 @@ class AssetUserManager:
if len(instances) == 1: if len(instances) == 1:
return instances[0] return instances[0]
elif len(instances) == 0: elif len(instances) == 0:
self.raise_does_not_exist(self.__name__) self.raise_does_not_exist(self.__class__.__name__)
else: else:
self.raise_multiple_return(self.__name__, len(instances)) self.raise_multiple_return(self.__class__.__name__, len(instances))
def raise_does_not_exist(self, name): def raise_does_not_exist(self, name):
raise self.ObjectDoesNotExist(self.MSG_NOT_EXIST.format(name)) raise self.ObjectDoesNotExist(self.MSG_NOT_EXIST.format(name))
......
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