NASER fix some issue
This commit is contained in:
@@ -72,7 +72,7 @@ namespace App\Http\Controllers;
|
|||||||
// ]);
|
// ]);
|
||||||
if ($admin->bale) {
|
if ($admin->bale) {
|
||||||
try {
|
try {
|
||||||
$response = Http::post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
$response = Http::withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
||||||
"chat_id" => $admin->bale,
|
"chat_id" => $admin->bale,
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
]);
|
]);
|
||||||
@@ -86,7 +86,7 @@ namespace App\Http\Controllers;
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
$response = Http::post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
$response = Http::withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
||||||
"chat_id" => '985309723',
|
"chat_id" => '985309723',
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
]);
|
]);
|
||||||
@@ -101,12 +101,7 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
foreach ($admins as $admin) {
|
foreach ($admins as $admin) {
|
||||||
try{
|
try{
|
||||||
Http::/*withOptions([
|
Http::withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
||||||
'curl' => [
|
|
||||||
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
|
|
||||||
CURLOPT_TCP_FASTOPEN => 1,
|
|
||||||
]
|
|
||||||
])->*/withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
|
||||||
"chat_id" => $admin->bale,
|
"chat_id" => $admin->bale,
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
]);
|
]);
|
||||||
@@ -124,8 +119,7 @@ namespace App\Http\Controllers;
|
|||||||
"chat_id" => $admin->bale,
|
"chat_id" => $admin->bale,
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
]);
|
]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class TaskController extends Controller
|
|||||||
$user = User::where('user_name', $_COOKIE['user_identity'])->first();
|
$user = User::where('user_name', $_COOKIE['user_identity'])->first();
|
||||||
if ($user) {
|
if ($user) {
|
||||||
if ($user->is_admin == 1) {
|
if ($user->is_admin == 1) {
|
||||||
$tasks = Tasks::with(['duration', 'comments.user'])
|
$tasks = Tasks::with(['duration', 'comments.user', 'appName'])
|
||||||
->orderBy('target_date', 'desc')
|
->orderBy('target_date', 'desc')
|
||||||
->get();
|
->get();
|
||||||
// dd($tasks);
|
// dd($tasks);
|
||||||
@@ -182,6 +182,22 @@ class TaskController extends Controller
|
|||||||
'tasks' => (new Tasks())->filterByState($tasks),
|
'tasks' => (new Tasks())->filterByState($tasks),
|
||||||
'count' => $count,
|
'count' => $count,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
|
'isAdminLevel1' => $user->is_admin == 1,
|
||||||
|
'mentionUsers' => User::select('id', 'name', 'user_name')->get(),
|
||||||
|
'appsList' => App::select('id', 'name_fa')->get(),
|
||||||
|
'priorityLabels' => [
|
||||||
|
'urgent' => 'فوری',
|
||||||
|
'high' => 'بالا',
|
||||||
|
'medium' => 'متوسط',
|
||||||
|
'low' => 'پایین'
|
||||||
|
],
|
||||||
|
'priorityColors' => [
|
||||||
|
'urgent' => 'bg-red-100 text-red-800',
|
||||||
|
'high' => 'bg-orange-100 text-orange-800',
|
||||||
|
'medium' => 'bg-yellow-100 text-yellow-800',
|
||||||
|
'low' => 'bg-green-100 text-green-800'
|
||||||
|
],
|
||||||
|
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return back()->with('message', [
|
return back()->with('message', [
|
||||||
@@ -529,12 +545,7 @@ class TaskController extends Controller
|
|||||||
private function send_bale($chat_id, $message)
|
private function send_bale($chat_id, $message)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Http::withOptions([
|
Http::withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
||||||
'curl' => [
|
|
||||||
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
|
|
||||||
CURLOPT_TCP_FASTOPEN => 1,
|
|
||||||
]
|
|
||||||
])->withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [
|
|
||||||
"chat_id" => $chat_id,
|
"chat_id" => $chat_id,
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ class Tasks extends Model
|
|||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function app(){
|
public function appName(){
|
||||||
return $this->belogsTo(App::class);
|
return $this->belongsTo(App::class, 'app' , 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function duration(){
|
public function duration(){
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ use App\Models\User;
|
|||||||
use App\Models\App;
|
use App\Models\App;
|
||||||
|
|
||||||
|
|
||||||
$mentionUsers = User::select('id', 'name', 'user_name')->get();
|
|
||||||
$appsList = App::select('id', 'name_fa')->get();
|
|
||||||
$isAdminLevel1 = false;
|
|
||||||
if (isset($_COOKIE['user_identity'])) {
|
|
||||||
$isAdminLevel1 = (int)User::where('user_name', $_COOKIE['user_identity'])->value('is_admin') === 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$backlog = <<<SVG
|
$backlog = <<<SVG
|
||||||
<svg height="12px" width="12px" viewBox="0 0 16 16" class="flex-shrink-0 flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg"><g>
|
<svg height="12px" width="12px" viewBox="0 0 16 16" class="flex-shrink-0 flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg"><g>
|
||||||
<g transform="translate(8 8) rotate(-90)"><line x1="5.75" y1="0" x2="6.5" y2="0" stroke="#60646C" stroke-width="1.21" stroke-linecap="round">
|
<g transform="translate(8 8) rotate(-90)"><line x1="5.75" y1="0" x2="6.5" y2="0" stroke="#60646C" stroke-width="1.21" stroke-linecap="round">
|
||||||
@@ -67,18 +60,7 @@ $state = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
//$p_tasks = Pivot_Tasks::get();
|
//$p_tasks = Pivot_Tasks::get();
|
||||||
$priorityLabels = [
|
|
||||||
'urgent' => 'فوری',
|
|
||||||
'high' => 'بالا',
|
|
||||||
'medium' => 'متوسط',
|
|
||||||
'low' => 'پایین'
|
|
||||||
];
|
|
||||||
$priorityColors = [
|
|
||||||
'urgent' => 'bg-red-100 text-red-800',
|
|
||||||
'high' => 'bg-orange-100 text-orange-800',
|
|
||||||
'medium' => 'bg-yellow-100 text-yellow-800',
|
|
||||||
'low' => 'bg-green-100 text-green-800'
|
|
||||||
];
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@extends('app')
|
@extends('app')
|
||||||
@@ -115,8 +97,7 @@ $priorityColors = [
|
|||||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">
|
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">
|
||||||
اولویت
|
اولویت
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">تاریخ
|
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">{{ $isAdminLevel1 ? 'نام اپ' : 'تاریخ شروع' }}
|
||||||
شروع
|
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">مهلت
|
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">مهلت
|
||||||
</th>
|
</th>
|
||||||
@@ -155,6 +136,7 @@ $priorityColors = [
|
|||||||
$actionType = $ended_at ? 'start' : ($started_at ? 'end' : 'start');
|
$actionType = $ended_at ? 'start' : ($started_at ? 'end' : 'start');
|
||||||
$p_id = $lastDuration?->id ?? '';
|
$p_id = $lastDuration?->id ?? '';
|
||||||
@endphp
|
@endphp
|
||||||
|
{{--@if($_COOKIE['user_identity'] == 'naser_me') {{dump($task)}} @endif--}}
|
||||||
<tr class="hover:bg-gray-50">
|
<tr class="hover:bg-gray-50">
|
||||||
<td class="px-2 py-2">
|
<td class="px-2 py-2">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
@@ -173,7 +155,7 @@ $priorityColors = [
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-2 text-sm text-gray-600">
|
<td class="px-2 py-2 text-sm text-gray-600">
|
||||||
{{ $task->start_date ? Jalalian::fromCarbon(Carbon::parse($task->start_date))->format('Y/m/d') : '-' }}
|
{{ $isAdminLevel1 ? $task->appName->name_fa : Jalalian::fromCarbon(Carbon::parse($task->start_date))->format('Y/m/d') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-2 text-sm text-gray-600">
|
<td class="px-2 py-2 text-sm text-gray-600">
|
||||||
{{ $task->target_date ? Jalalian::fromCarbon(Carbon::parse($task->target_date))->format('Y/m/d') : '-' }}
|
{{ $task->target_date ? Jalalian::fromCarbon(Carbon::parse($task->target_date))->format('Y/m/d') : '-' }}
|
||||||
@@ -772,7 +754,7 @@ $priorityColors = [
|
|||||||
const appTypes = {1:'خانگی', 2:'همکار'};
|
const appTypes = {1:'خانگی', 2:'همکار'};
|
||||||
if (appNameEl) {
|
if (appNameEl) {
|
||||||
const app = (appsList || []).find(a => String(a.id) === String(task.app));
|
const app = (appsList || []).find(a => String(a.id) === String(task.app));
|
||||||
appNameEl.textContent = app?.name_fa ` (${appTypes[app.type]})` || '-';
|
appNameEl.textContent = app ? `${app.name_fa} (${appTypes[app.type]})` : '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
// اولویت
|
// اولویت
|
||||||
|
|||||||
Reference in New Issue
Block a user