Commit 74be1082 authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

update new ui

parent d9e7ef9c
Pipeline #26899 passed with stage
in 1 minute and 22 seconds
......@@ -8,6 +8,14 @@
</div>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Master File Format
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
{{ $action === 'create' ? 'Create' : ($action === 'edit' ? 'Edit' : '') }}
</h2>
</div>
<div class="m-2">
@if ($action === 'list')
......@@ -21,19 +29,17 @@
</div>
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md">
<div class="pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="text-2xl text-black ">
Master File Format
</h2>
</div>
<div class="card py-4">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button type="button"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showAddForm">Add</button>
<div class="flex ">
<div class="px-1 ml-5">
<button type="button"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showAddForm"><i aria-hidden="true"
class="fa fa-add fa-solid"></i>Add</button>
</div>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
......@@ -118,7 +124,7 @@
</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
<div class="flex justify-center space-x-2">
<a wire:click="showpatchEditForm({{ $formatFile->formatservice_ID }})"
<a wire:click="showEditForm({{ $formatFile->formatservice_ID }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
......
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6"x-data="{ changePassword: @entangle('changePassword'), tomGReady: false }" x-show="tomGReady">
<form wire:submit.prevent="submitEditForm">
@csrf
<div class="card pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="font-medium tracking-wide text-slate-700 line-clamp-1 dark:text-navy-100 lg:text-base">
<i class="fa-solid fa-edit text-primary"></i> Edit User
</h2>
</div>
<div class="w-3/4 px-3 space-y-3 m-auto mb-4">
<div class="flex items-center">
<label class="w-2/12 mr-2">
<span>Name:</span>
</label>
<span class="relative flex w-full">
<input wire:model.defer="name"
class="form-input w-2/4 rounded-lg border border-slate-300 bg-transparent px-3 py-2 text-xs pl-4 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Name" name="name" type="text" />
@error('name')
<span class="text-red-500 text-md self-center ml-4">{{ $message }}</span>
@enderror
</span>
</div>
<div class="flex items-center">
<label class="w-2/12 mr-2">
<span>Email:</span>
</label>
<span class="relative flex w-full">
<input wire:model.defer="email"
class="form-input w-2/4 rounded-lg border border-slate-300 bg-transparent px-3 py-2 text-xs pl-4 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Email" name="email" type="email" />
@error('email')
<span class="text-red-500 text-md self-center ml-4">{{ $message }}</span>
@enderror
</span>
</div>
<div class="flex items-center " wire:ignore>
<span class="w-2/12 mr-2">Add Groups:</span>
<span class="relative flex w-full">
<input class="mt-1.5 relative flex w-1/2" wire:ignore x-data="{ groupLists: @entangle('group_lists') }"
x-init="groupLists = @js($userGroups);
const tempGroup = pages.groupSelect;
pages.fetchGroups(tempGroup).then(() => {
$el._x_tom = new Tom($el, {
...tempGroup.group,
onChange: (value) => {
groupLists = value;
}
});
$el._x_tom.setValue(groupLists);
tomGReady = true
})" type="text">
</span>
</div>
<!-- Toggle Button for Change Password -->
<div class="flex items-center">
<button type="button" @click="changePassword = !changePassword"
class="btn border bg-gray-300 border-gray-300 font-medium text-gray-800 hover:text-white focus:text-white hover:bg-gray-500 focus:bg-gray-500 active:bg-gray-150/80 dark:border-navy-450 dark:text-navy-50 dark:hover:bg-navy-500 dark:focus:bg-navy-500 dark:active:bg-navy-500/90">
Change Password
</button>
</div>
<!-- Password Fields (Hidden by Default) -->
<div x-show="changePassword">
<div class="flex items-center mt-4">
<label class="w-2/12 mr-2">
<span>Current Password:</span>
</label>
<span class="relative flex w-full">
<input wire:model.defer="current_password"
class="form-input w-2/4 rounded-lg border border-slate-300 bg-transparent px-3 py-2 text-xs pl-4 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Current Password" name="current_password" type="password" />
@error('current_password')
<span class="text-red-500 text-md self-center ml-4">{{ $message }}</span>
@enderror
</span>
</div>
<div class="flex items-center mt-4">
<label class="w-2/12 mr-2">
<span>New Password:</span>
</label>
<span class="relative flex w-full">
<input wire:model.defer="new_password"
class="form-input w-2/4 rounded-lg border border-slate-300 bg-transparent px-3 py-2 text-xs pl-4 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="New Password" name="new_password" type="password" />
@error('new_password')
<span class="text-red-500 text-md self-center ml-4">{{ $message }}</span>
@enderror
</span>
</div>
<div class="flex items-center mt-4">
<label class="w-2/12 mr-2">
<span>Confirm New Password:</span>
</label>
<span class="relative flex w-full">
<input wire:model.defer="new_password_confirmation"
class="form-input w-2/4 rounded-lg border border-slate-300 bg-transparent px-3 py-2 text-xs pl-4 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Confirm New Password" name="new_password_confirmation" type="password" />
@error('new_password_confirmation')
<span class="text-red-500 text-md self-center ml-4">{{ $message }}</span>
@enderror
</span>
</div>
</div>
</div>
<div class="grid grid-cols-12 justify-center space-x-2 pt-4">
<span wire:click="goBack"
class="col-start-4 btn border border-slate-300 font-medium text-slate-800 hover:bg-slate-150 focus:bg-slate-150 active:bg-slate-150/80 dark:border-navy-450 dark:text-navy-50 dark:hover:bg-navy-500 dark:focus:bg-navy-500 dark:active:bg-navy-500/90">
Cancel
</span>
<button type="submit"
class="btn ml-3 bg-primary font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
Save
</button>
</div>
</div>
</form>
</div>
......@@ -9,7 +9,7 @@
</div>
<div class="w-3/4 px-3 space-y-3 m-auto mb-4">
<div class="flex items-center w-3/5">
<label class="w-2/12 mr-2">
<label for="" class="w-2/12 mr-2">
<span>Name</span>
</label>
<span class="relative flex w-full">
......@@ -23,7 +23,7 @@
</span>
</div>
<div class="flex items-center w-3/5">
<label class="w-2/12 mr-2">
<label for="" class="w-2/12 mr-2">
<span>Comapany</span>
</label>
<span class="relative flex w-full">
......
<div>
<div x-cloak>
@include('components.no-permission')
<div class="flex items-center space-x-4 py-5 lg:py-6 ">
<ul class="hidden flex-wrap items-center space-x-2 sm:flex">
<li class="flex items-center space-x-2">
<a class="text-primary transition-colors hover:text-primary-focus dark:text-accent-light dark:hover:text-accent"
href="/">Home</a>
<svg x-ignore xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</li>
<li class="flex items-center space-x-2">
<a class="text-primary transition-colors hover:text-primary-focus dark:text-accent-light dark:hover:text-accent"
wire:click="$emit('menuClicked', 'Group')">Group Management</a>
</li>
</ul>
<div wire:loading.class="flex" wire:loading.class.remove="hidden" wire:target="showCompanyList"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="app-preloader grid h-full w-full place-content-center">
<div class="app-preloader-inner relative inline-block h-48 w-48"></div>
</div>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Group Management
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
{{ $action === 'create' ? 'Create' : ($action === 'edit' ? 'Edit' : '') }}
</h2>
</div>
@if ($action === 'list')
<div x-data="{ show: @entangle('showMessage'), message: '' }" x-init="window.addEventListener('show-message', event => {
......@@ -48,36 +45,29 @@
selectedGroups: @entangle('selectedGroups')
}" class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 ">
<div class="card pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="font-medium tracking-wide text-slate-700 line-clamp-1 dark:text-navy-100 lg:text-base">
Group Management
</h2>
</div>
<div class="card py-4">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button wire:click="showGroupCreateForm()"
class="btn h-6 w-28 rounded space-x-1 bg-primary px-3 text-xs font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z">
</path>
</svg>
<span>Create</span>
</button>
<a @click.prevent="if (selectedGroupsAlpine.length > 0) { showDeleteListModal = true; } else { showAlert = true;}"
class="btn h-6 w-28 rounded space-x-1 bg-primary px-3 text-xs font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0">
</path>
</svg>
<span>Delete</span>
</a>
<div class="flex ">
<div class="px-1 ml-5">
<button type="button"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showGroupCreateForm"><i aria-hidden="true"
class="fa fa-add fa-solid"></i>Add</button>
</div>
<div class=" ml-1">
<a @click.prevent="if (selectedGroupsAlpine.length > 0) { showDeleteListModal = true; } else { showAlert = true;}"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus flex items-center space-x-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0">
</path>
</svg>
<span>Delete</span>
</a>
</div>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-3 px-5 items-center">
......@@ -165,14 +155,14 @@
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $group->created_at }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
<div class="flex justify-center space-x-2">
<div class="flex justify-center space-x-1">
<a wire:click="showGroupEditForm({{ $group->id }})"
class="btn h-8 w-8 p-0 text-info hover:bg-info/20 focus:bg-info/20 active:bg-info/25">
class="btn h-8 w-8 p-0 hover:bg-info/20 focus:bg-info/20 active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
<div>
<a @click="$wire.emit('showDeleteModal', {{ $group->id }})"
class="btn h-8 w-8 p-0 text-error hover:bg-error/20 focus:bg-error/20 active:bg-error/25">
class="btn h-8 w-8 p-0 hover:text-white focus:text-white active:bg-error/25">
<i class="fa fa-trash-alt"></i>
</a>
</div>
......
<div class="max-w-4xl mx-auto p-8 bg-white shadow-lg rounded-lg">
<div class=" p-6 bg-white shadow-lg rounded-lg">
<style>
.ql-container {
height: 15rem;
......@@ -20,8 +20,8 @@
[{ color: [] }, { background: [] }],
[{ font: [] }],
[{ align: [] }],
['clean'], // remove formatting button
['image'], // Add image upload button
['clean'],
['image'],
],
handlers: {
image: function() {
......@@ -58,7 +58,7 @@
canvas.width = width;
canvas.height = height;
ctx.drawImage(img, 0, 0, width, height);
const resizedImage = canvas.toDataURL('image/jpeg', 0.7); // Adjust quality
const resizedImage = canvas.toDataURL('image/jpeg', 0.7);
const range = quill.getSelection();
quill.insertEmbed(range.index, 'image', resizedImage);
};
......@@ -263,8 +263,8 @@
</div>
<div class="flex justify-end space-x-4 mt-4">
<button type="button" wire:click="goBack"
class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400">Cancel</button>
<a href="/news" type="button"
class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400">Cancel</a>
<button type="submit" x-ref="submitButton"
class="px-4 py-2 bg-primary text-white rounded-md shadow-sm hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">Save</button>
</div>
......
<div class="max-w-4xl mx-auto p-8 bg-white shadow-lg rounded-lg">
<div class=" p-6 bg-white shadow-lg rounded-lg">
<style>
.ql-container {
height: 15rem;
......@@ -232,8 +232,8 @@
</div>
<div class="flex justify-end space-x-4 mt-4">
<button type="button" wire:click="goBack"
class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400">Cancel</button>
<a href="/news" type="button"
class="px-4 py-2 bg-gray-200 text-gray-700 rounded-md shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400">Cancel</a>
<button type="submit" x-ref="submitButton"
class="px-4 py-2 bg-primary text-white rounded-md shadow-sm hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">Save</button>
</div>
......
<div class="border-0 shadow-none">
` <div wire:loading.class="" wire:loading.class.remove="hidden" wire:target="save"
<div wire:loading.class="" wire:loading.class.remove="hidden" wire:target="save"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="items-center h-100vh" style="align-content: center;">
......@@ -8,13 +8,16 @@
</div>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
News & Update
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
{{ $action === 'create'? 'Create' :(($action === 'edit')? 'Edit':'') }}
</h2>
</div>
<div class="m-2">
{{-- <div wire:loading.class="flex" wire:loading.class.remove="hidden"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"></div>
</div>
</div> --}}
@if ($action === 'list')
@if ($message)
<div class="alert alert-success">
......@@ -28,11 +31,6 @@
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md" x-data="{ showDeleteListModal : false}">
<div class="pb-4 pt-5 bg-white rounded-lg shadow-lg">
<div class="my-1 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="text-2xl mb-3 text-black ">
News & Update
</h2>
</div>
<div class="flex justify-between">
<div class="px-2 ml-4">
<button type="button"
......@@ -129,16 +127,16 @@
<tr
class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
<label class="inline-flex items-center space-x-2">
<div class="inline-flex items-center space-x-2">
<input @change="toggleGroup($event)"
class="form-checkbox is-basic h-4 w-4 rounded border-slate-400/70 checked:bg-primary checked:border-primary hover:border-primary focus:border-primary dark:bg-navy-900 dark:border-navy-500 dark:checked:bg-accent dark:checked:border-accent dark:hover:border-accent dark:focus:border-accent"
type="checkbox" wire:model.defer="selectedNews"
value="{{ $news->shippingnetnews_ID }}" />
</label>
</div>
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
{{ \Illuminate\Support\Str::limit($news->topic, 70) }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $news->group->groupname??"" }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $news->groupname??"" }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $news->authorDate }}
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $news->issueDate }}</td>
......@@ -195,7 +193,7 @@
</template>
<livewire:delete-modal />
{{ $results->links('livewire.paginate-custom') }}
{{ $results->links('livewire.paginate-custom' ) }}
</div>
</div>
......
<div class="bg-main-container">
<link href="{{ asset('css/pages/patch.css') }}" rel="stylesheet">
<div class="max-w-full mx-auto px-5 ">
<h2 class="text-2xl text-black ">
<div class="mt-5 mb-2 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Patch Management
</h2>
<a type="button" href="/patch" class="btn mx-auto m-3 text-white bg-primary px-3 py-2">Back</a>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
Create
</h2>
</div>
<a type="button" href="/patch" class="btn mx-auto m-3 text-white bg-primary px-3 py-2">Back</a>
<div class="pb-4 max-w-full mx-auto">
@if (session()->has('message'))
<div class="alert alert-success">
{{ session('message') }}
......@@ -67,20 +73,6 @@
</div>
</div>
{{-- <template x-if="selectedProject"> --}}
{{-- <template x-if="true">
<div class="mb-3">
<label for="branch" class="form-label w-64 text-lg mr-2">Select Branch:</label>
<select x-model="selectedBranch" id="branch"
class="ml-2 w-64 h-8 mt-1 border border-gray-300 rounded-md">
<option value="">Choose Branch</option>
<template x-for="branch in branches" :key="branch.name">
<option :value="branch.name" x-text="branch.name"></option>
</template>
</select>
</div>
</template> --}}
<div class="mb-3">
<input type="text" value="c5d80f79" wire:model.defer="startCommit" placeholder="Start Commit"
class="placeholder:text-sm text-lg mb-2 form-input rounded-lg border border-slate-300 px-2">
......
......@@ -9,12 +9,17 @@
}
});
}, 1000);
});">
<link href="{{ asset('css/pages/patch.css') }}" rel="stylesheet">
<div class="max-w-full mx-auto px-5" x-cloak>
<h2 class="text-2xl text-black ">
Patch Management
</h2>
});" x-cloak>
<link href="{{ asset('css/pages/patch.css') }}" rel="stylesheet">
<div class="mt-5 mb-2 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Patch Management
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
Edit
</h2>
</div>
<div class="max-w-full mx-auto px-5" >
<style>
.progress-bar {
height: 20px;
......@@ -191,10 +196,10 @@
<tr
class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
<td class="whitespace-nowrap px-4 py-1 sm:px-5">
<label class="inline-flex items-center space-x-2">
<label for="patchFile-{{ $patchFile['fid'] }}" class="inline-flex items-center space-x-2">
<input
class="form-checkbox is-basic h-4 w-4 rounded border-slate-400/70 checked:bg-primary checked:border-primary focus:border-primary dark:bg-navy-900 dark:border-navy-500 dark:checked:bg-accent dark:checked:border-accent dark:hover:border-accent dark:focus:border-accent"
type="checkbox" x-model="selectedDeleteFiles"
type="checkbox" x-model="selectedDeleteFiles" id="patchFile-{{ $patchFile['fid'] }}"
value="{{ $patchFile['fid'] }}" />
</label>
</td>
......@@ -204,14 +209,14 @@
<td class="whitespace-nowrap px-1 py-1 sm:px-2">
<div class="flex justify-center space-x-2">
<a wire:click="$emit('openModalFormPatchFile', '{{ $patchFile['fid'] }}' , '{{ $patchId }}')"
<button wire:click="$emit('openModalFormPatchFile', '{{ $patchFile['fid'] }}' , '{{ $patchId }}')"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
<a onclick="confirmDeletePatchFile({{ $patchFile['fid'] }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
</button>
<button onclick="confirmDeletePatchFile({{ $patchFile['fid'] }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25" >
<i class="fa fa-trash"></i>
</a>
</button>
</div>
</td>
</tr>
......
......@@ -9,12 +9,6 @@
</div>
</div>
<div class="m-2">
{{-- <div wire:loading.class="flex" wire:loading.class.remove="hidden"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"></div>
</div>
</div> --}}
@if ($action === 'list')
@if ($message)
<div class="alert alert-success">
......@@ -25,14 +19,12 @@
</div>
</div>
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md">
<div class="pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="text-2xl text-black ">
Patch Management
</h2>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Patch Management
</h2>
</div>
<div class="pb-4 card shadow-lg p-4">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button type="button"
......@@ -71,7 +63,7 @@
</div>
</div>
<div class="mx-3 mt-3 px-4">
<div class="mx-3 mt-3">
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table class="is-hoverable table w-full text-left border-b">
<thead>
......@@ -161,7 +153,6 @@
</div>
</div>
</div>
@elseif($action === 'add')
<livewire:pages.patch.patch-create>
@elseif($action === 'edit')
......
<div>
<div x-cloak>
@include('components.no-permission')
<div class="flex items-center space-x-4 py-5 lg:py-6 ">
<ul class="hidden flex-wrap items-center space-x-2 sm:flex">
<li class="flex items-center space-x-2">
<a class="text-primary transition-colors hover:text-primary-focus dark:text-accent-light dark:hover:text-accent"
href="/">Home</a>
<svg x-ignore xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</li>
<li class="flex items-center space-x-2">
<a class="text-primary transition-colors hover:text-primary-focus dark:text-accent-light dark:hover:text-accent"
wire:click="$emit('menuClicked', 'Role')">Role Management</a>
</li>
</ul>
<div wire:loading.class="flex" wire:loading.class.remove="hidden" wire:target="showRoleList"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="app-preloader grid h-full w-full place-content-center">
<div class="app-preloader-inner relative inline-block h-48 w-48"></div>
</div>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Role Management
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
{{ $action === 'create' ? 'Create' : ($action === 'edit' ? 'Edit' : '') }}
</h2>
</div>
@if ($action === 'list')
<div x-data="{ show: @entangle('showMessage'), message: '' }" x-init="window.addEventListener('show-message', event => {
......@@ -48,39 +44,27 @@
selectedRoles: @entangle('selectedRoles')
}" class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 ">
<div class="card pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="font-medium tracking-wide text-slate-700 line-clamp-1 dark:text-navy-100 lg:text-base">
Role Management
</h2>
</div>
{{-- @include('components/search-by', ['searchBy' => $searchBy ?? []]) --}}
<div class="card pb-4 py-4 ">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button wire:click="showRoleCreateForm()"
class="btn h-6 w-28 rounded space-x-1 bg-primary px-3 text-xs font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z">
</path>
</svg>
<span>Create</span>
</button>
<a @click.prevent="if (selectedRolesAlpine.length > 0) { showDeleteListModal = true; } else { showAlert = true;}"
class="btn h-6 w-28 rounded space-x-1 bg-primary px-3 text-xs font-medium text-white hover:bg-primary-focus focus:bg-primary-focus active:bg-primary-focus/90 dark:bg-accent dark:hover:bg-accent-focus dark:focus:bg-accent-focus dark:active:bg-accent/90">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0">
</path>
</svg>
<span>Delete</span>
</a>
<div class="flex ">
<div class="px-1 ml-5">
<button type="button"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showRoleCreateForm"><i aria-hidden="true"
class="fa fa-add fa-solid"></i>Add</button>
</div>
<div class=" ml-1">
<a @click.prevent="if (selectedRolesAlpine.length > 0) { showDeleteListModal = true; } else { showAlert = true;}"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus flex items-center space-x-1">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round"
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0">
</path>
</svg>
<span>Delete</span>
</a>
</div>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
......@@ -169,14 +153,14 @@
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $role->created_at }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
<div class="flex justify-center space-x-2">
<div class="flex justify-center space-x-1">
<a wire:click="showRoleEditForm({{ $role->id }})"
class="btn h-8 w-8 p-0 text-info hover:bg-info/20 focus:bg-info/20 active:bg-info/25">
class="btn h-8 w-8 p-0 hover:bg-info/20 focus:bg-info/20 active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
<div>
<a @click="$wire.emit('showDeleteModal', {{ $role->id }})"
class="btn h-8 w-8 p-0 text-error hover:bg-error/20 focus:bg-error/20 active:bg-error/25">
class="btn h-8 w-8 p-0 hover:text-white focus:text-white active:bg-error/25">
<i class="fa fa-trash-alt"></i>
</a>
</div>
......
......@@ -10,21 +10,21 @@
this.resetCheckAllCheckbox();
});
this.loadSelectedPatch();
Livewire.on('removePatchSelected', (patch) => {
const checkboxes = document.querySelectorAll('.individual-checkbox');
Livewire.on('removePatchSelected', (patch) => {
const checkboxes = document.querySelectorAll('.individual-checkbox');
checkboxes.forEach(checkbox => {
if (checkbox.value === patch) {
checkbox.checked = false;
this.updatePatchSelection(checkbox.value, checkbox.getAttribute('data-patchname'), false);
}
});
checkboxes.forEach(checkbox => {
if (checkbox.value === patch) {
checkbox.checked = false;
this.updatePatchSelection(checkbox.value, checkbox.getAttribute('data-patchname'), false);
}
});
this.updateSelectedPatchList();
});
Livewire.on('updateSelectPatchAfterDeleted', () => {
this.clearAllSelections();
});
this.updateSelectedPatchList();
});
Livewire.on('updateSelectPatchAfterDeleted', () => {
this.clearAllSelections();
});
},
toggleAllCheckboxes(event) {
const checkboxes = document.querySelectorAll('.individual-checkbox');
......@@ -66,10 +66,10 @@
this.selectedPatchByPage[this.currentPage] = pagePatches;
},
clearAllSelections() {
this.allSelectPatches = [];
this.allSelectPatchName = [];
this.allSelectPatches = [];
this.allSelectPatchName = [];
},
},
updateSelectedPatchList() {
this.selectedPatch = Object.values(this.selectedPatchByPage).flat();
},
......@@ -89,13 +89,11 @@
checkAllCheckbox.checked = checkboxes.length > 0 && pagePatches.length === checkboxes
.length;
}
}" x-init="$watch('selectedPatch', () => resetCheckAllCheckbox())" class="w-full mb-6">
}" x-init="$watch('selectedPatch', () => resetCheckAllCheckbox())" class="w-full mb-6">
<div class="p-6 bg-white shadow-md rounded-lg">
<div x-show="true" class="">
<div class="flex justify-between mb-5">
<h2 class="font-medium tracking-wide text-slate-700 line-clamp-1 dark:text-navy-100 lg:text-base">
Patch List
</h2>
<div class="flex justify-end mb-5">
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
......
<div class="w-full px-3 mb-6 bg-main-container">
<div class="p-6 rounded-lg relative h-svh bg-main-container ">
<div x-cloak class="w-full px-3 mb-6 bg-main-container">
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Delete Patch
</h2>
<h2 @click="selectedPatches = []; "
class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4 cursor-pointer">
Delete Multi
</h2>
</div>
<div class="pt-2 pb-4 rounded-lg relative h-svh bg-main-container ">
<div class="flex flex-wrap -mx-3">
<div class="w-2/3 px-3 mb-6 ">
<div class="shadow-md bg-white w-full mb-3 p-3 rounded-lg">
......
<div class="w-full md:w-1/3 px-3 mb-6" x-data="{ showProgressModal: @entangle('showProgressModal') }">
<div class="w-full md:w-1/3 px-3 mb-6" x-cloak x-data="{ showProgressModal: @entangle('showProgressModal') }">
<div class="p-6 bg-white shadow-md rounded-lg">
<h2 class="text-2xl font-bold mb-4">Selected Patches</h2>
......
......@@ -3,7 +3,7 @@
selectedPatchByPage: {},
allSelectPatches: [],
allSelectPatchName: [],
currentPage: @entangle('page'), // Bind currentPage to Livewire 'page' variable
currentPage: @entangle('page'),
init() {
this.$watch('currentPage', (value) => {
this.loadSelectedPatch();
......@@ -77,7 +77,7 @@
}" x-init="$watch('selectedPatch', () => resetCheckAllCheckbox())">
<style>
.animate-spin {
animation: spin 1s linear infinite;
animation: spin 1s linear infinite;
}
@keyframes spin {
......@@ -91,22 +91,27 @@
}
</style>
<div class="max-w-full mx-auto p-6 bg-gray-100">
<div class="max-w-full mx-auto pb-5 bg-gray-100">
@if (session()->has('message'))
<div class="alert alert-success">
{{ session('message') }}
</div>
@endif
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Send Patch to Customer
</h2>
<h2 @click="selectedPatches = []; " class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4 cursor-pointer">
Send Multi
</h2>
</div>
<div class="flex flex-wrap -mx-3">
<div class="w-full md:w-2/3 px-3 mb-6">
<div class="p-6 bg-white shadow-md rounded-lg">
<div x-show="true" class="">
<div class="flex justify-between mb-5">
<h2
class="font-medium tracking-wide text-slate-700 line-clamp-1 dark:text-navy-100 lg:text-base">
Send Multi Patch
</h2>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
......
......@@ -90,7 +90,7 @@
<div wire:ignore class="col-span-3">
<label for="server_key" class="block text-sm font-medium text-gray-700">Server Key</label>
<input id="server_key" class="mt-1.5 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
<input id="server_key" class="mt-1.5 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
x-data="{
serverKeyLists: @entangle('server_lists'),
serverKeyOption: @entangle('serverKeyOption')
......@@ -107,7 +107,7 @@
});
$el._x_tom.setValue(serverKeyLists);
tomGReady = true;"
tomGReady = true;"
type="text" placeholder="Search Server Key">
</div>
</div>
......@@ -212,4 +212,4 @@
</div>
</div>
</div>
</div>
\ No newline at end of file
</div>
<div class="border-0 shadow-none">
<div class="border-0 shadow-none" x-data="{ open: @entangle('showSearch'), serverKeySuccess: [] ,serverKeyWaitingSend: @entangle('serverKeyWaitingSend').defer }">
<div wire:loading.class="" wire:loading.class.remove="hidden" wire:target="save"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
......@@ -8,17 +8,21 @@
</div>
</div>
<div class="bg-main-container rounded-md">
<div class="max-w-full mx-auto px-5 text-left flex flex-col items-start">
<h2 class="text-2xl text-black ">
Send Patch to Customer
</h2>
<a href="/send-patch" type="button" class="btn ml-1 my-3 text-white bg-primary px-3 py-2">Back</a>
</div>
<div class="" x-data="{ tomGReady: false, serverKeyWaitingSend: @entangle('serverKeyWaitingSend').defer }" x-show="true">
<div class="mt-5 mb-2 flex h-8 place-content-center px-4 " x-data="{serverKeyWaitingSend2: @entangle('serverKeyWaitingSend')}">
<h2 class="text-xl text-slate-800">
Send Patch to Customer
</h2>
<h2 @click="serverKeySuccess = [], serverKeyWaitingSend2= [] "
class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4 cursor-pointer">
Send
</h2>
</div>
<a href="/send-patch" type="button" class="btn ml-1 my-3 text-white bg-primary px-3 py-2">Back</a>
<div class="rounded-md" >
<div class="" x-data="{ tomGReady: false }" x-show="true">
<div class="mb-4">
<div class="grid grid-cols-12 gap-2 ">
<div class="bg-main-container col-span-3 p-6 rounded-lg shadow-md">
<div class="col-span-3 p-6 rounded-lg shadow-md card">
<!-- Server Information Group -->
<div class="mb-6">
<h3 class="text-lg font-medium text-gray-900 mb-2">Server Key</h3>
......@@ -28,7 +32,9 @@
<input type="text"
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
wire:model.debounce.500ms="serverkey" placeholder="Search for a server key">
<span wire:loading wire:target="serverkey, selectedOwnerType, company, db_type, cur_ver, selectAllResults" class="absolute right-3">
<span wire:loading
wire:target="serverkey, selectedOwnerType, company, db_type, cur_ver, selectAllResults"
class="absolute right-3">
<svg class="animate-spin h-5 w-5 text-black"
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10"
......@@ -41,7 +47,7 @@
</div>
@if ($showSearch)
<ul
<ul x-show="open" @click.away="open = false"
class="absolute left-0 right-0 mt-2 border border-gray-200 rounded-md max-h-64 overflow-auto z-50 bg-white">
<li class="p-2 bg-gray-200 hover:bg-gray-300 cursor-pointer font-semibold"
wire:click="selectAllResults">
......@@ -65,8 +71,6 @@
<h3 class="text-lg font-medium text-gray-900 mb-2">Server Information</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<label for="server_of" class="block text-sm font-medium text-gray-700">Server
of</label>
<select id="server_of" name="server_of" wire:model="selectedOwnerType"
class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
<option value="">Please Select</option>
......@@ -79,45 +83,31 @@
</div>
</div>
<!-- Company & Database Information Group -->
<div class="mb-6">
<h3 class="text-lg font-medium text-gray-900 mb-2">Company & Database Information</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="mb-6 ">
<h3 class="text-lg font-medium text-gray-900 mb-2">Company Information </h3>
<div class="grid grid-cols-1 gap-4">
<div>
<label for="company"
class="block text-sm font-medium text-gray-700">Company</label>
<input type="text" id="company" name="company" wire:model='company'
class="mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
</div>
</div>
</div>
<div class="mb-6 ">
<h3 class="text-lg font-medium text-gray-900 mb-2">Database </h3>
<div class="grid grid-cols-1 gap-4">
<div>
<label for="db_type" class="block text-sm font-medium text-gray-700">DB
Type</label>
<input type="text" id="db_type" name="db_type" wire:model='db_type'
class="mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
</div>
</div>
</div>
<!-- Additional Information Group -->
<div class="mb-6">
<h3 class="text-lg font-medium text-gray-900 mb-2">Additional Information</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="mb-6 ">
<h3 class="text-lg font-medium text-gray-900 mb-2">Current Version</h3>
<div class="grid grid-cols-1 gap-4">
<div>
<label for="cur_ver" class="block text-sm font-medium text-gray-700">Cur.
Ver.</label>
<input type="text" id="cur_ver" name="cur_ver" wire:model='cur_ver'
<input type="text" id="cur_ver" name="cur_ver" wire:model='cur_ver'
class="mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
</div>
{{-- <div>
<label for="hscode_method" class="block text-sm font-medium text-gray-700">HSCODE
2017 Method</label>
<select id="hscode_method" name="hscode_method"
class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
<option>Please Select</option>
<!-- Options -->
</select>
</div> --}}
</div>
</div>
......@@ -135,15 +125,14 @@
</div>
</div> --}}
</div>
<div class="bg-main-container p-6 rounded-lg shadow-md col-span-4">
<div class="card p-6 rounded-lg shadow-md col-span-4">
<h3 class="text-lg font-medium text-gray-900 mb-2">Server key waiting to send</h3>
<div id="serverkey-list" class="overflow-y-auto max-h-[70vh]">
<div class="bg-gray m-3">
@foreach ($serverKeyWaitingSend as $key => $serverkey)
<div class="flex items-center bg-blue-500 text-white w-full px-4 py-2 rounded m-1">
<span class="flex-grow">{{ $serverkey['key'] }}</span>
<button wire:click="removeServerKey('{{ $serverkey['key'] }}')"
class="ml-2">
<button wire:click="removeServerKey('{{ $serverkey['key'] }}')" class="ml-2">
<i class="fas fa-trash-alt"></i>
</button>
</div>
......@@ -159,60 +148,49 @@
</div>
</div>
</div>
<div class="bg-main-container p-6 rounded-lg shadow-md col-span-4">
<div class="card p-6 rounded-lg shadow-md col-span-4">
<h3 class="text-lg font-medium text-gray-900 mb-2">Server key send success</h3>
{{-- <div id="serverkey-list" class="overflow-y-auto max-h-[70vh]">
<div class="bg-gray m-3">
@foreach ($serverKeySuccess as $key => $serverkey)
<div class="flex items-center bg-lime-600 text-white w-full px-4 py-2 rounded m-1">
<span class="flex-grow">{{ $serverkey['key'] }}</span>
</div>
@endforeach
</div>
</div> --}}
<div x-data="{ serverKeySuccess: [] }" x-init="
Livewire.on('patchSent', server => {
serverKeySuccess.push(server); // เพิ่ม server ที่สำเร็จลงในรายการ
});
">
<!-- UI ที่จะแสดงรายการของ server ที่สำเร็จ -->
<template x-for="server in serverKeySuccess" :key="server.id">
<div class="bg-green-100 text-green-700 p-2 rounded mb-2">
Patch Sent: <span x-text="server.key"></span>
</div>
</template>
</div>
<div x-init="Livewire.on('patchSent', server => {
serverKeySuccess.push(server);
});">
<template x-for="server in serverKeySuccess" :key="server.id">
<div class="bg-green-100 text-green-700 p-2 rounded mb-2">
Patch Sent: <span x-text="server.key"></span>
</div>
</template>
</div>
</div>
</div>
</div>
<div class="mb-4">
<h3 class="text-xl font-medium leading-6 text-black">Server list</h3>
</div>
<div class="flex px-5 items-center justify-end mb-3" x-data="{ isInputActive: false }">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-14 rounded-full p-0 hover:bg-slate-300/20 focus:bg-slate-300/20 active:bg-slate-300/25 dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-white px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
<option value="SNKEY">Server Key</option>
<option value="COMPANY">Company</option>
</select>
</span>
<div class="mb-1">
<h3 class="text-xl font-medium leading-6 text-black my-3"><i aria-hidden="true" class="fa fa-server mr-3"></i>Server list</h3>
</div>
<div class="is-scrollbar-hidden min-w-full table-responsive">
<div class="is-scrollbar-hidden min-w-full table-responsive card p-4 mb-4">
<div class="flex px-5 items-center justify-end mb-3" x-data="{ isInputActive: false }">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-14 rounded-full p-0 hover:bg-slate-300/20 focus:bg-slate-300/20 active:bg-slate-300/25 dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-white px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
<option value="SNKEY">Server Key</option>
<option value="COMPANY">Company</option>
</select>
</span>
</div>
<table class="min-w-full is-hoverable table w-full divide-y divide-gray-200">
<thead>
<tr>
......@@ -272,10 +250,13 @@
@endforeach
</tbody>
</table>
<div class="mt-4">
{{ $results->links('livewire.paginate-custom') }}
</div>
</div>
<div class="mt-4">
{{ $results->links('livewire.paginate-custom') }}
</div>
<div>
&nbsp;
</div>
</div>
</div>
</div>
......@@ -8,7 +8,7 @@
</div>
</div>
<main class="m-2">
<div class="m-2">
@if ($action === 'list')
@if ($message)
<div class="alert alert-success">
......@@ -19,131 +19,120 @@
</div>
</div>
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md">
<div class="pb-4">
<div class="my-3 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="text-2xl text-black ">
Send Patch to Customer
</h2>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
Send Patch to Customer
</h2>
</div>
<div class="pb-4 card shadow-lg p-4">
<div class="flex justify-between">
<div class="px-2 ml-4">
</div>
{{-- @include('components/search-by', ['searchBy' => $searchBy ?? []]) --}}
<div class="flex justify-between">
<div class="px-2 ml-4">
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-14 rounded-full p-0 hover:bg-primary-focus hover:text-main-container active:text-main-container focus:text-main-container dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model.defer="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model.defer="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-main-container px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
@foreach ($searchBy as $key => $by)
<option value="{{ $key }}">{{ $by }}</option>
@endforeach
</select>
</span>
<button type="button"
class="bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus"
wire:click="search">Search</button>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-14 rounded-full p-0 hover:bg-primary-focus hover:text-main-container active:text-main-container focus:text-main-container dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model.defer="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model.defer="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-main-container px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
@foreach ($searchBy as $key => $by)
<option value="{{ $key }}">{{ $by }}</option>
@endforeach
</select>
</span>
<button type="button"
class="bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus"
wire:click="search">Search</button>
</div>
</div>
</div>
</div>
<div class="mx-3 mt-3 px-4">
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table class="is-hoverable table w-full text-left ">
<thead>
<tr>
<th
class="whitespace-nowrap text-center rounded-tl-lg bg-slate-300 px-4 py-3 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5">
Patch ID
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Patch Name
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Description
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Server
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Date
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Level
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Remark
</th>
<th
class="whitespace-nowrap rounded-tr-lg bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Action
</th>
</tr>
</thead>
<tbody>
<div class="mx-3 mt-3 px-4">
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table class="is-hoverable table w-full text-left ">
<thead>
<tr>
<th
class="whitespace-nowrap text-center rounded-tl-lg bg-slate-300 px-4 py-3 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5">
Patch ID
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Patch Name
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Description
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Server
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Date
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Level
</th>
<th
class="whitespace-nowrap bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Remark
</th>
<th
class="whitespace-nowrap rounded-tr-lg bg-slate-300 text-black px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Action
</th>
</tr>
</thead>
<tbody>
@foreach ($results as $patch)
<tr
class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
{{-- <td class="whitespace-nowrap px-4 py-3 sm:px-5">
<label class="inline-flex items-center space-x-2">
<input
class="form-checkbox is-basic h-4 w-4 rounded border-slate-400/70 checked:bg-primary checked:border-primary hover:border-primary focus:border-primary dark:bg-navy-900 dark:border-navy-500 dark:checked:bg-accent dark:checked:border-accent dark:hover:border-accent dark:focus:border-accent"
type="checkbox" wire:model.defer="selectedPatchs"
value="{{ $patch->id }}" />
</label>
</td> --}}
<td class="whitespace-nowrap px-1 py-3 sm:px-2 text-center">{{ $patch->PID }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PATCHNAME }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
{{ \Illuminate\Support\Str::limit($patch->PDESC, 40) }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->NUMSERVER }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PDATE }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PLEVEL }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->Remark }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
<div class="flex justify-center space-x-2">
<a wire:click="showpatchEditForm({{ $patch->PID }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@foreach ($results as $patch)
<tr class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
<td class="whitespace-nowrap px-1 py-3 sm:px-2 text-center">{{ $patch->PID }}
</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PATCHNAME }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
{{ \Illuminate\Support\Str::limit($patch->PDESC, 40) }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->NUMSERVER }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PDATE }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->PLEVEL }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $patch->Remark }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
<div class="flex justify-center space-x-2">
<a wire:click="showpatchEditForm({{ $patch->PID }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- <livewire:delete-modal /> --}}
{{ $results->links('livewire.paginate-custom') }}
{{-- <livewire:delete-modal /> --}}
{{ $results->links('livewire.paginate-custom') }}
</div>
</div>
</div>
@elseif($action === 'edit')
{{-- <livewire:pages.send-patch.send-patch-edit :editPid="$editPid"> --}}
<livewire:pages.send-patch.send-patch-edit :editPid="$editPid">
@endif
</main>
</div>
<div class="border-0 shadow-none">
<div wire:loading.class="" wire:loading.class.remove="hidden" wire:target="save"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="items-center h-100vh" style="align-content: center;">
<div class="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"></div>
</div>
<div class="border-0 shadow-none" x-cloak>
<div wire:loading.class="" wire:loading.class.remove="hidden" wire:target="save"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="items-center h-100vh" style="align-content: center;">
<div class="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"></div>
</div>
</div>
<div class="m-2" >
{{-- <div wire:loading.class="flex" wire:loading.class.remove="hidden"
class="absolute inset-0 items-center justify-center z-50 bg-slate-50 dark:bg-navy-900 hidden">
<div class="flex justify-center items-center ">
<div class="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-blue-500"></div>
</div>
<div class="my-5 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800">
User Management
</h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
{{ $action === 'create' ? 'Create' : ($action === 'edit' ? 'Edit' : '') }}
</h2>
</div>
<div class="m-2">
@if ($action === 'list')
@if ($message)
<div class="alert alert-success">
<div wire:ignore x-data="{ show: true }" x-init="setTimeout(() => show = false, 3000)"
x-show.transition.duration.500ms="show"
class="fixed top-5 right-5 z-50 bg-green-500 text-white py-2 px-4 rounded-md shadow-lg">
{{ $message }}
</div>
</div>
</div> --}}
@if ($action === 'list')
@if ($message)
<div class="alert alert-success">
<div wire:ignore x-data="{ show: true }" x-init="setTimeout(() => show = false, 3000)"
x-show.transition.duration.500ms="show"
class="fixed top-5 right-5 z-50 bg-green-500 text-white py-2 px-4 rounded-md shadow-lg">
{{ $message }}
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md">
<div class="pb-4 pt-5 bg-white rounded-lg shadow-lg">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button type="button"
class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showUserAddForm">Add</button>
</div>
</div>
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md">
<div class="my-1 flex h-8 items-center justify-between px-4 sm:px-5">
<h2 class="text-2xl text-black ">
User Management
</h2>
</div>
<div class="pb-4 pt-5 bg-white rounded-lg shadow-lg">
<div class="flex justify-between">
<div class="px-2 ml-4">
<button type="button" class="py-2 px-3 bg-primary rounded-md text-white hover:bg-primary-focus"
wire:click="showUserAddForm">Add</button>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-10 rounded-full p-0 hover:bg-primary-focus hover:text-main-container active:text-main-container focus:text-main-container primary-focus hover:text-main-container active:text-main-container focus:text-main-container dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model.defer="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model.defer="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-main-container px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
@foreach ($searchBy as $key => $by)
<option value="{{ $key }}">{{ $by }}</option>
@endforeach
</select>
</span>
<button type="button" class="bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus"
wire:click="search">Search</button>
</div>
<div class="inline-flex flex-initial">
<div x-data="{ isInputActive: true }">
<div class="flex gap-4 px-5 items-center">
<button @click="isInputActive = !isInputActive"
class="btn h-8 w-10 rounded-full p-0 hover:bg-primary-focus hover:text-main-container active:text-main-container focus:text-main-container primary-focus hover:text-main-container active:text-main-container focus:text-main-container dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4.5 w-4.5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<span class="w-64" x-show="isInputActive === true">
<input
class="form-input h-9 peer w-full rounded-lg border border-slate-300 bg-transparent px-3 py-2 placeholder:text-slate-400/70 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:hover:border-navy-400 dark:focus:border-accent"
placeholder="Search Keyword" type="text" wire:model.defer="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model.defer="searchSelected"
class="form-select h-9 w-full rounded-lg border border-slate-300 bg-main-container px-3 py-2 hover:border-slate-400 focus:border-primary dark:border-navy-450 dark:bg-navy-700 dark:hover:border-navy-400 dark:focus:border-accent">
@foreach ($searchBy as $key => $by)
<option value="{{ $key }}">{{ $by }}</option>
@endforeach
</select>
</span>
<button type="button"
class="bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus"
wire:click="search">Search</button>
</div>
</div>
</div>
<div class="mx-3 mt-3 px-4">
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table class="is-hoverable table w-full text-left border-b" >
<thead>
<tr>
</div>
<div class="mx-3 mt-3 px-4">
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table class="is-hoverable table w-full text-left border-b">
<thead>
<tr>
<th
class="whitespace-nowrap rounded-tl-lg bg-slate-300 px-4 py-3 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5">
#
......@@ -97,104 +97,110 @@
class="whitespace-nowrap rounded-tr-lg bg-slate-300 px-4 py-3 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5">
Action
</th>
</tr>
</thead>
<tbody>
@foreach ($results as $user)
<tr class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
</tr>
</thead>
<tbody>
@foreach ($results as $user)
<tr
class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500">
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
<label class="inline-flex items-center space-x-2">
<label for="selectedUsers-{{ $user->id }}"
class="inline-flex items-center space-x-2">
<input @change="toggleGroup($event)"
class="form-checkbox is-basic h-4 w-4 rounded border-slate-400/70 checked:bg-primary checked:border-primary hover:border-primary focus:border-primary dark:bg-navy-900 dark:border-navy-500 dark:checked:bg-accent dark:checked:border-accent dark:hover:border-accent dark:focus:border-accent"
type="checkbox" wire:model.defer="selectedUsers"
id="selectedUsers-{{ $user->id }}"
value="{{ $user->id }}" />
</label>
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $user->username }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $user->email }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
@php
$groups = $user->groups->take(5);
$remainingCount = $user->groups->count() - $groups->count();
@endphp
@foreach ($groups as $group)
<li
class="inline-block mr-2 mb-2 px-2 py-1 bg-primary text-white rounded text-xs">
{{ $group->name }}</li>
@endforeach
@if ($remainingCount > 0)
<li class="inline-block px-2 py-1 bg-gray-300 text-gray-700 rounded">+
{{ $remainingCount }} more</li>
@endif
<ul>
@php
$groups = $user->groups->take(5);
$remainingCount = $user->groups->count() - $groups->count();
@endphp
@foreach ($groups as $group)
<li
class="inline-block mr-2 mb-2 px-2 py-1 bg-primary text-white rounded text-xs">
{{ $group->name }}</li>
@endforeach
@if ($remainingCount > 0)
<li
class="inline-block px-2 py-1 bg-gray-300 text-gray-700 rounded">
+
{{ $remainingCount }} more</li>
@endif
</ul>
</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $user->created_at }}</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
<div class="flex justify-center space-x-2">
<a wire:click="showUserEditForm({{ $user->id }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
<a @click="$wire.emit('showDeleteModal', {{ $user->id }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-trash"></i>
</a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<template x-if="showDeleteListModal">
<div class="fixed inset-0 z-[100] flex flex-col items-center justify-center overflow-hidden px-4 py-6 sm:px-5"
@keydown.window.escape="showDeleteListModal = false">
<div class="absolute inset-0 bg-slate-900/60 transition-opacity duration-300"
@click="showDeleteListModal = false"></div>
<div
class="relative p-4 max-w-lg rounded-lg bg-white px-4 py-10 text-center transition-opacity duration-300 dark:bg-navy-700 sm:px-5">
<svg xmlns="http://www.w3.org/2000/svg" class="inline h-28 w-28 text-error"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z">
</path>
</svg>
<div class="mt-4 mx-5">
<h2 class="text-2xl text-slate-700 dark:text-navy-100">
Are you sure <br> you want to delete <span
x-text="selectedUsersAlpine.length"></span> users?
</h2>
<p class="mt-2"></p>
<button @click="showDeleteListModal = false"
class="btn mt-6 bg-[#6a6e69] font-medium text-white hover:bg-[#313430] focus:bg-[#313430]-focus active:bg-[#313430]-focus/90">
Close
</button>
<button
@click="$wire.emitSelf('deleteSelected', selectedUsers ); showDeleteListModal = false"
class="btn mt-6 bg-error font-medium text-white hover:bg-error-focus focus:bg-error-focus active:bg-error-focus/90">
Confirm
</button>
</div>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $user->created_at }}
</td>
<td class="whitespace-nowrap px-1 py-3 sm:px-2">
<div class="flex justify-center space-x-1">
<a wire:click="showUserEditForm({{ $user->id }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-edit"></i>
</a>
<a @click="$wire.emit('showDeleteModal', {{ $user->id }})"
class="btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25">
<i class="fa fa-trash"></i>
</a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<template x-if="showDeleteListModal">
<div class="fixed inset-0 z-[100] flex flex-col items-center justify-center overflow-hidden px-4 py-6 sm:px-5"
@keydown.window.escape="showDeleteListModal = false">
<div class="absolute inset-0 bg-slate-900/60 transition-opacity duration-300"
@click="showDeleteListModal = false"></div>
<div
class="relative p-4 max-w-lg rounded-lg bg-white px-4 py-10 text-center transition-opacity duration-300 dark:bg-navy-700 sm:px-5">
<svg xmlns="http://www.w3.org/2000/svg" class="inline h-28 w-28 text-error"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z">
</path>
</svg>
<div class="mt-4 mx-5">
<h2 class="text-2xl text-slate-700 dark:text-navy-100">
Are you sure <br> you want to delete <span
x-text="selectedUsersAlpine.length"></span> users?
</h2>
<p class="mt-2"></p>
<button @click="showDeleteListModal = false"
class="btn mt-6 bg-[#6a6e69] font-medium text-white hover:bg-[#313430] focus:bg-[#313430]-focus active:bg-[#313430]-focus/90">
Close
</button>
<button
@click="$wire.emitSelf('deleteSelected', selectedUsers ); showDeleteListModal = false"
class="btn mt-6 bg-error font-medium text-white hover:bg-error-focus focus:bg-error-focus active:bg-error-focus/90">
Confirm
</button>
</div>
</div>
</template>
<livewire:delete-modal />
{{ $results->links('livewire.paginate-custom') }}
</div>
</div>
</template>
<livewire:delete-modal />
{{ $results->links('livewire.paginate-custom') }}
</div>
</div>
@elseif($action === 'create')
</div>
@elseif($action === 'create')
<livewire:pages.user.user-create wire:key="user-create" />
@elseif($action === 'edit')
<livewire:pages.user.user-edit :editUserId="$editUserId" wire:key="user-edit" />
@else
<div></div>
@endif
</div>
</div>
\ No newline at end of file
</div>
......@@ -27,6 +27,8 @@ use App\Http\Controllers\SendPatchController;
use App\Http\Controllers\ServerLicenseController;
use App\Http\Controllers\TestController;
use App\Http\Controllers\TransferDataController;
use App\Http\Livewire\MainContainer;
use App\Http\Livewire\Pages\Patch\PatchIndex;
use App\Http\Livewire\Pages\Role\RoleIndex;
use App\Http\Livewire\Pages\SendPatch\SendPatch;
/*
......@@ -49,13 +51,16 @@ Route::middleware('guest')->group(function () {
Route::post('/register', [\App\Http\Controllers\AuthController::class, 'register'])->name('register');
});
Route::middleware([ ])->group(function () {
Route::middleware(['auth' ])->group(function () {
Route::post('/logout', [\App\Http\Controllers\AuthController::class, 'logout'])->name('logout');
Route::get('/convert-to-json', [ConvertToJsonController::class, 'convert']);
Route::get('/', [HomeController::class, 'index'])->name('index');
Route::get('/get-serverlicense', [ServerLicenseController::class, 'getAllServerKey']);
Route::get('/patch', [PatchController::class, 'index'])->name('patch.index');
Route::get('/master-file', [MasterFileController::class, 'index'])->name('master-file.index');
Route::get('/format-file-master', [FormatFileMasterContrller::class, 'index'])->name('format-file-master.index');
Route::get('/send-patch', [SendPatchController::class, 'index']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment