no message

This commit is contained in:
kuaifan 2024-09-16 19:51:11 +08:00
parent c39fc80c02
commit 9a69f3b019
6 changed files with 41 additions and 29 deletions

View File

@ -3,6 +3,7 @@
namespace App\Events;
use App\Models\WebSocket;
use App\Module\Base;
use Cache;
use Hhxsv5\LaravelS\Swoole\Events\WorkerStartInterface;
use Swoole\Http\Server;
@ -19,6 +20,11 @@ class WorkerStartEvent implements WorkerStartInterface
if (isset($server->startMsecTime) && Cache::get("swooleServerStartMsecTime") != $server->startMsecTime) {
Cache::forever("swooleServerStartMsecTime", $server->startMsecTime);
WebSocket::query()->delete();
//
$all = Base::json2array(Cache::get("User::online:all"));
foreach ($all as $userid) {
Cache::forget("User::online:" . $userid);
}
}
}
}

View File

@ -194,6 +194,12 @@ class WebSocketService implements WebSocketHandlerInterface
Cache::put("User::fd:" . $fd, "on", Carbon::now()->addDay());
Cache::put("User::online:" . $userid, "on", Carbon::now()->addDay());
//
$all = Base::json2array(Cache::get("User::online:all"));
if (!isset($all[$userid])) {
$all[$userid] = $userid;
Cache::forever("User::online:all", Base::array2json($all));
}
//
WebSocket::updateInsert([
'key' => md5($fd . '@' . $userid)
], [

View File

@ -133,13 +133,13 @@ body.dark-mode-reverse {
.task-item {
.task-progress {
.task-time {
&.overdue {
color: #ed4014;
&.today {
color: #ff9900;
background-color: transparent;
}
&.today {
color: #ff9900;
&.overdue {
color: #ed4014;
background-color: transparent;
}
}
@ -156,13 +156,13 @@ body.dark-mode-reverse {
> div {
&.row-time {
.task-time {
&.overdue {
color: #ed4014;
&.today {
color: #ff9900;
background-color: transparent;
}
&.today {
color: #ff9900;
&.overdue {
color: #ed4014;
background-color: transparent;
}
}

View File

@ -544,20 +544,20 @@
border-radius: 3px;
display: flex;
align-items: center;
&.overdue,
&.today {
color: #ffffff;
}
&.today,
&.overdue {
font-weight: 600;
background-color: #ed4014;
border-color: #ed4014;
color: #ffffff;
}
&.today {
font-weight: 500;
background-color: #ff9900;
border-color: #ff9900;
}
&.overdue {
font-weight: 600;
background-color: #ed4014;
border-color: #ed4014;
}
.taskfont {
margin-right: 3px;
font-size: 12px;
@ -864,24 +864,24 @@
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
&.overdue,
&.today {
&.today,
&.overdue {
color: #ffffff;
padding: 0 4px;
border: 1px solid transparent;
font-size: 13px;
border-radius: 3px;
}
&.overdue {
font-weight: 600;
background-color: #ed4014;
border-color: #ed4014;
}
&.today {
font-weight: 500;
background-color: #ff9900;
border-color: #ff9900;
}
&.overdue {
font-weight: 600;
background-color: #ed4014;
border-color: #ed4014;
}
}
}
}

View File

@ -380,14 +380,14 @@
height: 26px;
line-height: 26px;
cursor: pointer;
&.overdue {
font-weight: 600;
color: #ed4014;
}
&.today {
font-weight: 500;
color: #ff9900;
}
&.overdue {
font-weight: 600;
color: #ed4014;
}
}
.clock {
margin: 3px 2px;

View File

@ -257,12 +257,12 @@
font-style: normal;
margin-left: 4px;
}
&.overdue {
color: #ed4014;
}
&.today {
color: #ff9900;
}
&.overdue {
color: #ed4014;
}
}
}
}