feat: support function permission
This commit is contained in:
@@ -397,7 +397,10 @@ function changeAppInternal(requireRendering) {
|
||||
+ " <div class=\"row\">\n"
|
||||
+ " <div class=\"col-sm-12 d-flex justify-content-center\">\n"
|
||||
+ " <div class=\"input-group mb-2\">\n"
|
||||
+ " <div class=\"input-group-prepend\">\n"
|
||||
+ " <div class=\"input-group-prepend input-group-text\">\n"
|
||||
+ "<input type=\"checkbox\" id=\"showIOInput\" onchange=\"filterIOFunction()\" checked=\"on\" aria-label=\"Checkbox for ShowIO\" data-toggle=\"tooltip\" title=\"仅显示有IO函数\"></input>"
|
||||
+ " </div>\n"
|
||||
+ " <div class=\"input-group-append\">\n"
|
||||
+ " <select id=\"selectAction\" onchange=\"showDescription()\" class=\"custom-select\" style=\"-webkit-appearance: none;\"><option value=\"-1\">选择方法</option></select> \n"
|
||||
+ " </div>\n"
|
||||
+ " <input type=\"text\" class=\"form-control\" id=\"argInput\" placeholder=\"填写参数\" >\n"
|
||||
@@ -435,10 +438,16 @@ function changeAppInternal(requireRendering) {
|
||||
+ " </div>\n"
|
||||
+ " </div></div>\n" + "";
|
||||
$("#mainDiv")[0].innerHTML = html;
|
||||
for (const f of global.currentContract.exportedFunctions) {
|
||||
$('#selectAction')
|
||||
.append(`<option value="${f.functionName}">${f.functionName}</option>`);
|
||||
}
|
||||
filterIOFunction();
|
||||
}
|
||||
}
|
||||
function filterIOFunction(){
|
||||
var showIO = showIOInput.checked;
|
||||
$('#selectAction').html("<option value=\"-1\">选择方法</option>");
|
||||
for (const f of global.currentContract.exportedFunctions) {
|
||||
if (!showIO || f.relatedPermission.length!=0)
|
||||
$('#selectAction')
|
||||
.append(`<option value="${f.functionName}">${f.functionName}</option>`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user