EasyPHP 面板助手

新窗口打开站点;自动启用服务;书签功能;

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         EasyPHP 面板助手
// @namespace    https://www.wdssmq.com/
// @author       沉冰浮水
// @description  新窗口打开站点;自动启用服务;书签功能;
// @version      0.1
// @match        http://127.0.0.1:1111/*
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==
/*jshint esversion:6 */
(function () {
  "use strict";
  let $ = typeof window.$ == "function" ? window.$ : unsafeWindow.jQuery;
  $("a.list_alias_name").attr("target", "_blank");

  // 自动启用
  $(".btn-success[type=submit]").each(function () {
    $(this).click();
  });

  // 书签
  const bookmarks = GM_getValue("bookmarks", []);
  if (bookmarks.length === 0) {
    GM_setValue("bookmarks", [
      {
        site: "zbp",
        name: "后台",
        url: "/zb_system/cmd.php?act=login",
      },
    ]);
  }

  // 站点列表
  const siteList = {};
  $(".list_alias_name").each(function () {
    const site = $(this).find("b").text();
    siteList[site] = $(this);
  });

  // 输出书签
  bookmarks.forEach((item) => {
    const site = item.site;
    if (!siteList[site]) {
      return;
    }
    const rootUrl = siteList[site].attr("href");
    siteList[site].after(
      ` | <a title="${item.name}" class="list_alias_name" target="_blank" href="${rootUrl}${item.url}">${item.name}</a>`
    );
  });
})();