update
This commit is contained in:
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -145,4 +147,13 @@ public class NasManager {
|
||||
}
|
||||
return json.toJSONString();
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/jellyfin.do")
|
||||
public void jellyfin(HttpServletResponse response){
|
||||
try {
|
||||
response.sendRedirect("http://"+UpdateIp.nas_ip+":8096");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.regex.Pattern;
|
||||
@Controller
|
||||
public class UpdateIp {
|
||||
private static List<String> keys = new ArrayList<>();
|
||||
public static String nas_ip=null;
|
||||
@Resource
|
||||
RedisTools redisTools;
|
||||
|
||||
@@ -49,6 +50,7 @@ public class UpdateIp {
|
||||
String line = null;
|
||||
boolean isIp = false;
|
||||
boolean isNas=false;
|
||||
nas_ip=ip;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
//System.out.println(line.trim().replace("server_name","").replace("upstream","").trim());
|
||||
if (keys.contains(line.trim().replace("server_name", "").replace("upstream", "").replace("{", "").trim())) {
|
||||
|
||||
Reference in New Issue
Block a user