code-server

add coder-server url on job detail

As of 05. 07. 2024. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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...
})();