Bläddra i källkod

Update 服务器部署方案

Nolovenodie丶 2 år sedan
förälder
incheckning
912cbe3319
2 ändrade filer med 42 tillägg och 0 borttagningar
  1. 21 0
      README.md
  2. 21 0
      script.sh

+ 21 - 0
README.md

@@ -14,8 +14,29 @@ https://user-images.githubusercontent.com/18238152/235517763-5ee7fe21-87e7-414f-
 
 ## 使用方法
 
+**两种方法 只需部署一种即可**
+
+> 插件版
+
+_需要用户装载插件_
+
 Chrome 扩展设置 > 开发者模式 > 加载已解压的扩展程序 > 直接选择源码即可
 
+> 服务器版
+
+_无需使用插件, 直接部署至服务端, 用户无缝使用_
+
+    # Docker 版
+    # 国内
+    docker exec EmbyServer /bin/sh -c 'cd /system/dashboard-ui && wget -O - https://tinyurl.com/3m72wwtk | sh'
+    # 国外
+    docker exec EmbyServer /bin/sh -c 'cd /system/dashboard-ui && wget -O - https://tinyurl.com/2p97xcpd | sh'
+
+    # 正常版
+    # 参考教程: https://cangshui.net/5167.html
+
+---
+
 ## TODO
 
 -   封装为单 JS/CSS, 供客户端使用

+ 21 - 0
script.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# 创建emby-crx目录并下载所需文件
+mkdir emby-crx
+wget https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/css/style.css -P emby-crx/
+wget https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/common-utils.js -P emby-crx/
+wget https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/jquery-3.6.0.min.js -P emby-crx/
+wget https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/md5.min.js -P emby-crx/
+wget https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/content/main.js -P emby-crx/
+
+# 读取index.html文件内容
+content=$(cat index.html)
+
+# 定义要插入的代码
+code='<link rel="stylesheet" id="theme-css"  href="emby-crx/style.css" type="text/css" media="all" />\n<script src="emby-crx/common-utils.js"></script>\n<script src="emby-crx/jquery-3.6.0.min.js"></script>\n<script src="emby-crx/md5.min.js"></script>\n<script src="emby-crx/main.js"></script>'
+
+# 在</head>之前插入代码
+new_content=$(echo -e "${content/<\/head>/$code\n<\/head>}")
+
+# 将新内容写入index.html文件
+echo -e "$new_content" > index.html