Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #7

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions application/index/controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ public function index()
'country' => $uuid_temp['INFO']['Country'],
"countryCode" => $uuid_temp['INFO']['Country Code']
];
else {
else
$uuid_temp['IP'] = SystemMonitor::fetchIPInfo($ip);
if (empty($uuid_temp["IP"]['countryCode']))
$uuid_temp["IP"]["country"] = "Private";
}


if (($time - intval($uuid_temp['INFO']['Update Time'])) > 500)
$uuids_offline[$uuid] = $uuid_temp;
else
Expand All @@ -58,6 +55,14 @@ public function info($uuid = '')
$info = SystemMonitor::getInfo($uuid);
// $uptime_str = SystemMonitor::timeFormat(intval($info['Uptime']));
$ip = SystemMonitor::fetchIPInfo(SystemMonitor::getIPByUUID($uuid));
if (!empty($info['Country']) && !empty($info['Country Code']))
$ip = [
'country' => $info['Country'],
"countryCode" => $info['Country Code']
];
else
$ip = SystemMonitor::fetchIPInfo(SystemMonitor::getIPByUUID($uuid));

ksort($info);
$this->assign("latest", $latest);
$this->assign("info", $info);
Expand Down
2 changes: 1 addition & 1 deletion application/index/view/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{$v['INFO']['IPV4']}
</div>
<div class="mdui-list-item-text mdui-list-item-one-line">
{$v['IP']['country']}
{$v['IP']['country']|default="Unknown"}
</div>
</div>
<i class="mdui-icon material-icons mdui-text-color-red">&#xe2c1;</i>
Expand Down