no message

This commit is contained in:
hellcat 2026-07-04 19:22:10 +08:00
parent 57863e1a71
commit cddcedcb79

View File

@ -21,62 +21,62 @@ final class NasaTestFnSubfile
$sDateCode = date("Ymd"); $sDateCode = date("Ymd");
// $sDateCode = "20260211"; // test // $sDateCode = "20260211"; // test
$sDateToday = date("Y-m-d"); $sDateToday = date("Y-m-d");
$sDateToday = "2026-02-26"; // $sDateToday = "2026-02-26";
$aFnClients = FreenodeHelperService::getClients(); $aFnClients = FreenodeHelperService::getClients();
$oNodeBus = SiteMap::where("group_code", "nodehub")->first(); $oNodeBus = SiteMap::where("group_code", "nodehub")->first();
$cFnSite = SiteMap::whereIn("group_code", ["fn_b"])->get(); // a系列逐渐抛弃 $cFnSite = SiteMap::whereIn("group_code", ["fn_b"])->get(); // a系列逐渐抛弃
// foreach ($cFnSite as $oFnSite) { foreach ($cFnSite as $oFnSite) {
//
// // model // model
// $oTestSubfile = TestSubfile::where("site_code", $oFnSite->code_short)->whereDate("created_at", $sDateToday)->first(); $oTestSubfile = TestSubfile::where("site_code", $oFnSite->code_short)->whereDate("created_at", $sDateToday)->first();
//
// if (!$oTestSubfile) { if (!$oTestSubfile) {
// $oTestSubfile = new TestSubfile(); $oTestSubfile = new TestSubfile();
// $oTestSubfile->site_code = $oFnSite->code_short; $oTestSubfile->site_code = $oFnSite->code_short;
// } }
//
// // 页面监测 // 页面监测
// $sUrlHtml = "https://".$oFnSite->url."/a/fn".$sDateCode.".html"; $sUrlHtml = "https://".$oFnSite->url."/a/fn".$sDateCode.".html";
// $oResponse = Http::withoutVerifying()->get($sUrlHtml); // 不验证ssl $oResponse = Http::withoutVerifying()->get($sUrlHtml); // 不验证ssl
// $iHttpStatus = $oResponse->status() ?? 0; $iHttpStatus = $oResponse->status() ?? 0;
//
// if ($iHttpStatus != 200) { if ($iHttpStatus != 200) {
// TeleSlave::warn()->send("运行监测-fn_b:有页面未获取成功"); TeleSlave::warn()->send("运行监测-fn_b:有页面未获取成功");
// } }
//
// $oTestSubfile->status_http_page = $iHttpStatus; $oTestSubfile->status_http_page = $iHttpStatus;
//
// // subfile监测 // subfile监测
// foreach ($aFnClients as $sFnClient) { foreach ($aFnClients as $sFnClient) {
// $sUrlSubFile = FreenodeHelperService::urlFeedToday($oFnSite->code_short, $sFnClient); $sUrlSubFile = FreenodeHelperService::urlFeedToday($oFnSite->code_short, $sFnClient);
// $oResponse = Http::timeout(60) $oResponse = Http::timeout(60)
// ->withoutVerifying() ->withoutVerifying()
// ->withHeaders([ ->withHeaders([
// 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
// 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
// 'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8', 'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8',
// ]) ])
// ->get($sUrlSubFile); ->get($sUrlSubFile);
//
// $iHttpStatus = $oResponse->status() ?? 0; $iHttpStatus = $oResponse->status() ?? 0;
//
// $sBody = $iHttpStatus; $sBody = $iHttpStatus;
//
// if ($iHttpStatus == 200) { if ($iHttpStatus == 200) {
// $sBody = $oResponse->body(); $sBody = $oResponse->body();
// } else { } else {
// TeleSlave::warn()->send("运行监测-fn_b:有subfile未获取成功"); TeleSlave::warn()->send("运行监测-fn_b:有subfile未获取成功");
// } }
//
// $oTestSubfile->{$sFnClient."_url"} = "https://".$sUrlSubFile; $oTestSubfile->{$sFnClient."_url"} = "https://".$sUrlSubFile;
// $oTestSubfile->{$sFnClient."_content"} = $sBody; $oTestSubfile->{$sFnClient."_content"} = $sBody;
// } }
//
// $oTestSubfile->save(); $oTestSubfile->save();
//
// } }
//// _admin //// _admin
@ -90,12 +90,14 @@ final class NasaTestFnSubfile
foreach ($aFnClients as $sFnClient) { foreach ($aFnClients as $sFnClient) {
$sFilePath = $_ENV["dir_base"]."public/freenode/merge/_admin/".$sFnClient."/".$sDateToday.".txt"; $sFilePath = $_ENV["dir_base"]."public/freenode/merge/_admin/".$sFnClient."/".$sDateToday.".txt";
$file = file_get_contents($sFilePath);
if (!file_exists($sFilePath)) { if (!file_exists($sFilePath)) {
continue; continue;
} }
$file = file_get_contents($sFilePath);
$oTestSubfile->{$sFnClient."_url"} = $sFilePath; $oTestSubfile->{$sFnClient."_url"} = $sFilePath;
$oTestSubfile->{$sFnClient."_content"} = $file; $oTestSubfile->{$sFnClient."_content"} = $file;