code-server

add coder-server url on job detail

05.07.2024 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         code-server
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  add coder-server url on job detail
// @author       You
// @match        http://paddlecloud.baidu-int.com/paddle/job/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=juejin.cn
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @grant        none
// ==/UserScript==

function get_a() {
    let a = document.querySelector("#resourceInfo > div.ant-table-wrapper > div > div > div > div > div.ant-table-body > table > tbody > tr.ant-table-row.ant-table-row-level-0 > td:nth-child(2)");
    return a;
}

function get_d(){
    let d = document.querySelector("#resourceInfo > div.ant-table-wrapper > div > div > div > div > div.ant-table-body > table > tbody > tr.ant-table-row.ant-table-row-level-0 > td.ant-table-cell.ant-table-cell-fix-right.ant-table-cell-fix-right-first > div")
    return d;
}


(function() {
    'use strict';
    let interval = setInterval(function(){
        let a = get_a();
        let d = get_d();
        console.log(a);
        console.log(d);
        if (a && d) {
            console.log("add code server");
            let ip = a.innerText;
            var code = document.createElement("a");
            code.href = "http://" + ip + ":8000";
            code.class = "ant-btn ant-btn-link";
            var s = document.createElement("span");
            s.innerHTML = "\n code-server\n";
            code.appendChild(s);
            console.log("ip: ", ip);
            d.appendChild(code);
            clearInterval(interval);
        }
    }, 500);
    // Your code here...
})();