This commit is contained in:
李超 2025-03-18 19:03:40 +08:00
parent b87f602b93
commit ee88a8e56a
29 changed files with 35 additions and 34 deletions

View File

@ -1,4 +1,4 @@
cookie: vindex==44=10=0AB00=0R;supportLang=cn%2Cen;lang=cn;sessionid=200001263afc7bd853da75cda25fc2d59c5c;loginid=8217f15cdadae3707406c7ba3e58d42a;200001263afc7bd853da75cda25fc2d59c5c=true;abcd1234=true;login=false;
cookie: vindex==44=1c=0AB00=0R;supportLang=cn%2Cen;lang=cn;sessionid=20000194c2464bf6a1f4f583fa01a649a09f;loginid=39b21ec76fad68bfe1ad3372d037d194;20000194c2464bf6a1f4f583fa01a649a09f=true;abcd1234=true;login=false;
dtcloud_cookie: Hm_lvt_d980fb2543f406139975c7a72a5a0387=1740971050,1740974075,1741246647; ea6ee7ef65afa3fa0312817d0b12190e=787b65e4f93b05a0765ee0e7a6e2d24c; CECLOUD_OPS_SID=Tm1Sa01tUTRaakF0WW1FeE1DMDBNelUwTFdJMFl6QXROR1ppWWpWallqVXdNMlZsfGRYTmxjaTVvYkhjdVpIUmpiRzkxWkM1amIyMD0=; CECLOUD_OPS_CID=TmpObVpEbG1ORGd0WmpjNU1DMDBObUZtTFdKbVptWXRZVEJpWkRNd1pERTFOakk1fGRYTmxjaTVvYkhjdVpIUmpiRzkxWkM1amIyMD0=
mysql:
password: sLy1ZxZBEroGcoSv75P/xigUJ59/Yhsz1Z7896WzArcImdobrwg5+N6QEo4yT6CcpW22Y6bYy6a0ZWYAEzDaKZhOQG0odaUAv/SDP7JM7l7hH987XFJkUauaETu97Ev0kObsbS4laEiEg/+VG8fQrPuD2iRax1IWGXTKOtn+gHlyzSp016OhKOUUKKdW16OaC8AbVX9F3tVp10c2hsQNvLJl27MN5m3jXpoq9CTdcXsk15oHZVuIp3Kj9RWa8azpauiCPEKVE1KPvuJAhPYYakZBAdxGNU7Ye/YPZq68PJZHm6otEsaQxGJB1+DRNYh0oFWN9+aSYph6kAn0p5/c4g==

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 KiB

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 KiB

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 KiB

After

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 KiB

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 303 KiB

11
main.go
View File

@ -5,6 +5,7 @@ import (
"dt_automate/auth"
_ "dt_automate/method"
"dt_automate/tool"
"dt_automate/wps"
_ "dt_automate/wps"
"flag"
"fmt"
@ -76,19 +77,19 @@ func main() {
// method.HW_DTCLOUD() //截取运维中心的图片
// method.HW_BAOLJ() //截取堡垒机的图片
// // // 政务网区截图
// // 政务网区截图
// method.ZWW_FW1() //截取防火墙的图片
// method.ZWW_TSGZ() //截取态势感知的图片
// method.ZWW_DTCLOUD() //截取运维中心的图片
// method.ZWWW_BAOLJ() //截取堡垒机的图片
// 互联网区运维巡检文档生成
// wps.HW_SYS_Word() //运维平台word文档生成
wps.HW_SYS_Word() //运维平台word文档生成
// //政务网区运维巡检文档生成
// wps.ZWW_SYS_Word() //运维平台word文档生成
wps.ZWW_SYS_Word() //运维平台word文档生成
// // 安全巡检文档生成
// wps.SAFET_Word() //安全巡检文档生成
wps.SAFET_Word() //安全巡检文档生成
//安全事件表格生成(需要先执行互联网区防火墙截图)
// attackevent.Fw_event(attackevent.HW_fw1_cookie(), "2025-03-15") //将防火墙安全事件存放到xlsx文件中
// attackevent.Fw_event(attackevent.HW_fw1_cookie(), "2025-03-17") //将防火墙安全事件存放到xlsx文件中
//nessus的csv文件生成docx报告
// nessus.CSV_damo()
//翻译模块调用腾讯xt翻译月500万字限制

View File

@ -42,7 +42,7 @@ func HW_DTCLOUD() {
}
// 导航到指定网址
_, err = page.Goto("https://ops.hlw.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
_, err = page.Goto("https://ops.hlw.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit})
if err != nil {
log.Fatalf("could not go to the page: %v", err)
}
@ -71,7 +71,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_man.png")
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //跳转到运维中心概览
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //跳转到运维中心概览
page.WaitForTimeout(10000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/hw_dtcloud_01.png"),
@ -79,7 +79,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_01.png")
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-资源容量
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-资源容量
page.WaitForTimeout(10000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/hw_dtcloud_02.png"),
@ -87,7 +87,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_02.png")
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-概览
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-概览
page.WaitForTimeout(10000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/hw_dtcloud_03.png"),
@ -95,7 +95,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_03.png")
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-资源监控
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-资源监控
page.WaitForTimeout(10000)
page.Locator(`.arco-tree.arco-tree-show-line`).Locator(`div`).Nth(8).Locator(`span`).Nth(2).Locator(`span`).Nth(0).Click()
page.Locator(`div[data-test-id="PhysicalServer"]`).Click()
@ -106,7 +106,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_04.png")
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-告警-告警查看
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警-告警查看
page.WaitForTimeout(10000)
page.Locator(`.arco-space-item`).Nth(0).Locator(`div`).Nth(1).Locator(`button`).Click()
page.WaitForTimeout(2000)
@ -116,7 +116,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_05.png")
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-告警--告警历史
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警--告警历史
page.WaitForTimeout(10000)
page.Locator(`.arco-btn.arco-btn-outline.arco-btn-size-default.arco-btn-shape-square`).Nth(0).Click()
page.WaitForTimeout(500)
@ -130,7 +130,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_06.png")
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-监控巡检-巡检结果
page.Goto("https://ops.hlw.dtcloud.com/region/dtcloud1/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-监控巡检-巡检结果
page.WaitForTimeout(10000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/hw_dtcloud_07.png"),
@ -138,7 +138,7 @@ func HW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_07.png")
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-容量-云服务容量
page.Goto("https://ops.hlw.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-容量-云服务容量
page.WaitForTimeout(10000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/hw_dtcloud_08.png"),

View File

@ -42,7 +42,7 @@ func ZWW_DTCLOUD() {
}
// 导航到指定网址
_, err = page.Goto("https://ops.zww.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded})
_, err = page.Goto("https://ops.zww.dtcloud.com/login", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit})
if err != nil {
log.Fatalf("could not go to the page: %v", err)
}
@ -65,7 +65,7 @@ func ZWW_DTCLOUD() {
if err := page.Locator(".el-button.login-form-item.login-btn.el-button--primary").Click(); err != nil {
log.Fatalf("could not click button: %v", err)
}
page.WaitForTimeout(10000)
page.WaitForTimeout(20000)
//运维中心主页
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_man.png"),
@ -73,43 +73,43 @@ func ZWW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_man.png")
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //跳转到运维中心概览
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/overview?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //跳转到运维中心概览
page.WaitForTimeout(20000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_01.png"),
FullPage: playwright.Bool(false),
})
// tool.Jietu("img/hw_dtcloud_01.png")
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-资源容量
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/resource?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-资源容量
page.WaitForTimeout(20000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_02.png"),
FullPage: playwright.Bool(false),
})
// tool.Jietu("img/hw_dtcloud_02.png")
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-概览
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/overview", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-概览
page.WaitForTimeout(20000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_03.png"),
FullPage: playwright.Bool(false),
})
// tool.Jietu("img/hw_dtcloud_03.png")
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-资源监控-物理服务器
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/monitor/resource", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-资源监控-物理服务器
page.WaitForTimeout(20000)
page.Locator(`.arco-tree.arco-tree-show-line`).Locator(`div`).Nth(8).Locator(`span`).Nth(2).Locator(`span`).Nth(0).Click()
page.Locator(`div[data-test-id="PhysicalServer"]`).Click()
page.WaitForTimeout(2000)
page.WaitForTimeout(4000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_04.png"),
FullPage: playwright.Bool(false),
})
// tool.Jietu("img/hw_dtcloud_04.png")
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-告警-告警查看
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/view", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警-告警查看
page.WaitForTimeout(20000)
page.Locator(`.arco-space-item`).Nth(0).Locator(`div`).Nth(1).Locator(`button`).Click()
page.WaitForTimeout(6000)
page.Screenshot(playwright.PageScreenshotOptions{
@ -118,8 +118,8 @@ func ZWW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_05.png")
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //监控-告警历史
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/alert/history", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //监控-告警历史
page.WaitForTimeout(20000)
page.Locator(`.arco-btn.arco-btn-outline.arco-btn-size-default.arco-btn-shape-square`).Nth(0).Click()
page.WaitForTimeout(1000)
page.Locator(`.arco-input-tag-input.arco-input-tag-input-size-default.arco-input-tag-input-autowidth`).Click()
@ -132,16 +132,16 @@ func ZWW_DTCLOUD() {
})
// tool.Jietu("img/hw_dtcloud_06.png")
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-监控巡检-巡检结果
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/region/dtcloud2/console/om/health-inspection/outputs?page=1&size=10&order=createTime%3Adesc&searchResult=%7B%7D", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-监控巡检-巡检结果
page.WaitForTimeout(20000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_07.png"),
FullPage: playwright.Bool(false),
})
// tool.Jietu("img/hw_dtcloud_07.png")
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateDomcontentloaded}) //运维-容量-云服务容量
page.WaitForTimeout(10000)
page.Goto("https://ops.zww.dtcloud.com/console/om/capacity/service?regionId=-1", playwright.PageGotoOptions{WaitUntil: playwright.WaitUntilStateCommit}) //运维-容量-云服务容量
page.WaitForTimeout(20000)
page.Screenshot(playwright.PageScreenshotOptions{
Path: playwright.String("img/zww_dtcloud_08.png"),
FullPage: playwright.Bool(false),