Commit 497eea9b authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

add modaledit patchcode

parent 4e4fec73
...@@ -24,7 +24,7 @@ const serverLicenseSelect = { ...@@ -24,7 +24,7 @@ const serverLicenseSelect = {
console.error("Invalid data for item:", data); console.error("Invalid data for item:", data);
return ""; return "";
} }
return `<span class="badge rounded-lg bg-primary dark:bg-accent text-white p-px m-1 mr-2 py-2"> return `<span class="badge rounded-lg bg-primary dark:bg-accent text-white px-2 m-1 mr-2 py-2">
<span class="mx-2">${escape(data.name)}</span> <span class="mx-2">${escape(data.name)}</span>
</span>`; </span>`;
}, },
......
...@@ -26,7 +26,7 @@ const userSelect = { ...@@ -26,7 +26,7 @@ const userSelect = {
console.error("Invalid data for item:", data); console.error("Invalid data for item:", data);
return ""; 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 px-2 m-1 mr-2 py-2">
<span class="mx-2">${escape(data.name)}</span> <span class="mx-2">${escape(data.name)}</span>
</span>`; </span>`;
}, },
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<div class="mb-4"> <div class="mb-4">
<div class="flex items-center mt-2"> <div class="flex items-center mt-2">
<label for="upload_file" class="block text-gray-700 font-medium mr-5">Upload File Data</label> <label for="upload_file" class="block text-gray-700 font-medium mr-5">Upload File Data</label>
@if ($file) @if ($file)
<div class="text-sm text-gray-600 dark:text-gray-300 mr-4"> <div class="text-sm text-gray-600 dark:text-gray-300 mr-4">
Uploaded File: {{ $file->getClientOriginalName() }} Uploaded File: {{ $file->getClientOriginalName() }}
...@@ -44,11 +44,13 @@ ...@@ -44,11 +44,13 @@
</svg> </svg>
<span>Choose File</span> <span>Choose File</span>
</div> </div>
@error('file')
<span class="text-red-600 text-sm mt-2">{{ $message }}</span>
@enderror
</label> </label>
</div> </div>
@error('file')
<span class="text-red-600 text-sm mt-2">{{ $message }}</span>
@enderror
</div> </div>
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
</h2> </h2>
</div> </div>
<a type="button" href="/patch" class="btn mx-auto m-3 text-white bg-primary px-3 py-2">Back</a> <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"> <div class="pb-4 max-w-full mx-auto">
@if (session()->has('message')) @if (session()->has('message'))
<div class="alert alert-success"> <div class="alert alert-success">
{{ session('message') }} {{ session('message') }}
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="w-full md:w-1/2 px-3 mb-6"> <div class="w-full md:w-1/2 px-3 mb-6" x-data="{ showModal: false, showModal2: false, tempPathCode: @entangle('PATCHCODE').defer, tempPathCodeServer: @entangle('PATCHCODE_SERVER').defer }">
<div class="p-6 bg-white shadow-md rounded-lg rounded-lg "> <div class="p-6 bg-white shadow-md rounded-lg rounded-lg ">
<h2 class="text-2xl text-black font-bold mb-4">Create Patch</h2> <h2 class="text-2xl text-black font-bold mb-4">Create Patch</h2>
<div class="mb-4"> <div class="mb-4">
...@@ -139,8 +139,8 @@ ...@@ -139,8 +139,8 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patch_level" class="block text-gray-700">Patch level</label> <label for="patch_level" class="block text-gray-700">Patch level</label>
<input type="text" id="patch_level" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <input type="text" id="patch_level"
wire:model.defer="PLEVEL"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PLEVEL">
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="code" class="block text-gray-700">Patch Code</label> <label for="code" class="block text-gray-700">Patch Code</label>
...@@ -155,8 +155,8 @@ ...@@ -155,8 +155,8 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="pdesc" class="block text-gray-700">Patch Desciption</label> <label for="pdesc" class="block text-gray-700">Patch Desciption</label>
<textarea id="pdesc" wire:model.defer="PDESC" <textarea id="pdesc" wire:model.defer="PDESC" class="w-full mt-1 p-2 border border-gray-300 rounded-md"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="3"></textarea> rows="3"></textarea>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="remark" class="block text-gray-700">Remark</label> <label for="remark" class="block text-gray-700">Remark</label>
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patchcode" class="block text-gray-700">Patchcode</label> <label for="patchcode" class="block text-gray-700">Patchcode</label>
<textarea id="patchcode" wire:model.defer="PATCHCODE" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <textarea id="patchcode" @click="showModal = true" x-model="tempPathCode" wire:model.defer="PATCHCODE"
rows="5">pathcode</textarea> class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5">pathcode</textarea>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="uninstall" class="block text-gray-700">Uninstall</label> <label for="uninstall" class="block text-gray-700">Uninstall</label>
...@@ -195,13 +195,41 @@ ...@@ -195,13 +195,41 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patchcode_server" class="block text-gray-700">Patchcode_server</label> <label for="patchcode_server" class="block text-gray-700">Patchcode_server</label>
<textarea id="patchcode_server" wire:model.defer="PATCHCODE_SERVER" <textarea id="patchcode_server" @click="showModal2 = true" x-model="tempPathCodeServer"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5"></textarea> wire:model.defer="PATCHCODE_SERVER" class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5"></textarea>
</div> </div>
<div class="flex justify-center"> <div class="flex justify-center">
<button type="button" wire:click="save" <button type="button" wire:click="save"
class="bg-stone-700 text-white px-4 py-2 rounded-md hover:bg-blue-600">Save</button> class="bg-stone-700 text-white px-4 py-2 rounded-md hover:bg-blue-600">Save</button>
</div> </div>
<div x-show="showModal" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto">
<div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4">
<div class="w-full p-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code</h2>
<textarea x-model="tempPathCode" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30"
style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<div class="mt-4 flex justify-end space-x-2">
<button @click="showModal = false"
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button>
</div>
</div>
</div>
</div>
<div x-show="showModal2" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto">
<div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4">
<div class="w-full p-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code Server</h2>
<textarea x-model="tempPathCodeServer" class="w-full h-full p-2 bg-white rounded border border-gray-300"
rows="30" style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<div class="mt-4 flex justify-end space-x-2">
<button @click="showModal2 = false"
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
}); });
}, 1000); }, 1000);
});" x-cloak> });" x-cloak>
<link href="{{ asset('css/pages/patch.css') }}" rel="stylesheet"> <link href="{{ asset('css/pages/patch.css') }}" rel="stylesheet">
<div class="mt-5 mb-2 flex h-8 place-content-center px-4 "> <div class="mt-5 mb-2 flex h-8 place-content-center px-4 ">
<h2 class="text-xl text-slate-800"> <h2 class="text-xl text-slate-800">
Patch Management Patch Management
</h2> </h2>
<h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4"> <h2 class="ml-3 text-xl text-slate-800 font-semibold underline underline-offset-4">
Edit Edit
</h2> </h2>
</div> </div>
<div class="max-w-full mx-auto px-5" > <div class="max-w-full mx-auto px-5">
<style> <style>
.progress-bar { .progress-bar {
height: 20px; height: 20px;
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
class="placeholder:text-sm text-lg mb-2 form-input rounded-lg border border-slate-300 px-2"> class="placeholder:text-sm text-lg mb-2 form-input rounded-lg border border-slate-300 px-2">
<div class="text-center"> <div class="text-center">
<button type="button" wire:click="getChangedFiles" <button type="button" wire:click="getChangedFiles"
class="btn mx-auto mt-3 text-white bg-stone-700 px-3 py-2">Get Changed class="btn mx-auto mt-3 text-white bg-primary px-3 py-2">Get Changed
Files</button> Files</button>
</div> </div>
</div> </div>
...@@ -173,18 +173,18 @@ ...@@ -173,18 +173,18 @@
</div> </div>
</div> </div>
<div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1"> <div class="is-scrollbar-hidden min-w-full table-responsive" x-data="pages.tables.initExample1">
<table aria-describedby="mydesc" class="is-hoverable table w-full text-left border-b"> <table aria-describedby="mydesc" class="is-hoverable table w-full text-left border-b">
<thead> <thead>
<tr> <tr>
<th scope="col" <th scope="col"
class="whitespace-nowrap rounded-tl-md bg-slate-300 px-4 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5"> class="whitespace-nowrap rounded-tl-md bg-slate-300 px-4 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-5">
# #
</th> </th>
<th scope="col" <th scope="col"
class="whitespace-nowrap bg-slate-300 px-2 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-2"> class="whitespace-nowrap bg-slate-300 px-2 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-2">
File Name File Name
</th> </th>
<th scope="col" <th scope="col"
class="whitespace-nowrap rounded-tr-md bg-slate-300 px-2 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-2"> class="whitespace-nowrap rounded-tr-md bg-slate-300 px-2 py-1 font-semibold uppercase text-black dark:bg-navy-800 dark:text-navy-100 lg:px-2">
Action Action
</th> </th>
...@@ -196,10 +196,12 @@ ...@@ -196,10 +196,12 @@
<tr <tr
class="border-y border-transparent border-b-slate-200 dark:border-b-navy-500"> 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"> <td class="whitespace-nowrap px-4 py-1 sm:px-5">
<label for="patchFile-{{ $patchFile['fid'] }}" class="inline-flex items-center space-x-2"> <label for="patchFile-{{ $patchFile['fid'] }}"
class="inline-flex items-center space-x-2">
<input <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" 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" id="patchFile-{{ $patchFile['fid'] }}" type="checkbox" x-model="selectedDeleteFiles"
id="patchFile-{{ $patchFile['fid'] }}"
value="{{ $patchFile['fid'] }}" /> value="{{ $patchFile['fid'] }}" />
</label> </label>
</td> </td>
...@@ -209,12 +211,13 @@ ...@@ -209,12 +211,13 @@
<td class="whitespace-nowrap px-1 py-1 sm:px-2"> <td class="whitespace-nowrap px-1 py-1 sm:px-2">
<div class="flex justify-center space-x-2"> <div class="flex justify-center space-x-2">
<button 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"> 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 aria-hidden="true" class="fa fa-edit"></i> <i aria-hidden="true" class="fa fa-edit"></i>
</button> </button>
<button onclick="confirmDeletePatchFile({{ $patchFile['fid'] }})" <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" > 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 aria-hidden="true" class="fa fa-trash"></i> <i aria-hidden="true" class="fa fa-trash"></i>
</button> </button>
</div> </div>
...@@ -229,7 +232,7 @@ ...@@ -229,7 +232,7 @@
</div> </div>
</div> </div>
<div class="w-full md:w-1/2 px-3 mb-6"> <div class="w-full md:w-1/2 px-3 mb-6" x-data="{ showModal: false, showModal2: false, tempPathCode: @entangle('PATCHCODE').defer, tempPathCodeServer: @entangle('PATCHCODE_SERVER').defer }">
<div class="p-6 bg-white shadow-lg rounded-lg "> <div class="p-6 bg-white shadow-lg rounded-lg ">
<h2 class="text-2xl font-bold mb-4">Edit Patch</h2> <h2 class="text-2xl font-bold mb-4">Edit Patch</h2>
<div class="mb-4"> <div class="mb-4">
...@@ -270,8 +273,8 @@ ...@@ -270,8 +273,8 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="pdesc" class="block text-gray-700">Patch Description</label> <label for="pdesc" class="block text-gray-700">Patch Description</label>
<textarea id="pdesc" wire:model.defer="PDESC" <textarea id="pdesc" wire:model.defer="PDESC" class="w-full mt-1 p-2 border border-gray-300 rounded-md"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="3"></textarea> rows="3"></textarea>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="remark" class="block text-gray-700">Remark</label> <label for="remark" class="block text-gray-700">Remark</label>
...@@ -281,7 +284,7 @@ ...@@ -281,7 +284,7 @@
<div class="mb-4"> <div class="mb-4">
<label for="owner" class="block text-gray-700">Owner</label> <label for="owner" class="block text-gray-700">Owner</label>
<input type="text" id="owner" wire:model.defer="POWNER" <input type="text" id="owner" wire:model.defer="POWNER"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" > class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="papprovedate" class="block text-gray-700">Papprovedate</label> <label for="papprovedate" class="block text-gray-700">Papprovedate</label>
...@@ -300,8 +303,8 @@ ...@@ -300,8 +303,8 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patchcode" class="block text-gray-700">Patchcode</label> <label for="patchcode" class="block text-gray-700">Patchcode</label>
<textarea id="patchcode" wire:model.defer="PATCHCODE" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <textarea id="patchcode" @click="showModal = true" x-model="tempPathCode" wire:model.defer="PATCHCODE"
rows="5">pathcode</textarea> class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5">pathcode</textarea>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="uninstall" class="block text-gray-700">Uninstall</label> <label for="uninstall" class="block text-gray-700">Uninstall</label>
...@@ -310,16 +313,40 @@ ...@@ -310,16 +313,40 @@
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patchcode_server" class="block text-gray-700">Patchcode_server</label> <label for="patchcode_server" class="block text-gray-700">Patchcode_server</label>
<textarea id="patchcode_server" wire:model.defer="PATCHCODE_SERVER" <textarea id="patchcode_server" @click="showModal2 = true" x-model="tempPathCodeServer" wire:model.defer="PATCHCODE_SERVER"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5"></textarea> class="w-full mt-1 p-2 border border-gray-300 rounded-md" rows="5"></textarea>
</div> </div>
<div class="flex justify-center"> <div class="flex justify-center">
<button type="button" @click="$wire.call('startProcess')" <button type="button" @click="$wire.call('startProcess')"
class="bg-stone-700 text-white px-4 py-2 rounded-md hover:bg-blue-600">Save</button> class="bg-primary text-white px-4 py-2 rounded-md hover:bg-blue-600">Save</button>
</div> </div>
<div x-show="showModal" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto">
<div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4"><div class="w-full p-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code</h2>
<textarea x-model="tempPathCode" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30"
style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<div class="mt-4 flex justify-end space-x-2">
<button @click="showModal = false"
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button>
</div>
</div>
</div>
</div>
<div x-show="showModal2" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto">
<div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4"><div class="w-full p-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code Server</h2>
<textarea x-model="tempPathCodeServer" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30"
style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<div class="mt-4 flex justify-end space-x-2">
<button @click="showModal2 = false"
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
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