您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Log format
// ==UserScript== // @name 阿里云日志美化 // @namespace GoldSubmarine // @version 0.3 // @description Log format // @author GoldSubmarine // @match https://sls.console.aliyun.com/lognext/project/* // @icon https://www.google.com/s2/favicons?domain=tampermonkey.net // @grant none // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // ==/UserScript== (function() { 'use strict'; // 💬💡 function getObserver() { return new MutationObserver(function(records) { for(const record of records) { record.addedNodes.forEach(li => { let hiddenStr = "" $(li).find("div[class^='Virtual__style__live-content'] > div").each(function() { let html = $(this).text() let removeLabelArr = ["__raw_log__: "] removeLabelArr.forEach((removeLabel) => { if(html.indexOf(removeLabel) === 0) { let span = $(this).find("span").eq(0) if(span.text() === removeLabel) span.remove() } }) let labelArr = ["__tag__:__hostname__:", "__tag__:__path__:", "app:", "__tag__:__receive_time__:", "__tag__:__client_ip__:", "ts:"] labelArr.forEach((label) => { if(html.indexOf(label) === 0) { hiddenStr += html + ' ' $(this).css("display","none") } }) }) let tipHtml = $(li).find("div[class^='Virtual__style__live-content'] > span:eq(1)") tipHtml.html(" 💡 ") tipHtml.attr("aria-label", hiddenStr) tipHtml.attr("data-balloon-pos", "right") }) } }); } addCssByLink('https://cdn.jsdelivr.net/npm/[email protected]/balloon.min.css') function addCssByLink(url) { var link = document.createElement('link') link.setAttribute('rel', 'stylesheet') link.setAttribute('type', 'text/css') link.setAttribute('href', url) var heads = document.getElementsByTagName('head') if (heads.length) heads[0].appendChild(link) else document.documentElement.appendChild(link) } let observer = getObserver() setInterval(() => { $("div[class^='Context__style__inner-list'] .next-virtual-list-wrapper ul").each(function() { let html = $(this)[0] observer.observe(html, {childList: true}) }) }, 1000) })();