Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | <script setup lang="ts">
import AppLayout from '@/layouts/AppLayout.vue';
import { Head, Link, useForm } from '@inertiajs/vue3';
import administration from '@/routes/administration';
import products from '@/routes/products';
import users from '@/routes/users';
import groups from '@/routes/groups';
import companySettings from '@/routes/company-settings';
import smsSettings from '@/routes/sms-settings';
import whatsappSettings from '@/routes/whatsapp-settings';
import { Users, UsersRound, Shield, Building2, UserCheck, Package, Tag, MessageSquare, Zap, FileText, ClipboardList, Database, Percent, BookOpen, CreditCard, ArrowUpCircle, Eye, KeyRound, Hash, Mail, Globe2, ListChecks } from 'lucide-vue-next';
import auditLogs from '@/routes/audit-logs';
import backups from '@/routes/backups/index';
import { ref } from 'vue';
const upgradeForm = useForm({});
const isUpgrading = ref(false);
const upgradeDatabase = () => {
if (confirm('Are you sure you want to upgrade the database? This will run pending migrations.')) {
isUpgrading.value = true;
upgradeForm.post('/administration/upgrade-database', {
preserveScroll: true,
onFinish: () => {
isUpgrading.value = false;
},
});
}
};
const props = defineProps<{
stats: {
users_count: number;
groups_count: number;
products_count: number;
audit_logs_count: number;
backups_count: number;
teams_count: number;
};
}>();
</script>
<template>
<Head title="Administration" />
<AppLayout :breadcrumbs="[{ title: 'Administration', href: administration.index().url }]">
<div class="p-4">
<h1 class="mb-6 text-2xl font-bold">Administration</h1>
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-4">
<!-- Users Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Users</h2>
<p class="text-sm text-gray-600">Manage user accounts and permissions</p>
<p class="mt-2 text-2xl font-bold text-primary">{{ props.stats.users_count }}</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Users class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
v-if="$page.props.auth?.abilities?.users?.list"
:href="users.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Users
</Link>
<Link
v-if="$page.props.auth?.abilities?.users?.create"
:href="users.create().url"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add User
</Link>
</div>
</div>
<!-- Groups Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Groups</h2>
<p class="text-sm text-gray-600">Manage user groups and permissions</p>
<p class="mt-2 text-2xl font-bold text-primary">{{ props.stats.groups_count }}</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Shield class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
v-if="$page.props.auth?.abilities?.groups?.list"
:href="groups.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Groups
</Link>
<Link
v-if="$page.props.auth?.abilities?.groups?.create"
:href="groups.create().url"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add Group
</Link>
</div>
</div>
<!-- Teams Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Teams</h2>
<p class="text-sm text-gray-600">Organize users into teams for jobcard assignment</p>
<p class="mt-2 text-2xl font-bold text-primary">{{ props.stats.teams_count }}</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<UsersRound class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
href="/administration/teams"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Teams
</Link>
<Link
href="/administration/teams/create"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add Team
</Link>
</div>
</div>
<!-- Categories Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Categories</h2>
<p class="text-sm text-gray-600">Manage product and service categories</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Tag class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="administration.categories.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Categories
</Link>
</div>
</div>
<!-- Company Settings Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Companies</h2>
<p class="text-sm text-gray-600">Manage company information and branding</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Building2 class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="companySettings.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Companies
</Link>
</div>
</div>
<!-- SMS Settings Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">SMS Settings</h2>
<p class="text-sm text-gray-600">Configure BulkSMS for customer messaging</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<MessageSquare class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="smsSettings.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Configure SMS
</Link>
</div>
</div>
<!-- WhatsApp Settings Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">WhatsApp Settings</h2>
<p class="text-sm text-gray-600">Configure WhatsApp Business API for customer messaging</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<MessageSquare class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="whatsappSettings.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Configure WhatsApp
</Link>
</div>
</div>
<!-- Xero Integration Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Xero Integration</h2>
<p class="text-sm text-gray-600">Sync customers, products, and invoices with Xero</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Zap class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/xero-settings"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Configure Xero
</Link>
</div>
</div>
<!-- PDF Templates Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">PDF Templates</h2>
<p class="text-sm text-gray-600">Manage PDF templates for invoices, quotes, jobcards, and proforma invoices</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<FileText class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="administration.pdfTemplates.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Templates
</Link>
</div>
</div>
<!-- Email Templates Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Email Templates</h2>
<p class="text-sm text-gray-600">Create drag-and-drop templates with customer and contact variables</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Mail class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/email-templates"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Email Templates
</Link>
</div>
</div>
<!-- Audit Logs Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Audit Logs</h2>
<p class="text-sm text-gray-600">Track all changes and activities in the system</p>
<p class="mt-2 text-2xl font-bold text-primary">{{ props.stats.audit_logs_count }}</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<ClipboardList class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="auditLogs.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Audit Logs
</Link>
</div>
</div>
<!-- Backups & Restore Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Backups & Restore</h2>
<p class="text-sm text-gray-600">Automated backups, scheduling, and one-click restore</p>
<p class="mt-2 text-2xl font-bold text-primary">{{ props.stats.backups_count }}</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Database class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="backups.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Backups
</Link>
</div>
</div>
<!-- Database Upgrade Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Database Upgrade</h2>
<p class="text-sm text-gray-600">Run pending database migrations to upgrade the system</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<ArrowUpCircle class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<button
@click="upgradeDatabase"
:disabled="isUpgrading"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
>
<span v-if="isUpgrading">Upgrading...</span>
<span v-else>Upgrade Database</span>
</button>
</div>
</div>
<!-- Module Visibility Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Module Visibility</h2>
<p class="text-sm text-gray-600">Control which modules appear in the sidebar menu</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Eye class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
:href="administration.moduleVisibility().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Modules
</Link>
</div>
</div>
<!-- License Card -->
<div v-if="!$page.props.isLicensingInstance" class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">License</h2>
<p class="text-sm text-gray-600">Set and validate this instance license key</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<KeyRound class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/license"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage License
</Link>
</div>
</div>
<!-- Document Numbering Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Document Numbering</h2>
<p class="text-sm text-gray-600">Configure prefixes and next numbers for invoices, quotes, jobcards, credit notes, and purchase orders</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Hash class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/document-numbering"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Manage Numbering
</Link>
</div>
</div>
<!-- Localization Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Localization</h2>
<p class="text-sm text-gray-600">Decimal and thousands separators for amounts in the app, PDFs, and emails</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Globe2 class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/localization"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Configure Localization
</Link>
</div>
</div>
<!-- Status Editor Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Status Editor</h2>
<p class="text-sm text-gray-600">Edit Jobcard and Quote status labels and reset to defaults</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<ListChecks class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto pt-4">
<Link
href="/administration/status-editor"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
Open Status Editor
</Link>
</div>
</div>
<!-- Tax Rates Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Tax Rates</h2>
<p class="text-sm text-gray-600">Manage tax rates for invoices, quotes, and jobcards</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<Percent class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
:href="administration.taxRates.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Tax Rates
</Link>
<Link
:href="administration.taxRates.create().url"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add Tax Rate
</Link>
</div>
</div>
<!-- Chart of Accounts Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Chart of Accounts</h2>
<p class="text-sm text-gray-600">Manage your company's chart of accounts</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<BookOpen class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
:href="administration.chartOfAccounts.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Accounts
</Link>
<Link
:href="administration.chartOfAccounts.create().url"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add Account
</Link>
</div>
</div>
<!-- Bank Accounts Card -->
<div class="flex flex-col rounded-lg border bg-white p-6 shadow-sm">
<div class="flex items-center justify-between">
<div>
<h2 class="text-lg font-semibold">Bank Accounts</h2>
<p class="text-sm text-gray-600">Manage bank accounts for your company</p>
</div>
<div class="rounded-full bg-primary/10 p-3">
<CreditCard class="h-6 w-6 text-primary" />
</div>
</div>
<div class="mt-auto flex gap-2 pt-4">
<Link
:href="administration.bankAccounts.index().url"
class="rounded bg-primary px-3 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"
>
View Bank Accounts
</Link>
<Link
:href="administration.bankAccounts.create().url"
class="rounded border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors"
>
Add Bank Account
</Link>
</div>
</div>
</div>
</div>
</AppLayout>
</template>
|