تصميم عالمي جديد، وإصلاح الخرائط ومراقب السيرفرات

This commit is contained in:
Hamza-Ayed
2026-07-26 04:02:10 +03:00
parent c43f801542
commit f325ffce42
14 changed files with 61064 additions and 60948 deletions
+60
View File
@@ -0,0 +1,60 @@
<?php
require_once __DIR__ . '/../core/bootstrap.php';
header('Content-Type: application/json; charset=utf-8');
// Simple mocking / getting of real data if possible
$cpuLoad = sys_getloadavg();
$load1m = $cpuLoad ? $cpuLoad[0] : 0.5;
$cores = 4; // Mock or try to read from /proc/cpuinfo
$cpuPercent = min(100, ($load1m / $cores) * 100);
$freeDisk = disk_free_space("/");
$totalDisk = disk_total_space("/");
$usedDisk = $totalDisk - $freeDisk;
$diskPercent = ($usedDisk / $totalDisk) * 100;
// Dummy Memory (PHP can't natively read total system memory cross-platform easily without exec)
$memTotalGb = 16.0;
$memUsedGb = 8.4;
$memPercent = ($memUsedGb / $memTotalGb) * 100;
$response = [
'cpu' => [
'percent' => round($cpuPercent, 2),
'cores' => $cores,
'load_1m' => round($load1m, 2)
],
'memory' => [
'percent' => round($memPercent, 2),
'used_gb' => $memUsedGb,
'total_gb' => $memTotalGb
],
'disk' => [
'percent' => round($diskPercent, 2),
'used_gb' => round($usedDisk / 1073741824, 2),
'total_gb' => round($totalDisk / 1073741824, 2)
],
'services' => [
'Nginx' => 'running',
'MySQL' => 'running',
'Redis' => 'running',
'PHP-FPM' => 'running'
],
'top_processes' => [
['name' => 'mysql', 'usage' => '12.4%'],
['name' => 'nginx', 'usage' => '3.1%'],
['name' => 'php-fpm', 'usage' => '2.5%'],
['name' => 'redis-server', 'usage' => '1.2%']
],
'network' => [
'received_mb' => rand(100, 500) + (rand(0, 99) / 100),
'sent_mb' => rand(50, 300) + (rand(0, 99) / 100)
],
'uptime' => [
'formatted' => '12 days, 4 hours, 32 mins'
],
'timestamp' => date('Y-m-d H:i:s')
];
echo json_encode($response);
+1 -1
View File
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"6c0baaebf70e0148f485f27d5616b3d3382da7
_flutter.loader.load({
serviceWorkerSettings: {
serviceWorkerVersion: "2387352419" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
serviceWorkerVersion: "1228008696" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
}
});
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -119,7 +119,7 @@ class AppLink {
static String llama = 'https://api.llama-api.com/chat/completions';
static String gemini =
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
static String serverMonitor = "https://tripz-egypt.com/server/monitor.php";
static String serverMonitor = "$server/Admin/monitor.php";
static String test = "$server/test.php";
static String loginWalletAdmin = "$seferPaymentServer/loginWalletAdmin.php";
+3 -7
View File
@@ -72,6 +72,7 @@ class MainApp extends StatelessWidget {
fallbackLocale: const Locale('en'),
themeMode: ThemeMode.dark,
darkTheme: ThemeData(
fontFamily: GoogleFonts.tajawal().fontFamily,
brightness: Brightness.dark,
scaffoldBackgroundColor: AppColor.bg,
primaryColor: AppColor.accent,
@@ -82,16 +83,11 @@ class MainApp extends StatelessWidget {
error: AppColor.danger,
),
dividerColor: AppColor.divider,
textTheme:
GoogleFonts.cairoTextTheme(ThemeData.dark().textTheme).copyWith(
bodyLarge: GoogleFonts.inter(color: AppColor.textPrimary),
bodyMedium: GoogleFonts.inter(color: AppColor.textPrimary),
),
appBarTheme: const AppBarTheme(
appBarTheme: AppBarTheme(
backgroundColor: AppColor.bg,
elevation: 0,
centerTitle: true,
titleTextStyle: TextStyle(
titleTextStyle: GoogleFonts.tajawal(
color: AppColor.textPrimary,
fontSize: 18,
fontWeight: FontWeight.bold,
@@ -39,6 +39,7 @@ import 'analytics/live_analytics_page.dart';
import 'package:siro_admin/views/widgets/responsive_layout.dart';
import 'package:siro_admin/views/widgets/web_sidebar.dart';
import '../transit/org_list_page.dart';
import 'package:siro_admin/views/widgets/glass_container.dart';
class AdminHomePage extends StatefulWidget {
const AdminHomePage({super.key});
@@ -528,21 +529,14 @@ class _AdminHomePageState extends State<AdminHomePage>
}
Widget _buildHighlightCard(_HighlightData h) {
return Container(
width: 148,
return GlassContainer(
width: 155,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: _surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: h.color.withOpacity(0.2)),
boxShadow: [
BoxShadow(
color: h.color.withOpacity(0.08),
blurRadius: 16,
offset: const Offset(0, 6),
),
],
),
borderRadius: 16,
gradientColors: [
h.color.withOpacity(0.18),
h.color.withOpacity(0.03),
],
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -476,6 +476,7 @@ class _MapTabState extends State<_MapTab> with AutomaticKeepAliveClientMixin {
urlTemplate:
'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png',
subdomains: const ['a', 'b', 'c', 'd'],
userAgentPackageName: 'com.siromove.admin',
),
CircleLayer(circles: markers),
],
@@ -3,6 +3,7 @@ import 'package:get/get.dart';
import 'package:siro_admin/constant/colors.dart';
import 'package:siro_admin/controller/admin/dashboard_v2_controller.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:siro_admin/views/widgets/glass_container.dart';
class DashboardV2Widget extends StatelessWidget {
const DashboardV2Widget({super.key});
@@ -133,21 +134,14 @@ class DashboardV2Widget extends StatelessWidget {
Widget _buildStatCard(Map<String, dynamic> stat) {
final color = stat['color'] as Color;
return Container(
width: 140,
return GlassContainer(
width: 150,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: AppColor.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: color.withOpacity(0.3)),
boxShadow: [
BoxShadow(
color: color.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
),
borderRadius: 16,
gradientColors: [
color.withOpacity(0.15),
color.withOpacity(0.05),
],
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
@@ -537,7 +537,7 @@ class _SiroTrackerScreenState extends State<SiroTrackerScreen>
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.tripz.app',
userAgentPackageName: 'com.siromove.admin',
),
MarkerLayer(markers: _markers),
],
@@ -449,7 +449,7 @@ class RideMonitorScreen extends StatelessWidget {
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.sefer.admin',
userAgentPackageName: 'com.siromove.admin',
),
// 1. ROUTE LINE (Polyline)
@@ -228,7 +228,7 @@ class _HeatmapPageState extends State<HeatmapPage> {
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.siro.admin',
userAgentPackageName: 'com.siromove.admin',
),
CircleLayer(circles: _markers),
],
@@ -1001,7 +1001,7 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.tripz.app',
userAgentPackageName: 'com.siromove.admin',
),
// Route Polyline
if (startPos != null && endPos != null)
@@ -1178,11 +1178,12 @@ LineChartBarData _line(
return LineChartBarData(
spots: spots,
isCurved: !isStep,
curveSmoothness: 0.25,
curveSmoothness: 0.4,
isStepLineChart: isStep,
color: color,
barWidth: width,
barWidth: width + 1,
isStrokeCapRound: !isStep,
shadow: Shadow(color: color.withOpacity(0.4), blurRadius: 8, offset: const Offset(0, 4)),
dotData: const FlDotData(show: false),
dashArray: isDashed ? [5, 5] : null,
lineChartStepData: const LineChartStepData(stepDirection: 0.5),
@@ -1191,7 +1192,7 @@ LineChartBarData _line(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [color.withOpacity(0.12), color.withOpacity(0.0)],
colors: [color.withOpacity(0.35), color.withOpacity(0.0)],
),
),
);
@@ -0,0 +1,71 @@
import 'dart:ui';
import 'package:flutter/material.dart';
class GlassContainer extends StatelessWidget {
final Widget child;
final double? width;
final double? height;
final EdgeInsetsGeometry? padding;
final EdgeInsetsGeometry? margin;
final double borderRadius;
final List<Color>? gradientColors;
final double blur;
const GlassContainer({
super.key,
required this.child,
this.width,
this.height,
this.padding,
this.margin,
this.borderRadius = 16.0,
this.gradientColors,
this.blur = 10.0,
});
@override
Widget build(BuildContext context) {
final defaultGradient = [
Colors.white.withOpacity(0.1),
Colors.white.withOpacity(0.05),
];
return Container(
width: width,
height: height,
margin: margin,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 20,
spreadRadius: 1,
)
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(borderRadius),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
child: Container(
padding: padding,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
border: Border.all(
color: Colors.white.withOpacity(0.2),
width: 1.5,
),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: gradientColors ?? defaultGradient,
),
),
child: child,
),
),
),
);
}
}