تصميم عالمي جديد، وإصلاح الخرائط ومراقب السيرفرات
This commit is contained in:
@@ -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);
|
||||||
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"6c0baaebf70e0148f485f27d5616b3d3382da7
|
|||||||
|
|
||||||
_flutter.loader.load({
|
_flutter.loader.load({
|
||||||
serviceWorkerSettings: {
|
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. */
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+60903
-60904
File diff suppressed because one or more lines are too long
@@ -119,7 +119,7 @@ class AppLink {
|
|||||||
static String llama = 'https://api.llama-api.com/chat/completions';
|
static String llama = 'https://api.llama-api.com/chat/completions';
|
||||||
static String gemini =
|
static String gemini =
|
||||||
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
|
'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 test = "$server/test.php";
|
||||||
static String loginWalletAdmin = "$seferPaymentServer/loginWalletAdmin.php";
|
static String loginWalletAdmin = "$seferPaymentServer/loginWalletAdmin.php";
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class MainApp extends StatelessWidget {
|
|||||||
fallbackLocale: const Locale('en'),
|
fallbackLocale: const Locale('en'),
|
||||||
themeMode: ThemeMode.dark,
|
themeMode: ThemeMode.dark,
|
||||||
darkTheme: ThemeData(
|
darkTheme: ThemeData(
|
||||||
|
fontFamily: GoogleFonts.tajawal().fontFamily,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
scaffoldBackgroundColor: AppColor.bg,
|
scaffoldBackgroundColor: AppColor.bg,
|
||||||
primaryColor: AppColor.accent,
|
primaryColor: AppColor.accent,
|
||||||
@@ -82,16 +83,11 @@ class MainApp extends StatelessWidget {
|
|||||||
error: AppColor.danger,
|
error: AppColor.danger,
|
||||||
),
|
),
|
||||||
dividerColor: AppColor.divider,
|
dividerColor: AppColor.divider,
|
||||||
textTheme:
|
appBarTheme: AppBarTheme(
|
||||||
GoogleFonts.cairoTextTheme(ThemeData.dark().textTheme).copyWith(
|
|
||||||
bodyLarge: GoogleFonts.inter(color: AppColor.textPrimary),
|
|
||||||
bodyMedium: GoogleFonts.inter(color: AppColor.textPrimary),
|
|
||||||
),
|
|
||||||
appBarTheme: const AppBarTheme(
|
|
||||||
backgroundColor: AppColor.bg,
|
backgroundColor: AppColor.bg,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
titleTextStyle: TextStyle(
|
titleTextStyle: GoogleFonts.tajawal(
|
||||||
color: AppColor.textPrimary,
|
color: AppColor.textPrimary,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.bold,
|
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/responsive_layout.dart';
|
||||||
import 'package:siro_admin/views/widgets/web_sidebar.dart';
|
import 'package:siro_admin/views/widgets/web_sidebar.dart';
|
||||||
import '../transit/org_list_page.dart';
|
import '../transit/org_list_page.dart';
|
||||||
|
import 'package:siro_admin/views/widgets/glass_container.dart';
|
||||||
class AdminHomePage extends StatefulWidget {
|
class AdminHomePage extends StatefulWidget {
|
||||||
const AdminHomePage({super.key});
|
const AdminHomePage({super.key});
|
||||||
|
|
||||||
@@ -528,21 +529,14 @@ class _AdminHomePageState extends State<AdminHomePage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHighlightCard(_HighlightData h) {
|
Widget _buildHighlightCard(_HighlightData h) {
|
||||||
return Container(
|
return GlassContainer(
|
||||||
width: 148,
|
width: 155,
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
borderRadius: 16,
|
||||||
color: _surface,
|
gradientColors: [
|
||||||
borderRadius: BorderRadius.circular(16),
|
h.color.withOpacity(0.18),
|
||||||
border: Border.all(color: h.color.withOpacity(0.2)),
|
h.color.withOpacity(0.03),
|
||||||
boxShadow: [
|
],
|
||||||
BoxShadow(
|
|
||||||
color: h.color.withOpacity(0.08),
|
|
||||||
blurRadius: 16,
|
|
||||||
offset: const Offset(0, 6),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -476,6 +476,7 @@ class _MapTabState extends State<_MapTab> with AutomaticKeepAliveClientMixin {
|
|||||||
urlTemplate:
|
urlTemplate:
|
||||||
'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png',
|
'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png',
|
||||||
subdomains: const ['a', 'b', 'c', 'd'],
|
subdomains: const ['a', 'b', 'c', 'd'],
|
||||||
|
userAgentPackageName: 'com.siromove.admin',
|
||||||
),
|
),
|
||||||
CircleLayer(circles: markers),
|
CircleLayer(circles: markers),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:siro_admin/constant/colors.dart';
|
import 'package:siro_admin/constant/colors.dart';
|
||||||
import 'package:siro_admin/controller/admin/dashboard_v2_controller.dart';
|
import 'package:siro_admin/controller/admin/dashboard_v2_controller.dart';
|
||||||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||||
|
import 'package:siro_admin/views/widgets/glass_container.dart';
|
||||||
|
|
||||||
class DashboardV2Widget extends StatelessWidget {
|
class DashboardV2Widget extends StatelessWidget {
|
||||||
const DashboardV2Widget({super.key});
|
const DashboardV2Widget({super.key});
|
||||||
@@ -133,21 +134,14 @@ class DashboardV2Widget extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildStatCard(Map<String, dynamic> stat) {
|
Widget _buildStatCard(Map<String, dynamic> stat) {
|
||||||
final color = stat['color'] as Color;
|
final color = stat['color'] as Color;
|
||||||
return Container(
|
return GlassContainer(
|
||||||
width: 140,
|
width: 150,
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
borderRadius: 16,
|
||||||
color: AppColor.surface,
|
gradientColors: [
|
||||||
borderRadius: BorderRadius.circular(16),
|
color.withOpacity(0.15),
|
||||||
border: Border.all(color: color.withOpacity(0.3)),
|
color.withOpacity(0.05),
|
||||||
boxShadow: [
|
],
|
||||||
BoxShadow(
|
|
||||||
color: color.withOpacity(0.05),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ class _SiroTrackerScreenState extends State<SiroTrackerScreen>
|
|||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
userAgentPackageName: 'com.tripz.app',
|
userAgentPackageName: 'com.siromove.admin',
|
||||||
),
|
),
|
||||||
MarkerLayer(markers: _markers),
|
MarkerLayer(markers: _markers),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ class RideMonitorScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
userAgentPackageName: 'com.sefer.admin',
|
userAgentPackageName: 'com.siromove.admin',
|
||||||
),
|
),
|
||||||
|
|
||||||
// 1. ROUTE LINE (Polyline)
|
// 1. ROUTE LINE (Polyline)
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ class _HeatmapPageState extends State<HeatmapPage> {
|
|||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
userAgentPackageName: 'com.siro.admin',
|
userAgentPackageName: 'com.siromove.admin',
|
||||||
),
|
),
|
||||||
CircleLayer(circles: _markers),
|
CircleLayer(circles: _markers),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1001,7 +1001,7 @@ class _RideMapMonitorScreenState extends State<RideMapMonitorScreen> {
|
|||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
userAgentPackageName: 'com.tripz.app',
|
userAgentPackageName: 'com.siromove.admin',
|
||||||
),
|
),
|
||||||
// Route Polyline
|
// Route Polyline
|
||||||
if (startPos != null && endPos != null)
|
if (startPos != null && endPos != null)
|
||||||
|
|||||||
@@ -1178,11 +1178,12 @@ LineChartBarData _line(
|
|||||||
return LineChartBarData(
|
return LineChartBarData(
|
||||||
spots: spots,
|
spots: spots,
|
||||||
isCurved: !isStep,
|
isCurved: !isStep,
|
||||||
curveSmoothness: 0.25,
|
curveSmoothness: 0.4,
|
||||||
isStepLineChart: isStep,
|
isStepLineChart: isStep,
|
||||||
color: color,
|
color: color,
|
||||||
barWidth: width,
|
barWidth: width + 1,
|
||||||
isStrokeCapRound: !isStep,
|
isStrokeCapRound: !isStep,
|
||||||
|
shadow: Shadow(color: color.withOpacity(0.4), blurRadius: 8, offset: const Offset(0, 4)),
|
||||||
dotData: const FlDotData(show: false),
|
dotData: const FlDotData(show: false),
|
||||||
dashArray: isDashed ? [5, 5] : null,
|
dashArray: isDashed ? [5, 5] : null,
|
||||||
lineChartStepData: const LineChartStepData(stepDirection: 0.5),
|
lineChartStepData: const LineChartStepData(stepDirection: 0.5),
|
||||||
@@ -1191,7 +1192,7 @@ LineChartBarData _line(
|
|||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user