Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AD-Control-Golang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶腾飞
AD-Control-Golang
Commits
3d237ca9
Commit
3d237ca9
authored
Jun 14, 2022
by
陶腾飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/06/14 v2.5.7
parent
cf5b293f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
134 deletions
+21
-134
README.MD
+1
-0
public/dept.go
+1
-3
public/env.go
+1
-1
public/msg_deal.go
+11
-19
public/msg_init.go
+0
-1
users/menu.go
+7
-110
No files found.
README.MD
View file @
3d237ca9
...
@@ -103,6 +103,7 @@
...
@@ -103,6 +103,7 @@
-
2022/04/26 v2.5.4 cmdb消息初始化
-
2022/04/26 v2.5.4 cmdb消息初始化
-
2022/04/29 v2.5.5 ci工具 自我升级
-
2022/04/29 v2.5.5 ci工具 自我升级
-
2022/05/26 v2.5.6 更新主要计算机功能bug修复
-
2022/05/26 v2.5.6 更新主要计算机功能bug修复
-
2022/06/14 v2.5.7 更新日志输出、删除情报一二三部
## 四、其他说明
## 四、其他说明
...
...
public/dept.go
View file @
3d237ca9
...
@@ -16,9 +16,7 @@ const Dept_zw_chaiwu = "财务"
...
@@ -16,9 +16,7 @@ const Dept_zw_chaiwu = "财务"
const
Dept_zw_jishu
=
"技术"
const
Dept_zw_jishu
=
"技术"
const
Dept_zw_qbmb
=
"情报部门"
const
Dept_zw_qbmb
=
"情报部门"
const
Dept_zw_qbmb_1
=
"情报一部"
const
Dept_zw_qbmb_2
=
"情报二部"
const
Dept_zw_qbmb_3
=
"情报三部"
const
Dept_zw_qbmb_jl_string
=
"巨量"
const
Dept_zw_qbmb_jl_string
=
"巨量"
const
Dept_zw_qbmb_zj_string
=
"字节"
const
Dept_zw_qbmb_zj_string
=
"字节"
const
Dept_zw_qbmb_mt_string
=
"美团"
const
Dept_zw_qbmb_mt_string
=
"美团"
...
...
public/env.go
View file @
3d237ca9
...
@@ -11,7 +11,7 @@ const SymbolHostname = "-"
...
@@ -11,7 +11,7 @@ const SymbolHostname = "-"
// AD-Control //
// AD-Control //
const
Version
string
=
"2.5.
6
"
const
Version
string
=
"2.5.
7
"
const
Host_adserver
string
=
"ADSERVER"
const
Host_adserver
string
=
"ADSERVER"
const
Host_adserver_lan
string
=
"192.168.0.20"
const
Host_adserver_lan
string
=
"192.168.0.20"
const
Host_adserver_wan
string
=
"115.231.214.234"
const
Host_adserver_wan
string
=
"115.231.214.234"
...
...
public/msg_deal.go
View file @
3d237ca9
...
@@ -120,10 +120,10 @@ func (rep *MJreport) MsgDeal() interface{} {
...
@@ -120,10 +120,10 @@ func (rep *MJreport) MsgDeal() interface{} {
err
:=
cmdbUpdateRecordFromJSON
(
rep
.
DataStr
,
ci
)
err
:=
cmdbUpdateRecordFromJSON
(
rep
.
DataStr
,
ci
)
if
err
!=
nil
{
if
err
!=
nil
{
LOG
(
ERROR
,
rep
.
Instruction
,
err
)
LOG
(
ERROR
,
rep
.
Instruction
,
err
)
}
else
{
break
LOG
(
INFO
,
rep
.
Instruction
,
rep
.
Computername
)
}
}
}
}
LOG
(
INFO
,
rep
.
Instruction
,
rep
.
Computername
)
// 客户端
// 客户端
case
Msg_status_deal
:
case
Msg_status_deal
:
return
nil
return
nil
...
@@ -131,11 +131,11 @@ func (rep *MJreport) MsgDeal() interface{} {
...
@@ -131,11 +131,11 @@ func (rep *MJreport) MsgDeal() interface{} {
case
Msg_Report_WillLogInUser
:
case
Msg_Report_WillLogInUser
:
l
:=
fmt
.
Sprintf
(
"%s 在 %s 登陆"
,
rep
.
DataStr
,
rep
.
Computername
)
l
:=
fmt
.
Sprintf
(
"%s 在 %s 登陆"
,
rep
.
DataStr
,
rep
.
Computername
)
LOG
(
INFO
,
"REP_LOGIN"
,
l
)
LOG
(
INFO
,
rep
.
Instruction
,
l
)
SendWxworkTextToAdmins
(
l
)
SendWxworkTextToAdmins
(
l
)
case
Msg_Report_WillLogOutUser
:
case
Msg_Report_WillLogOutUser
:
l
:=
fmt
.
Sprintf
(
"%s 在 %s 注销"
,
rep
.
DataStr
,
rep
.
Computername
)
l
:=
fmt
.
Sprintf
(
"%s 在 %s 注销"
,
rep
.
DataStr
,
rep
.
Computername
)
LOG
(
INFO
,
"REP_LOGOUT"
,
l
)
LOG
(
INFO
,
rep
.
Instruction
,
l
)
SendWxworkTextToAdmins
(
l
)
SendWxworkTextToAdmins
(
l
)
// 更新主要计算机
// 更新主要计算机
...
@@ -176,8 +176,12 @@ func (rep *MJreport) MsgDeal() interface{} {
...
@@ -176,8 +176,12 @@ func (rep *MJreport) MsgDeal() interface{} {
// 注册账号
// 注册账号
case
Msg_Report_SignUPUser
:
case
Msg_Report_SignUPUser
:
switch
rep
.
Status
{
switch
rep
.
Status
{
case
Msg_status_commit
:
case
Msg_status_commit
:
LOG
(
INFO
,
rep
.
Instruction
,
rep
.
DataStr
)
SendWxworkTextToHR
(
rep
.
DataStr
)
SendWxworkTextToHR
(
rep
.
DataStr
)
// SendWxworkTextToAdmins(rep.DataStr)
case
Msg_status_deal
:
case
Msg_status_deal
:
msg
:=
strings
.
Split
(
rep
.
DataStr
,
"
\n
"
)
msg
:=
strings
.
Split
(
rep
.
DataStr
,
"
\n
"
)
//region := strings.Split(msg[1], "\n")[1]
//region := strings.Split(msg[1], "\n")[1]
...
@@ -234,8 +238,9 @@ func (rep *MJreport) MsgDeal() interface{} {
...
@@ -234,8 +238,9 @@ func (rep *MJreport) MsgDeal() interface{} {
rep
.
SendWXwork
(
Error_WXWork_Fail_ReTry
)
rep
.
SendWXwork
(
Error_WXWork_Fail_ReTry
)
break
break
}
}
// 如果创建完成
,
// 如果创建完成
rep
.
SendWXwork
(
name
+
"创建完成"
)
rep
.
SendWXwork
(
name
+
"创建完成"
)
LOG
(
ERROR
,
rep
.
Instruction
,
name
+
"创建完成"
)
SendWxworkTextToAUser
(
rep
.
Username
,
name
+
"创建完成"
)
SendWxworkTextToAUser
(
rep
.
Username
,
name
+
"创建完成"
)
}
}
...
@@ -316,19 +321,6 @@ func (exec *MJexec) MsgDeal() interface{} {
...
@@ -316,19 +321,6 @@ func (exec *MJexec) MsgDeal() interface{} {
exec
.
PsExec
()
exec
.
PsExec
()
exec
.
Status
=
Msg_Exec_State_Over
exec
.
Status
=
Msg_Exec_State_Over
case
Msg_Exec_HideShowIcon
:
var
hidetype
string
if
exec
.
DataBool
{
hidetype
=
"-"
}
else
{
hidetype
=
"+"
}
exec
.
Command
=
fmt
.
Sprintf
(
`attrib %sh "%s"`
,
hidetype
,
exec
.
DataStr
)
exec
.
PsExec
()
exec
.
IfMsg
=
true
exec
.
Explain
=
"图标已"
+
exec
.
Explain
exec
.
Status
=
Msg_Exec_State_Over
case
Msg_Exec_InstallSoftware
:
case
Msg_Exec_InstallSoftware
:
// 对于 msi 格式,从\\adserver目录使用msiexec安装
// 对于 msi 格式,从\\adserver目录使用msiexec安装
// 共享则需要everyone的读取权限
// 共享则需要everyone的读取权限
...
@@ -348,7 +340,7 @@ func (exec *MJexec) MsgDeal() interface{} {
...
@@ -348,7 +340,7 @@ func (exec *MJexec) MsgDeal() interface{} {
case
Msg_Exec_OpenRemoteTerminal
:
case
Msg_Exec_OpenRemoteTerminal
:
exec
.
Command
=
"powershell"
exec
.
Command
=
"powershell"
msg
:=
fmt
.
Sprintf
(
"%s
\n
ComputernName:%s
\n
Command:%s
\n
SessionID:%s
"
,
WxWorkInteraction_RemoteTerminal
,
exec
.
Computername
,
exec
.
Command
,
exec
.
SessionID
)
msg
:=
fmt
.
Sprintf
(
"%s
\n
ComputernName:%s
\n
Command:%s
\n
SessionID:%s
\n
mstsc /v %s /shadow:%s /control"
,
WxWorkInteraction_RemoteTerminal
,
exec
.
Computername
,
exec
.
Command
,
exec
.
SessionID
,
exec
.
Computername
,
exec
.
SessionID
)
SendWxworkTextToAdmins
(
msg
)
SendWxworkTextToAdmins
(
msg
)
exec
.
Status
=
Msg_Exec_State_Over
exec
.
Status
=
Msg_Exec_State_Over
...
...
public/msg_init.go
View file @
3d237ca9
...
@@ -48,7 +48,6 @@ const Msg_Exec_LogOffUser_cmd string = "shutdown -l"
...
@@ -48,7 +48,6 @@ const Msg_Exec_LogOffUser_cmd string = "shutdown -l"
const
Msg_Exec_RebootWindows
string
=
"rebootWindows"
const
Msg_Exec_RebootWindows
string
=
"rebootWindows"
const
Msg_Exec_RebootWindows_cmd
string
=
"shutdown -r -t 15"
const
Msg_Exec_RebootWindows_cmd
string
=
"shutdown -r -t 15"
const
Msg_Exec_InstallSoftware
string
=
"installsoftware"
const
Msg_Exec_InstallSoftware
string
=
"installsoftware"
const
Msg_Exec_HideShowIcon
string
=
"HideShowIcon"
const
Msg_Exec_OpenAdminEXE
string
=
"OpenAdmin"
const
Msg_Exec_OpenAdminEXE
string
=
"OpenAdmin"
const
Msg_Exec_OpenRemoteTerminal
string
=
"OpenRemoteTerminal"
const
Msg_Exec_OpenRemoteTerminal
string
=
"OpenRemoteTerminal"
...
...
users/menu.go
View file @
3d237ca9
...
@@ -138,7 +138,7 @@ func tAccountManagerSignUP() {
...
@@ -138,7 +138,7 @@ func tAccountManagerSignUP() {
}
}
var
signUp
signUpStruct
var
signUp
signUpStruct
if
_
,
err
:=
(
MainWindow
{
if
_
,
err
:=
(
MainWindow
{
Title
:
"
隐藏/显示桌面图标
"
,
Title
:
"
申请个人账号
"
,
MinSize
:
Size
{
Width
:
300
,
Height
:
400
},
MinSize
:
Size
{
Width
:
300
,
Height
:
400
},
Size
:
Size
{
Width
:
300
,
Height
:
400
},
Size
:
Size
{
Width
:
300
,
Height
:
400
},
Layout
:
VBox
{},
Layout
:
VBox
{},
...
@@ -223,7 +223,7 @@ func (signUp *signUpStruct) signUpPush() {
...
@@ -223,7 +223,7 @@ func (signUp *signUpStruct) signUpPush() {
func
menuInitHostManager
(
ni
*
walk
.
NotifyIcon
)
{
func
menuInitHostManager
(
ni
*
walk
.
NotifyIcon
)
{
fa
:=
"主机管理"
fa
:=
"主机管理"
text
:=
fmt
.
Sprintf
(
"主机名: %s"
,
pub
.
User_computername
)
text
:=
fmt
.
Sprintf
(
"主机名: %s"
,
pub
.
User_computername
)
sub
:=
[
...
]
string
{
text
,
"绑定主机"
,
"请求
终端
"
}
sub
:=
[
...
]
string
{
text
,
"绑定主机"
,
"请求
远程处理
"
}
// 建立空菜单
// 建立空菜单
nm
,
err
:=
walk
.
NewMenu
()
nm
,
err
:=
walk
.
NewMenu
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -285,7 +285,7 @@ func tHostManagerBind() {
...
@@ -285,7 +285,7 @@ func tHostManagerBind() {
}
}
// 主机管理 请求
终端
// 主机管理 请求
远程处理
func
tHostManagerTerminal
()
{
func
tHostManagerTerminal
()
{
var
Reg_target
string
=
Reg_RemoteTerminal
var
Reg_target
string
=
Reg_RemoteTerminal
var
exec
bool
var
exec
bool
...
@@ -299,11 +299,9 @@ func tHostManagerTerminal() {
...
@@ -299,11 +299,9 @@ func tHostManagerTerminal() {
Msg
(
`暂时无法使用,稍后重试!`
)
Msg
(
`暂时无法使用,稍后重试!`
)
return
return
}
}
if
Msg_YesNo
(
"是否请求管理员进行远程处理问题"
)
{
if
Msg_YesNo
(
`非管理人员,请勿使用!`
)
{
pub
.
SendServerExec
(
pub
.
GJexec
(
pub
.
Msg_Exec_OpenRemoteTerminal
,
User_sessionID
))
pub
.
SendServerExec
(
pub
.
GJexec
(
pub
.
Msg_Exec_OpenRemoteTerminal
,
User_sessionID
))
reg
.
Write_ADPC
(
Reg_target
,
pub
.
NowTimestampString
())
reg
.
Write_ADPC
(
Reg_target
,
pub
.
NowTimestampString
())
}
}
}
}
...
@@ -312,7 +310,7 @@ func tHostManagerTerminal() {
...
@@ -312,7 +310,7 @@ func tHostManagerTerminal() {
func
menuInitTools
(
ni
*
walk
.
NotifyIcon
)
{
func
menuInitTools
(
ni
*
walk
.
NotifyIcon
)
{
fa
:=
"工具集合"
fa
:=
"工具集合"
sub
:=
[
...
]
string
{
"Excel关键词分割"
,
"优雅批量打开网页"
,
"
隐藏/显示桌面图标"
,
"更新手机代理程序"
,
"
PDF转换"
,
"窗口拦截"
,
"软件安装"
}
sub
:=
[
...
]
string
{
"Excel关键词分割"
,
"优雅批量打开网页"
,
"PDF转换"
,
"窗口拦截"
,
"软件安装"
}
// 建立空菜单
// 建立空菜单
nm
,
err
:=
walk
.
NewMenu
()
nm
,
err
:=
walk
.
NewMenu
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -321,12 +319,6 @@ func menuInitTools(ni *walk.NotifyIcon) {
...
@@ -321,12 +319,6 @@ func menuInitTools(ni *walk.NotifyIcon) {
//lastone := len(sub)-1
//lastone := len(sub)-1
for
i
,
buttonText
:=
range
sub
{
for
i
,
buttonText
:=
range
sub
{
// 过滤按钮
// switch i{
// case lastone:
// if ! pub.TheUser(pub.AD_User_huyibo) {continue}
// }
// 建立 子按钮
// 建立 子按钮
na
:=
walk
.
NewAction
()
na
:=
walk
.
NewAction
()
if
err
:=
na
.
SetText
(
buttonText
);
err
!=
nil
{
if
err
:=
na
.
SetText
(
buttonText
);
err
!=
nil
{
...
@@ -340,14 +332,10 @@ func menuInitTools(ni *walk.NotifyIcon) {
...
@@ -340,14 +332,10 @@ func menuInitTools(ni *walk.NotifyIcon) {
case
1
:
case
1
:
na
.
Triggered
()
.
Attach
(
tBatchOpenWeb
)
na
.
Triggered
()
.
Attach
(
tBatchOpenWeb
)
case
2
:
case
2
:
na
.
Triggered
()
.
Attach
(
tHideShowIcon
)
case
3
:
na
.
Triggered
()
.
Attach
(
tUpdateATool
)
case
4
:
na
.
Triggered
()
.
Attach
(
tPdfTrans
)
na
.
Triggered
()
.
Attach
(
tPdfTrans
)
case
5
:
case
3
:
na
.
Triggered
()
.
Attach
(
tWindowsBlock
)
na
.
Triggered
()
.
Attach
(
tWindowsBlock
)
case
6
:
case
4
:
na
.
Triggered
()
.
Attach
(
tSoftwareInstall
)
na
.
Triggered
()
.
Attach
(
tSoftwareInstall
)
}
}
...
@@ -393,97 +381,6 @@ func tPdfTrans() {
...
@@ -393,97 +381,6 @@ func tPdfTrans() {
pub
.
LOG
(
INFO
,
"USERS_TOOLS"
,
"执行 工具集合-PDF转换"
)
pub
.
LOG
(
INFO
,
"USERS_TOOLS"
,
"执行 工具集合-PDF转换"
)
}
}
// 工具集合 更新手机代理程序
func
tUpdateATool
()
{
pub
.
Execcmd_wait
(
`xcopy \\adserver\software\phoneproxy\ATools\win-unpacked C:\Application\win-unpacked /D /S /E /C /y`
)
Msg
(
"更新完成"
)
pub
.
LOG
(
INFO
,
"USERS_TOOLS"
,
"执行 工具集合-更新手机代理程序"
)
}
// 工具集合 隐藏/显示桌面图标
func
tHideShowIcon
()
{
Msg
(
"注:并非所有图标都会列出,没有列出的图标请手动隐藏(右键文件,打开属性,勾选隐藏,点击确定)"
)
mw
:=
&
MyMainWindow
{
model
:
HideShowIconModel
()}
if
_
,
err
:=
(
MainWindow
{
AssignTo
:
&
mw
.
MainWindow
,
Title
:
"隐藏/显示桌面图标"
,
MinSize
:
Size
{
Width
:
300
,
Height
:
400
},
Size
:
Size
{
Width
:
300
,
Height
:
400
},
Layout
:
VBox
{},
Children
:
[]
Widget
{
ListBox
{
AssignTo
:
&
mw
.
lb
,
Model
:
mw
.
model
,
OnItemActivated
:
mw
.
tHideShowIconDeal
,
},
PushButton
{
Text
:
"隐藏/显示"
,
OnClicked
:
mw
.
tHideShowIconDeal
,
},
},
}
.
Run
());
err
!=
nil
{
Msg
(
"执行错误"
)
pub
.
LOG
(
pub
.
ERROR
,
NULL
,
err
)
}
pub
.
LOG
(
INFO
,
"USERS_TOOLS"
,
"执行 工具集合-隐藏/显示桌面图标"
)
}
type
MyMainWindow
struct
{
*
walk
.
MainWindow
model
*
EnvModel
lb
*
walk
.
ListBox
}
type
EnvItem
struct
{
name
string
}
type
EnvModel
struct
{
walk
.
ListModelBase
items
[]
EnvItem
}
func
HideShowIconModel
()
*
EnvModel
{
r
,
err
:=
pub
.
PSCommandOutput
(
`Get-ChildItem -Force -Filter *.lnk C:\Users\Public\Desktop -Name`
)
if
err
!=
nil
{
Msg
(
"执行失败"
)
return
nil
}
list
:=
strings
.
Split
(
r
,
"
\n
"
)
m
:=
&
EnvModel
{
items
:
make
([]
EnvItem
,
len
(
list
)
-
1
)}
for
i
:=
0
;
i
<
len
(
list
)
-
1
;
i
++
{
unlnk
:=
list
[
i
][
:
len
(
list
[
i
])
-
5
]
m
.
items
[
i
]
=
EnvItem
{
unlnk
}
}
return
m
}
func
(
mw
*
MyMainWindow
)
tHideShowIconDeal
()
{
app
:=
(
&
mw
.
model
.
items
[
mw
.
lb
.
CurrentIndex
()])
.
name
fullAppDir
:=
`C:\Users\public\desktop\`
+
app
+
`.lnk`
var
exec
pub
.
MJexec
exec
.
Init
(
pub
.
Msg_Exec_HideShowIcon
,
User_sessionID
)
exec
.
DataStr
=
fullAppDir
r
,
err
:=
pub
.
PSCommandOutputNoSplit
(
fmt
.
Sprintf
(
`(Get-Item "%s" -Force ).Attributes`
,
fullAppDir
))
if
err
!=
nil
{
Msg
(
"执行失败"
)
return
}
if
strings
.
Contains
(
r
,
"Hidden"
)
{
exec
.
Explain
=
"隐藏"
exec
.
DataBool
=
false
}
else
{
exec
.
Explain
=
"显示"
exec
.
DataBool
=
true
}
pub
.
SendServerExec
(
exec
)
}
// 工具集合 火绒窗口拦截工具
// 工具集合 火绒窗口拦截工具
func
tWindowsBlock
()
{
func
tWindowsBlock
()
{
PopBlock
:=
`C:\Progra~2\zhiwei\huorong_windows_block\PopBlock.exe`
PopBlock
:=
`C:\Progra~2\zhiwei\huorong_windows_block\PopBlock.exe`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment