diff --git a/app/Http/Controllers/Api/GlobalSettingsController.php b/app/Http/Controllers/Api/GlobalSettingsController.php index 6afc896..fe1d87d 100644 --- a/app/Http/Controllers/Api/GlobalSettingsController.php +++ b/app/Http/Controllers/Api/GlobalSettingsController.php @@ -8,6 +8,7 @@ use App\Http\Resources\GlobalSettingResource; use App\Models\GlobalSetting; use App\Traits\GlobalApiResponse; use Exception; +use Illuminate\Http\Request; class GlobalSettingsController extends Controller { @@ -15,9 +16,13 @@ class GlobalSettingsController extends Controller /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { $query = GlobalSetting::query()->orderBy('id','desc'); + if($request->has('search') && !empty($request->get("search"))){ + $query->where('key', 'LIKE', '%'.$request->get('search').'%'); + } + return GlobalSettingResource::collection($query->paginate()); } diff --git a/app/Http/Controllers/Api/ImportDatasourceController.php b/app/Http/Controllers/Api/ImportDatasourceController.php index ba365e7..dd634a6 100644 --- a/app/Http/Controllers/Api/ImportDatasourceController.php +++ b/app/Http/Controllers/Api/ImportDatasourceController.php @@ -20,7 +20,7 @@ class ImportDatasourceController extends Controller $search = $request->get("search"); $query->where('status', 'like', "%".$search."%"); } - return ImportDatasourceResource::collection($query->paginate(10)); + return ImportDatasourceResource::collection($query->paginate()); } /** diff --git a/app/Http/Controllers/Api/RequestAssignmentController.php b/app/Http/Controllers/Api/RequestAssignmentController.php index 193dcec..10d4319 100644 --- a/app/Http/Controllers/Api/RequestAssignmentController.php +++ b/app/Http/Controllers/Api/RequestAssignmentController.php @@ -12,9 +12,12 @@ class RequestAssignmentController extends Controller /** * Display a listing of the resource. */ - public function index() + public function index(Request $request) { $query = PbgTask::query(); + if($request->has('search') && !empty($request->get("search"))){ + $query->where('name', 'LIKE', '%'.$request->get('search').'%'); + } return RequestAssignmentResouce::collection($query->paginate()); } diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index a79a949..2985421 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -4,12 +4,15 @@ namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use App\Http\Requests\Auth\LoginRequest; +use App\Http\Resources\UserResource; use App\Models\User; +use App\Traits\GlobalApiResponse; use Illuminate\Support\Facades\Hash; use Illuminate\Http\Request; class UsersController extends Controller { + use GlobalApiResponse; public function login(LoginRequest $request){ $user = User::where('email', $request->email)->first(); @@ -21,7 +24,15 @@ class UsersController extends Controller return response(['user' => $user, 'token' => $token], 200); } - public function index(){ - return response()->json(User::all()); + public function index(Request $request){ + $query = User::query(); + if($request->has('search') && !empty($request->get("search"))){ + $query->where('name', 'LIKE', '%'.$request->get('search').'%'); + } + return UserResource::collection($query->paginate()); + } + public function logout(Request $request){ + $request->user()->tokens()->delete(); + return response()->json(['message' => 'logged out successfully']); } } diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index 54bf875..9b638b8 100755 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -33,6 +33,15 @@ class AuthenticatedSessionController extends Controller $request->session()->regenerate(); + // Ambil user yang sedang login + $user = Auth::user(); + + // 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); } @@ -44,12 +53,16 @@ class AuthenticatedSessionController extends Controller */ public function destroy(Request $request) { + if($request->user()){ + $request->user()->tokens()->delete(); + } + Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); - - return redirect('/'); + + return redirect()->route('login'); } } diff --git a/app/Http/Controllers/Master/UsersController.php b/app/Http/Controllers/Master/UsersController.php index df6941a..166fe49 100644 --- a/app/Http/Controllers/Master/UsersController.php +++ b/app/Http/Controllers/Master/UsersController.php @@ -7,12 +7,18 @@ use Illuminate\Http\Request; use Illuminate\Validation\Rules; use Illuminate\Support\Facades\Hash; use App\Models\User; +use App\Traits\GlobalApiResponse; use Illuminate\Auth\Events\Registered; class UsersController extends Controller { + use GlobalApiResponse; + public function allUsers(Request $request){ + $users = User::all(); + return $this->resSuccess($users); + } public function index(){ - $users = User::paginate(20); + $users = User::paginate(); return view('master.users.index', compact('users')); } public function create(){ diff --git a/app/Http/Resources/RequestAssignmentResouce.php b/app/Http/Resources/RequestAssignmentResouce.php index baa5acc..2d10d7b 100644 --- a/app/Http/Resources/RequestAssignmentResouce.php +++ b/app/Http/Resources/RequestAssignmentResouce.php @@ -15,6 +15,7 @@ class RequestAssignmentResouce extends JsonResource public function toArray(Request $request): array { return [ + 'id' => $this->id, 'uuid' => $this->uuid, 'name' => $this->name, 'owner_name' => $this->owner_name, diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php new file mode 100644 index 0000000..bbe7c69 --- /dev/null +++ b/app/Http/Resources/UserResource.php @@ -0,0 +1,28 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' =>$this->id, + 'name' =>$this->name, + 'email' =>$this->email, + 'created_at' =>$this->created_at->toDateTimeString(), + 'updated_at' =>$this->updated_at->toDateTimeString(), + 'position' => $this->position, + 'firstname' => $this->firstname, + 'lastname' => $this->lastname, + ]; + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 1cf5f15..ad012c7 100755 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider * * @var string */ - public const HOME = '/home'; + public const HOME = '/dashboards/bigdata'; /** * Define your route model bindings, pattern filters, and other route configuration. diff --git a/app/ServiceSIMBG.php b/app/ServiceSIMBG.php index af45fc2..6c2d206 100644 --- a/app/ServiceSIMBG.php +++ b/app/ServiceSIMBG.php @@ -143,7 +143,7 @@ class ServiceSIMBG 'page' => $currentPage, 'size' => 20, 'sort' => 'ASC', - 'type' => 'task', + 'type' => 'task' ]); $url = "/api/pbg/v1/list/?" . $queryParams; @@ -192,15 +192,15 @@ class ServiceSIMBG $this->syncTaskDetailSubmit($item['uid']); $savedCount++; } catch (Exception $e) { + $importDatasource->update([ + 'status' => ImportDatasourceStatus::Failed->value, + 'message' => 'failed to save', + 'response_body' => $item + ]); Log::error("Failed to process task", [ 'error' => $e->getMessage(), 'task' => $item, ]); - $importDatasource->update([ - 'status' => ImportDatasourceStatus::Failed->value, - 'message' => $e->getMessage(), - 'response_body' => $item - ]); $failedCount++; } } diff --git a/config/cors.php b/config/cors.php index 8a39e6d..94f07be 100644 --- a/config/cors.php +++ b/config/cors.php @@ -29,6 +29,6 @@ return [ 'max_age' => 0, - 'supports_credentials' => false, + 'supports_credentials' => true, ]; diff --git a/database/migrations/2025_01_29_220149_change_skrd_amount_column.php b/database/migrations/2025_01_29_220149_change_skrd_amount_column.php new file mode 100644 index 0000000..f200f2f --- /dev/null +++ b/database/migrations/2025_01_29_220149_change_skrd_amount_column.php @@ -0,0 +1,28 @@ +decimal('skrd_amount',20,2)->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('pbg_task_retributions', function (Blueprint $table) { + $table->decimal('skrd_amount', 20,2)->nullable()->change(); + }); + } +}; diff --git a/resources/js/dashboards/bigdata.js b/resources/js/dashboards/bigdata.js index 92a68bd..4d63b0c 100644 --- a/resources/js/dashboards/bigdata.js +++ b/resources/js/dashboards/bigdata.js @@ -1,868 +1,920 @@ import ApexCharts from "apexcharts"; import jsVectorMap from "jsvectormap/dist/jsvectormap.js"; -import 'jsvectormap/dist/maps/world-merc.js'; -import 'jsvectormap/dist/maps/world.js'; -import GlobalConfig, {addThousandSeparators} from '../global-config.js'; +import "jsvectormap/dist/maps/world-merc.js"; +import "jsvectormap/dist/maps/world.js"; +import GlobalConfig, { addThousandSeparators } from "../global-config.js"; class BigData { - init(){ - this.initAllChart(); - this.initChartTargetPAD(); - this.initChartUsaha(); - this.initChartNonUsaha(); - } + init() { + this.initAllChart(); + this.initChartTargetPAD(); + this.initChartUsaha(); + this.initChartNonUsaha(); + } - initChartTargetPAD() { - console.log("api host : " + GlobalConfig.apiHost); - fetch(`${GlobalConfig.apiHost}/api/all-task-documents`) - .then(response => { - if(!response.ok){ - throw new Error("Network response was not ok"); - } - return response.json(); - }) - .then(data => { - const seriesData = data.data.series; - document.getElementById("countTargetPAD").innerText = `${data.data.count} Berkas`; - document.getElementById("totalTargetPAD").innerText = `Rp.${addThousandSeparators(data.data.total)}`; + initChartTargetPAD() { + console.log("api host : " + GlobalConfig.apiHost); + fetch(`${GlobalConfig.apiHost}/api/all-task-documents`) + .then((response) => { + if (!response.ok) { + throw new Error("Network response was not ok"); + } + return response.json(); + }) + .then((data) => { + const seriesData = data.data.series; + document.getElementById( + "countTargetPAD" + ).innerText = `${data.data.count} Berkas`; + document.getElementById( + "totalTargetPAD" + ).innerText = `Rp.${addThousandSeparators(data.data.total)}`; + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: seriesData, + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts( + document.querySelector("#chart12"), + options1 + ).render(); + }) + .catch((error) => { + console.error("error fetching chart dara : ", error); + }); + } + + initChartUsaha() { + fetch(`${GlobalConfig.apiHost}/api/business-documents`) + .then((response) => { + if (!response.ok) { + throw new Error("Network response was not ok"); + } + return response.json(); + }) + .then((data) => { + const seriesData = data.data.series; + document.getElementById( + "countBusinessDocuments" + ).innerText = `${data.data.count} Berkas`; + document.getElementById( + "totalBusinessDocuments" + ).innerText = `Rp.${addThousandSeparators(data.data.total)}`; + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: seriesData, + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts( + document.querySelector("#chartBusinessDocuments"), + options1 + ).render(); + }) + .catch((error) => { + console.error("error fetching chart dara : ", error); + }); + } + + initChartNonUsaha() { + fetch(`${GlobalConfig.apiHost}/api/non-business-documents`) + .then((response) => { + if (!response.ok) { + throw new Error("Network response was not ok"); + } + return response.json(); + }) + .then((data) => { + const seriesData = data.data.series; + document.getElementById( + "countNonUsaha" + ).innerText = `${data.data.count} Berkas`; + document.getElementById( + "totalNonUsaha" + ).innerText = `Rp.${addThousandSeparators(data.data.total)}`; + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: seriesData, + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts( + document.querySelector("#chartNonUsaha"), + options1 + ).render(); + }) + .catch((error) => { + console.error("error fetching chart dara : ", error); + }); + } + + initAllChart() { var options1 = { chart: { - type: 'area', + type: "area", height: 50, sparkline: { - enabled: true - } + enabled: true, + }, }, - series: [{ - data: seriesData - }], + series: [ + { + data: [80, 100, 50, 30, 90], + }, + ], stroke: { width: 2, - curve: 'smooth' + curve: "smooth", }, markers: { - size: 0 + size: 0, }, colors: ["#7e67fe"], tooltip: { fixed: { - enabled: false + enabled: false, }, x: { - show: false + show: false, }, y: { title: { formatter: function (seriesName) { - return '' - } - } + return ""; + }, + }, }, marker: { - show: false - } + show: false, + }, }, fill: { opacity: [1], - type: ['gradient'], + type: ["gradient"], gradient: { type: "vertical", // shadeIntensity: 1, inverseColors: false, opacityFrom: 0.5, opacityTo: 0, - stops: [0, 100] + stops: [0, 100], }, }, - } - - new ApexCharts(document.querySelector("#chart12"), options1).render(); - }) - .catch(error => { - console.error("error fetching chart dara : ", error); - }); - } + }; + + new ApexCharts(document.querySelector("#chart01"), options1).render(); - initChartUsaha(){ - fetch(`${GlobalConfig.apiHost}/api/business-documents`) - .then(response => { - if(!response.ok){ - throw new Error("Network response was not ok"); - } - return response.json(); - }) - .then(data => { - const seriesData = data.data.series; - document.getElementById("countBusinessDocuments").innerText = `${data.data.count} Berkas`; - document.getElementById("totalBusinessDocuments").innerText = `Rp.${addThousandSeparators(data.data.total)}`; var options1 = { chart: { - type: 'area', + type: "area", height: 50, sparkline: { - enabled: true - } + enabled: true, + }, }, - series: [{ - data: seriesData - }], + series: [ + { + data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6], + }, + ], stroke: { width: 2, - curve: 'smooth' + curve: "smooth", }, markers: { - size: 0 + size: 0, }, colors: ["#7e67fe"], tooltip: { fixed: { - enabled: false + enabled: false, }, x: { - show: false + show: false, }, y: { title: { formatter: function (seriesName) { - return '' - } - } + return ""; + }, + }, }, marker: { - show: false - } + show: false, + }, }, fill: { opacity: [1], - type: ['gradient'], + type: ["gradient"], gradient: { type: "vertical", // shadeIntensity: 1, inverseColors: false, opacityFrom: 0.5, opacityTo: 0, - stops: [0, 100] + stops: [0, 100], }, }, - } - - new ApexCharts(document.querySelector("#chartBusinessDocuments"), options1).render(); - }) - .catch(error => { - console.error("error fetching chart dara : ", error); - }); - } + }; + + new ApexCharts(document.querySelector("#chart02"), options1).render(); - initChartNonUsaha(){ - fetch(`${GlobalConfig.apiHost}/api/non-business-documents`) - .then(response => { - if(!response.ok){ - throw new Error("Network response was not ok"); - } - return response.json(); - }) - .then(data => { - const seriesData = data.data.series; - document.getElementById("countNonUsaha").innerText = `${data.data.count} Berkas`; - document.getElementById("totalNonUsaha").innerText = `Rp.${addThousandSeparators(data.data.total)}`; var options1 = { chart: { - type: 'area', + type: "area", height: 50, sparkline: { - enabled: true - } + enabled: true, + }, }, - series: [{ - data: seriesData - }], + series: [ + { + data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95], + }, + ], stroke: { width: 2, - curve: 'smooth' + curve: "smooth", }, markers: { - size: 0 + size: 0, }, colors: ["#7e67fe"], tooltip: { fixed: { - enabled: false + enabled: false, }, x: { - show: false + show: false, }, y: { title: { formatter: function (seriesName) { - return '' - } - } + return ""; + }, + }, }, marker: { - show: false - } + show: false, + }, }, fill: { opacity: [1], - type: ['gradient'], + type: ["gradient"], gradient: { type: "vertical", // shadeIntensity: 1, inverseColors: false, opacityFrom: 0.5, opacityTo: 0, - stops: [0, 100] + stops: [0, 100], }, }, - } - - new ApexCharts(document.querySelector("#chartNonUsaha"), options1).render(); - }) - .catch(error => { - console.error("error fetching chart dara : ", error); - }); - } + }; - initAllChart(){ - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [80, 100, 50, 30, 90] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, + new ApexCharts(document.querySelector("#chart03"), options1).render(); + + // var options1 = { + // chart: { + // type: 'area', + // height: 50, + // sparkline: { + // enabled: true + // } + // }, + // series: [{ + // data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71] + // }], + // stroke: { + // width: 2, + // curve: 'smooth' + // }, + // markers: { + // size: 0 + // }, + // colors: ["#7e67fe"], + // tooltip: { + // fixed: { + // enabled: false + // }, + // x: { + // show: false + // }, + // y: { + // title: { + // formatter: function (seriesName) { + // return '' + // } + // } + // }, + // marker: { + // show: false + // } + // }, + // fill: { + // opacity: [1], + // type: ['gradient'], + // gradient: { + // type: "vertical", + // // shadeIntensity: 1, + // inverseColors: false, + // opacityFrom: 0.5, + // opacityTo: 0, + // stops: [0, 100] + // }, + // }, + // } + + // new ApexCharts(document.querySelector("#chart04"), options1).render(); + + // var options1 = { + // chart: { + // type: 'area', + // height: 50, + // sparkline: { + // enabled: true + // } + // }, + // series: [{ + // data: [80, 100, 50, 30, 90] + // }], + // stroke: { + // width: 2, + // curve: 'smooth' + // }, + // markers: { + // size: 0 + // }, + // colors: ["#7e67fe"], + // tooltip: { + // fixed: { + // enabled: false + // }, + // x: { + // show: false + // }, + // y: { + // title: { + // formatter: function (seriesName) { + // return '' + // } + // } + // }, + // marker: { + // show: false + // } + // }, + // fill: { + // opacity: [1], + // type: ['gradient'], + // gradient: { + // type: "vertical", + // // shadeIntensity: 1, + // inverseColors: false, + // opacityFrom: 0.5, + // opacityTo: 0, + // stops: [0, 100] + // }, + // }, + // } + + // new ApexCharts(document.querySelector("#chart05"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart06"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart07"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart08"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [80, 100, 50, 30, 90], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart09"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart10"), options1).render(); + + var options1 = { + chart: { + type: "area", + height: 50, + sparkline: { + enabled: true, + }, + }, + series: [ + { + data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95], + }, + ], + stroke: { + width: 2, + curve: "smooth", + }, + markers: { + size: 0, + }, + colors: ["#7e67fe"], + tooltip: { + fixed: { + enabled: false, + }, + x: { + show: false, + }, + y: { + title: { + formatter: function (seriesName) { + return ""; + }, + }, + }, + marker: { + show: false, + }, + }, + fill: { + opacity: [1], + type: ["gradient"], + gradient: { + type: "vertical", + // shadeIntensity: 1, + inverseColors: false, + opacityFrom: 0.5, + opacityTo: 0, + stops: [0, 100], + }, + }, + }; + + new ApexCharts(document.querySelector("#chart11"), options1).render(); + + // var options1 = { + // chart: { + // type: 'area', + // height: 50, + // sparkline: { + // enabled: true + // } + // }, + // series: [{ + // data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71] + // }], + // stroke: { + // width: 2, + // curve: 'smooth' + // }, + // markers: { + // size: 0 + // }, + // colors: ["#7e67fe"], + // tooltip: { + // fixed: { + // enabled: false + // }, + // x: { + // show: false + // }, + // y: { + // title: { + // formatter: function (seriesName) { + // return '' + // } + // } + // }, + // marker: { + // show: false + // } + // }, + // fill: { + // opacity: [1], + // type: ['gradient'], + // gradient: { + // type: "vertical", + // // shadeIntensity: 1, + // inverseColors: false, + // opacityFrom: 0.5, + // opacityTo: 0, + // stops: [0, 100] + // }, + // }, + // } + + // new ApexCharts(document.querySelector("#chart12"), options1).render(); } - - new ApexCharts(document.querySelector("#chart01"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart02"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart03"), options1).render(); - - // var options1 = { - // chart: { - // type: 'area', - // height: 50, - // sparkline: { - // enabled: true - // } - // }, - // series: [{ - // data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71] - // }], - // stroke: { - // width: 2, - // curve: 'smooth' - // }, - // markers: { - // size: 0 - // }, - // colors: ["#7e67fe"], - // tooltip: { - // fixed: { - // enabled: false - // }, - // x: { - // show: false - // }, - // y: { - // title: { - // formatter: function (seriesName) { - // return '' - // } - // } - // }, - // marker: { - // show: false - // } - // }, - // fill: { - // opacity: [1], - // type: ['gradient'], - // gradient: { - // type: "vertical", - // // shadeIntensity: 1, - // inverseColors: false, - // opacityFrom: 0.5, - // opacityTo: 0, - // stops: [0, 100] - // }, - // }, - // } - - // new ApexCharts(document.querySelector("#chart04"), options1).render(); - - // var options1 = { - // chart: { - // type: 'area', - // height: 50, - // sparkline: { - // enabled: true - // } - // }, - // series: [{ - // data: [80, 100, 50, 30, 90] - // }], - // stroke: { - // width: 2, - // curve: 'smooth' - // }, - // markers: { - // size: 0 - // }, - // colors: ["#7e67fe"], - // tooltip: { - // fixed: { - // enabled: false - // }, - // x: { - // show: false - // }, - // y: { - // title: { - // formatter: function (seriesName) { - // return '' - // } - // } - // }, - // marker: { - // show: false - // } - // }, - // fill: { - // opacity: [1], - // type: ['gradient'], - // gradient: { - // type: "vertical", - // // shadeIntensity: 1, - // inverseColors: false, - // opacityFrom: 0.5, - // opacityTo: 0, - // stops: [0, 100] - // }, - // }, - // } - - // new ApexCharts(document.querySelector("#chart05"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart06"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart07"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart08"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [80, 100, 50, 30, 90] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart09"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [87, 54, 4, 76, 31, 95, 70, 92, 53, 9, 6] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart10"), options1).render(); - - var options1 = { - chart: { - type: 'area', - height: 50, - sparkline: { - enabled: true - } - }, - series: [{ - data: [41, 42, 35, 42, 6, 12, 13, 22, 42, 94, 95] - }], - stroke: { - width: 2, - curve: 'smooth' - }, - markers: { - size: 0 - }, - colors: ["#7e67fe"], - tooltip: { - fixed: { - enabled: false - }, - x: { - show: false - }, - y: { - title: { - formatter: function (seriesName) { - return '' - } - } - }, - marker: { - show: false - } - }, - fill: { - opacity: [1], - type: ['gradient'], - gradient: { - type: "vertical", - // shadeIntensity: 1, - inverseColors: false, - opacityFrom: 0.5, - opacityTo: 0, - stops: [0, 100] - }, - }, - } - - new ApexCharts(document.querySelector("#chart11"), options1).render(); - - // var options1 = { - // chart: { - // type: 'area', - // height: 50, - // sparkline: { - // enabled: true - // } - // }, - // series: [{ - // data: [8, 41, 40, 48, 77, 35, 0, 77, 63, 100, 71] - // }], - // stroke: { - // width: 2, - // curve: 'smooth' - // }, - // markers: { - // size: 0 - // }, - // colors: ["#7e67fe"], - // tooltip: { - // fixed: { - // enabled: false - // }, - // x: { - // show: false - // }, - // y: { - // title: { - // formatter: function (seriesName) { - // return '' - // } - // } - // }, - // marker: { - // show: false - // } - // }, - // fill: { - // opacity: [1], - // type: ['gradient'], - // gradient: { - // type: "vertical", - // // shadeIntensity: 1, - // inverseColors: false, - // opacityFrom: 0.5, - // opacityTo: 0, - // stops: [0, 100] - // }, - // }, - // } - - // new ApexCharts(document.querySelector("#chart12"), options1).render(); - } } -document.addEventListener('DOMContentLoaded', function (e) { - new BigData().init(); -}); \ No newline at end of file +document.addEventListener("DOMContentLoaded", function (e) { + let apiTokenMeta = document.querySelector("meta[name='api-token']"); + + if (apiTokenMeta && apiTokenMeta.content) { + let apiToken = apiTokenMeta.content; + localStorage.setItem("token", apiToken); // Simpan token ke localStorage + console.log("Token berhasil disimpan:", apiToken); + } + new BigData().init(); +}); diff --git a/resources/js/master/users/users.js b/resources/js/master/users/users.js new file mode 100644 index 0000000..bd42f27 --- /dev/null +++ b/resources/js/master/users/users.js @@ -0,0 +1,60 @@ +import { Grid } from "gridjs/dist/gridjs.umd.js"; +import gridjs from "gridjs/dist/gridjs.umd.js"; +import "gridjs/dist/gridjs.umd.js"; +import GlobalConfig from "../../global-config"; + +class UsersTable { + init() { + this.initTableUsers(); + } + + initTableUsers() { + new Grid({ + columns: [ + "ID", + "Name", + "Email", + "Firstname", + "Lastname", + "Position", + ], + pagination: { + limit: 15, + server: { + url: (prev, page) => + `${prev}${prev.includes("?") ? "&" : "?"}page=${ + page + 1 + }`, + }, + }, + sort: true, + search: { + server: { + url: (prev, keyword) => `${prev}?search=${keyword}`, + }, + }, + server: { + url: `${GlobalConfig.apiHost}/api/users`, + credentials: "include", + headers: { + Authorization: `Bearer ${localStorage.getItem("token")}`, + "Content-Type": "application/json", + }, + then: (data) => + data.data.map((item) => [ + item.id, + item.name, + item.email, + item.firstname, + item.lastname, + item.position, + ]), + total: (data) => data.meta.total, + }, + }).render(document.getElementById("table-users")); + } +} + +document.addEventListener("DOMContentLoaded", function (e) { + new UsersTable().init(); +}); diff --git a/resources/js/request-assignment/request-assignment.js b/resources/js/request-assignment/request-assignment.js new file mode 100644 index 0000000..3c7ec21 --- /dev/null +++ b/resources/js/request-assignment/request-assignment.js @@ -0,0 +1,67 @@ +import { Grid } from "gridjs/dist/gridjs.umd.js"; +import "gridjs/dist/gridjs.umd.js"; +import GlobalConfig from "../global-config"; + +class RequestAssignment { + init() { + this.initTableRequestAssignment(); + } + + initTableRequestAssignment() { + new Grid({ + columns: [ + "ID", + "Name", + "Condition", + "Registration Number", + "Document Number", + "Address", + "Status", + "Function Type", + "Consultation Type", + "Due Date", + ], + search: { + server: { + url: (prev, keyword) => `${prev}?search=${keyword}`, + }, + }, + pagination: { + limit: 15, + server: { + url: (prev, page) => + `${prev}${prev.includes("?") ? "&" : "?"}page=${ + page + 1 + }`, + }, + }, + sort: true, + server: { + url: `${GlobalConfig.apiHost}/api/request-assignments`, + credentials: "include", + headers: { + Authorization: `Bearer ${localStorage.getItem("token")}`, + "Content-Type": "application/json", + }, + then: (data) => + data.data.map((item) => [ + item.id, + item.name, + item.condition, + item.registration_number, + item.document_number, + item.address, + item.status_name, + item.function_type, + item.consultation_type, + item.due_date, + ]), + total: (data) => data.meta.total, + }, + }).render(document.getElementById("table-request-assignment")); + } +} + +document.addEventListener("DOMContentLoaded", function (e) { + new RequestAssignment().init(); +}); diff --git a/resources/js/settings/general/general-settings.js b/resources/js/settings/general/general-settings.js index d205482..ef29a76 100644 --- a/resources/js/settings/general/general-settings.js +++ b/resources/js/settings/general/general-settings.js @@ -29,24 +29,26 @@ class SyncronizeTask { }, }, ], + search: { + server: { + url: (prev, keyword) => `${prev}?search=${keyword}`, + }, + }, pagination: { limit: 15, server: { - url: (prev, page, limit) => `${prev}?page=${page}`, + url: (prev, page) => + `${prev}${prev.includes("?") ? "&" : "?"}page=${ + page + 1 + }`, }, }, sort: true, - search: { - server: { - url: (prev, page, keyword) => - `${prev}?page=${page}&search=${keyword}`, - }, - }, server: { url: `${GlobalConfig.apiHost}/api/global-settings`, headers: { Authorization: `Bearer ${document - .querySelector('meta[name="csrf-token"]') + .querySelector('meta[name="api-token"]') .getAttribute("content")}`, "Content-Type": "application/json", }, @@ -59,6 +61,7 @@ class SyncronizeTask { item.created_at, item.id, ]), + total: (data) => data.meta.total, }, }); table.render(document.getElementById("general-setting-table")); @@ -100,9 +103,6 @@ class SyncronizeTask { } } } -document.addEventListener("click", function (e) { - handleDelete(e); // Call the function on click event -}); document.addEventListener("DOMContentLoaded", function (e) { new SyncronizeTask().init(); }); diff --git a/resources/js/settings/syncronize/syncronize.js b/resources/js/settings/syncronize/syncronize.js index c16e9b1..eb10c58 100644 --- a/resources/js/settings/syncronize/syncronize.js +++ b/resources/js/settings/syncronize/syncronize.js @@ -1,52 +1,67 @@ import { Grid } from "gridjs/dist/gridjs.umd.js"; -import gridjs from 'gridjs/dist/gridjs.umd.js' -import 'gridjs/dist/gridjs.umd.js' +import gridjs from "gridjs/dist/gridjs.umd.js"; +import "gridjs/dist/gridjs.umd.js"; import GlobalConfig from "../../global-config.js"; class SyncronizeTask { - init(){ - this.initTableImportDatasources(); - this.onSyncSubmit(); - } - initTableImportDatasources(){ - new Grid({ - columns: [ - "ID", "Message", "Response", "Status", "Created", - ], - pagination: { - limit: 15, - server: { - url: (prev, page, limit) => `${prev}?page=${page}` - } - }, - sort: true, - search: { - server: { - url: (prev, page, keyword) => `${prev}?page=${page}&search=${keyword}` - } - }, - server: { - url: `${GlobalConfig.apiHost}/api/import-datasource`, - then: data => data.data.map((item) => [item.id, item.message, item.response_body, item.status, item.created_at]) - } - }).render(document.getElementById("table-import-datasources")); - } - onSyncSubmit(){ - const form = document.getElementById("sync-form"); - if(form){ - form.addEventListener("submit", function (event) { - event.preventDefault(); // Prevent the default form submission - - const button = document.getElementById("btn-sync-submit"); - if (button) { - button.disabled = true; - button.innerText = "Processing..."; - } - form.submit(); - }); + init() { + this.initTableImportDatasources(); + this.onSyncSubmit(); + } + initTableImportDatasources() { + new Grid({ + columns: ["ID", "Message", "Response", "Status", "Created"], + search: { + server: { + url: (prev, keyword) => `${prev}?search=${keyword}`, + }, + }, + pagination: { + limit: 15, + server: { + url: (prev, page) => + `${prev}${prev.includes("?") ? "&" : "?"}page=${ + page + 1 + }`, + }, + }, + sort: true, + server: { + url: `${GlobalConfig.apiHost}/api/import-datasource`, + headers: { + Authorization: `Bearer ${document + .querySelector('meta[name="api-token"]') + .getAttribute("content")}`, + "Content-Type": "application/json", + }, + then: (data) => + data.data.map((item) => [ + item.id, + item.message, + item.response_body, + item.status, + item.created_at, + ]), + total: (data) => data.meta.total, + }, + }).render(document.getElementById("table-import-datasources")); + } + onSyncSubmit() { + const form = document.getElementById("sync-form"); + if (form) { + form.addEventListener("submit", function (event) { + event.preventDefault(); // Prevent the default form submission + + const button = document.getElementById("btn-sync-submit"); + if (button) { + button.disabled = true; + button.innerText = "Processing..."; + } + form.submit(); + }); + } } - } } -document.addEventListener('DOMContentLoaded', function (e) { - new SyncronizeTask().init(); -}); \ No newline at end of file +document.addEventListener("DOMContentLoaded", function (e) { + new SyncronizeTask().init(); +}); diff --git a/resources/js/tables/common-table.js b/resources/js/tables/common-table.js index f6d640a..997d554 100644 --- a/resources/js/tables/common-table.js +++ b/resources/js/tables/common-table.js @@ -1,128 +1,70 @@ import { Grid } from "gridjs/dist/gridjs.umd.js"; -import gridjs from 'gridjs/dist/gridjs.umd.js' -import 'gridjs/dist/gridjs.umd.js' +import gridjs from "gridjs/dist/gridjs.umd.js"; +import "gridjs/dist/gridjs.umd.js"; import GlobalConfig from "../global-config"; class CommonTable { - init() { - // this.CommonTableInit(); - this.CommonTableInitWithFetchApi(); - } + init() { + // this.CommonTableInit(); + this.CommonTableInitWithFetchApi(); + } - CommonTableInit() { - new Grid({ - columns: [ - { - name: 'ID', - formatter: (function (cell) { - return gridjs.html('' + cell + ''); - }) - }, - "Name", - { - name: 'Email', - formatter: (function (cell) { - return gridjs.html('' + cell + ''); - }) - }, - "Position", "Company", "Country", - { - name: 'Actions', - width: '120px', - formatter: (function (cell) { - return gridjs.html(` + CommonTableInitWithFetchApi() { + fetch(`${GlobalConfig.apiHost}/api/users`) + .then((response) => response.json()) + .then((data) => { + console.log("check log response"); + console.log(data.data); + new Grid({ + columns: [ + { + name: "id", + formatter: function (cell) { + return gridjs.html( + '' + + cell + + "" + ); + }, + }, + "name", + { + name: "email", + formatter: function (cell) { + return gridjs.html( + '' + cell + "" + ); + }, + }, + "position", + "firstname", + "lastname", + { + name: "Actions", + width: "120px", + formatter: function (cell) { + return gridjs.html(`
`); - }) - }, - ], - pagination: { - limit: 10 - }, - sort: true, - search: true, - data: [ - ["11", "Alice", "alice@example.com", "Software Engineer", "ABC Company", "United States"], - ["12", "Bob", "bob@example.com", "Product Manager", "XYZ Inc", "Canada"], - ["13", "Charlie", "charlie@example.com", "Data Analyst", "123 Corp", "Australia"], - ["14", "David", "david@example.com", "UI/UX Designer", "456 Ltd", "United Kingdom"], - ["15", "Eve", "eve@example.com", "Marketing Specialist", "789 Enterprises", "France"], - ["11", "Alice", "alice@example.com", "Software Engineer", "ABC Company", "United States"], - ["12", "Bob", "bob@example.com", "Product Manager", "XYZ Inc", "Canada"], - ["13", "Charlie", "charlie@example.com", "Data Analyst", "123 Corp", "Australia"], - ["14", "David", "david@example.com", "UI/UX Designer", "456 Ltd", "United Kingdom"], - ["15", "Eve", "eve@example.com", "Marketing Specialist", "789 Enterprises", "France"], - ["11", "Alice", "alice@example.com", "Software Engineer", "ABC Company", "United States"], - ["12", "Bob", "bob@example.com", "Product Manager", "XYZ Inc", "Canada"], - ["13", "Charlie", "charlie@example.com", "Data Analyst", "123 Corp", "Australia"], - ["14", "David", "david@example.com", "UI/UX Designer", "456 Ltd", "United Kingdom"], - ["15", "Eve", "eve@example.com", "Marketing Specialist", "789 Enterprises", "France"], - ["11", "Alice", "alice@example.com", "Software Engineer", "ABC Company", "United States"], - ["12", "Bob", "bob@example.com", "Product Manager", "XYZ Inc", "Canada"], - ["13", "Charlie", "charlie@example.com", "Data Analyst", "123 Corp", "Australia"], - ["14", "David", "david@example.com", "UI/UX Designer", "456 Ltd", "United Kingdom"], - ["15", "Eve", "eve@example.com", "Marketing Specialist", "789 Enterprises", "France"], - ["16", "Frank", "frank@example.com", "HR Manager", "ABC Company", "Germany"], - ["17", "Grace", "grace@example.com", "Financial Analyst", "XYZ Inc", "Japan"], - ["18", "Hannah", "hannah@example.com", "Sales Representative", "123 Corp", "Brazil"], - ["19", "Ian", "ian@example.com", "Software Developer", "456 Ltd", "India"], - ["20", "Jane", "jane@example.com", "Operations Manager", "789 Enterprises", "China"] - ] - }).render(document.getElementById("common-table")); - } - - CommonTableInitWithFetchApi(){ - fetch(`${GlobalConfig.apiHost}/api/users`) - .then((response) => response.json()) - .then((data) => { - console.log("check log response"); - console.log(data.data); - new Grid({ - columns: [ - { - name: 'id', - formatter: (function (cell) { - return gridjs.html('' + cell + ''); + }, + }, + ], + pagination: { + limit: 10, + }, + sort: true, + search: true, + data: data, + }).render(document.getElementById("common-table")); }) - }, - "name", - { - name: 'email', - formatter: (function (cell) { - return gridjs.html('' + cell + ''); - }) - }, - "position", "firstname", "lastname", - { - name: 'Actions', - width: '120px', - formatter: (function (cell) { - return gridjs.html(` - - `); - }) - }, - ], - pagination: { - limit: 10 - }, - sort: true, - search: true, - data: data - }).render(document.getElementById("common-table")); - }) - .catch((error) => console.error("Error fetching data: " + error)); - } + .catch((error) => console.error("Error fetching data: " + error)); + } } -document.addEventListener('DOMContentLoaded', function (e) { - new CommonTable().init(); -}); \ No newline at end of file +document.addEventListener("DOMContentLoaded", function (e) { + new CommonTable().init(); +}); diff --git a/resources/views/auth/signin.blade.php b/resources/views/auth/signin.blade.php index d031bca..a7fe03b 100755 --- a/resources/views/auth/signin.blade.php +++ b/resources/views/auth/signin.blade.php @@ -39,25 +39,25 @@ class="authentication-bg"Don't have an account? + {{--
Don't have an account? Sign Up -
+ --}} diff --git a/resources/views/layouts/partials/sidebar.blade.php b/resources/views/layouts/partials/sidebar.blade.php index 23d45f3..4652c90 100644 --- a/resources/views/layouts/partials/sidebar.blade.php +++ b/resources/views/layouts/partials/sidebar.blade.php @@ -29,7 +29,7 @@