Commit 930e8709 authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

add , reload , delete patch

parent 5bad2db9
This diff is collapsed.
{"/livewire.js":"/livewire.js?id=90730a3b0e7144480175"}
\ No newline at end of file
import Alpine from "alpinejs";
import $ from 'jquery';
import Alpine from 'alpinejs';
import persist from '@alpinejs/persist';
import collapse from '@alpinejs/collapse';
import intersect from '@alpinejs/intersect';
// AlpineJS Plugins
import persist from "@alpinejs/persist"; // @see https://alpinejs.dev/plugins/persist
import collapse from "@alpinejs/collapse"; // @see https://alpinejs.dev/plugins/collapse
import intersect from "@alpinejs/intersect"; // @see https://alpinejs.dev/plugins/intersect
// Alpine.js Plugins
Alpine.plugin(persist);
Alpine.plugin(collapse);
Alpine.plugin(intersect);
// Third Party Libraries
/*
Scrollbar Library
@see https://github.com/Grsmto/simplebar
*/
import SimpleBar from "simplebar";
/*
Code highlighting library
Just for demo purpose only for highlighting code
@see https://highlightjs.org/
*/
import hljs from "highlight.js/lib/core";
import xml from "highlight.js/lib/languages/xml";
/*
Date Utility Library
@see https://day.js.org/
*/
import dayjs from "dayjs";
/*
Carousel Library
@see https://swiperjs.com/
*/
import Swiper from "swiper/bundle";
/*
Drag & Drop Library
@see https://github.com/SortableJS/Sortable
*/
import Sortable from "sortablejs";
/*
Charts Libraries
@see https://apexcharts.com/
*/
import ApexCharts from "apexcharts";
/*
Tables Libraries
@see https://gridjs.io/
*/
import * as Gridjs from "gridjs";
// Forms Libraries
import "@caneara/iodine"; // @see https://github.com/caneara/iodine
import * as FilePond from "filepond"; // @see https://pqina.nl/filepond/
import FilePondPluginImagePreview from "filepond-plugin-image-preview"; // @see https://pqina.nl/filepond/docs/api/plugins/image-preview/
import FilePondPluginFileEncode from "filepond-plugin-file-encode"; // @see https://pqina.nl/filepond/docs/api/plugins/image-preview/
import Quill from "quill/dist/quill.min"; // @see https://quilljs.com/
import flatpickr from "flatpickr"; // @see https://flatpickr.js.org/
import Tom from "tom-select/dist/js/tom-select.complete.min"; // @see https://tom-select.js.org/
// Import Fortawesome icons
import $ from 'jquery';
import SimpleBar from 'simplebar';
import hljs from 'highlight.js/lib/core';
import sql from 'highlight.js/lib/languages/sql';
import xml from 'highlight.js/lib/languages/xml';
import dayjs from 'dayjs';
import Swiper from 'swiper/bundle';
import Sortable from 'sortablejs';
import ApexCharts from 'apexcharts';
import * as Gridjs from 'gridjs';
import "@caneara/iodine";
import * as FilePond from 'filepond';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';
import FilePondPluginFileEncode from 'filepond-plugin-file-encode';
import Quill from 'quill/dist/quill.min';
import flatpickr from 'flatpickr';
import Tom from 'tom-select/dist/js/tom-select.complete.min';
import "@fortawesome/fontawesome-free/css/all.css";
// Helper Functions
import * as helpers from "./utils/helpers";
// Pages Scripts
import * as pages from "./pages";
// Global Store
import store from "./store";
// Breakpoints Store
import breakpoints from "./utils/breakpoints";
// Alpine Components
import usePopper from "./components/usePopper";
import accordionItem from "./components/accordionItem";
// Alpine Directives
import tooltip from "./directives/tooltip";
import inputMask from "./directives/inputMask";
// Alpine Magic Functions
import notification from "./magics/notification";
import clipboard from "./magics/clipboard";
// Register HTML, XML language for highlight.js
// Just for demo purpose only for highlighting code
hljs.registerLanguage("xml", xml);
import * as helpers from './utils/helpers';
import * as pages from './pages';
import store from './store';
import breakpoints from './utils/breakpoints';
import usePopper from './components/usePopper';
import accordionItem from './components/accordionItem';
import tooltip from './directives/tooltip';
import inputMask from './directives/inputMask';
import notification from './magics/notification';
import clipboard from './magics/clipboard';
// Register highlight.js languages
hljs.registerLanguage('xml', xml);
hljs.registerLanguage('sql', sql);
hljs.configure({ ignoreUnescapedHTML: true });
// Register plugin image preview for filepond
// Register FilePond plugins
FilePond.registerPlugin(FilePondPluginImagePreview);
FilePond.registerPlugin(FilePondPluginFileEncode);
......@@ -108,24 +60,19 @@ window.FilePond = FilePond;
window.flatpickr = flatpickr;
window.Quill = Quill;
window.Tom = Tom;
window.Alpine = Alpine;
window.helpers = helpers;
window.pages = pages;
window.$ = $;
Alpine.plugin(persist);
Alpine.plugin(collapse);
Alpine.plugin(intersect);
Alpine.directive("tooltip", tooltip);
Alpine.directive("input-mask", inputMask);
Alpine.magic("notification", () => notification);
Alpine.magic("clipboard", () => clipboard);
Alpine.directive('tooltip', tooltip);
Alpine.directive('input-mask', inputMask);
Alpine.magic('notification', () => notification);
Alpine.magic('clipboard', () => clipboard);
Alpine.store('breakpoints', breakpoints);
Alpine.store('global', store);
Alpine.store("breakpoints", breakpoints);
Alpine.store("global", store);
Alpine.data('usePopper', usePopper);
Alpine.data('accordionItem', accordionItem);
Alpine.data("usePopper", usePopper);
Alpine.data("accordionItem", accordionItem);
Alpine.start();
export { charts } from "./apexchartDemo";
export { tomSelect } from "./tomselectDemo";
export { userSelect , fetchUsers } from "./userSelect";
export { roleSelect , fetchRoles } from "./roleSelect";
export { serverLicenseSelect , fetchServerLicenses } from "./serverLicenseSelect";
export * as tables from "./tablesDemo";
export * as formValidation from "./formValidationDemo";
......
const roleSelect = {
role: {
const serverLicenseSelect = {
serverkey: {
valueField: "id",
searchField: "name",
options: [], // Initialize empty array for options
......@@ -24,7 +24,7 @@ const roleSelect = {
console.error("Invalid data for item:", data);
return "";
}
return `<span class="badge rounded-full bg-primary dark:bg-accent text-white p-px mr-2">
return `<span class="badge rounded-lg bg-primary dark:bg-accent text-white p-px m-1 mr-2 py-2">
<span class="mx-2">${escape(data.name)}</span>
</span>`;
},
......@@ -32,19 +32,19 @@ const roleSelect = {
},
};
const fetchRoles = (roleSelect) => {
return fetch('/get-roles')
const fetchServerLicenses = (serverLicenseSelect) => {
return fetch('/get-serverlicense')
.then(response => response.json())
.then(data => {
if (!data.roles || !Array.isArray(data.roles)) {
if (!data.serverLicenses || !Array.isArray(data.serverLicenses)) {
console.error("Invalid response format:", data);
return;
}
roleSelect.role.options = data.roles;
serverLicenseSelect.serverkey.options = data.serverLicenses;
})
.catch(error => console.error('Error fetching role data:', error));
.catch(error => console.error('Error fetching serverkey data:', error));
};
export { roleSelect, fetchRoles };
\ No newline at end of file
export { serverLicenseSelect, fetchServerLicenses };
\ No newline at end of file
......@@ -26,47 +26,50 @@
rel="stylesheet" />
<script>
/**
* THIS SCRIPT REQUIRED FOR PREVENT FLICKERING IN SOME BROWSERS
*/
localStorage.getItem("_x_darkMode_on") === "true" &&
document.documentElement.classList.add("dark");
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
@isset($head)
{{ $head }}
@endisset
@livewireStyles
</head>
<body x-data x-bind="$store.global.documentBody"
class="@isset($isSidebarOpen) {{ $isSidebarOpen === 'true' ? 'is-sidebar-open' : '' }} @endisset @isset($isHeaderBlur) {{ $isHeaderBlur === 'true' ? 'is-header-blur' : '' }} @endisset @isset($hasMinSidebar) {{ $hasMinSidebar === 'true' ? 'has-min-sidebar' : '' }} @endisset @isset($headerSticky) {{ $headerSticky === 'false' ? 'is-header-not-sticky' : '' }} @endisset">
<x-app-partials.sideblock></x-app-partials.sideblock>
<x-app-partials.header></x-app-partials.header>
<!-- App preloader-->
<x-app-preloader></x-app-preloader>
<!-- Page Wrapper -->
<div id="root" class="min-h-100vh flex grow bg-slate-50 dark:bg-navy-900" x-cloak>
<style>
html,
body {
/* height: 100%; */
margin: 0;
}
{{ $slot }}
body {
display: flex;
flex-direction: column;
/* min-height: 100vh; */
}
</div>
main {
flex: 1;
background-color: white;
}
</style>
</head>
<!--
This is a place for Alpine.js Teleport feature
@see https://alpinejs.dev/directives/teleport
-->
<div id="x-teleport-target"></div>
<body class="h-full">
<script>
window.addEventListener("DOMContentLoaded", () => Alpine.start());
</script>
@livewireScripts
<main class="flex-grow overflow-hidden">
{{ $slot }}
@yield('content')
</main>
<footer class="bg-gray-800 text-white p-4">
<div class="container mx-auto">
<p class="text-center">&copy; 2024 Your Company</p>
</div>
</footer>
@livewireScripts
@isset($script)
{{ $script }}
@endisset
@yield('script')
</body>
</html>
......@@ -839,7 +839,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path>
</svg>
</button> -->
<p>Hello, {{ auth()->user()->username }}</p>
{{-- <p>Hello, {{ auth()->user()}}</p> --}}
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" x-tooltip.primary="'Logout'" class="btn h-8 w-8 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">
......
<div class="sidebar-panel">
<div class="flex h-full grow flex-col bg-white pl-[var(--main-sidebar-width)] dark:bg-navy-750">
<!-- Sidebar Panel Header -->
<div class="flex h-18 w-full items-center justify-between pl-4 pr-1">
<p class="text-base tracking-wider text-slate-800 dark:text-navy-100">
{{ $sidebarMenu['title'] }}
</p>
<button @click="$store.global.isSidebarExpanded = false"
class="btn h-7 w-7 rounded-full p-0 text-primary hover:bg-slate-300/20 focus:bg-slate-300/20 active:bg-slate-300/25 dark:text-accent-light/80 dark:hover:bg-navy-300/20 dark:focus:bg-navy-300/20 dark:active:bg-navy-300/25 xl:hidden">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</button>
</div>
<!-- Sidebar Panel Body -->
<div class="h-[calc(100%-4.5rem)] overflow-x-hidden pb-6" x-data="{ expandedItem: null }" x-init="$el._x_simplebar = new SimpleBar($el);">
@foreach ($sidebarMenu['items'] as $key => $menuItems)
@if ($key > 0)
<div class="my-3 mx-4 h-px bg-slate-200 dark:bg-navy-500"></div>
@endif
<ul class="flex flex-1 flex-col px-4 font-inter">
@foreach ($menuItems as $keyMenu => $menu)
@if (isset($menu['submenu']))
<li x-data="accordionItem('{{ $keyMenu }}')">
<a :class="expanded ? 'text-slate-800 font-semibold dark:text-navy-50' :
'text-slate-600 dark:text-navy-200'"
@click="expanded = !expanded"
class="flex items-center justify-between py-2 text-xs+ tracking-wide outline-none transition-[color,padding-left] duration-300 ease-in-out hover:text-slate-800 dark:hover:text-navy-50"
href="javascript:void(0);">
<span>{{ $menu['title'] }}</span>
<svg :class="expanded && 'rotate-90'" xmlns="http://www.w3.org/2000/svg"
class="h-4 w-4 text-slate-400 transition-transform ease-in-out" 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"></path>
</svg>
</a>
<ul x-collapse x-show="expanded">
@foreach ($menu['submenu'] as $keyMenu => $submenu)
<li
@if ($submenu['route_name'] === $pageName) x-init="$el.scrollIntoView({block:'center'}); expanded = true" @endif>
<a href="{{ route($submenu['route_name']) }}"
class="flex items-center justify-between p-2 text-xs+ tracking-wide
outline-none transition-[color,padding-left] duration-300 ease-in-out hover:pl-4
{{ $submenu['route_name'] === $pageName ? 'text-primary dark:text-accent-light font-medium' : 'text-slate-600 hover:text-slate-800 dark:text-navy-200 dark:hover:text-navy-50' }}">
<div class="flex items-center space-x-2">
<div
class="h-1.5 w-1.5 rounded-full border border-current opacity-40">
</div>
<span>{{ $submenu['title'] }}</span>
</div>
</a>
</li>
@endforeach
</ul>
</li>
@else
<li @if ($menu['route_name'] === $pageName) x-init="$el.scrollIntoView({block:'center'});" @endif>
<a href="{{ route($menu['route_name']) }}"
class="flex text-xs+ py-2 tracking-wide outline-none transition-colors duration-300 ease-in-out {{ $menu['route_name'] === $pageName ? 'text-primary dark:text-accent-light font-medium' : 'text-slate-600 hover:text-slate-800 dark:text-navy-200 dark:hover:text-navy-50' }}">
{{ $menu['title'] }}
</a>
</li>
@endif
@endforeach
</ul>
@endforeach
</div>
</div>
</div>
......@@ -32,41 +32,21 @@
localStorage.getItem("_x_darkMode_on") === "true" &&
document.documentElement.classList.add("dark");
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
@isset($head)
{{ $head }}
@endisset
@livewireStyles
{{-- @livewireStyles --}}
</head>
<body x-data x-bind="$store.global.documentBody"
class="@isset($isSidebarOpen) {{ $isSidebarOpen === 'true' ? 'is-sidebar-open' : '' }} @endisset @isset($isHeaderBlur) {{ $isHeaderBlur === 'true' ? 'is-header-blur' : '' }} @endisset @isset($hasMinSidebar) {{ $hasMinSidebar === 'true' ? 'has-min-sidebar' : '' }} @endisset @isset($headerSticky) {{ $headerSticky === 'false' ? 'is-header-not-sticky' : '' }} @endisset">
<x-app-partials.sideblock></x-app-partials.sideblock>
<x-app-partials.header></x-app-partials.header>
<!-- App preloader-->
<x-app-preloader></x-app-preloader>
<!-- Page Wrapper -->
<div id="root" class="min-h-100vh flex grow bg-slate-50 dark:bg-navy-900" x-cloak>
<body>
{{ $slot }}
{{ $slot }}
</div>
<!--
This is a place for Alpine.js Teleport feature
@see https://alpinejs.dev/directives/teleport
-->
<div id="x-teleport-target"></div>
<script>
window.addEventListener("DOMContentLoaded", () => Alpine.start());
</script>
@livewireScripts
{{-- @livewireScripts --}}
@isset($script)
{{ $script }}
@endisset
</body>
</html>
<x-base-layout title="Starter Sideblock" is-sidebar-open="true" is-header-blur="true">
<main class="main-content w-full px-[var(--margin-x)] pb-8">
<div class="flex items-center space-x-4 py-5 lg:py-6">
<!-- <div class="hidden h-full py-1 sm:flex">
<div class="h-full w-px bg-slate-300 dark:bg-navy-600"></div>
</div> -->
<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>
<div class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 28 28" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8.25 21v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21m0 0h4.5V3.545M12.75 21h7.5V10.75M2.25 21h1.5m18 0h-18M2.25 9l4.5-1.636M18.75 3l-1.5.545m0 6.205l3 1m1.5.5l-1.5-.5M6.75 7.364V3h-3v18m3-13.636l10.5-3.819" />
</svg><span class="ml-0">Home</span>
</div>
</li>
</ul>
</div>
<div class="w-full">
<div class="w-full card p-4 sm:p-5">
<p class="text-3xl text-center font-medium text-slate-700 dark:text-navy-100">
Welcome Admin
</p>
<div class="mt-4 space-y-4">
<div class="flex">
<div class="flex w-full items-center justify-center rounded-lg gap-10">
<button
class="btn h-6 w-56 space-x-2 rounded-full bg-amber-500 font-medium text-slate-800 hover:bg-amber-600 ">
<span>Upload File</span>
</button>
<button
class="btn h-6 w-56 space-x-2 rounded-full bg-amber-500 font-medium text-slate-800 hover:bg-amber-600 ">
<span>Pre-Arrival Manifest</span>
</button>
</div>
</div>
<label class="block">
<span class="text-center">
<ol class="steps">
<li class="step before:bg-slate-200 dark:before:bg-navy-500">
</li>
<li class="step before:bg-slate-200 dark:before:bg-navy-500">
<div
class="step-header rounded-full bg-slate-200 text-slate-800 dark:bg-navy-500 dark:text-white">
</div>
</li>
<li class="step before:bg-slate-200 dark:before:bg-navy-500">
</li>
</ol>
</span>
</label>
</div>
</div>
</div>
</main>
</x-layout-sideblock>
<x-app-layout title="Starter Sideblock" is-sidebar-open="true" is-header-blur="true">
{{-- <div class="container mx-auto mt-10 card min-h-auto z-0"> --}}
{{-- <div class="flex flex-col md:flex-row items-center"> --}}
{{-- Hello World --}}
{{-- </div> --}}
{{-- </div> --}}
<livewire:navbar />
<livewire:main-container />
</x-app-layout>
\ No newline at end of file
<div class="card mx-4 my-4 z-0 ">
<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>
{{-- end loading --}}
@if ($currentContent === 'Role')
<livewire:pages.role.role-index />
@elseif ($currentContent === 'User')
<livewire:pages.user.user-index />
@elseif ($currentContent === 'SendPatch')
<livewire:pages.send-patch.send-patch />
@else
<div class=" h-fit">
home
</div>
@endif
</div>
<nav class="bg-white shadow p-4 z-100">
<div class="container mx-auto flex justify-between items-center">
<div class="text-xl font-bold text-stone-700">SPN Patch</div>
<ul class="flex space-x-4 z-50">
<li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" class="relative">
<a href="#" class="text-gray-700 hover:text-stone-700">Server License Management</a>
<ul x-show="open" @click="open = false" @mouseleave="open = false"
class="absolute left-0 mt-2 w-48 bg-white shadow-lg">
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 1</a></li>
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 2</a></li>
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 3</a></li>
</ul>
</li>
<li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" class="relative">
<a href="#" class="text-gray-700 hover:text-stone-700">Patch Management</a>
<ul x-show="open" @click="open = false" @mouseleave="open = false"
class="absolute left-0 mt-2 w-48 bg-white shadow-lg">
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 1</a></li>
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 2</a></li>
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu 3</a></li>
</ul>
</li>
<li x-data="{ open: false }"wire:click.prevent="loadContent('SendPatch')" class="relative">
<a href="#" class="text-gray-700 hover:text-stone-700">Send Patch</a>
</li>
<li x-data="{ open: false }" @click.away="open = false" @mouseenter="open = true" class="relative">
<a href="#" class="text-gray-700 hover:text-stone-700">Configuration</a>
<ul x-show="open" @click="open = false" @mouseleave="open = false"
class="absolute left-0 mt-2 w-48 bg-white shadow-lg">
<li><a href="#" wire:click.prevent="loadContent('Role')"
class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Role</a></li>
<li><a href="#" wire:click.prevent="loadContent('User')"
class="block px-4 py-2 text-gray-700 hover:bg-stone-100">User</a>
</li>
<li><a href="#" class="block px-4 py-2 text-gray-700 hover:bg-stone-100">Submenu Item 3</a>
</li>
</ul>
</li>
<li><a href="#" class="bg-stone-700 text-white px-4 py-2 rounded">Logout</a></li>
<span>Hello , {{ auth()->user()->USERNAME ?? '' }}</span>
</ul>
</div>
</nav>
<div>
<!-- Your content here -->
<h1>Role Index Page</h1>
</div>
\ No newline at end of file
<div class="p-4 h-fit" >
<div class="mb-4" x-data="{ tomGReady: false }" x-show="tomGReady">
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-5">
<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>
@foreach ($ownerType as $type)
<option value="{{ $type->owntype_code }}">{{ $type->owntype_description }}</option>
@endforeach
</select>
</div>
<div class="" wire:ignore>
<label for="server_key" class="block text-sm font-medium text-gray-700">Server Key:</label>
<input id="server_key" class="mt-1.5 relative flex w-full" x-data="{
serverKeyLists: @entangle('server_lists')
}"
x-init="serverKeyLists = []
const tempLicense = pages.serverLicenseSelect;
pages.fetchServerLicenses(tempLicense).then(() => {
$el._x_tom = new Tom($el, {
...tempLicense.serverkey,
onChange: (value) => {
serverKeyLists = value;
}
});
$el._x_tom.setValue(serverKeyLists);
tomGReady = true;
});
{{-- $watch('test', (value) => {
if (tomGReady) {
$el._x_tom.clearOptions();
$el._x_tom.addOption(value);
$el._x_tom.refreshOptions(false);
}
}); --}}" type="text" placeholder="Search Server Key">
</div>
<div>
<label for="company" class="block text-sm font-medium text-gray-700">Company</label>
<input type="text" id="company" name="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>
<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"
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="cur_ver" class="block text-sm font-medium text-gray-700">Cur. Ver.</label>
<input type="text" id="cur_ver" name="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>
<label for="company_select" class="block text-sm font-medium text-gray-700">Company</label>
<select id="company_select" name="company_select"
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 company</option>
<!-- Options -->
</select>
</div>
<div class="flex space-x-2 mt-6">
{{-- <button class="btn bg-blue-500 text-white px-4 py-2 rounded">Add All List</button>
<button class="btn bg-red-500 text-white px-4 py-2 rounded">Delete All</button> --}}
</div>
</div>
</div>
<div class="flex justify-end mb-4 space-x-2">
<button type="button" wire:click="sendPatch"
class="btn bg-stone-700 text-white px-4 py-2 rounded hover:bg-stone-800">Send</button>
<button
class="btn bg-white text-stone-700 border border-stone-700 px-4 py-2 rounded hover:bg-gray-100">Back</button>
{{-- <button class="btn bg-stone-600 text-white px-4 py-2 rounded hover:bg-stone-700">Resend</button> --}}
</div>
<div class="mb-4">
<h3 class="text-lg font-medium leading-6 text-gray-900">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>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead>
<tr>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Choose</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Server ID</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Company</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Serverkey</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Status</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Task Date</th>
<th
class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Action</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($results as $server)
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<input type="checkbox"
class="form-checkbox h-4 w-4 text-indigo-600 transition duration-150 ease-in-out">
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $server->ServerID }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $server->COMPANY }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $server->SNKEY }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $server->STATUS }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $server->TaskDate }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
@if ($server->TaskStatus == '999')
<button type="button" wire:click="resendPatch({{ $server->ServerID }})" class="btn bg-info text-white px-4 py-2 rounded"><i class="fa fa-repeat"
aria-hidden="true"></i></button>
@else
<button type="button" wire:click="deletePatch({{ $server->ServerID }})" class="btn bg-info-focus text-white px-4 py-2 rounded"><i class="fa fa-trash"
aria-hidden="true"></i></button>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="mt-4">
{{ $results->links('livewire.paginate-custom') }}
</div>
</div>
<div>
<main class="main-content px-[var(--margin-x)] pb-8">
<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 href="#"
class="text-primary transition-colors hover:text-primary-focus dark:text-accent-light dark:hover:text-accent">Patch
Management(Send Patch to Customer)</a>
</li>
</ul>
</div>
<style>
table {
width: 100%;
table-layout: auto;
}
.table-responsive {
overflow-x: auto;
}
</style>
<main 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">
......@@ -30,7 +28,7 @@
@endif
<div class="grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 ">
<div class="card pb-4">
<div class="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">
......@@ -56,24 +54,25 @@
<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" />
placeholder="Search Keyword" type="text" wire:model.defer="keyword" />
</span>
<span class="w-52" x-show="isInputActive === true">
<select wire:model="searchSelected"
<select wire:model.defer="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">
@foreach ($searchBy as $key => $by)
<option value="{{ $key }}">{{ $by }}</option>
@endforeach
</select>
</span>
<button type="button" class="bg-stone-700 text-white px-4 py-2 rounded" 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 overflow-x-auto" x-data="pages.tables.initExample1">
<table class="is-hoverable w-full text-left">
<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
......@@ -81,35 +80,35 @@
#
</th> --}}
<th
class="whitespace-nowrap bg-slate-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap rounded-tl-lg bg-slate-200 px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Patch ID
</th>
<th
class="whitespace-nowrap bg-slate-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap bg-slate-200 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-200 px-4 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-5">
class="whitespace-nowrap rounded-tr-lg bg-slate-200 px-2 py-3 font-semibold uppercase text-slate-800 dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Action
</th>
</tr>
......@@ -127,14 +126,14 @@
value="{{ $patch->id }}" />
</label>
</td> --}}
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->PID }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->PATCHNAME }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->PDESC }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->NUMSERVER }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->PDATE }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->PLEVEL }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">{{ $patch->Remark }}</td>
<td class="whitespace-nowrap px-4 py-3 sm:px-5">
<td class="whitespace-nowrap px-1 py-3 sm:px-2">{{ $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 text-info hover:bg-info/20 focus:bg-info/20 active:bg-info/25">
......@@ -154,9 +153,8 @@
</div>
</div>
</div>
@elseif($action === 'edit')
{{-- <livewire:pages.patch.patch-edit :roles="$roles" :users="$users" :companies="$companies" :editpatchId="$editpatchId" wire:key="patch-edit" /> --}}
<livewire:pages.send-patch.send-patch-edit :editPid="$editPid">
@endif
</main>
</div>
<x-base-layout title="Login">
<x-guest-layout title="Login">
<style>
.background-image {
background-image: url('images/login-background.jpg'); /* Replace with your image URL */
......@@ -114,4 +114,4 @@
</div>
</div>
</x-base-layout>
</x-guest-layout>
<!-- resources/views/auth/login.blade.php -->
@extends('layouts.guest')
@section('content')
<div class="flex items-center justify-center min-h-screen bg-gray-100">
<div class="w-full max-w-md">
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<h2 class="text-center text-2xl font-bold mb-6">Login</h2>
<form method="POST" action="{{ route('login') }}">
@csrf
<div class="mb-4">
<label for="email" class="block text-gray-700 text-sm font-bold mb-2">Email Address</label>
<input id="email" type="email" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('email')
<span class="text-red-500 text-sm mt-2">{{ $message }}</span>
@enderror
</div>
<div class="mb-4">
<label for="password" class="block text-gray-700 text-sm font-bold mb-2">Password</label>
<input id="password" type="password" name="password" required autocomplete="current-password"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('password')
<span class="text-red-500 text-sm mt-2">{{ $message }}</span>
@enderror
</div>
<div class="mb-6">
<label class="block text-gray-500 font-bold">
<input class="mr-2 leading-tight" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<span class="text-sm">Remember Me</span>
</label>
</div>
<div class="flex items-center justify-between">
<button type="submit"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">
Login
</button>
@if (Route::has('password.request'))
<a class="inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800"
href="{{ route('password.request') }}">
Forgot Password?
</a>
@endif
</div>
</form>
</div>
</div>
</div>
@endsection
This diff is collapsed.
This diff is collapsed.
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