-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 修复mysql模式下「资产授权列表」「用户授权列表」「用户组授权列表」无法使用的问题 fixed #315
- 修复资产新增、修改无权限的缺陷 fixed #314 - 修复执行动态指令时多行失败且无法自动执行的问题 fixed #313 #310 - 修复计划任务无法选择资产的问题 fixed #312 - 修复导入导出备份无效的问题 fixed #303 - 增加「资产详情」「资产授权」「用户详情」「用户授权」「用户组详情」「用户组授权」「角色详情」「授权策略详情」按钮 - 修复资产列表使用IP搜索无效的问题 - 资产列表增加最近接入时间排序、增加修改每页数量 fixed #311 - 修复登录页面双因素认证输入框无法自动获取焦点的问题 fixed #311 - 增加普通页面资产列表最后接入时间排序 fixed #311 - 计划任务增加执行本机系统命令
- Loading branch information
1 parent
2c86a77
commit a85bdfc
Showing
26 changed files
with
420 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package utils | ||
|
||
import ( | ||
"bytes" | ||
"os/exec" | ||
) | ||
|
||
// Exec 执行shell命令 | ||
func Exec(command string) (string, string, error) { | ||
var stdout bytes.Buffer | ||
var stderr bytes.Buffer | ||
|
||
cmd := exec.Command("bash", "-c", command) | ||
cmd.Stdout = &stdout | ||
cmd.Stderr = &stderr | ||
err := cmd.Run() | ||
return stdout.String(), stderr.String(), err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package utils | ||
|
||
import "testing" | ||
|
||
func TestExec(t *testing.T) { | ||
commands := []string{ | ||
`pwd`, | ||
`whoami`, | ||
`cat /etc/resolv.conf`, | ||
`echo "test" > /tmp/ddtest`, | ||
`rm -rf /tmp/ddtest`, | ||
} | ||
for _, command := range commands { | ||
output, errout, err := Exec(command) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
t.Log("output:", output) | ||
t.Log("errout:", errout) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.