diff --git a/202510_油猴_NPS自动最大分页.md b/202510_油猴_NPS自动最大分页.md deleted file mode 100644 index 704db16..0000000 --- a/202510_油猴_NPS自动最大分页.md +++ /dev/null @@ -1,28 +0,0 @@ -``` -// ==UserScript== -// @name NPS自动最大分页 -// @namespace http://tampermonkey.net/ -// @version 1.0 -// @description 页面加载完成后自动点击指定按钮和分页链接 -// @author 8ga -// @match http://115.29.241.23:38888/index/tcp -// @grant none -// @run-at document-idle -// ==/UserScript== - -(function () { - 'use strict'; - window.addEventListener('load', function () { - const dropdownButton = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-pagination > div.float-left.pagination-detail > span.page-list > span > button"); - if (dropdownButton) { - dropdownButton.click(); - setTimeout(() => { - const fourthLink = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-pagination > div.float-left.pagination-detail > span.page-list > span > div > a:nth-child(4)"); - if (fourthLink) { - fourthLink.click(); - } - }, 500); - } - }); -})(); -``` \ No newline at end of file diff --git a/202510_油猴_NPS自动美化脚本.md b/202510_油猴_NPS自动美化脚本.md new file mode 100644 index 0000000..c1450b4 --- /dev/null +++ b/202510_油猴_NPS自动美化脚本.md @@ -0,0 +1,47 @@ +// ==UserScript== +// @name NPS自动美化脚本 +// @namespace http://tampermonkey.net/ +// @version 1.0 +// @description 页面加载完成后自动点击指定按钮和分页链接 +// @author 8ga +// @match 115.29.241.23:38888/index/tcp +// @grant none +// @run-at document-idle +// ==/UserScript== + +(function () { + 'use strict'; + window.addEventListener('load', function () { + setTimeout(() => { + const dropdownButton = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-pagination > div.float-left.pagination-detail > span.page-list > span > button"); + if (dropdownButton) { + dropdownButton.click(); + const fourthLink = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-pagination > div.float-left.pagination-detail > span.page-list > span > div > a:nth-child(4)"); + if (fourthLink) { + fourthLink.click(); + } + } + if (!document.body.classList.contains('mini-navbar')) { + const collspace = document.querySelector("#page-wrapper > div.row.border-bottom > nav > div > a"); + if (collspace) { + collspace.click(); + } + } + const culumnBtn = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-toolbar > div.columns.columns-right.btn-group.float-right > div > button"); + if (culumnBtn) { + culumnBtn.click(); + setTimeout(() => { + const columnDiv = document.querySelector("#page-wrapper > div.wrapper.wrapper-content.animated.fadeInRight > div > div > div > div.ibox-content > div.bootstrap-table.bootstrap4 > div.fixed-table-toolbar > div.columns.columns-right.btn-group.float-right > div > div"); + const inputList = Array.from(columnDiv.querySelectorAll('label')); + const updateIndex = [0, 1, 3, 4, 8]; + updateIndex.forEach(i => { + if (inputList[i]) { + inputList[i].click(); + } + }); + culumnBtn.click(); + }, 100) + } + }, 500); + }); +})(); \ No newline at end of file