mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
替换 jsdelivr 污染域名
This commit is contained in:
parent
50437b9ab2
commit
fa2706ebf0
@ -18,7 +18,7 @@
|
||||
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
||||
| ![默认主题](resource/template/theme-default/screenshot.png) | <img src="resource/template/theme-daynight/screenshot.png" width="3000px"/> | <img src="resource/template/theme-hotaru/screenshot.png" width="1500px" /> |
|
||||
| <div align="center"><b>默认主题魔改 <a href="https://ii.do/43.html">[教程]</a></b></div> | <div align="center"><b>Neko Mdui <a href="https://github.com/MikoyChinese">@MikoyChinese</a></b></div> | |
|
||||
| ![默认主题魔改](https://cdn.jsdelivr.net/gh/idarku/img@main/me/1631120192341.webp) | ![Neko Mdui](resource/template/theme-mdui/screenshot.png) | |
|
||||
| ![默认主题魔改](https://fastly.jsdelivr.net/gh/idarku/img@main/me/1631120192341.webp) | ![Neko Mdui](resource/template/theme-mdui/screenshot.png) | |
|
||||
|
||||
## 安装脚本
|
||||
|
||||
@ -32,7 +32,7 @@ sudo ./nezha.sh
|
||||
国内镜像加速:
|
||||
|
||||
```shell
|
||||
curl -L https://cdn.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh
|
||||
curl -L https://fastly.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh
|
||||
CN=true sudo ./nezha.sh
|
||||
```
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
{{template "component/server" .}}
|
||||
{{template "common/footer" .}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
||||
<script>
|
||||
var clipboard = new ClipboardJS('.ui.icon.green.mini.button');
|
||||
const checkBoxList = document.querySelectorAll('tbody > tr > td > input.nezha-servers[type=checkbox]')
|
||||
|
@ -8,7 +8,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>tty@{{.ServerName}} - {{.Title}}</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg?v20210804" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@4.13.0/css/xterm.css">
|
||||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/xterm@4.13.0/css/xterm.css">
|
||||
</head>
|
||||
|
||||
<style>
|
||||
@ -28,9 +28,9 @@
|
||||
|
||||
<body onresize="onResize()">
|
||||
<div id="terminal-container"></div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xterm@4.13.0/lib/xterm.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-attach@0.6.0/lib/xterm-addon-attach.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.5.0/lib/xterm-addon-fit.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/xterm@4.13.0/lib/xterm.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/xterm-addon-attach@0.6.0/lib/xterm-addon-attach.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/xterm-addon-fit@0.5.0/lib/xterm-addon-fit.min.js"></script>
|
||||
<script>
|
||||
let sendResizing = false;
|
||||
|
||||
|
4
resource/template/theme-daynight/home.html
vendored
4
resource/template/theme-daynight/home.html
vendored
@ -165,8 +165,8 @@
|
||||
</footer>
|
||||
|
||||
<script src="/static/theme-daynight/js/main.js?v202102012266"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/sweetalert2@10"></script>
|
||||
|
||||
<script>
|
||||
const initData = JSON.parse('{{.Servers}}').servers;
|
||||
|
8
resource/template/theme-hotaru/home.html
vendored
8
resource/template/theme-hotaru/home.html
vendored
@ -14,7 +14,7 @@
|
||||
<meta http-equiv="Content-Language" content="zh" />
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://fastly.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.1/css/all.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/semantic-ui-alerts.min.css">
|
||||
<link rel="stylesheet" href="/static/theme-hotaru/css/core.css?v202012121912" type="text/css">
|
||||
@ -146,10 +146,10 @@
|
||||
<a href="/server">管理后台</a>
|
||||
</p>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.js"></script>
|
||||
<script src="/static/semantic-ui-alerts.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
|
||||
<script>
|
||||
const initData = JSON.parse('{{.Servers}}').servers;
|
||||
var statusCards = new Vue({
|
||||
|
6
resource/template/theme-mdui/home.html
vendored
6
resource/template/theme-mdui/home.html
vendored
@ -9,7 +9,7 @@
|
||||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg?v20210804" />
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="/static/theme-mdui/mdui.css" type="text/css">
|
||||
<style>
|
||||
.mdui-table td, .mdui-table th{padding: 6px;}
|
||||
@ -151,8 +151,8 @@
|
||||
{{template "theme-mdui/footer" .}}
|
||||
|
||||
<script src="/static/theme-mdui/mdui.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.12/vue.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
6
resource/template/theme-mdui/service.html
vendored
6
resource/template/theme-mdui/service.html
vendored
@ -9,7 +9,7 @@
|
||||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg?v20210804" />
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="/static/theme-mdui/mdui.css" type="text/css">
|
||||
{{if ts .CustomCode}}
|
||||
{{.CustomCode|safe}}
|
||||
@ -116,8 +116,8 @@
|
||||
{{template "theme-mdui/footer" .}}
|
||||
|
||||
<script src="/static/theme-mdui/mdui.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.12/vue.min.js"></script>
|
||||
<script>
|
||||
var container=document.querySelector("#container");
|
||||
|
@ -8,7 +8,7 @@
|
||||
<title>{{.Title}}</title>
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css"/>
|
||||
<link rel="stylesheet" href="/static/theme-mdui/mdui.css" type="text/css">
|
||||
{{if ts .CustomCode}}
|
||||
{{.CustomCode|safe}}
|
||||
@ -34,8 +34,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||
<script src="https://fastly.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<script>
|
||||
var $input = mdui.$('#container').find('.mdui-textfield-input');
|
||||
var $dialog = new mdui.Dialog(mdui.$('.mdui-dialog'));
|
||||
|
@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha"
|
||||
NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
|
||||
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent"
|
||||
NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service"
|
||||
NZ_VERSION="v0.8.3"
|
||||
NZ_VERSION="v0.9.0"
|
||||
|
||||
red='\033[0;31m'
|
||||
green='\033[0;32m'
|
||||
@ -75,7 +75,7 @@ pre_check() {
|
||||
Get_Docker_Argu=" "
|
||||
Docker_IMG="ghcr.io\/naiba\/nezha-dashboard"
|
||||
else
|
||||
GITHUB_RAW_URL="cdn.jsdelivr.net/gh/naiba/nezha@master"
|
||||
GITHUB_RAW_URL="fastly.jsdelivr.net/gh/naiba/nezha@master"
|
||||
GITHUB_URL="dn-dao-github-mirror.daocloud.io"
|
||||
Get_Docker_URL="get.daocloud.io/docker"
|
||||
Get_Docker_Argu=" -s docker --mirror Aliyun"
|
||||
@ -124,7 +124,7 @@ before_show_menu() {
|
||||
}
|
||||
|
||||
install_base() {
|
||||
(command -v git >/dev/null 2>&1 && command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v tar >/dev/null 2>&1) ||
|
||||
(command -v git >/dev/null 2>&1 && command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1) ||
|
||||
(install_soft curl wget git unzip)
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ install_agent() {
|
||||
|
||||
local version=$(curl -m 10 -sL "https://api.github.com/repos/naiba/nezha/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||
if [ ! -n "$version" ]; then
|
||||
version=$(curl -m 10 -sL "https://cdn.jsdelivr.net/gh/naiba/nezha/" | grep "option\.value" | awk -F "'" '{print $2}' | sed 's/naiba\/nezha@/v/g')
|
||||
version=$(curl -m 10 -sL "https://fastly.jsdelivr.net/gh/naiba/nezha/" | grep "option\.value" | awk -F "'" '{print $2}' | sed 's/naiba\/nezha@/v/g')
|
||||
fi
|
||||
|
||||
if [ ! -n "$version" ]; then
|
||||
@ -205,6 +205,7 @@ install_agent() {
|
||||
echo -e "${red}Release 下载失败,请检查本机能否连接 ${GITHUB_URL}${plain}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
unzip -qo nezha-agent_linux_${os_arch}.zip &&
|
||||
mv nezha-agent $NZ_AGENT_PATH &&
|
||||
rm -rf nezha-agent_linux_${os_arch}.zip README.md
|
||||
@ -294,8 +295,8 @@ modify_dashboard_config() {
|
||||
read -ep "请输入 Oauth2 应用的 Client Secret: " nz_github_oauth_client_secret &&
|
||||
read -ep "请输入 GitHub/Gitee 登录名作为管理员,多个以逗号隔开: " nz_admin_logins &&
|
||||
read -ep "请输入站点标题: " nz_site_title &&
|
||||
read -ep "请输入站点访问端口: (8008)" nz_site_port &&
|
||||
read -ep "请输入用于 Agent 接入的 RPC 端口: (5555)" nz_grpc_port
|
||||
read -ep "请输入站点访问端口: (默认 8008)" nz_site_port &&
|
||||
read -ep "请输入用于 Agent 接入的 RPC 端口: (默认 5555)" nz_grpc_port
|
||||
|
||||
if [[ -z "${nz_admin_logins}" || -z "${nz_github_oauth_client_id}" || -z "${nz_github_oauth_client_secret}" || -z "${nz_site_title}" ]]; then
|
||||
echo -e "${red}所有选项都不能为空${plain}"
|
||||
|
Loading…
Reference in New Issue
Block a user