Compare commits
2 Commits
fix/add-se
...
change-req
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbfa2a37bb | ||
|
|
dceb46ab86 |
@@ -67,5 +67,4 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
|
||||
API_KEY_GOOGLE="xxxxx"
|
||||
SPREAD_SHEET_ID="xxxxx"
|
||||
OPENAI_API_KEY="xxxxx"
|
||||
SPREAD_SHEET_ID="xxxxx"
|
||||
77
README.md
77
README.md
@@ -17,14 +17,13 @@ sudo nano /etc/supervisor/conf.d/laravel-worker.conf
|
||||
|
||||
[program:laravel-worker]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /home/arifal/development/sibedas-pbg-web/artisan queue:work --queue=default --timeout=40000 --tries=1 --sleep=3
|
||||
command=php /path-to-your-project/artisan queue:work --tries=3 --timeout=600
|
||||
autostart=true
|
||||
autorestart=true
|
||||
numprocs=4
|
||||
numprocs=1
|
||||
user=www-data
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/home/arifal/development/sibedas-pbg-web/storage/logs/worker.log
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
stdout_logfile=/var/log/supervisor/laravel-worker.log
|
||||
```
|
||||
|
||||
- Reload Supervisor
|
||||
@@ -36,71 +35,3 @@ sudo supervisorctl start laravel-worker
|
||||
sudo supervisorctl restart laravel-worker
|
||||
sudo supervisorctl status
|
||||
```
|
||||
|
||||
# How to running
|
||||
|
||||
- Install composer package
|
||||
|
||||
```
|
||||
composer install
|
||||
```
|
||||
|
||||
- Install npm package
|
||||
|
||||
```
|
||||
npm install && npm run build
|
||||
```
|
||||
|
||||
- Create symlinks storage
|
||||
|
||||
```
|
||||
php artisan storage:link
|
||||
```
|
||||
|
||||
- Running migration
|
||||
|
||||
```
|
||||
php artisan migrate
|
||||
```
|
||||
|
||||
- Create view table
|
||||
- excute all sql queries on folder database/view_query
|
||||
|
||||
# Add ENV variable
|
||||
|
||||
- API_KEY_GOOGLE
|
||||
|
||||
```
|
||||
Get api key from google developer console for and turn on spreadsheet api or feaature for google sheet
|
||||
```
|
||||
|
||||
- SPREAD_SHEET_ID
|
||||
|
||||
```
|
||||
Get spreadsheet id from google sheet link
|
||||
```
|
||||
|
||||
- OPENAI_API_KEY
|
||||
|
||||
```
|
||||
Get OpenAI API key from chatgpt subscription
|
||||
```
|
||||
|
||||
- ENV
|
||||
|
||||
```
|
||||
|
||||
API_KEY_GOOGLE="xxxxx"
|
||||
SPREAD_SHEET_ID="xxxxx"
|
||||
OPENAI_API_KEY="xxxxx"
|
||||
|
||||
```
|
||||
|
||||
# Technology version
|
||||
|
||||
- php 8.3
|
||||
- Laravel 11
|
||||
- node v22.13.0
|
||||
- npm 10.9.2
|
||||
- mariadb Ver 15.1 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
|
||||
- Ubuntu 24.04
|
||||
|
||||
@@ -34,7 +34,7 @@ class ExecuteScraping extends Command
|
||||
}
|
||||
public function handle()
|
||||
{
|
||||
SyncronizeSIMBG::dispatch()->onQueue('default');
|
||||
SyncronizeSIMBG::dispatch();
|
||||
Log::info("running scheduler daily scraping");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ class BigDataResumeController extends Controller
|
||||
$query = BigdataResume::query()->orderBy('id', 'desc');
|
||||
|
||||
if($request->filled('search')){
|
||||
$query->where('year', 'LIKE', '%'.$request->input('search').'%');
|
||||
$query->where('name', 'LIKE', '%'.$request->input('search').'%');
|
||||
}
|
||||
|
||||
$query = $query->paginate(config('app.paginate_per_page', 50));
|
||||
|
||||
@@ -34,7 +34,7 @@ class GlobalSettingsController extends Controller
|
||||
try {
|
||||
$data = GlobalSetting::create($request->validated());
|
||||
return new GlobalSettingResource($data);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return $this->resError($e->getMessage(), null, $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\TaskAssignmentsResource;
|
||||
use App\Models\TaskAssignment;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TaskAssignmentsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request, $uuid)
|
||||
{
|
||||
try{
|
||||
$query = TaskAssignment::query()
|
||||
->where('pbg_task_uid', $uuid)
|
||||
->orderBy('id', 'desc');
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$query->where('name', 'like', "%{$request->get('search')}%")
|
||||
->orWhere('email', 'like', "%{$request->get('search')}%");
|
||||
}
|
||||
|
||||
return TaskAssignmentsResource::collection($query->paginate(config('app.paginate_per_page', 50)));
|
||||
}catch(\Exception $exception){
|
||||
return response()->json(['message' => $exception->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class TourismController extends Controller
|
||||
$tourisms->village_name = $village ? $village->village_name : null;
|
||||
|
||||
$district = DB::table('districts')->where('district_code', $tourisms->district_code)->first();
|
||||
$tourisms->district_name = $village ? $village->village_name : null;
|
||||
$tourisms->district_name = $district ? $district->district_name : null;
|
||||
return $tourisms;
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Traits\GlobalApiResponse;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UsersController extends Controller
|
||||
{
|
||||
@@ -29,8 +30,7 @@ class UsersController extends Controller
|
||||
public function index(Request $request){
|
||||
$query = User::query();
|
||||
if($request->has('search') && !empty($request->get("search"))){
|
||||
$query->where('name', 'LIKE', '%'.$request->get('search').'%')
|
||||
->orWhere('email', 'LIKE', '%'.$request->get('search').'%');
|
||||
$query->where('name', 'LIKE', '%'.$request->get('search').'%');
|
||||
}
|
||||
return UserResource::collection($query->paginate(config('app.paginate_per_page', 50)));
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@ class AuthenticatedSessionController extends Controller
|
||||
|
||||
// Buat token untuk API
|
||||
$token = $user->createToken(env('APP_KEY'))->plainTextToken;
|
||||
|
||||
// Simpan token di session (bisa digunakan di JavaScript)
|
||||
session(['api_token' => $token]);
|
||||
|
||||
return redirect()->intended(RouteServiceProvider::HOME);
|
||||
|
||||
@@ -4,15 +4,36 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\BusinessOrIndustry;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class BusinessOrIndustriesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('business-industries.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
return view('business-industries.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,12 +4,33 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CustomersController extends Controller
|
||||
{
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('customers.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('customers.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
public function create()
|
||||
{
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Dashboards;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PotentialsController extends Controller
|
||||
{
|
||||
public function inside_system(){
|
||||
return view('dashboards.potentials.inside_system');
|
||||
}
|
||||
public function outside_system(){
|
||||
return view('dashboards.potentials.outside_system');
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,36 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\Advertisement;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class AdvertisementController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('data.advertisements.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('data.advertisements.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,15 +5,37 @@ namespace App\Http\Controllers\Data;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\SpatialPlanning;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SpatialPlanningController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('data.spatialPlannings.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('data.spatialPlannings.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,15 +6,35 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\Tourism;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class TourismController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('data.tourisms.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
return view('data.tourisms.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,15 +6,35 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\Umkm;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class UmkmController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('data.umkm.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
return view('data.umkm.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,15 +8,36 @@ use Exception;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request as IndexRequest;
|
||||
|
||||
class DataSettingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(IndexRequest $request)
|
||||
{
|
||||
return view("data-settings.index");
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
return view("data-settings.index", compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
use App\Traits\GlobalApiResponse;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class UsersController extends Controller
|
||||
{
|
||||
@@ -21,9 +22,29 @@ class UsersController extends Controller
|
||||
$users = User::all();
|
||||
return $this->resSuccess($users);
|
||||
}
|
||||
public function index(){
|
||||
public function index(Request $request){
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
$users = User::paginate();
|
||||
return view('master.users.index', compact('users'));
|
||||
return view('master.users.index', compact('users', 'creator', 'updater', 'destroyer'));
|
||||
}
|
||||
public function create(){
|
||||
$roles = Role::all();
|
||||
|
||||
@@ -6,15 +6,36 @@ use App\Http\Requests\MenuRequest;
|
||||
use App\Models\Menu;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class MenusController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('menus.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('menus.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,15 +5,37 @@ namespace App\Http\Controllers\RequestAssignment;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\PbgTask;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class PbgTaskController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view('pbg_task.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('pbg_task.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +59,7 @@ class PbgTaskController extends Controller
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
$data = PbgTask::with(['pbg_task_retributions','pbg_task_index_integrations', 'pbg_task_retributions.pbg_task_prasarana'])->findOrFail($id);
|
||||
$data = PbgTask::with(['pbg_task_retributions','pbg_task_index_integrations', 'pbg_task_retributions.pbg_task_prasarana', 'taskAssignments'])->findOrFail($id);
|
||||
return view("pbg_task.show", compact("data"));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,15 +10,36 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RolesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
return view("roles.index");
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view("roles.index", compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,27 @@ class SyncronizeController extends Controller
|
||||
$this->service_simbg = $service_simbg;
|
||||
}
|
||||
public function index(Request $request){
|
||||
return view('settings.syncronize.index');
|
||||
$menuId = $request->query('menu_id');
|
||||
$user = Auth::user();
|
||||
$userId = $user->id;
|
||||
|
||||
// Ambil role_id yang dimiliki user
|
||||
$roleIds = DB::table('user_role')
|
||||
->where('user_id', $userId)
|
||||
->pluck('role_id');
|
||||
|
||||
// Ambil data akses berdasarkan role_id dan menu_id
|
||||
$roleAccess = DB::table('role_menu')
|
||||
->whereIn('role_id', $roleIds)
|
||||
->where('menu_id', $menuId)
|
||||
->first();
|
||||
|
||||
// Pastikan roleAccess tidak null sebelum mengakses properti
|
||||
$creator = $roleAccess->allow_create ?? 0;
|
||||
$updater = $roleAccess->allow_update ?? 0;
|
||||
$destroyer = $roleAccess->allow_destroy ?? 0;
|
||||
|
||||
return view('settings.syncronize.index', compact('creator', 'updater', 'destroyer'));
|
||||
}
|
||||
|
||||
public function syncPbgTask(){
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TaskAssignmentsResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return parent::toArray($request);
|
||||
}
|
||||
}
|
||||
@@ -22,14 +22,7 @@ class SyncronizeSIMBG implements ShouldQueue
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
$serviceSIMBG = app(ServiceSIMBG::class);
|
||||
$serviceSIMBG->syncTaskPBG();
|
||||
} catch (\Exception $e) {
|
||||
\Log::error("SyncronizeSIMBG Job Failed: " . $e->getMessage(), [
|
||||
'exception' => $e,
|
||||
]);
|
||||
$this->fail($e); // Mark the job as failed
|
||||
}
|
||||
$serviceSIMBG = app(ServiceSIMBG::class);
|
||||
$serviceSIMBG->syncTaskPBG();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class TaskAssignment extends Model
|
||||
protected $fillable = [
|
||||
'user_id', 'name', 'username', 'email', 'phone_number', 'role',
|
||||
'role_name', 'is_active', 'file', 'expertise', 'experience',
|
||||
'is_verif', 'uid', 'status', 'status_name', 'note', 'pbg_task_uid', 'tas_id'
|
||||
'is_verif', 'uid', 'status', 'status_name', 'note', 'pbg_task_uid'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -339,12 +339,20 @@ class ServiceSIMBG
|
||||
$decodedResponse = json_decode($response->getContent(), true);
|
||||
|
||||
if (isset($decodedResponse['errors']['code']) && $decodedResponse['errors']['code'] === 'token_not_valid') {
|
||||
Log::warning("Token is invalid, refreshing token...");
|
||||
|
||||
// Regenerate token
|
||||
$initResToken = $this->getToken();
|
||||
|
||||
// Check if new token is valid
|
||||
if (!empty($initResToken->original['data']['token']['access'])) {
|
||||
$new_token = $initResToken->original['data']['token']['access'];
|
||||
|
||||
// **Fix: Update headers before retrying**
|
||||
$headers['Authorization'] = "Bearer " . $new_token;
|
||||
continue;
|
||||
|
||||
Log::info("Token refreshed successfully, retrying API request...");
|
||||
continue; // Retry with new token
|
||||
} else {
|
||||
Log::error("Failed to refresh token");
|
||||
return $this->resError("Failed to refresh token");
|
||||
@@ -456,21 +464,29 @@ class ServiceSIMBG
|
||||
'Authorization' => "Bearer " . $token,
|
||||
];
|
||||
|
||||
for ($attempt = 0; $attempt < 2; $attempt++) {
|
||||
for ($attempt = 0; $attempt < 2; $attempt++) { // Try twice (original + retry)
|
||||
$res = $this->service_client->get($url, $headers);
|
||||
|
||||
// Check if response is JsonResponse and decode it
|
||||
if ($res instanceof \Illuminate\Http\JsonResponse) {
|
||||
$decodedResponse = json_decode($res->getContent(), true);
|
||||
|
||||
// Handle invalid token case
|
||||
if (isset($decodedResponse['errors']['code']) && $decodedResponse['errors']['code'] === 'token_not_valid') {
|
||||
Log::warning("Token is invalid, refreshing token...");
|
||||
|
||||
// Regenerate the token
|
||||
$initResToken = $this->getToken();
|
||||
|
||||
// Check if the new token is valid
|
||||
if (!empty($initResToken->original['data']['token']['access'])) {
|
||||
$new_token = $initResToken->original['data']['token']['access'];
|
||||
|
||||
// **Fix: Update headers with the new token**
|
||||
$headers['Authorization'] = "Bearer " . $new_token;
|
||||
continue;
|
||||
|
||||
Log::info("Token refreshed successfully, retrying API request...");
|
||||
continue; // Retry the request with the new token
|
||||
} else {
|
||||
Log::error("Failed to refresh token");
|
||||
return $this->resError("Failed to refresh token");
|
||||
@@ -478,6 +494,7 @@ class ServiceSIMBG
|
||||
}
|
||||
}
|
||||
|
||||
// If request succeeds, break out of retry loop
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -485,6 +502,7 @@ class ServiceSIMBG
|
||||
$responseData = $res->original ?? [];
|
||||
$data = $responseData['data']['data'] ?? [];
|
||||
if (empty($data)) {
|
||||
Log::error("API response indicates failure", ['url' => $url, 'uuid' => $uuid, 'response' => $responseData]);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -565,7 +583,7 @@ class ServiceSIMBG
|
||||
|
||||
foreach ($datas as $data) {
|
||||
$task_assignments[] = [
|
||||
'pbg_task_uid' => $uuid,
|
||||
'pbg_task_uid' => $uuid, // Assuming this is a foreign key
|
||||
'user_id' => $data['user_id'],
|
||||
'name' => $data['name'],
|
||||
'username' => $data['username'],
|
||||
@@ -574,23 +592,22 @@ class ServiceSIMBG
|
||||
'role' => $data['role'],
|
||||
'role_name' => $data['role_name'],
|
||||
'is_active' => $data['is_active'],
|
||||
'file' => !empty($data['file']) ? json_encode($data['file']) : null,
|
||||
'expertise' => !empty($data['expertise']) ? json_encode($data['expertise']) : null,
|
||||
'experience' => !empty($data['experience']) ? json_encode($data['experience']) : null,
|
||||
'file' => json_encode($data['file']), // Store as JSON if it's an array
|
||||
'expertise' => $data['expertise'],
|
||||
'experience' => $data['experience'],
|
||||
'is_verif' => $data['is_verif'],
|
||||
'uid' => $data['uid'],
|
||||
'uid' => $data['uid'], // Unique identifier
|
||||
'status' => $data['status'],
|
||||
'status_name' => $data['status_name'],
|
||||
'note' => $data['note'],
|
||||
'ta_id' => $data['id'],
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
];
|
||||
}
|
||||
TaskAssignment::upsert(
|
||||
$task_assignments,
|
||||
['uid'],
|
||||
['ta_id','name', 'username', 'email', 'phone_number', 'role', 'role_name', 'is_active', 'file', 'expertise', 'experience', 'is_verif', 'status', 'status_name', 'note', 'updated_at']
|
||||
$task_assignments, // Data to insert/update
|
||||
['uid'], // Unique key for conflict resolution
|
||||
['name', 'username', 'email', 'phone_number', 'role', 'role_name', 'is_active', 'file', 'expertise', 'experience', 'is_verif', 'status', 'status_name', 'note', 'updated_at']
|
||||
);
|
||||
return true;
|
||||
}catch(Exception $e){
|
||||
|
||||
@@ -79,8 +79,6 @@ return [
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
PDO::ATTR_TIMEOUT => 40000,
|
||||
PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION wait_timeout=40000; SET SESSION interactive_timeout=40000;"
|
||||
]) : [],
|
||||
],
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ return [
|
||||
// set timeout queue
|
||||
|
||||
'worker' => [
|
||||
'timeout' => 40000
|
||||
'timeout' => 300
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?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('task_assignments', function (Blueprint $table) {
|
||||
$table->json('expertise')->nullable()->change();
|
||||
$table->json('experience')->nullable()->change();
|
||||
$table->bigInteger('ta_id')->nullable()->after('id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('task_assignments', function (Blueprint $table) {
|
||||
$table->text('expertise')->nullable()->change();
|
||||
$table->text('experience')->nullable()->change();
|
||||
$table->dropColumn('ta_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -119,7 +119,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
],
|
||||
[
|
||||
"name" => "Dashboard Potensi",
|
||||
"url" => null,
|
||||
"url" => "dashboard.lack_of_potential",
|
||||
"icon" => null,
|
||||
"parent_id" => $dashboard->id,
|
||||
"sort_order" => 3,
|
||||
@@ -236,20 +236,6 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
"parent_id" => $chat_bedas->id,
|
||||
"sort_order" => 1,
|
||||
],
|
||||
[
|
||||
"name" => "Dalam Sistem",
|
||||
"url" => "dashboard.potentials.inside_system",
|
||||
"icon" => null,
|
||||
"parent_id" => Menu::where('name', 'Dashboard Potensi')->first()->id,
|
||||
"sort_order" => 1,
|
||||
],
|
||||
[
|
||||
"name" => "Luar Sistem",
|
||||
"url" => "dashboard.potentials.outside_system",
|
||||
"icon" => null,
|
||||
"parent_id" => Menu::where('name', 'Dashboard Potensi')->first()->id,
|
||||
"sort_order" => 2,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($children_menus as $child_menu) {
|
||||
@@ -275,8 +261,6 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$peta = Menu::where('name', 'PETA')->first();
|
||||
$bigdata_resume = Menu::where('name', 'Lap Pimpinan')->first();
|
||||
$chatbot = Menu::where('name', 'Chat')->first();
|
||||
$dalam_sistem = Menu::where('name', 'Dalam Sistem')->first();
|
||||
$luar_sistem = Menu::where('name', 'Luar Sistem')->first();
|
||||
|
||||
// Superadmin gets all menus
|
||||
$superadmin->menus()->sync([
|
||||
@@ -305,9 +289,7 @@ class UsersRoleMenuSeeder extends Seeder
|
||||
$lack_of_potentials->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$spatial_plannings->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$pdam->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
// $peta->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$dalam_sistem->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$luar_sistem->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$peta->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$bigdata_resume->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
$chatbot->id => ["allow_show" => true, "allow_create" => true, "allow_update" => true, "allow_destroy" => true],
|
||||
]);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Grid } from "gridjs/dist/gridjs.umd.js";
|
||||
import gridjs from "gridjs/dist/gridjs.umd.js";
|
||||
import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig, { addThousandSeparators } from "../global-config.js";
|
||||
import Swal from "sweetalert2";
|
||||
import moment from "moment";
|
||||
|
||||
class BigdataResume {
|
||||
@@ -12,16 +13,23 @@ class BigdataResume {
|
||||
this.table = null;
|
||||
|
||||
// Initialize functions
|
||||
this.initEvents();
|
||||
this.initTableDataSettings();
|
||||
// this.initEvents();
|
||||
}
|
||||
async initEvents() {
|
||||
await this.initBigdataResumeTable();
|
||||
// this.handleSearch();
|
||||
initEvents() {
|
||||
document.body.addEventListener("click", async (event) => {
|
||||
const deleteButton = event.target.closest(
|
||||
".btn-delete-data-settings"
|
||||
);
|
||||
if (deleteButton) {
|
||||
event.preventDefault();
|
||||
await this.handleDelete(deleteButton);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async initBigdataResumeTable() {
|
||||
initTableDataSettings() {
|
||||
let tableContainer = document.getElementById("table-bigdata-resumes");
|
||||
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
{ name: "ID" },
|
||||
@@ -45,9 +53,7 @@ class BigdataResume {
|
||||
{ name: "Total Proses Dinas Teknis" },
|
||||
{
|
||||
name: "Created",
|
||||
attributes: {
|
||||
style: "width: 200px; white-space: nowrap;",
|
||||
},
|
||||
attributes: { style: "width: 200px; white-space: nowrap;" }, // Set width dynamically
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
@@ -60,12 +66,11 @@ class BigdataResume {
|
||||
},
|
||||
},
|
||||
sort: true,
|
||||
search: {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
// search: {
|
||||
// server: {
|
||||
// url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
// },
|
||||
// },
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/bigdata-report`,
|
||||
headers: {
|
||||
@@ -105,72 +110,61 @@ class BigdataResume {
|
||||
total: (data) => data.total,
|
||||
},
|
||||
width: "auto",
|
||||
fixedHeader: true,
|
||||
});
|
||||
|
||||
return new Promise((resolve) => {
|
||||
this.table.render(tableContainer);
|
||||
this.table.on("ready", resolve); // Tunggu event "ready"
|
||||
});
|
||||
}).render(tableContainer);
|
||||
}
|
||||
handleSearch() {}
|
||||
async handleDelete(deleteButton) {
|
||||
const id = deleteButton.getAttribute("data-id");
|
||||
|
||||
handleSearch() {
|
||||
document.getElementById("search-btn").addEventListener("click", () => {
|
||||
let searchValue = document.getElementById("search-box").value;
|
||||
const result = await Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You won't be able to revert this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
});
|
||||
|
||||
if (!this.table) {
|
||||
// Ensure table is initialized
|
||||
console.error("Table element not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
this.table
|
||||
.updateConfig({
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/bigdata-report?search=${searchValue}`,
|
||||
if (result.isConfirmed) {
|
||||
try {
|
||||
let response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/data-settings/${id}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
.getAttribute("content")}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
then: (data) => {
|
||||
return data.data.map((item) => [
|
||||
item.id,
|
||||
item.potention_count,
|
||||
addThousandSeparators(item.potention_sum),
|
||||
item.non_verified_count,
|
||||
addThousandSeparators(item.non_verified_sum),
|
||||
item.verified_count,
|
||||
addThousandSeparators(item.verified_sum),
|
||||
item.business_count,
|
||||
addThousandSeparators(item.business_sum),
|
||||
item.non_business_count,
|
||||
addThousandSeparators(item.non_business_sum),
|
||||
item.spatial_count,
|
||||
addThousandSeparators(item.spatial_sum),
|
||||
item.waiting_click_dpmptsp_count,
|
||||
addThousandSeparators(
|
||||
item.waiting_click_dpmptsp_sum
|
||||
),
|
||||
item.issuance_realization_pbg_count,
|
||||
addThousandSeparators(
|
||||
item.issuance_realization_pbg_sum
|
||||
),
|
||||
item.process_in_technical_office_count,
|
||||
addThousandSeparators(
|
||||
item.process_in_technical_office_sum
|
||||
),
|
||||
moment(item.created_at).format(
|
||||
"YYYY-MM-DD H:mm:ss"
|
||||
),
|
||||
]);
|
||||
},
|
||||
total: (data) => data.total,
|
||||
},
|
||||
})
|
||||
.forceRender();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
let result = await response.json();
|
||||
this.toastMessage.innerText =
|
||||
result.message || "Deleted successfully!";
|
||||
this.toast.show();
|
||||
|
||||
// Refresh Grid.js table
|
||||
if (typeof this.table !== "undefined") {
|
||||
this.table.updateConfig({}).forceRender();
|
||||
}
|
||||
} else {
|
||||
let error = await response.json();
|
||||
console.error("Delete failed:", error);
|
||||
this.toastMessage.innerText =
|
||||
error.message || "Delete failed!";
|
||||
this.toast.show();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error deleting item:", error);
|
||||
this.toastMessage.innerText = "An error occurred!";
|
||||
this.toast.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", function (e) {
|
||||
|
||||
@@ -31,6 +31,11 @@ class BusinessIndustries {
|
||||
let tableContainer = document.getElementById(
|
||||
"table-business-industries"
|
||||
);
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
|
||||
// Create a new Grid.js instance only if it doesn't exist
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
@@ -50,17 +55,30 @@ class BusinessIndustries {
|
||||
{ name: "Created", width: "180px" },
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
<div class="d-flex justify-content-center gap-2">
|
||||
<a href="/data/business-industries/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-business-industry d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash' ></i>
|
||||
</button>
|
||||
</div>
|
||||
`),
|
||||
formatter: (cell) => {
|
||||
|
||||
let buttons = `<div class="d-flex justify-content-center gap-2">`;
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/data/business-industries/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-business-industry d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
buttons += `</div>`;
|
||||
|
||||
return gridjs.html(buttons);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
@@ -77,7 +95,6 @@ class BusinessIndustries {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/api-business-industries`,
|
||||
|
||||
@@ -28,6 +28,10 @@ class Customers {
|
||||
initTableCustomers() {
|
||||
let tableContainer = document.getElementById("table-customers");
|
||||
// Create a new Grid.js instance only if it doesn't exist
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
@@ -39,17 +43,31 @@ class Customers {
|
||||
"Longitude",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
<div class="d-flex justify-content-center gap-2">
|
||||
<a href="/data/customers/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-customers d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash' ></i>
|
||||
</button>
|
||||
</div>
|
||||
`),
|
||||
formatter: (cell) => {
|
||||
let buttons = "";
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/data/customers/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-customers d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
if (!canUpdate && !canDelete) {
|
||||
buttons = `<span class="text-muted">No Privilege</span>`;
|
||||
}
|
||||
|
||||
return gridjs.html(`<div class="d-flex justify-content-center gap-2">${buttons}</div>`);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
@@ -66,7 +84,6 @@ class Customers {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/customers`,
|
||||
@@ -92,8 +109,6 @@ class Customers {
|
||||
}).render(tableContainer);
|
||||
}
|
||||
|
||||
handleSearch() {}
|
||||
|
||||
async handleDelete(deleteButton) {
|
||||
const id = deleteButton.getAttribute("data-id");
|
||||
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
import Big from "big.js";
|
||||
import GlobalConfig, { addThousandSeparators } from "../../global-config.js";
|
||||
import InitDatePicker from "../../utils/InitDatePicker.js";
|
||||
|
||||
class DashboardPotentialInsideSystem {
|
||||
async init() {
|
||||
new InitDatePicker(
|
||||
"#datepicker-lack-of-potential",
|
||||
this.handleChangedDate.bind(this)
|
||||
).init();
|
||||
this.bigTotalLackPotential = 0;
|
||||
this.totalPotensi = await this.getDataTotalPotensi("latest");
|
||||
this.totalTargetPAD = await this.getDataSettings("TARGET_PAD");
|
||||
this.allCountData = await this.getValueDashboard();
|
||||
this.reklameCount = this.allCountData.total_reklame ?? 0;
|
||||
this.pdamCount = this.allCountData.total_pdam ?? 0;
|
||||
this.tataRuangCount = this.allCountData.total_tata_ruang ?? 0;
|
||||
|
||||
let dataReportTourism = this.allCountData.data_report;
|
||||
|
||||
this.totalVilla = dataReportTourism
|
||||
.filter((item) => item.kbli_title.toLowerCase() === "vila")
|
||||
.reduce((sum, item) => sum + item.total_records, 0);
|
||||
this.totalRestoran = dataReportTourism
|
||||
.filter((item) => item.kbli_title.toLowerCase() === "restoran")
|
||||
.reduce((sum, item) => sum + item.total_records, 0);
|
||||
this.totalPariwisata = dataReportTourism.reduce(
|
||||
(sum, item) => sum + item.total_records,
|
||||
0
|
||||
);
|
||||
|
||||
this.bigTargetPAD = new Big(this.totalTargetPAD ?? 0);
|
||||
this.bigTotalPotensi = new Big(this.totalPotensi.total ?? 0);
|
||||
this.bigTotalLackPotential = this.bigTargetPAD.minus(
|
||||
this.bigTotalPotensi
|
||||
);
|
||||
this.initChartKekuranganPotensi();
|
||||
this.initDataValueDashboard();
|
||||
}
|
||||
async handleChangedDate(filterDate) {
|
||||
const totalPotensi = await this.getDataTotalPotensi(filterDate);
|
||||
this.bigTotalPotensi = new Big(totalPotensi.total ?? 0);
|
||||
this.bigTotalLackPotential = this.bigTargetPAD.minus(
|
||||
this.bigTotalPotensi
|
||||
);
|
||||
|
||||
this.initChartKekuranganPotensi();
|
||||
}
|
||||
async getDataTotalPotensi(filterDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${
|
||||
document.querySelector("meta[name='api-token']")
|
||||
.content
|
||||
}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Network response was not ok", response);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return {
|
||||
total: data.total_potensi.sum,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error fetching chart data:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async getDataSettings(string_key) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/data-settings?search=${string_key}`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${
|
||||
document.querySelector("meta[name='api-token']")
|
||||
.content
|
||||
}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Network response was not ok", response);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.data[0].value;
|
||||
} catch (error) {
|
||||
console.error("Error fetching chart data:", error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
async getValueDashboard() {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/dashboard-potential-count`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${
|
||||
document.querySelector("meta[name='api-token']")
|
||||
.content
|
||||
}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Network response was not ok", response);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching chart data:", error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
initChartKekuranganPotensi() {
|
||||
document
|
||||
.querySelectorAll(".document-count.chart-lack-of-potential")
|
||||
.forEach((element) => {
|
||||
element.innerText = ``;
|
||||
});
|
||||
document
|
||||
.querySelectorAll(".document-total.chart-lack-of-potential")
|
||||
.forEach((element) => {
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
this.bigTotalLackPotential.toString()
|
||||
)}`;
|
||||
});
|
||||
document
|
||||
.querySelectorAll(".small-percentage.chart-lack-of-potential")
|
||||
.forEach((element) => {
|
||||
element.innerText = ``;
|
||||
});
|
||||
}
|
||||
initDataValueDashboard() {
|
||||
document.getElementById("reklame-count").innerText = this.reklameCount;
|
||||
document.getElementById("pdam-count").innerText = this.pdamCount;
|
||||
document.getElementById("pbb-bangunan-count").innerText =
|
||||
this.tataRuangCount;
|
||||
document.getElementById("tata-ruang-count").innerText =
|
||||
this.tataRuangCount;
|
||||
document.getElementById("tata-ruang-usaha-count").innerText =
|
||||
this.tataRuangCount;
|
||||
document.getElementById("restoran-count").innerText =
|
||||
this.totalRestoran;
|
||||
document.getElementById("villa-count").innerText = this.totalVilla;
|
||||
document.getElementById("pariwisata-count").innerText =
|
||||
this.totalPariwisata;
|
||||
}
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", async function (e) {
|
||||
await new DashboardPotentialInsideSystem().init();
|
||||
});
|
||||
|
||||
function resizeDashboard() {
|
||||
let targetElement = document.getElementById("lack-of-potential-wrapper");
|
||||
let dashboardElement = document.getElementById(
|
||||
"lack-of-potential-fixed-container"
|
||||
);
|
||||
|
||||
let targetWidth = targetElement.offsetWidth;
|
||||
let dashboardWidth = 1400;
|
||||
|
||||
let scaleFactor = (targetWidth / dashboardWidth).toFixed(2);
|
||||
|
||||
// Prevent scaling beyond 1 (100%) to avoid overflow
|
||||
scaleFactor = Math.min(scaleFactor, 1);
|
||||
|
||||
dashboardElement.style.transformOrigin = "left top";
|
||||
dashboardElement.style.transition = "transform 0.2s ease-in-out";
|
||||
dashboardElement.style.transform = `scale(${scaleFactor})`;
|
||||
|
||||
// Ensure horizontal scrolling is allowed if necessary
|
||||
document.body.style.overflowX = "auto";
|
||||
}
|
||||
|
||||
window.addEventListener("load", resizeDashboard);
|
||||
window.addEventListener("resize", resizeDashboard);
|
||||
@@ -1,121 +0,0 @@
|
||||
import InitDatePicker from "../../utils/InitDatePicker.js";
|
||||
import GlobalConfig, { addThousandSeparators } from "../../global-config.js";
|
||||
|
||||
class DashboardPotentialOutsideSystem {
|
||||
async init() {
|
||||
new InitDatePicker(
|
||||
"#datepicker-outside-system",
|
||||
this.handleChangedDate.bind(this)
|
||||
).init();
|
||||
this.bigTotalLackPotential = 0;
|
||||
this.dataResume = await this.getBigDataResume("latest");
|
||||
console.log(this.dataResume);
|
||||
this.initChartNonBusiness();
|
||||
this.initChartBusiness();
|
||||
}
|
||||
async handleChangedDate(filterDate) {
|
||||
this.dataResume = await this.getBigDataResume(filterDate);
|
||||
this.initChartNonBusiness();
|
||||
this.initChartBusiness();
|
||||
}
|
||||
async getBigDataResume(filterDate) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${GlobalConfig.apiHost}/api/bigdata-resume?filterByDate=${filterDate}`,
|
||||
{
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${
|
||||
document.querySelector("meta[name='api-token']")
|
||||
.content
|
||||
}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error("Network response was not ok", response);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("Error fetching chart data:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
initChartNonBusiness() {
|
||||
const nonBusinessDoc = this.dataResume?.non_business_document ?? {};
|
||||
|
||||
document
|
||||
.querySelectorAll(".document-count.outside-system-non-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `${nonBusinessDoc.count ?? 0}`;
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll(".document-total.outside-system-non-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
(nonBusinessDoc.sum ?? 0).toString()
|
||||
)}`;
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll(".small-percentage.outside-system-non-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `${nonBusinessDoc.percentage ?? 0}%`;
|
||||
});
|
||||
}
|
||||
initChartBusiness() {
|
||||
const businessDoc = this.dataResume?.business_document ?? {};
|
||||
|
||||
document
|
||||
.querySelectorAll(".document-count.outside-system-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `${businessDoc.count ?? 0}`;
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll(".document-total.outside-system-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `Rp.${addThousandSeparators(
|
||||
(businessDoc.sum ?? 0).toString()
|
||||
)}`;
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll(".small-percentage.outside-system-business")
|
||||
.forEach((element) => {
|
||||
element.innerText = `${businessDoc.percentage ?? 0}%`;
|
||||
});
|
||||
}
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", async function (e) {
|
||||
await new DashboardPotentialOutsideSystem().init();
|
||||
});
|
||||
function resizeDashboard() {
|
||||
let targetElement = document.getElementById("outside-system-wrapper");
|
||||
let dashboardElement = document.getElementById(
|
||||
"outside-system-fixed-container"
|
||||
);
|
||||
|
||||
let targetWidth = targetElement.offsetWidth;
|
||||
let dashboardWidth = 1400;
|
||||
|
||||
let scaleFactor = (targetWidth / dashboardWidth).toFixed(2);
|
||||
|
||||
// Prevent scaling beyond 1 (100%) to avoid overflow
|
||||
scaleFactor = Math.min(scaleFactor, 1);
|
||||
|
||||
dashboardElement.style.transformOrigin = "left top";
|
||||
dashboardElement.style.transition = "transform 0.2s ease-in-out";
|
||||
dashboardElement.style.transform = `scale(${scaleFactor})`;
|
||||
|
||||
// Ensure horizontal scrolling is allowed if necessary
|
||||
document.body.style.overflowX = "auto";
|
||||
}
|
||||
|
||||
window.addEventListener("load", resizeDashboard);
|
||||
window.addEventListener("resize", resizeDashboard);
|
||||
@@ -29,6 +29,10 @@ class DataSettings {
|
||||
|
||||
initTableDataSettings() {
|
||||
let tableContainer = document.getElementById("table-data-settings");
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1"
|
||||
// Create a new Grid.js instance only if it doesn't exist
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
@@ -40,16 +44,29 @@ class DataSettings {
|
||||
name: "Actions",
|
||||
width: "120px",
|
||||
formatter: function (cell) {
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-content-center gap-2">
|
||||
let buttons = "";
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/data-settings/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<button class="btn btn-sm btn-red d-inline-flex align-items-center justify-content-center btn-delete-data-settings" data-id="${cell}">
|
||||
<i class='bx bxs-trash' ></i>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button class="btn btn-sm btn-red d-inline-flex align-items-center justify-content-center btn-delete-data-settings" data-id="${cell}">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
</div>
|
||||
`);
|
||||
`;
|
||||
}
|
||||
|
||||
if (!canUpdate && !canDelete) {
|
||||
buttons = `<span class="text-muted">No Privilege</span>`;
|
||||
}
|
||||
|
||||
return gridjs.html(`<div class="d-flex justify-content-center gap-2">${buttons}</div>`);
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -67,7 +84,6 @@ class DataSettings {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/data-settings`,
|
||||
|
||||
@@ -4,6 +4,11 @@ import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../../global-config.js";
|
||||
import GeneralTable from "../../table-generator.js";
|
||||
|
||||
// Ambil hak akses dari data-attribute
|
||||
const tableElement = document.getElementById("reklame-data-table");
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
|
||||
const dataAdvertisementsColumns = [
|
||||
"No",
|
||||
"Nama Wajib Pajak",
|
||||
@@ -17,21 +22,39 @@ const dataAdvertisementsColumns = [
|
||||
"Kontak",
|
||||
{
|
||||
name: "Actions",
|
||||
widht: "120px",
|
||||
width: "120px",
|
||||
formatter: function(cell, row) {
|
||||
const id = row.cells[10].data;
|
||||
const model = "data/advertisements";
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-items-end gap-10">
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
|
||||
// Tampilkan tombol Edit jika user punya akses update
|
||||
if (canUpdate) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
<i class='bx bx-edit' ></i></button>
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
// Tampilkan tombol Delete jika user punya akses delete
|
||||
if (canDelete) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-red btn-delete"
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash' ></i></button>
|
||||
</div>
|
||||
`);
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
actionButtons += '</div>';
|
||||
|
||||
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -4,6 +4,11 @@ import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../../global-config.js";
|
||||
import GeneralTable from "../../table-generator.js";
|
||||
|
||||
// Ambil hak akses dari data-attribute
|
||||
const tableElement = document.getElementById("spatial-planning-data-table");
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
|
||||
const dataSpatialPlanningColumns = [
|
||||
"No",
|
||||
"Nama",
|
||||
@@ -19,18 +24,35 @@ const dataSpatialPlanningColumns = [
|
||||
formatter: function (cell, row) {
|
||||
const id = row.cells[8].data;
|
||||
const model = "data/spatial-plannings";
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-items-end gap-10">
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
|
||||
// Tampilkan tombol Edit jika user punya akses update
|
||||
if (canUpdate) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
<i class='bx bx-edit'></i></button>
|
||||
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
// Tampilkan tombol Delete jika user punya akses delete
|
||||
if (canDelete) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-red btn-delete"
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash'></i></button>
|
||||
</div>
|
||||
`);
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
actionButtons += '</div>';
|
||||
|
||||
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -3,6 +3,14 @@ import gridjs from "gridjs/dist/gridjs.umd.js";
|
||||
import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../../global-config.js";
|
||||
import GeneralTable from "../../table-generator.js";
|
||||
import L from "leaflet";
|
||||
import "leaflet/dist/leaflet.css";
|
||||
|
||||
// Ambil hak akses dari data-attribute
|
||||
const tableElement = document.getElementById("tourisms-data-table");
|
||||
const canView = "1";
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
|
||||
const dataTourismsColumns = [
|
||||
"No",
|
||||
@@ -21,26 +29,49 @@ const dataTourismsColumns = [
|
||||
widht: "120px",
|
||||
formatter: function (cell, row) {
|
||||
const id = row.cells[11].data;
|
||||
const district = row.cells[4].data;
|
||||
const long = row.cells[9].data;
|
||||
const lat = row.cells[10].data;
|
||||
const model = "data/tourisms";
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-items-end gap-10">
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
<i class='bx bx-edit'></i></button>
|
||||
|
||||
<button class="btn btn-info me-2 btn-view"
|
||||
data-long="${long}" data-lat="${lat}">
|
||||
<i class='bx bx-map'></i></button>
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
|
||||
// Tampilkan tombol View jika user punya akses view
|
||||
if (canView) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-info me-2 btn-view"
|
||||
data-long="${long}" data-lat="${lat}" data-district="${district}">
|
||||
<i class='bx bx-map'></i>
|
||||
</button>`
|
||||
}
|
||||
|
||||
// Tampilkan tombol Edit jika user punya akses update
|
||||
if (canUpdate) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
// Tampilkan tombol Delete jika user punya akses delete
|
||||
if (canDelete) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-red btn-delete"
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash'></i></button>
|
||||
</div>
|
||||
`);
|
||||
},
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>`
|
||||
}
|
||||
|
||||
actionButtons += '</div>';
|
||||
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
@@ -74,24 +105,117 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
table.init();
|
||||
|
||||
// Event listener untuk tombol "View" yang memunculkan modal
|
||||
// document.addEventListener("click", function (e) {
|
||||
// if (e.target && e.target.classList.contains("btn-view")) {
|
||||
// const long = e.target.getAttribute("data-long");
|
||||
// const lat = e.target.getAttribute("data-lat");
|
||||
|
||||
// // Menyiapkan URL iframe dengan koordinat yang didapatkan
|
||||
// const iframeSrc = `https://www.google.com/maps?q=${lat},${long}&hl=es;z=14&output=embed`;
|
||||
|
||||
// // Menemukan modal dan iframe di dalam modal
|
||||
// const modal = document.querySelector(".modalGMaps");
|
||||
// const iframe = modal.querySelector("iframe");
|
||||
|
||||
// // Set src iframe untuk menampilkan peta dengan koordinat yang relevan
|
||||
// iframe.src = iframeSrc;
|
||||
|
||||
// // Menampilkan modal
|
||||
// var modalInstance = new bootstrap.Modal(modal);
|
||||
// modalInstance.show();
|
||||
// }
|
||||
// });
|
||||
|
||||
let map;
|
||||
let geoLayer;
|
||||
// Event listener untuk tombol "View" yang memunculkan modal dengan Leaflet
|
||||
document.addEventListener("click", function (e) {
|
||||
if (e.target && e.target.classList.contains("btn-view")) {
|
||||
const long = e.target.getAttribute("data-long");
|
||||
const lat = e.target.getAttribute("data-lat");
|
||||
const long = parseFloat(e.target.getAttribute("data-long"));
|
||||
const lat = parseFloat(e.target.getAttribute("data-lat"));
|
||||
const district = e.target.getAttribute("data-district");
|
||||
|
||||
// Menyiapkan URL iframe dengan koordinat yang didapatkan
|
||||
const iframeSrc = `https://www.google.com/maps?q=${lat},${long}&hl=es;z=14&output=embed`;
|
||||
|
||||
// Menemukan modal dan iframe di dalam modal
|
||||
const modal = document.querySelector(".modalGMaps");
|
||||
const iframe = modal.querySelector("iframe");
|
||||
|
||||
// Set src iframe untuk menampilkan peta dengan koordinat yang relevan
|
||||
iframe.src = iframeSrc;
|
||||
|
||||
// Menampilkan modal
|
||||
var modalInstance = new bootstrap.Modal(modal);
|
||||
modalInstance.show();
|
||||
|
||||
setTimeout(() => {
|
||||
if (!map) {
|
||||
map = L.map("map").setView([lat, long], 14);
|
||||
|
||||
// Tambahkan tile layer (peta dasar)
|
||||
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
} else {
|
||||
map.setView([lat, long], 14);
|
||||
}
|
||||
|
||||
if (geoLayer) {
|
||||
map.removeLayer(geoLayer);
|
||||
}
|
||||
|
||||
// Tambahkan marker untuk lokasi
|
||||
L.marker([lat, long]).addTo(map)
|
||||
.bindPopup(`<b>${district}</b><br>Lat: ${lat}, Long: ${long}`)
|
||||
.openPopup();
|
||||
|
||||
// Tambahkan GeoJSON ke dalam peta
|
||||
fetch(`/storage/maps/tourisms/${district.toUpperCase()}.json`)
|
||||
.then((res) => res.json())
|
||||
.then((geojson) => {
|
||||
let colorMapping = {
|
||||
BJ: "rgb(235, 30, 30)",
|
||||
BA: "rgb(151, 219, 242)",
|
||||
CA: "rgb(70, 70, 165)",
|
||||
"P-2": "rgb(230, 255, 75)",
|
||||
HL: "rgb(50, 95, 40)",
|
||||
HPT: "rgb(75, 155, 55)",
|
||||
HP: "rgb(125, 180, 55)",
|
||||
W: "rgb(255, 165, 255)",
|
||||
PTL: "rgb(0, 255, 205)",
|
||||
"IK-2": "rgb(130, 185, 210)",
|
||||
"P-3": "rgb(175, 175, 55)",
|
||||
PS: "rgb(5, 215, 215)",
|
||||
PD: "rgb(235, 155, 60)",
|
||||
PK: "rgb(245, 155, 30)",
|
||||
HK: "rgb(155, 0, 255)",
|
||||
KPI: "rgb(105, 0, 0)",
|
||||
MBT: "rgb(95, 115, 145)",
|
||||
"P-4": "rgb(185, 235, 185)",
|
||||
TB: "rgb(70, 150, 255)",
|
||||
"P-1": "rgb(200, 245, 70)",
|
||||
TR: "rgb(215, 55, 0)",
|
||||
THR: "rgb(185, 165, 255)",
|
||||
TWA: "rgb(210, 190, 255)",
|
||||
};
|
||||
var geoLayer = L.geoJSON(geojson, {
|
||||
style: function (feature) {
|
||||
let htmlString = feature.properties.description.toString();
|
||||
let match = htmlString.match(
|
||||
/<td>Kode Zona<\/td>\s*<td>(.*?)<\/td>/
|
||||
);
|
||||
|
||||
let color_code = match[1];
|
||||
return {
|
||||
color: colorMapping[color_code],
|
||||
fillColor: colorMapping[color_code] || "#cccccc",
|
||||
fillOpacity: 0.6,
|
||||
weight: 1.5,
|
||||
};
|
||||
},
|
||||
onEachFeature: function(feature, layer) {
|
||||
if (feature.properties && feature.properties.name) {
|
||||
layer.bindPopup(feature.properties.name);
|
||||
}
|
||||
},
|
||||
}).addTo(map);
|
||||
map.fitBounds(geoLayer.getBounds());
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error loading GeoJSON:", error);
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,11 @@ import "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../../global-config.js";
|
||||
import GeneralTable from "../../table-generator.js";
|
||||
|
||||
// Ambil hak akses dari data-attribute
|
||||
const tableElement = document.getElementById("umkm-data-table");
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
|
||||
const dataUMKMColumns = [
|
||||
"No",
|
||||
"Nama Usaha",
|
||||
@@ -29,17 +34,35 @@ const dataUMKMColumns = [
|
||||
formatter: function(cell, row) {
|
||||
const id = row.cells[19].data;
|
||||
const model = "data/umkm";
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-items-end gap-10">
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
|
||||
// Tampilkan tombol Edit jika user punya akses update
|
||||
if (canUpdate) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
<i class='bx bx-edit' ></i></button>
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
// Tampilkan tombol Delete jika user punya akses delete
|
||||
if (canDelete) {
|
||||
hasPrivilege = true;
|
||||
actionButtons += `
|
||||
<button class="btn btn-red btn-delete"
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash' ></i></button>
|
||||
</div>
|
||||
`);
|
||||
data-id="${id}">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>`;
|
||||
}
|
||||
|
||||
actionButtons += '</div>';
|
||||
|
||||
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -9,6 +9,12 @@ class UsersTable {
|
||||
}
|
||||
|
||||
initTableUsers() {
|
||||
let tableContainer = document.getElementById(
|
||||
"table-users"
|
||||
);
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
@@ -20,14 +26,18 @@ class UsersTable {
|
||||
"Roles",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
formatter: (cell) =>{
|
||||
if (!canUpdate) {
|
||||
return gridjs.html(`<span class="text-muted">No Privilege</span>`);
|
||||
}
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-content-center">
|
||||
<a href="/master/users/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
</div>
|
||||
`),
|
||||
`);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
@@ -44,7 +54,6 @@ class UsersTable {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/users`,
|
||||
|
||||
@@ -28,35 +28,38 @@ class Menus {
|
||||
initTableMenus() {
|
||||
let tableContainer = document.getElementById("table-menus");
|
||||
|
||||
// if (this.table) {
|
||||
// // If table exists, update its data instead of recreating
|
||||
// this.table
|
||||
// .updateConfig({
|
||||
// server: {
|
||||
// url: `${GlobalConfig.apiHost}/api/menus`,
|
||||
// credentials: "include",
|
||||
// headers: {
|
||||
// Authorization: `Bearer ${document
|
||||
// .querySelector('meta[name="api-token"]')
|
||||
// .getAttribute("content")}`,
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// then: (data) =>
|
||||
// data.data.map((item) => [
|
||||
// item.id,
|
||||
// item.name,
|
||||
// item.url,
|
||||
// item.icon,
|
||||
// item.parent_id,
|
||||
// item.sort_order,
|
||||
// item.id,
|
||||
// ]),
|
||||
// total: (data) => data.total,
|
||||
// },
|
||||
// })
|
||||
// .forceRender();
|
||||
// return;
|
||||
// }
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
if (this.table) {
|
||||
// If table exists, update its data instead of recreating
|
||||
this.table
|
||||
.updateConfig({
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/menus`,
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
.getAttribute("content")}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
then: (data) =>
|
||||
data.data.map((item) => [
|
||||
item.id,
|
||||
item.name,
|
||||
item.url,
|
||||
item.icon,
|
||||
item.parent_id,
|
||||
item.sort_order,
|
||||
item.id,
|
||||
]),
|
||||
total: (data) => data.total,
|
||||
},
|
||||
})
|
||||
.forceRender();
|
||||
return;
|
||||
}
|
||||
|
||||
this.table = new Grid({
|
||||
columns: [
|
||||
@@ -68,18 +71,33 @@ class Menus {
|
||||
"Sort Order",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
||||
<a href="/menus/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<button data-id="${cell}"
|
||||
class="btn btn-red btn-sm btn-delete-menu d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash' ></i>
|
||||
</button>
|
||||
</div>
|
||||
`),
|
||||
formatter: (cell) => {
|
||||
let buttons = `<div class="d-flex justify-content-center align-items-center gap-2">`;
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/menus/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-red btn-sm btn-delete-menu d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
if (!canUpdate && !canDelete) {
|
||||
buttons += `<span class="text-muted">No Privilege</span>`;
|
||||
}
|
||||
|
||||
buttons += `</div>`;
|
||||
|
||||
return gridjs.html(buttons);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
@@ -96,7 +114,6 @@ class Menus {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/menus`,
|
||||
|
||||
@@ -9,6 +9,11 @@ class PbgTasks {
|
||||
}
|
||||
|
||||
initTableRequestAssignment() {
|
||||
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||
|
||||
// Pastikan kontainer kosong sebelum merender ulang Grid.js
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
@@ -24,19 +29,29 @@ class PbgTasks {
|
||||
{
|
||||
name: "Action",
|
||||
formatter: function (cell) {
|
||||
let tableContainer = document.getElementById("table-pbg-tasks");
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
|
||||
if (!canUpdate) {
|
||||
return gridjs.html(`
|
||||
<span class="text-muted">No Privilege</span>
|
||||
`);
|
||||
}
|
||||
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-content-center align-items-center gap-2">
|
||||
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">Detail</a
|
||||
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
Detail
|
||||
</a>
|
||||
</div>
|
||||
`);
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
search: {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
pagination: {
|
||||
limit: 15,
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
import { Grid } from "gridjs/dist/gridjs.umd.js";
|
||||
import "gridjs/dist/gridjs.umd.js";
|
||||
import gridjs from "gridjs/dist/gridjs.umd.js";
|
||||
import GlobalConfig from "../global-config";
|
||||
|
||||
class PbgTaskAssignments {
|
||||
init() {
|
||||
this.initTablePbgTaskAssignments();
|
||||
}
|
||||
|
||||
initTablePbgTaskAssignments() {
|
||||
let tableContainer = document.getElementById(
|
||||
"table-pbg-task-assignments"
|
||||
);
|
||||
|
||||
let uuid = document.getElementById("uuid").value;
|
||||
|
||||
new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
"Nama",
|
||||
"Email",
|
||||
"Nomor Telepon",
|
||||
"Keahlian",
|
||||
"Status",
|
||||
],
|
||||
search: {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
pagination: {
|
||||
limit: 15,
|
||||
server: {
|
||||
url: (prev, page) =>
|
||||
`${prev}${prev.includes("?") ? "&" : "?"}page=${
|
||||
page + 1
|
||||
}`,
|
||||
},
|
||||
},
|
||||
sort: true,
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/task-assignments/${uuid}`,
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
.getAttribute("content")}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
then: (data) =>
|
||||
data.data.map((item) => [
|
||||
item.id,
|
||||
item.name,
|
||||
item.email,
|
||||
item.phone_number,
|
||||
item.expertise,
|
||||
item.status_name,
|
||||
]),
|
||||
total: (data) => data.meta.total,
|
||||
},
|
||||
}).render(tableContainer);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function (e) {
|
||||
new PbgTaskAssignments().init();
|
||||
});
|
||||
@@ -27,6 +27,10 @@ class Roles {
|
||||
|
||||
initTableRoles() {
|
||||
let tableContainer = document.getElementById("table-roles");
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
let canDelete = tableContainer.getAttribute("data-destroyer") === "1";
|
||||
// Create a new Grid.js instance only if it doesn't exist
|
||||
this.table = new gridjs.Grid({
|
||||
columns: [
|
||||
@@ -34,22 +38,38 @@ class Roles {
|
||||
"Name",
|
||||
"Description",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
<div class="d-flex justify-content-center gap-2">
|
||||
<a href="/roles/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<a href="/roles/role-menu/${cell}" class="btn btn-primary btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
Role Menu
|
||||
</a>
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-role d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash' ></i>
|
||||
</button>
|
||||
</div>
|
||||
`),
|
||||
name: "Action",
|
||||
formatter: (cell) => {
|
||||
let buttons = `<div class="d-flex justify-content-center gap-2">`;
|
||||
|
||||
if (canUpdate) {
|
||||
buttons += `
|
||||
<a href="/roles/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
<a href="/roles/role-menu/${cell}" class="btn btn-primary btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
Role Menu
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
if (canDelete) {
|
||||
buttons += `
|
||||
<button data-id="${cell}" class="btn btn-sm btn-red btn-delete-role d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bxs-trash'></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
if (!canUpdate && !canDelete) {
|
||||
buttons += `<span class="text-muted">No Privilege</span>`;
|
||||
}
|
||||
|
||||
buttons += `</div>`;
|
||||
|
||||
return gridjs.html(buttons);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
limit: 50,
|
||||
@@ -65,7 +85,6 @@ class Roles {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
server: {
|
||||
url: `${GlobalConfig.apiHost}/api/roles`,
|
||||
|
||||
@@ -12,21 +12,23 @@ class GeneralTable {
|
||||
}
|
||||
|
||||
init() {
|
||||
const tableContainer = document.getElementById(this.tableId);
|
||||
|
||||
// Kosongkan container sebelum render ulang
|
||||
tableContainer.innerHTML = "";
|
||||
|
||||
const table = new Grid({
|
||||
columns: this.columns,
|
||||
search: this.options.search || {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
},
|
||||
debounceTimeout: 1000,
|
||||
},
|
||||
pagination: this.options.pagination || {
|
||||
limit: 15,
|
||||
server: {
|
||||
url: (prev, page) =>
|
||||
`${prev}${prev.includes("?") ? "&" : "?"}page=${
|
||||
page + 1
|
||||
}`,
|
||||
`${prev}${prev.includes("?") ? "&" : "?"}page=${page + 1}`,
|
||||
},
|
||||
},
|
||||
sort: this.options.sort || true,
|
||||
@@ -42,8 +44,8 @@ class GeneralTable {
|
||||
total: (data) => data.meta.total,
|
||||
},
|
||||
});
|
||||
|
||||
table.render(document.getElementById(this.tableId));
|
||||
|
||||
table.render(tableContainer);
|
||||
this.handleActions();
|
||||
}
|
||||
|
||||
@@ -51,29 +53,22 @@ class GeneralTable {
|
||||
processData(data) {
|
||||
return data.data.map((item) => {
|
||||
return this.columns.map((column) => {
|
||||
return item[column] || "";
|
||||
return item[column] || '';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
handleActions() {
|
||||
document.addEventListener("click", (event) => {
|
||||
if (event.target && event.target.classList.contains("btn-edit")) {
|
||||
if (event.target && event.target.classList.contains('btn-edit')) {
|
||||
this.handleEdit(event);
|
||||
} else if (
|
||||
event.target &&
|
||||
event.target.classList.contains("btn-delete")
|
||||
) {
|
||||
}
|
||||
else if (event.target && event.target.classList.contains('btn-delete')) {
|
||||
this.handleDelete(event);
|
||||
} else if (
|
||||
event.target &&
|
||||
event.target.classList.contains("btn-create")
|
||||
) {
|
||||
}
|
||||
else if (event.target && event.target.classList.contains('btn-create')) {
|
||||
this.handleCreate(event);
|
||||
} else if (
|
||||
event.target &&
|
||||
event.target.classList.contains("btn-bulk-create")
|
||||
) {
|
||||
} else if (event.target && event.target.classList.contains('btn-bulk-create')) {
|
||||
this.handleBulkCreate(event);
|
||||
}
|
||||
});
|
||||
@@ -82,28 +77,28 @@ class GeneralTable {
|
||||
// Fungsi untuk menangani create
|
||||
handleCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
const model = event.target.getAttribute('data-model'); // Mengambil model dari data-model
|
||||
window.location.href = `${this.baseUrl}/${model}/create`;
|
||||
}
|
||||
|
||||
handleBulkCreate(event) {
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
const model = event.target.getAttribute("data-model");
|
||||
const model = event.target.getAttribute('data-model');
|
||||
window.location.href = `${this.baseUrl}/${model}/bulk-create`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani edit
|
||||
handleEdit(event) {
|
||||
const id = event.target.getAttribute("data-id");
|
||||
const model = event.target.getAttribute("data-model"); // Mengambil model dari data-model
|
||||
console.log("Editing record with ID:", id);
|
||||
const id = event.target.getAttribute('data-id');
|
||||
const model = event.target.getAttribute('data-model'); // Mengambil model dari data-model
|
||||
console.log('Editing record with ID:', id);
|
||||
// Menggunakan model dan ID untuk membangun URL dinamis
|
||||
window.location.href = `${this.baseUrl}/${model}/${id}/edit`;
|
||||
}
|
||||
|
||||
// Fungsi untuk menangani delete
|
||||
handleDelete(event) {
|
||||
const id = event.target.getAttribute("data-id");
|
||||
const id = event.target.getAttribute('data-id');
|
||||
console.log(id);
|
||||
// if (confirm("Are you sure you want to delete this item?")) {
|
||||
// this.deleteRecord(id);
|
||||
@@ -115,7 +110,7 @@ class GeneralTable {
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#d33",
|
||||
cancelButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
this.deleteRecord(id);
|
||||
@@ -124,8 +119,8 @@ class GeneralTable {
|
||||
text: "Your record has been deleted.",
|
||||
icon: "success",
|
||||
showConfirmButton: false, // Menghilangkan tombol OK
|
||||
timer: 2000, // Menutup otomatis dalam 2 detik (opsional)
|
||||
});
|
||||
timer: 2000 // Menutup otomatis dalam 2 detik (opsional)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -133,9 +128,8 @@ class GeneralTable {
|
||||
async deleteRecord(id) {
|
||||
try {
|
||||
console.log(id);
|
||||
const response = await fetch(`${this.apiUrl}/${id}`, {
|
||||
// Menambahkan model dalam URL
|
||||
method: "DELETE",
|
||||
const response = await fetch(`${this.apiUrl}/${id}`, { // Menambahkan model dalam URL
|
||||
method: 'DELETE',
|
||||
headers: this.options.headers || {
|
||||
Authorization: `Bearer ${document
|
||||
.querySelector('meta[name="api-token"]')
|
||||
@@ -147,14 +141,10 @@ class GeneralTable {
|
||||
location.reload();
|
||||
} else {
|
||||
const data = await response.json();
|
||||
showErrorAlert(
|
||||
`Failed to delete record: ${
|
||||
data.message || "Unknown error"
|
||||
}`
|
||||
);
|
||||
showErrorAlert(`Failed to delete record: ${data.message || "Unknown error"}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error deleting data:", error);
|
||||
console.error('Error deleting data:', error);
|
||||
showErrorAlert("Error deleting data. Please try again.");
|
||||
}
|
||||
}
|
||||
@@ -163,7 +153,7 @@ class GeneralTable {
|
||||
// Fungsi untuk menampilkan alert
|
||||
function showErrorAlert(message) {
|
||||
const alertContainer = document.getElementById("alert-container");
|
||||
|
||||
|
||||
alertContainer.innerHTML = `
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
${message}
|
||||
@@ -172,4 +162,4 @@ function showErrorAlert(message) {
|
||||
`;
|
||||
}
|
||||
|
||||
export default GeneralTable;
|
||||
export default GeneralTable;
|
||||
@@ -1,234 +0,0 @@
|
||||
//
|
||||
// inside_system.scss
|
||||
//
|
||||
|
||||
.square {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.dia-top-left-bottom-right:after {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(
|
||||
to top right,
|
||||
transparent calc(50% - 2px),
|
||||
black,
|
||||
transparent calc(50% + 2px)
|
||||
);
|
||||
}
|
||||
|
||||
.dia-top-right-bottom-left:after {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(
|
||||
to top left,
|
||||
transparent calc(50% - 2px),
|
||||
black,
|
||||
transparent calc(50% + 2px)
|
||||
);
|
||||
}
|
||||
|
||||
.lack-of-potential-wrapper {
|
||||
background-image: url("/public/images/bg-dashboard.jpg");
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
max-width: 100vw;
|
||||
}
|
||||
|
||||
.lack-of-potential-wrapper::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
// #lack-of-potential-fixed-container {
|
||||
// min-width: 1110px;
|
||||
// max-width: unset; /* Allow it to grow if needed */
|
||||
// }
|
||||
|
||||
// @media (max-width: 768px) {
|
||||
// #lack-of-potential-fixed-container {
|
||||
// transform: scale(0.8); /* Adjust the scale as needed */
|
||||
// }
|
||||
// }
|
||||
|
||||
// line degrees
|
||||
.line {
|
||||
background-color: black;
|
||||
position: absolute;
|
||||
height: 3px;
|
||||
}
|
||||
.home-to-non-usaha {
|
||||
width: 100px;
|
||||
top: 13%;
|
||||
left: 38%;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.restoran-to-bapenda {
|
||||
width: 110px;
|
||||
top: 14%;
|
||||
left: 60%;
|
||||
transform: rotate(40deg);
|
||||
}
|
||||
.pbb-to-bapenda {
|
||||
width: 80px;
|
||||
top: 21%;
|
||||
left: 80%;
|
||||
}
|
||||
.reklame-to-bapenda {
|
||||
width: 120px;
|
||||
left: 75%;
|
||||
top: 30%;
|
||||
transform: rotateZ(142deg);
|
||||
}
|
||||
.non-usaha-to-bapenda {
|
||||
width: 116px;
|
||||
left: 18%;
|
||||
top: 33%;
|
||||
transform: rotateZ(124deg);
|
||||
}
|
||||
.non-usaha-to-pdam {
|
||||
width: 100px;
|
||||
left: 38%;
|
||||
top: 34%;
|
||||
transform: rotateZ(90deg);
|
||||
}
|
||||
.non-usaha-to-kecamatan {
|
||||
width: 140px;
|
||||
left: 55%;
|
||||
top: 33%;
|
||||
transform: rotateZ(237deg);
|
||||
}
|
||||
.bapenda-to-usaha {
|
||||
width: 114px;
|
||||
left: 18%;
|
||||
top: 49%;
|
||||
transform: rotateZ(56deg);
|
||||
}
|
||||
.pdam-to-usaha {
|
||||
width: 88px;
|
||||
left: 39%;
|
||||
top: 49%;
|
||||
transform: rotateZ(90deg);
|
||||
}
|
||||
.kecamatan-to-usaha {
|
||||
width: 118px;
|
||||
left: 56%;
|
||||
top: 50%;
|
||||
transform: rotateZ(117deg);
|
||||
}
|
||||
.usaha-to-villa {
|
||||
width: 100px;
|
||||
left: 10%;
|
||||
top: 63%;
|
||||
transform: rotateZ(143deg);
|
||||
}
|
||||
.usaha-to-pabrik {
|
||||
width: 150px;
|
||||
left: 15%;
|
||||
top: 70%;
|
||||
transform: rotateZ(143deg);
|
||||
}
|
||||
.usaha-to-pariwisata {
|
||||
width: 150px;
|
||||
left: 43%;
|
||||
top: 70%;
|
||||
transform: rotateZ(38deg);
|
||||
}
|
||||
.usaha-to-protocol {
|
||||
width: 106px;
|
||||
left: 36%;
|
||||
top: 71%;
|
||||
transform: rotateZ(86deg);
|
||||
}
|
||||
.pariwisata-to-disbudpar {
|
||||
width: 86px;
|
||||
left: 54%;
|
||||
top: 83%;
|
||||
transform: rotateZ(150deg);
|
||||
}
|
||||
.non-usaha-to-wasdal {
|
||||
width: 300px;
|
||||
left: -32%;
|
||||
top: 34%;
|
||||
transform: rotateZ(226deg);
|
||||
}
|
||||
.usaha-to-wasdal {
|
||||
width: 300px;
|
||||
left: -34%;
|
||||
top: 50%;
|
||||
transform: rotateZ(129deg);
|
||||
}
|
||||
.wasdal-to-upt {
|
||||
width: 155px;
|
||||
left: 3%;
|
||||
top: -67%;
|
||||
transform: rotateZ(127deg);
|
||||
}
|
||||
.wasdal-to-satpol {
|
||||
width: 155px;
|
||||
left: 19%;
|
||||
top: -52%;
|
||||
transform: rotateZ(76deg);
|
||||
}
|
||||
.wasdal-to-kejari {
|
||||
width: 182px;
|
||||
left: 25%;
|
||||
top: -55%;
|
||||
transform: rotateZ(51deg);
|
||||
}
|
||||
.wasdal-to-tni {
|
||||
width: 260px;
|
||||
left: 29%;
|
||||
top: -62%;
|
||||
transform: rotateZ(30deg);
|
||||
}
|
||||
.wasdal-to-potential {
|
||||
width: 50px;
|
||||
left: 28%;
|
||||
top: 41%;
|
||||
}
|
||||
.potential-to-tata-ruang {
|
||||
width: 50px;
|
||||
left: 72%;
|
||||
top: 41%;
|
||||
}
|
||||
.tata-ruang-to-non-usaha {
|
||||
width: 220px;
|
||||
left: 0%;
|
||||
top: 30%;
|
||||
transform: rotateZ(144deg);
|
||||
}
|
||||
.tata-ruang-to-usaha {
|
||||
width: 280px;
|
||||
left: 0%;
|
||||
top: 52%;
|
||||
transform: rotateZ(224deg);
|
||||
}
|
||||
.tata-ruang-to-peta {
|
||||
width: 122px;
|
||||
left: 8%;
|
||||
top: 41%;
|
||||
}
|
||||
.peta-to-tapak {
|
||||
width: 30px;
|
||||
left: 47%;
|
||||
top: 41%;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
//
|
||||
// outside_system.scss
|
||||
//
|
||||
.square {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.dia-top-left-bottom-right:after {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(
|
||||
to top right,
|
||||
transparent calc(50% - 2px),
|
||||
black,
|
||||
transparent calc(50% + 2px)
|
||||
);
|
||||
}
|
||||
|
||||
.dia-top-right-bottom-left:after {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: linear-gradient(
|
||||
to top left,
|
||||
transparent calc(50% - 2px),
|
||||
black,
|
||||
transparent calc(50% + 2px)
|
||||
);
|
||||
}
|
||||
|
||||
.outside-system-wrapper {
|
||||
background-image: url("/public/images/bg-dashboard.jpg");
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
max-width: 90vw;
|
||||
}
|
||||
|
||||
.outside-system-wrapper::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
//
|
||||
// _gridjs.scss
|
||||
//
|
||||
//
|
||||
|
||||
.gridjs-container {
|
||||
color: var(--#{$prefix}body-color);
|
||||
@@ -13,6 +13,7 @@
|
||||
border: 1px solid var(--#{$prefix}border-color);
|
||||
border-radius: 0px;
|
||||
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
@@ -23,12 +24,11 @@
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar:horizontal {
|
||||
height: 15px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
// background-color: rgba(var(--#{$prefix}dark-rgb), 0.075);
|
||||
background-color: $primary;
|
||||
background-color: rgba(var(--#{$prefix}dark-rgb), .075);
|
||||
border-radius: 10px;
|
||||
padding: 5px;
|
||||
border: none;
|
||||
@@ -69,13 +69,15 @@ th {
|
||||
&.gridjs-th {
|
||||
border-top: 0;
|
||||
color: var(--#{$prefix}body-color);
|
||||
background-color: rgba(var(--#{$prefix}light-rgb), 0.75);
|
||||
background-color: rgba(var(--#{$prefix}light-rgb), .75);
|
||||
|
||||
}
|
||||
|
||||
&.gridjs-th-sort {
|
||||
|
||||
&:focus,
|
||||
&:hover {
|
||||
background-color: rgba(var(--#{$prefix}light-rgb), 0.85);
|
||||
background-color: rgba(var(--#{$prefix}light-rgb), .85);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,6 +99,7 @@ th {
|
||||
}
|
||||
|
||||
.gridjs-pagination {
|
||||
|
||||
.gridjs-pages button {
|
||||
background-color: transparent;
|
||||
color: var(--#{$prefix}link-color);
|
||||
@@ -163,8 +166,7 @@ input.gridjs-input {
|
||||
background-color: $input-bg;
|
||||
color: $input-color;
|
||||
line-height: $input-line-height;
|
||||
padding: $input-padding-y $input-padding-x $input-padding-y $input-padding-x *
|
||||
2.5;
|
||||
padding: $input-padding-y $input-padding-x $input-padding-y $input-padding-x * 2.5;
|
||||
border-radius: $input-border-radius;
|
||||
@include font-size($input-font-size);
|
||||
|
||||
@@ -201,26 +203,30 @@ th.gridjs-th-sort .gridjs-th-content {
|
||||
}
|
||||
|
||||
button {
|
||||
|
||||
&.gridjs-sort-asc,
|
||||
&.gridjs-sort-desc {
|
||||
background-size: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// gridjs selection
|
||||
.gridjs-tr-selected {
|
||||
td {
|
||||
background-color: $table-active-bg;
|
||||
}
|
||||
|
||||
.gridjs-td .gridjs-checkbox[type="checkbox"] {
|
||||
.gridjs-td .gridjs-checkbox[type=checkbox] {
|
||||
background-color: $form-check-input-checked-bg-color;
|
||||
border-color: $form-check-input-checked-border-color;
|
||||
|
||||
@if $enable-gradients {
|
||||
background-image: escape-svg($form-check-input-checked-bg-image),
|
||||
var(--#{$prefix}gradient);
|
||||
} @else {
|
||||
var(--#{$prefix}gradient);
|
||||
}
|
||||
|
||||
@else {
|
||||
background-image: escape-svg($form-check-input-checked-bg-image);
|
||||
}
|
||||
}
|
||||
@@ -247,6 +253,7 @@ button {
|
||||
}
|
||||
|
||||
.gridjs-border-none {
|
||||
|
||||
td.gridjs-td,
|
||||
th.gridjs-th {
|
||||
border-right-width: 0;
|
||||
@@ -260,10 +267,11 @@ button {
|
||||
|
||||
[data-bs-theme="dark"] {
|
||||
button {
|
||||
|
||||
&.gridjs-sort-neutral,
|
||||
&.gridjs-sort-asc,
|
||||
&.gridjs-sort-desc {
|
||||
filter: $btn-close-white-filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,7 @@
|
||||
@import "components/widgets";
|
||||
@import "components/circle";
|
||||
@import "components/custom_circle";
|
||||
@import "dashboards/potentials/inside_system";
|
||||
@import "dashboards/potentials/outside_system";
|
||||
@import "dashboards/lack-of-potential";
|
||||
|
||||
// Plugin
|
||||
@import "plugins/simplebar";
|
||||
|
||||
@@ -2,6 +2,79 @@
|
||||
|
||||
@section('css')
|
||||
@vite(['node_modules/gridjs/dist/theme/mermaid.min.css'])
|
||||
<style>
|
||||
/* Ensure the Grid.js container allows full scrolling */
|
||||
#table-bigdata-resumes {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden; /* Prevent vertical scrolling */
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
height: 100%; /* Adjust height if necessary */
|
||||
}
|
||||
|
||||
/* Ensure Grid.js wrapper is scrollable */
|
||||
.gridjs-wrapper {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Make the entire scrollbar much bigger */
|
||||
.gridjs-wrapper::-webkit-scrollbar {
|
||||
height: 40px; /* Increase scrollbar height */
|
||||
}
|
||||
|
||||
/* Scrollbar track (background) */
|
||||
.gridjs-wrapper::-webkit-scrollbar-track {
|
||||
background: #ddd;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/* Scrollbar thumb (draggable part) */
|
||||
.gridjs-wrapper::-webkit-scrollbar-thumb {
|
||||
background: #007bff;
|
||||
border-radius: 20px;
|
||||
width: 40px; /* Wider scrollbar thumb */
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
/* Scrollbar thumb hover effect */
|
||||
.gridjs-wrapper::-webkit-scrollbar-thumb:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
/* Bigger Scrollbar Buttons */
|
||||
.gridjs-wrapper::-webkit-scrollbar-button {
|
||||
background: #007bff;
|
||||
height: 40px; /* Force bigger button height */
|
||||
width: 40px; /* Force bigger button width */
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* Left Scroll Button */
|
||||
.gridjs-wrapper::-webkit-scrollbar-button:horizontal:decrement {
|
||||
display: block;
|
||||
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M15 18l-6-6 6-6"/></svg>') no-repeat center;
|
||||
background-size: 30px;
|
||||
width: 40px; /* Ensure button size */
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* Right Scroll Button */
|
||||
.gridjs-wrapper::-webkit-scrollbar-button:horizontal:increment {
|
||||
display: block;
|
||||
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 18l6-6-6-6"/></svg>') no-repeat center;
|
||||
background-size: 30px;
|
||||
width: 40px; /* Ensure button size */
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* Scrollbar button hover effect */
|
||||
.gridjs-wrapper::-webkit-scrollbar-button:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@@ -13,6 +86,10 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100">
|
||||
<div class="card-header d-flex align-items-center">
|
||||
<input type="text" class="form-control me-2 w-auto" />
|
||||
<button id="search-btn" class="btn btn-md btn-info text-white">Cari</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="table-bigdata-resumes"></div>
|
||||
</div>
|
||||
|
||||
@@ -15,9 +15,14 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('business-industries.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('business-industries.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-business-industries"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-business-industries"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,10 +15,15 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('customers.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto me-3">Create</a>
|
||||
<a href="{{ route('customers.upload')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('customers.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto me-3">Create</a>
|
||||
<a href="{{ route('customers.upload')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Upload</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-customers"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-customers"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Dashboards'])
|
||||
|
||||
@section('css')
|
||||
@vite(['resources/scss/dashboards/potentials/_inside_system.scss'])
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@include('layouts.partials.page-title', ['title' => 'Dashboards', 'subtitle' => 'Dalam Sistem'])
|
||||
|
||||
<div class="lack-of-potential-wrapper">
|
||||
<div class="row" id="lack-of-potential-wrapper">
|
||||
<div class="d-flex justify-content-between align-items-center mt-3 ms-2">
|
||||
<h2 class="text-danger m-0">
|
||||
ANALISA BIG DATA MELALUI APLIKASI <br> SIBEDAS PBG DALAM SISTEM
|
||||
</h2>
|
||||
<div class="text-black text-end d-flex flex-column align-items-end me-3">
|
||||
<input type="text" class="form-control mt-2" style="max-width: 125px;" id="datepicker-lack-of-potential" placeholder="Filter Date" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div id="lack-of-potential-fixed-container" class="" style="width:1400px;height:770px;position:relative;margin:auto;z-index:1;">
|
||||
<div style="position: absolute; top: 200px; left: 50px;">
|
||||
<x-custom-circle title="Restoran" size="small" style="background-color: #0e4753;" visible_data="true" data_id="restoran-count" data_count="0" />
|
||||
<div class="square dia-top-left-bottom-right" style="top:30px;left:50px;width:150px;height:120px;"></div>
|
||||
<x-custom-circle title="PBB Bangunan" visible_data="true" data_id="pbb-bangunan-count" data_count="0" size="small" style="background-color: #0e4753;" />
|
||||
<div class="square" style="width:150px;height:2px;background-color:black;left:50px;top:150px;"></div>
|
||||
<x-custom-circle title="Reklame" visible_data="true" data_id="reklame-count" data_count="0" size="small" style="background-color: #0e4753;" />
|
||||
<div class="square dia-top-right-bottom-left" style="top:140px;left:50px;width:150px;height:120px;"></div>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 300px; left: 200px;">
|
||||
<div class="square dia-top-right-bottom-left" style="top:-100px;left:30px;width:150px;height:120px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:-100px;left:120px;width:120px;height:120px;"></div>
|
||||
<x-custom-circle title="BAPENDA" size="small" style="float:left;background-color: #234f6c;" />
|
||||
<x-custom-circle title="PDAM" visible_data="true" data_id="pdam-count" data_count="0" visible_data_type="true" data_type="Pelanggan" size="small" style="float:left;background-color: #234f6c;" />
|
||||
<x-custom-circle title="KECAMATAN" size="small" style="float:left;background-color: #234f6c;" />
|
||||
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 0px; left: 270px;">
|
||||
<div class="square" style="width:5px;height:600px;background-color:black;left:70px;top:50px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:350px;left:-50px;width:120px;height:120px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:350px;left:70px;width:120px;height:120px;"></div>
|
||||
<x-custom-circle title="Rumah Tinggal" size="small" style="background-color: #234f6c;margin:auto;" />
|
||||
<x-custom-circle title="Non Usaha" size="large" style="background-color: #3a968b;margin-top:20px;" />
|
||||
<x-custom-circle title="USAHA" size="large" style="background-color: #627c8b;margin-top:150px;" />
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 650px; left: 110px;">
|
||||
<div class="square dia-top-right-bottom-left" style="top:-110px;left:40px;width:200px;height:120px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:-110px;left:90px;width:150px;height:170px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:-110px;left:230px;width:150px;height:170px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:-110px;left:260px;width:200px;height:180px;"></div>
|
||||
<x-custom-circle title="Villa" size="small" style="float:left;background-color: #234f6c;" visible_data="true" data_id="villa-count" data_count="0" />
|
||||
<x-custom-circle title="Pabrik" size="small" style="float:left;background-color: #234f6c;" />
|
||||
<x-custom-circle title="Jalan Protocol" size="small" style="float:left;background-color: #234f6c;" />
|
||||
<x-custom-circle title="Ruko" size="small" style="float:left;background-color: #234f6c;" />
|
||||
<x-custom-circle title="Pariwisata" size="small" style="float:left;background-color: #234f6c; margin-right: 20px;" visible_data="true" data_id="pariwisata-count" data_count="0" />
|
||||
<div class="square" style="width:150px;height:2px;background-color:black;left:350px;top:50px;"></div>
|
||||
<x-custom-circle title="DISBUDPAR" size="small" style="background-color: #3a968b;" />
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 280px; left: 550px;">
|
||||
<div class="square dia-top-left-bottom-right" style="top:-110px;left:-150px;width:200px;height:180px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:70px;left:-150px;width:200px;height:130px;"></div>
|
||||
<x-custom-circle title="Tim Wasdal Gabungan" size="large" style="background-color: #da6635;float:left" />
|
||||
<div class="square" style="width:650px;height:5px;background-color:black;left:100px;top:75px;"></div>
|
||||
@component('components.circle', [
|
||||
'document_title' => 'Kekurangan Potensi',
|
||||
'document_color' => '#ff5757',
|
||||
'document_type' => '',
|
||||
'document_id' => 'chart-lack-of-potential',
|
||||
'visible_small_circle' => false,
|
||||
'style' => 'margin-left:180px;top:-20px;'
|
||||
])
|
||||
@endcomponent
|
||||
<x-custom-circle title="Tata Ruang" size="large" style="background-color: #da6635;float:left;margin-left:250px;" visible_data="true" data_id="tata-ruang-count" data_count="0" />
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 310px; left: 1150px;">
|
||||
<div class="square dia-top-left-bottom-right" style="top:90px;left:-100px;width:100px;height:100px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:-110px;left:-100px;width:100px;height:100px;"></div>
|
||||
<x-custom-circle title="Peta" visible_data_type="true" data_type="1:5000" size="small" style="background-color: #224f6d;float:left;" />
|
||||
<x-custom-circle title="Tapak Bangunan" size="small" style="background-color: #2390af;float:left;margin-left:20px;" />
|
||||
</div>
|
||||
|
||||
<x-custom-circle title="BPN" size="small" style="background-color: #2390af;position:absolute;left:1270px;top:440px;" />
|
||||
|
||||
<div style="position: absolute; top: 470px; left: 430px;">
|
||||
<div class="square dia-top-right-bottom-left" style="top:-80px;left:20px;width:150px;height:120px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:-50px;left:100px;width:100px;height:100px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:-50px;left:180px;width:100px;height:100px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:-60px;left:240px;width:120px;height:120px;"></div>
|
||||
<x-custom-circle title="UPT Wasdal" size="small" style="background-color: #0f4853;float:left;" />
|
||||
<x-custom-circle title="Satpol PP" size="small" style="background-color: #0f4853;float:left;" />
|
||||
<x-custom-circle title="KEJARI" size="small" style="background-color: #0f4853;float:left;" />
|
||||
<x-custom-circle title="TNI & POLRI" size="small" style="background-color: #0f4853;float:left;" />
|
||||
</div>
|
||||
|
||||
<x-custom-circle title="UUCK" size="small" style="background-color: #2390af;position:absolute;left:980px;top:500px;" />
|
||||
|
||||
<div style="position: absolute; top: 50px; left: 1100px;">
|
||||
<x-custom-circle title="Non Usaha" size="large" style="background-color: #3a968b;margin-top:20px;" />
|
||||
<x-custom-circle title="USAHA" size="large" style="background-color: #627c8b;margin-top:260px;" visible_data="true" data_id="tata-ruang-usaha-count" data_count="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@vite(['resources/js/dashboards/potentials/inside_system.js'])
|
||||
@endsection
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
<!-- base layout -->
|
||||
@extends('layouts.vertical', ['subtitle' => 'Dashboards'])
|
||||
<!-- style -->
|
||||
@section('css')
|
||||
@vite(['resources/scss/dashboards/potentials/_outside_system.scss'])
|
||||
@endsection
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
@include('layouts.partials.page-title', ['title' => 'Dashboards', 'subtitle' => 'Luar Sistem'])
|
||||
<div class="outside-system-wrapper" id="outside-system-wrapper">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-between align-items-center mt-3 ms-2">
|
||||
<h2 class="text-danger m-0">
|
||||
ANALISA BIG DATA MELALUI APLIKASI <br>
|
||||
SIBEDAS PBG LUAR SISTEM
|
||||
</h2>
|
||||
<div class="text-black text-end d-flex flex-column align-items-end me-3">
|
||||
<input type="text" class="form-control mt-2" style="max-width: 125px;" id="datepicker-outside-system" placeholder="Filter Date" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outside-system-fixed-container" class="" style="width:1400px;height:770px;position:relative;margin:auto;z-index:1;">
|
||||
<div style="position: absolute; top: 70px; left: 50px; width: 200px; height: 500px;">
|
||||
@component('components.circle', [
|
||||
'document_title' => 'Non Usaha',
|
||||
'document_color' => '#399787',
|
||||
'document_type' => 'Berkas',
|
||||
'document_id' => 'outside-system-non-business',
|
||||
'visible_small_circle' => true,
|
||||
'style' => 'top:10px;'
|
||||
])
|
||||
@endcomponent
|
||||
<div class="square dia-top-right-bottom-left" style="top:10px;left:180px;width:230px;height:120px;"></div>
|
||||
@component('components.circle', [
|
||||
'document_title' => 'Usaha',
|
||||
'document_color' => '#5e7c89',
|
||||
'document_type' => 'Berkas',
|
||||
'document_id' => 'outside-system-business',
|
||||
'visible_small_circle' => true,
|
||||
'style' => 'top:300px;'
|
||||
])
|
||||
@endcomponent
|
||||
<div class="square dia-top-right-bottom-left" style="top:320px;left:170px;width:200px;height:100px;"></div>
|
||||
|
||||
<div class="square dia-top-left-bottom-right" style="top:120px;left:180px;width:500px;height:120px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:410px;left:180px;width:500px;height:160px;"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 50px; left: 350px; width: 200px; height: 550px;">
|
||||
<div class="square" style="width:200px;height:2px;background-color:black;left:100px;top:70px;"></div>
|
||||
<x-custom-circle title="Keterangan Rencana Kota (KRK)" size="large" style="background-color: #306364;position: absolute;" />
|
||||
<x-custom-circle title="Keterangan Rencana Kota (KRK)" size="large" style="background-color: #38b64b;position: absolute; top: 320px;" />
|
||||
<div class="square" style="width:200px;height:2px;background-color:black;left:100px;top:390px;"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 50px; left: 600px; width: 200px; height: 650px;">
|
||||
<x-custom-circle title="Samirindu DPMPTSP" size="large" style="background-color: #0e4753;position: absolute; top: 0px;" />
|
||||
<x-custom-circle title="RAB dan Gambar" size="large" style="background-color: #f0195b;position: absolute; top: 160px;" />
|
||||
<x-custom-circle title="OSS RBA (Nasional)" size="large" style="background-color: #38b64b;position: absolute; top: 320px;" />
|
||||
<x-custom-circle title="Dokumen Lingkungan (DLH)" size="large" style="background-color: #393536;position: absolute; top: 480px;" />
|
||||
<div class="square dia-top-left-bottom-right" style="top:50px;left:120px;width:250px;height:250px;"></div>
|
||||
<div class="square dia-top-left-bottom-right" style="top:230px;left:120px;width:220px;height:100px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:320px;left:120px;width:200px;height:100px;"></div>
|
||||
<div class="square dia-top-right-bottom-left" style="top:350px;left:120px;width:250px;height:200px;"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 50px; left: 900px; width: 200px; height: 550px;">
|
||||
<x-custom-circle title="Pemohon" size="large" style="background-color: #393536;position: absolute; top: 250px;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<!-- javascripts -->
|
||||
@section('scripts')
|
||||
@vite(['resources/js/dashboards/potentials/outside_system.js'])
|
||||
@endsection
|
||||
@@ -15,9 +15,14 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('data-settings.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('data-settings.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-data-settings"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-data-settings"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,16 +16,21 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/advertisements">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/advertisements">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="reklame-data-table"></div>
|
||||
<div id="reklame-data-table"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="spatial-planning-data-table"></div>
|
||||
<div id="spatial-planning-data-table"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/tourisms">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/tourisms">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="tourisms-data-table"></div>
|
||||
<div id="tourisms-data-table"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,14 +44,15 @@
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe
|
||||
{{-- <iframe
|
||||
src=""
|
||||
width="100%"
|
||||
height="450"
|
||||
style="border:0;"
|
||||
allowfullscreen=""
|
||||
loading="lazy">
|
||||
</iframe>
|
||||
</iframe> --}}
|
||||
<div id="map" style="height: 400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/umkm">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/umkm">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/umkm">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/umkm">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="umkm-data-table"></div>
|
||||
<div id="umkm-data-table"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
foreach ($menus as $menu) {
|
||||
$collapseId = "sidebar-" . $menu->id; // Unique ID untuk Bootstrap Collapse
|
||||
$hasChildren = $menu->children->count() > 0; // Cek apakah punya anak
|
||||
$marginLeft = $depth * 5; // Set jarak margin berdasarkan level
|
||||
$marginLeft = $depth * 10; // Set jarak margin berdasarkan level
|
||||
|
||||
echo '<li class="nav-item">';
|
||||
echo '<li class="nav-item" style="margin-left: ' . $marginLeft . 'px;">';
|
||||
|
||||
// Menu utama / anak (dengan dropdown jika punya anak)
|
||||
echo '<a class="nav-link ' . ($hasChildren ? 'menu-arrow' : '') . '"
|
||||
|
||||
@@ -54,13 +54,6 @@
|
||||
.floating-icon.animate {
|
||||
animation: bounce 1s infinite;
|
||||
}
|
||||
.menu-arrow {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-link[aria-expanded="true"] .menu-arrow i {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
</style>
|
||||
|
||||
<head>
|
||||
@@ -78,9 +71,21 @@
|
||||
@include('layouts.partials/topbar')
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{{-- <div class="container-fluid">
|
||||
|
||||
@yield('content')
|
||||
<div>
|
||||
<iconify-icon icon="solar:chat-square-outline" class="fs-35 align-middle"></iconify-icon>
|
||||
</div>
|
||||
|
||||
</div> --}}
|
||||
<div class="container-fluid">
|
||||
@yield('content')
|
||||
|
||||
|
||||
{{-- <div class="floating-icon">
|
||||
|
||||
</div> --}}
|
||||
@if (!Request::is('chatbot') && !Request::is('main-chatbot'))
|
||||
<a href="{{ route('chatbot.index') }}" class="floating-icon">
|
||||
|
||||
|
||||
@@ -13,11 +13,16 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('users.create') }}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">
|
||||
Create
|
||||
</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('users.create') }}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">
|
||||
Create
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-users"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-users"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,10 +16,15 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('menus.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('menus.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="table-menus"></div>
|
||||
<div id="table-menus"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,9 +13,14 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end">
|
||||
<a href="{{ route('pbg-task.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('pbg-task.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-pbg-tasks"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-pbg-tasks"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@extends('layouts.vertical', ['subtitle' => 'Detail'])
|
||||
|
||||
@section('css')
|
||||
@vite(['node_modules/gridjs/dist/theme/mermaid.min.css'])
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@@ -253,8 +252,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="pbgTaskAssignments">
|
||||
<input type="hidden" id="uuid" value="{{ $data->uuid }}" />
|
||||
<div id="table-pbg-task-assignments"></div>
|
||||
@if ($data->taskAssignments && $data->taskAssignments->isNotEmpty())
|
||||
@foreach ($data->taskAssignments as $task_assignment)
|
||||
<div class="border p-3 rounded shadow-sm col-md-4">
|
||||
<div class="mb-3">
|
||||
<dt>Nama</dt>
|
||||
<dd>{{$task_assignment->name}}</dd>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<dt>Email</dt>
|
||||
<dd>{{$task_assignment->email}}</dd>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<dt>Nomor Telepon</dt>
|
||||
<dd>{{$task_assignment->phone_number}}</dd>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<dt>Keahlian</dt>
|
||||
<dd>{{$task_assignment->expertise}}</dd>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<dt>Status</dt>
|
||||
<dd>{{$task_assignment->status_name}}</dd>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Data Not Available
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -265,5 +294,4 @@
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@vite(['resources/js/pbg-task/show.js'])
|
||||
@endsection
|
||||
@@ -16,9 +16,14 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end align-items-center mb-2">
|
||||
<a href="{{ route('roles.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@if ($creator)
|
||||
<a href="{{ route('roles.create')}}" class="btn btn-success btn-sm d-block d-sm-inline w-auto">Create</a>
|
||||
@endif
|
||||
</div>
|
||||
<div id="table-roles"
|
||||
data-updater="{{ $updater }}"
|
||||
data-destroyer="{{ $destroyer }}">
|
||||
</div>
|
||||
<div id="table-roles"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
<div class="card w-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap justify-content-end gap-2">
|
||||
<button type="button" class="btn btn-success btn-sm d-block d-sm-inline w-auto" id="btn-sync-submit">
|
||||
<span id="spinner" class="spinner-border spinner-border-sm me-1 d-none" role="status" aria-hidden="true"></span>
|
||||
Sync SIMBG
|
||||
</button>
|
||||
@if ($creator)
|
||||
<button type="button" class="btn btn-success btn-sm d-block d-sm-inline w-auto" id="btn-sync-submit">
|
||||
<span id="spinner" class="spinner-border spinner-border-sm me-1 d-none" role="status" aria-hidden="true"></span>
|
||||
Sync SIMBG
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<div id="table-import-datasources"></div>
|
||||
|
||||
@@ -15,7 +15,6 @@ use App\Http\Controllers\Api\RequestAssignmentController;
|
||||
use App\Http\Controllers\Api\RolesController;
|
||||
use App\Http\Controllers\Api\ScrapingController;
|
||||
use App\Http\Controllers\Api\SpatialPlanningsController;
|
||||
use App\Http\Controllers\Api\TaskAssignmentsController;
|
||||
use App\Http\Controllers\Api\UsersController;
|
||||
use App\Http\Controllers\Settings\SyncronizeController;
|
||||
use App\Http\Controllers\Api\AdvertisementController;
|
||||
@@ -141,9 +140,4 @@ Route::group(['middleware' => 'auth:sanctum'], function (){
|
||||
Route::get('/bigdata-resume', 'index')->name('api.bigdata-resume');
|
||||
Route::get('/bigdata-report', 'bigdata_report')->name('api.bigdata-report');
|
||||
});
|
||||
|
||||
// task-assignments
|
||||
Route::controller(TaskAssignmentsController::class)->group(function (){
|
||||
Route::get('/task-assignments/{uuid}', 'index')->name('api.task-assignments');
|
||||
});
|
||||
});
|
||||
@@ -4,10 +4,10 @@ use App\Http\Controllers\BigdataResumesController;
|
||||
use App\Http\Controllers\BusinessOrIndustriesController;
|
||||
use App\Http\Controllers\CustomersController;
|
||||
use App\Http\Controllers\Dashboards\LackOfPotentialController;
|
||||
use App\Http\Controllers\Dashboards\PotentialsController;
|
||||
use App\Http\Controllers\DataSettingController;
|
||||
use App\Http\Controllers\Dashboards\BigDataController;
|
||||
use App\Http\Controllers\GoogleApisController;
|
||||
use App\Http\Controllers\Home\HomeController;
|
||||
use App\Http\Controllers\Master\UsersController;
|
||||
use App\Http\Controllers\MenusController;
|
||||
use App\Http\Controllers\RequestAssignment\PbgTaskController;
|
||||
@@ -19,6 +19,7 @@ use App\Http\Controllers\Data\UmkmController;
|
||||
use App\Http\Controllers\Data\TourismController;
|
||||
use App\Http\Controllers\Data\SpatialPlanningController;
|
||||
use App\Http\Controllers\Report\ReportTourismController;
|
||||
use App\Http\Controllers\SpatialPlanningsController;
|
||||
use App\Http\Controllers\Chatbot\ChatbotController;
|
||||
use App\Http\Controllers\ChatbotPimpinan\ChatbotPimpinanController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -36,8 +37,6 @@ Route::group(['middleware' => 'auth'], function(){
|
||||
Route::get('/dashboard-pbg', [BigDataController::class, 'pbg'])->name('dashboard.pbg');
|
||||
Route::get('/lack-of-potential', [LackOfPotentialController::class, 'lack_of_potential'])->name('dashboard.lack_of_potential');
|
||||
Route::get('/maps', [GoogleApisController::class, 'index'])->name('dashboard.maps');
|
||||
Route::get('/inside-system', [PotentialsController::class, 'inside_system'])->name('dashboard.potentials.inside_system');
|
||||
Route::get('/outside-system', [PotentialsController::class, 'outside_system'])->name('dashboard.potentials.outside_system');
|
||||
});
|
||||
|
||||
// settings
|
||||
|
||||
@@ -48,13 +48,13 @@ export default defineConfig({
|
||||
|
||||
//js-additional
|
||||
"resources/js/settings/syncronize/syncronize.js",
|
||||
"resources/js/pbg-task/index.js",
|
||||
"resources/js/settings/general/general-settings.js",
|
||||
"resources/js/tables/common-table.js",
|
||||
|
||||
// dashboards
|
||||
"resources/js/dashboards/bigdata.js",
|
||||
"resources/js/dashboards/potentials/inside_system.js",
|
||||
"resources/js/dashboards/potentials/outside_system.js",
|
||||
"resources/js/dashboards/lack-of-potential.js",
|
||||
// roles
|
||||
"resources/js/roles/index.js",
|
||||
"resources/js/roles/create.js",
|
||||
@@ -101,9 +101,6 @@ export default defineConfig({
|
||||
"resources/js/bigdata-resumes/index.js",
|
||||
"resources/js/chatbot/index.js",
|
||||
"resources/js/chatbot-pimpinan/index.js",
|
||||
//pbg-task
|
||||
"resources/js/pbg-task/index.js",
|
||||
"resources/js/pbg-task/show.js",
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user