This commit is contained in:
subhajit 2026-07-10 18:30:35 +05:30
parent b97db6da40
commit a0ec71a22d
10 changed files with 144 additions and 153 deletions

View File

@ -51,15 +51,25 @@ public function storeApp(Request $request)
'name' => 'required|string|max:255',
'url' => 'required|url|max:255',
'icon_svg' => 'nullable|string',
'logo' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg,webp|max:2048',
'color' => 'nullable|string|max:20',
'desc' => 'nullable|string',
'tag' => 'nullable|string|max:255',
]);
$logoPath = null;
if ($request->hasFile('logo')) {
$file = $request->file('logo');
$filename = time() . '_' . uniqid() . '.' . $file->getClientOriginalExtension();
$file->move(public_path('uploads/logos'), $filename);
$logoPath = 'uploads/logos/' . $filename;
}
App::create([
'name' => $request->name,
'url' => $request->url,
'icon_svg' => $request->icon_svg,
'logo' => $logoPath,
'color' => $request->color ?? '#4f46e5',
'desc' => $request->desc,
'tag' => $request->tag ?? 'General',
@ -74,6 +84,9 @@ public function storeApp(Request $request)
public function destroyApp($id)
{
$app = App::findOrFail($id);
if ($app->logo && file_exists(public_path($app->logo))) {
@unlink(public_path($app->logo));
}
$app->delete();
return redirect()->route('admin.dashboard')->with('success', 'Service app deleted successfully.');

View File

@ -6,7 +6,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Attributes\Fillable;
#[Fillable(['name', 'url', 'icon_svg', 'color', 'desc', 'tag'])]
#[Fillable(['name', 'url', 'icon_svg', 'logo', 'color', 'desc', 'tag'])]
class App extends Model
{
use HasFactory;

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('apps', function (Blueprint $table) {
$table->string('logo')->nullable()->after('icon_svg');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('apps', function (Blueprint $table) {
$table->dropColumn('logo');
});
}
};

BIN
public/Screenshot_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel - SingleLogin Portal</title>
<title>Control Panel</title>
<!-- Google Fonts: Outfit & Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@ -482,10 +482,10 @@
<!-- Nav -->
<header class="navbar">
<div class="nav-logo">
<svg viewBox="0 0 24 24">
<svg viewBox="0 0 24 24" style="margin-right: 8px;">
<path d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,13C14.67,13 20,14.33 20,17V18H4V17C4,14.33 9.33,13 12,13Z" />
</svg>
SingleLogin Control Panel
Control Panel
</div>
<div class="nav-actions">
<!-- Allow Admin to view the User portal dashboard -->
@ -576,7 +576,7 @@
<h3 style="font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 600; margin-bottom: 16px; color: #a5b4fc;">Manage System Services</h3>
<!-- Add App Form -->
<form action="{{ route('admin.apps.store') }}" method="POST" style="margin-bottom: 30px;">
<form action="{{ route('admin.apps.store') }}" method="POST" enctype="multipart/form-data" style="margin-bottom: 30px;">
@csrf
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;">
<div>
@ -602,6 +602,10 @@
<label style="display:block; font-size:0.75rem; color:var(--text-muted); margin-bottom:6px; font-weight:500;">Icon SVG Code or Preset Name (outlook/teams/keka)</label>
<textarea name="icon_svg" rows="2" placeholder="e.g. keka, outlook, teams, or raw <svg>...</svg>" class="form-input" style="width:100%; padding:10px; background:rgba(255,255,255,0.03); border:1px solid var(--card-border); border-radius:8px; color:white; font-family:monospace; font-size:0.8rem;"></textarea>
</div>
<div style="margin-bottom: 12px;">
<label style="display:block; font-size:0.75rem; color:var(--text-muted); margin-bottom:6px; font-weight:500;">Upload Service Logo (Optional - Image will override preset SVG)</label>
<input type="file" name="logo" accept="image/*" class="form-input" style="width:100%; padding:8px; background:rgba(255,255,255,0.03); border:1px solid var(--card-border); border-radius:8px; color:white;">
</div>
<div style="margin-bottom: 16px;">
<label style="display:block; font-size:0.75rem; color:var(--text-muted); margin-bottom:6px; font-weight:500;">Service Description</label>
<input type="text" name="desc" placeholder="Brief description of the service..." class="form-input" style="width:100%; padding:10px; background:rgba(255,255,255,0.03); border:1px solid var(--card-border); border-radius:8px; color:white;">
@ -625,7 +629,13 @@
<tr>
<td>
<div style="display:flex; align-items:center; gap:8px;">
<div style="width:12px; height:12px; border-radius:50%; background-color:{{ $app->color }};"></div>
@if($app->logo)
<img src="{{ asset($app->logo) }}" alt="{{ $app->name }}" style="width:20px; height:20px; object-fit:contain; border-radius:4px;">
@else
<div style="width:20px; height:20px; border-radius:4px; background-color:{{ $app->color }}; display:flex; align-items:center; justify-content:center; color:white; font-size:10px; font-weight:bold;">
{{ strtoupper(substr($app->name, 0, 1)) }}
</div>
@endif
<strong>{{ $app->name }}</strong>
</div>
</td>
@ -1044,7 +1054,7 @@ function openAssignRolesModal(userId, name, roleIds) {
</script>
<footer style="text-align: center; padding: 40px 0; font-size: 0.75rem; color: var(--text-muted); z-index: 10;">
&copy; 2026 SingleLogin Systems. Authorized Access Only.
&copy; 2026 Systems. Authorized Access Only.
</footer>
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SingleLogin Portal - Admin Access</title>
<title>Control Panel - Admin Access</title>
<!-- Google Fonts: Outfit & Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@ -308,7 +308,7 @@
<svg viewBox="0 0 24 24">
<path d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8H17V6A5,5 0 0,0 12,1A5,5 0 0,0 7,6V8H6A2,2 0 0,0 4,10V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V10A2,2 0 0,0 18,8M8.9,6C8.9,4.29 10.29,2.9 12,2.9C13.71,2.9 15.1,4.29 15.1,6V8H8.9V6M18,20H6V10H18V20Z" />
</svg>
SingleLogin Admin
Control Panel Admin
</div>
<div class="brand-subtitle">Administrator Access Only</div>
</div>
@ -368,7 +368,7 @@
</div>
<div class="footer">
&copy; 2026 SingleLogin Systems. Secured with Microsoft Identity Platform.
&copy; 2026 Systems. Secured with Microsoft Identity Platform.
</div>
</div>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SingleLogin Portal - Authenticate</title>
<title>Portal - Authenticate</title>
<!-- Google Fonts: Outfit & Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@ -341,7 +341,7 @@
<svg viewBox="0 0 24 24">
<path d="M18,8H17V6A5,5 0 0,0 12,1A5,5 0 0,0 7,6V8H6A2,2 0 0,0 4,10V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V10A2,2 0 0,0 18,8M8.9,6C8.9,4.29 10.29,2.9 12,2.9C13.71,2.9 15.1,4.29 15.1,6V8H8.9V6M12,17A2,2 0 1,1 14,15A2,2 0 0,1 12,17Z" />
</svg>
SingleLogin
Unified Portal
</div>
<div class="brand-subtitle">Unified Identity Authentication Portal</div>
</div>
@ -393,7 +393,7 @@
</div>
<div class="footer">
&copy; 2026 SingleLogin Systems. Secured with Microsoft Identity Platform.
&copy; 2026 Systems. Secured with Microsoft Identity Platform.
</div>
</div>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard - SingleLogin Portal</title>
<title>Dashboard</title>
<!-- Google Fonts: Outfit & Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@ -267,109 +267,71 @@
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 24px;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 16px;
}
/* Service Cards */
.service-card {
/* Service Cards - Small */
.service-card-small {
background-color: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 16px;
padding: 28px;
border-radius: 12px;
padding: 16px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
gap: 14px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
backdrop-filter: blur(8px);
}
.service-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background-color: transparent;
transition: background-color 0.3s ease;
}
.service-card:hover {
transform: translateY(-5px);
.service-card-small:hover {
transform: translateY(-3px);
border-color: rgba(255, 255, 255, 0.15);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.service-icon-wrapper {
width: 54px;
height: 54px;
border-radius: 12px;
.service-icon-wrapper-small {
width: 44px;
height: 44px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
flex-shrink: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
transition: transform 0.3s ease;
}
.service-card:hover .service-icon-wrapper {
transform: scale(1.1) rotate(3deg);
.service-card-small:hover .service-icon-wrapper-small {
transform: scale(1.08);
}
.service-icon-wrapper svg {
width: 32px;
height: 32px;
.service-icon-wrapper-small svg {
width: 24px;
height: 24px;
}
.service-tag {
align-self: flex-start;
font-size: 0.75rem;
color: var(--text-muted);
background-color: rgba(255, 255, 255, 0.04);
padding: 2px 8px;
border-radius: 4px;
margin-bottom: 8px;
font-weight: 500;
}
.service-name {
font-family: 'Outfit', sans-serif;
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 8px;
}
.service-desc {
font-size: 0.85rem;
color: var(--text-muted);
line-height: 1.5;
margin-bottom: 24px;
}
.sso-launch-btn {
background-color: rgba(255, 255, 255, 0.04);
border: 1px solid var(--card-border);
color: var(--text-main);
padding: 8px 12px;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 500;
.service-info-small {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
width: 100%;
transition: all 0.2s ease;
flex-direction: column;
gap: 2px;
}
.service-card:hover .sso-launch-btn {
background-color: var(--accent-primary);
border-color: transparent;
box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
.service-name-small {
font-family: 'Outfit', sans-serif;
font-size: 1rem;
font-weight: 600;
color: var(--text-main);
margin: 0;
}
.service-tag-small {
font-size: 0.7rem;
color: var(--text-muted);
align-self: flex-start;
}
/* Fullscreen SSO Modal Overlay */
@ -477,38 +439,17 @@
align-items: flex-start;
padding: 24px;
}
.session-status {
text-align: left;
.nav-user {
margin-top: 10px;
width: 100%;
display: flex;
justify-content: flex-start;
}
}
</style>
</head>
<body>
<!-- Nav -->
<header class="navbar">
<div class="nav-logo">
<svg viewBox="0 0 24 24">
<path d="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20Z" />
</svg>
SingleLogin Dashboard
</div>
<div class="nav-user">
@if($user->role === 'admin')
<a href="{{ route('admin.dashboard') }}" class="logout-link" style="color: var(--info-color); border-color: rgba(6, 182, 212, 0.2); background-color: rgba(6, 182, 212, 0.05); margin-right: 10px;">
Admin Panel
</a>
@endif
<form action="{{ route('logout') }}" method="POST" id="logout-form" style="display: none;">
@csrf
</form>
<a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="logout-link">
Sign Out
</a>
</div>
</header>
<!-- Main Container -->
<main class="dashboard-container">
@ -545,11 +486,18 @@
</div>
</div>
<div class="session-status">
<div class="status-pill">
<span class="status-dot"></span>
<span>Secure Microsoft SSO Session Active</span>
</div>
<div class="nav-user">
@if($user->role === 'admin')
<a href="{{ route('admin.dashboard') }}" class="logout-link" style="color: var(--info-color); border-color: rgba(6, 182, 212, 0.2); background-color: rgba(6, 182, 212, 0.05); margin-right: 10px;">
Admin Panel
</a>
@endif
<form action="{{ route('logout') }}" method="POST" id="logout-form" style="display: none;">
@csrf
</form>
<a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="logout-link">
Sign Out
</a>
</div>
</section>
@ -559,12 +507,11 @@
<div class="services-grid">
@foreach($services as $service)
<div class="service-card" onclick="launchSSO('{{ $service['name'] }}', '{{ route('sso.launch', $service['id']) }}')" style="border-top: 4px solid {{ $service['color'] }}">
<div>
<div class="service-tag">{{ $service['tag'] }}</div>
<div class="service-icon-wrapper" style="background-color: rgba({{ hexdec(substr($service['color'], 1, 2)) }}, {{ hexdec(substr($service['color'], 3, 2)) }}, {{ hexdec(substr($service['color'], 5, 2)) }}, 0.08)">
<!-- Custom SVGs for Service Providers -->
@if($service['icon_svg'] === 'outlook')
<div class="service-card-small" onclick="launchSSO('{{ $service['name'] }}', '{{ route('sso.launch', $service['id']) }}')" style="border-left: 4px solid {{ $service['color'] }}">
<div class="service-icon-wrapper-small" style="background-color: rgba({{ hexdec(substr($service['color'] ?? '#4f46e5', 1, 2)) }}, {{ hexdec(substr($service['color'] ?? '#4f46e5', 3, 2)) }}, {{ hexdec(substr($service['color'] ?? '#4f46e5', 5, 2)) }}, 0.08)">
@if($service['logo'])
<img src="{{ asset($service['logo']) }}" alt="{{ $service['name'] }}" style="width: 32px; height: 32px; object-fit: contain; border-radius: 6px;">
@elseif($service['icon_svg'] === 'outlook')
<svg viewBox="0 0 24 24" fill="{{ $service['color'] }}">
<path d="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,19H5V8H19V19M19,6H5V5H19V6M17,12H12V17H17V12Z" />
</svg>
@ -579,20 +526,13 @@
@elseif(str_starts_with($service['icon_svg'] ?? '', '<svg'))
{!! $service['icon_svg'] !!}
@else
<svg viewBox="0 0 24 24" fill="{{ $service['color'] }}">
<path d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4M12,6A6,6 0 0,0 6,12A6,6 0 0,0 12,18A6,6 0 0,0 18,12A6,6 0 0,0 12,6M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8Z" />
</svg>
<img src="{{ asset('images/default_logo.png') }}" alt="Default Logo" style="width: 32px; height: 32px; object-fit: contain; border-radius: 6px;">
@endif
</div>
<div class="service-name">{{ $service['name'] }}</div>
<div class="service-desc">{{ $service['desc'] }}</div>
<div class="service-info-small">
<h3 class="service-name-small">{{ $service['name'] }}</h3>
<span class="service-tag-small">{{ $service['tag'] }}</span>
</div>
<button class="sso-launch-btn">
Launch Service
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14L21 3"/>
</svg>
</button>
</div>
@endforeach
</div>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Launching {{ $name }} - SingleLogin</title>
<title>Launching {{ $name }}</title>
<!-- Google Fonts: Outfit & Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>