UBNT Floating Login Button (Ultimate Fix)

Tombol login floating untuk UBNT AirOS (pasti muncul)

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         UBNT Floating Login Button (Ultimate Fix)
// @namespace    Add Loggin Button
// @version      1.0
// @description  Tombol login floating untuk UBNT AirOS (pasti muncul)
// @match        *://192.168.1.20/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function createFloatingLogin() {
        if (document.getElementById('ubntFloatingLogin')) return;

        const form = document.getElementById('loginform');
        if (!form) return;

        const btn = document.createElement('button');
        btn.id = 'ubntFloatingLogin';
        btn.innerText = 'LOGIN';
        btn.type = 'button';

        // ===== STYLE FLOATING =====
        btn.style.position = 'fixed';
        btn.style.bottom = '30px';
        btn.style.left = '50%';
        btn.style.transform = 'translateX(-50%)';
        btn.style.zIndex = '99999';
        btn.style.width = '280px';
        btn.style.padding = '20px';
        btn.style.fontSize = '22px';
        btn.style.fontWeight = 'bold';
        btn.style.background = '#0d6efd';
        btn.style.color = '#fff';
        btn.style.border = 'none';
        btn.style.borderRadius = '10px';
        btn.style.cursor = 'pointer';
        btn.style.boxShadow = '0 5px 15px rgba(0,0,0,.4)';

        btn.onmouseenter = () => btn.style.background = '#084298';
        btn.onmouseleave = () => btn.style.background = '#0d6efd';

        btn.onclick = () => {
            console.log('[UBNT] Floating login clicked');
            form.submit();
        };

        document.body.appendChild(btn);
        console.log('[UBNT] Floating login button created');
    }

    // paksa jalan terus sampai muncul
    const timer = setInterval(() => {
        if (document.getElementById('loginform')) {
            createFloatingLogin();
            clearInterval(timer);
        }
    }, 500);
})();