您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
check produce branch
// ==UserScript== // @name jenkin branch check // @namespace http://tampermonkey.net/ // @version 2024-07-25-2 // @description check produce branch // @author wkk // @match https://jenkins.fintopia.tech/job/WP/job/wms-build-deploy/build?delay=0sec // @icon https://www.google.com/s2/favicons?sz=64&domain=fintopia.tech // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; Q("form:contains('RELEASE_BRANCH')").find("input[value='RELEASE_BRANCH']").next().blur(function() { let regex1 = new RegExp("^releases/wms_" + getNowFormatDate() + "$"); if (regex1.test(this.value)) { this.style.border = '1px solid black'; return; } this.style.border = '1px solid red'; alert("请选择正确的发布分支"); }) //获取当前日期函数 function getNowFormatDate() { let date = new Date(), year = date.getFullYear(), //获取完整的年份(4位) month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月) strDate = date.getDate() // 获取当前日(1-31) if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0 if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0 return `${year}${month}${strDate}` } })();