您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add hours remaining to balance display on RunPod
当前为
// ==UserScript== // @name RunPod Balance Hours Remaining // @license MIT // @namespace http://tampermonkey.net/ // @version 0.1 // @description Add hours remaining to balance display on RunPod // @author You // @match https://www.runpod.io/* // @grant none // ==/UserScript== (function() { 'use strict'; function addHoursRemaining(balance, spendPerHr) { const balanceDiv = document.evaluate( '/html/body/div[1]/div[1]/div[2]/div[2]/div/div[2]/div/div/a/button/div/div[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; if (balanceDiv && !document.getElementById('hours-remaining')) { const hoursRemaining = balance / spendPerHr; const hoursDiv = document.createElement('div'); hoursDiv.id = 'hours-remaining'; hoursDiv.style.fontSize = '10px'; hoursDiv.style.color = '#94a3b8'; hoursDiv.style.fontWeight = '600'; hoursDiv.style.marginTop = '-2px'; hoursDiv.style.textAlign = 'right'; hoursDiv.textContent = `${hoursRemaining.toFixed(1)} hours remaining`; balanceDiv.after(hoursDiv); } } // Monitor XHR responses for GraphQL data const originalFetch = window.fetch; window.fetch = async function(...args) { const response = await originalFetch.apply(this, args); if (response.url.includes('api.runpod.io/graphql')) { response.clone().json().then(data => { if (data.data?.myself) { const balance = data.data.myself.clientBalance; const spendPerHr = data.data.myself.currentSpendPerHr; addHoursRemaining(balance, spendPerHr); } }); } return response; }; })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址