chore: change dashboard url using yacd-meta
This commit is contained in:
@@ -12,7 +12,7 @@ geodata-loader: memconservative
|
||||
external-controller: 0.0.0.0:9090
|
||||
# external-controller-tls: 0.0.0.0:9091 # RESTful API HTTPS device
|
||||
# secret: "123456"
|
||||
external-ui: ./dashboard/dist
|
||||
external-ui: ./dashboard
|
||||
# tcp-concurrent: false
|
||||
# inbound-tfo: false
|
||||
# global-client-fingerprint: chrome
|
||||
|
||||
@@ -171,7 +171,7 @@ prepare_clash() {
|
||||
|
||||
clash_external_ui=$(busybox awk '/external-ui: /{print $1}' "${clash_config}")
|
||||
if [ -z "${clash_external_ui}" ]; then
|
||||
echo -e "\nexternal-ui: ./dashboard/dist" >> "${clash_config}"
|
||||
echo -e "\nexternal-ui: ./dashboard" >> "${clash_config}"
|
||||
fi
|
||||
|
||||
clash_tproxy_port=$(busybox awk '/tproxy-port: /{print $1}' "${clash_config}")
|
||||
|
||||
@@ -374,19 +374,20 @@ cgroup_limit() {
|
||||
}
|
||||
|
||||
update_dashboard() {
|
||||
if [[ "${bin_name}" == "sing-box" || "${bin_name}" == "clash" ]]; then
|
||||
if [ "${bin_name}" = "sing-box" ] || [ "${bin_name}" = "clash" ]; then
|
||||
file_dashboard="${data_dir}/${bin_name}/dashboard.zip"
|
||||
rm -rf "${data_dir}/${bin_name}/dashboard/dist"
|
||||
if [ ! -d "${data_dir}/${bin_name}/dashboard" ];then
|
||||
log info "dashboard folder not exist,create it"
|
||||
rm -rf "${data_dir}/${bin_name}/dashboard"
|
||||
if [ ! -d "${data_dir}/${bin_name}/dashboard" ]; then
|
||||
log info "dashboard folder not exist, creating it"
|
||||
mkdir "${data_dir}/${bin_name}/dashboard"
|
||||
fi
|
||||
url="https://github.com/CHIZI-0618/yacd/archive/gh-pages.zip"
|
||||
dir_name="yacd-gh-pages"
|
||||
busybox wget --no-check-certificate "${url}" -O "${file_dashboard}" >&2 || { log error "Failed to download ${url}"; exit 1; }
|
||||
url="https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip"
|
||||
dir_name="Yacd-meta-gh-pages"
|
||||
busybox wget --no-check-certificate "${url}" -O "${file_dashboard}" >&2 || { log error "Failed to download $url"; exit 1; }
|
||||
unzip -o "${file_dashboard}" "${dir_name}/*" -d "${data_dir}/${bin_name}/dashboard" >&2
|
||||
mv -f "${data_dir}/${bin_name}/dashboard/${dir_name}" "${data_dir}/${bin_name}/dashboard/dist"
|
||||
mv -f "${data_dir}/${bin_name}/dashboard/$dir_name"/* "${data_dir}/${bin_name}/dashboard"
|
||||
rm -f "${file_dashboard}"
|
||||
rm -r "${data_dir}/${bin_name}/dashboard/${dir_name}"
|
||||
else
|
||||
log debug "${bin_name} does not support dashboards"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user