Commit 681d2cd0 authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

update validate patch

parent 6ea37075
...@@ -23,13 +23,15 @@ class PatchCreate extends Component ...@@ -23,13 +23,15 @@ class PatchCreate extends Component
public $fileChanges = [], $filePathChanges = []; public $fileChanges = [], $filePathChanges = [];
public $searchProject = 'SPN64Bits'; public $searchProject = 'SPN64Bits';
public $UNINSTALL = '$b=1'; public $UNINSTALL = '$b=1';
public $PATCHNAME, $PDATE, $PHP_VERSION, $PLEVEL, $PCODE, $MAJOR_VERSION, $PDESC, $Remark, $POWNER, $PAPPROVEDATE, $PTYPE, $SPECIFIC_CUSTOMER, $PATCHCODE, $PATCHCODE_SERVER; public $PATCHNAME, $PDATE, $PHP_VERSION = 0, $PLEVEL, $PCODE, $MAJOR_VERSION, $PDESC, $Remark, $POWNER,$POWNERNAME, $PAPPROVEDATE, $PTYPE, $SPECIFIC_CUSTOMER, $PATCHCODE, $PATCHCODE_SERVER;
public function mount() public function mount()
{ {
$this->PDATE = date("Y-m-d H:i:s"); $this->PDATE = date("Y-m-d H:i:s");
$this->PAPPROVEDATE = date("Y-m-d H:i:s"); $this->PAPPROVEDATE = date("Y-m-d H:i:s");
$this->PLEVEL = 'High'; $this->PLEVEL = 'High';
$this->POWNERNAME = auth()->user()->username??'';
$this->PATCHCODE = 'function updatePatchFile($PATH_APP,$content){ $this->PATCHCODE = 'function updatePatchFile($PATH_APP,$content){
$handle = fopen($PATH_APP, "w"); $handle = fopen($PATH_APP, "w");
fputs($handle,base64_decode($content)); fputs($handle,base64_decode($content));
...@@ -164,35 +166,33 @@ class PatchCreate extends Component ...@@ -164,35 +166,33 @@ class PatchCreate extends Component
public function save() public function save()
{ {
// $this->validate([
// 'PATCHNAME' => 'required|string|max:255', $this->validate([
// 'PDATE' => 'required|date', 'PATCHNAME' => 'required|string|max:255',
// 'PHP_VERSION' => 'required|integer', 'PHP_VERSION' => 'required|in:0,1,2,3',
// 'PLEVEL' => 'required|string|max:255', 'PLEVEL' => 'required|string|max:255',
// 'PCODE' => 'required|string|max:255', 'MAJOR_VERSION' => 'required|string|max:255',
// 'MAJOR_VERSION' => 'required|string|max:255', 'PDESC' => 'required|string|max:255',
// 'PDESC' => 'required|string|max:255', // 'POWNER' => 'required|string|max:255',
// 'Remark' => 'required|string|max:255', 'PAPPROVEDATE' => 'required|date',
// 'POWNER' => 'required|string|max:255', 'PTYPE' => 'required|string|max:255',
// 'PAPPROVEDATE' => 'required|date', // 'PATCHCODE' => 'required|string',
// 'PTYPE' => 'required|string|max:255', // 'UNINSTALL' => 'required|string|max:255',
// 'PATCHCODE' => 'required|string', // 'PATCHCODE_SERVER' => 'required|string',
// 'UNINSTALL' => 'required|string|max:255', ]);
// 'PATCHCODE_SERVER' => 'required|string',
// ]);
$codePhpVersion = MasterPhpVer::find($this->PHP_VERSION); $codePhpVersion = MasterPhpVer::find($this->PHP_VERSION);
$confSmartUpdate = new ConfSmartUpdate(); $confSmartUpdate = new ConfSmartUpdate();
$confSmartUpdate->PATCHNAME = $this->PATCHNAME; $confSmartUpdate->PATCHNAME = $this->PATCHNAME;
$confSmartUpdate->PDATE = $this->PDATE; $confSmartUpdate->PDATE = date("Y-m-d H:i:s");
$confSmartUpdate->PHP_VERSION_ID = $this->PHP_VERSION; $confSmartUpdate->PHP_VERSION_ID = $this->PHP_VERSION;
$confSmartUpdate->PLEVEL = $this->PLEVEL; $confSmartUpdate->PLEVEL = $this->PLEVEL;
$confSmartUpdate->PCODE = $this->PCODE; $confSmartUpdate->PCODE = $this->PCODE;
$confSmartUpdate->MAJOR_VERSION = $this->MAJOR_VERSION; $confSmartUpdate->MAJOR_VERSION = $this->MAJOR_VERSION;
$confSmartUpdate->PDESC = $this->PDESC; $confSmartUpdate->PDESC = $this->PDESC;
$confSmartUpdate->Remark = $this->Remark; $confSmartUpdate->Remark = $this->Remark;
$confSmartUpdate->POWNER = $this->POWNER; $confSmartUpdate->POWNER = auth()->user()->id;
$confSmartUpdate->PAPPROVEDATE = $this->PAPPROVEDATE; $confSmartUpdate->PAPPROVEDATE = $this->PAPPROVEDATE;
$confSmartUpdate->PTYPE = $this->PTYPE; $confSmartUpdate->PTYPE = $this->PTYPE;
$confSmartUpdate->PATCHCODE = ($codePhpVersion->check_code ?? '') . " " . $this->PATCHCODE; $confSmartUpdate->PATCHCODE = ($codePhpVersion->check_code ?? '') . " " . $this->PATCHCODE;
......
...@@ -5,6 +5,7 @@ namespace App\Http\Livewire\Pages\Patch; ...@@ -5,6 +5,7 @@ namespace App\Http\Livewire\Pages\Patch;
use Livewire\Component; use Livewire\Component;
use App\Models\ConfSmartUpdate; use App\Models\ConfSmartUpdate;
use App\Models\TabPatchFile; use App\Models\TabPatchFile;
use App\Models\User;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
...@@ -144,7 +145,14 @@ class PatchEdit extends Component ...@@ -144,7 +145,14 @@ class PatchEdit extends Component
public function loadPatchData() public function loadPatchData()
{ {
$patch = ConfSmartUpdate::findOrFail($this->patchId); $patch = ConfSmartUpdate::findOrFail($this->patchId);
if(!isset($patch->user)) {
$owner = User::where('id', $patch->POWNER)->first();
$this->POWNERNAME = $owner->username;
}else{
$this->POWNERNAME = $patch->user->username;
}
$this->PATCHNAME = $patch->PATCHNAME; $this->PATCHNAME = $patch->PATCHNAME;
$this->PDATE = $patch->PDATE; $this->PDATE = $patch->PDATE;
$this->PHP_VERSION = $patch->PHP_VERSION; $this->PHP_VERSION = $patch->PHP_VERSION;
...@@ -154,7 +162,7 @@ class PatchEdit extends Component ...@@ -154,7 +162,7 @@ class PatchEdit extends Component
$this->PDESC = $patch->PDESC; $this->PDESC = $patch->PDESC;
$this->Remark = $patch->Remark; $this->Remark = $patch->Remark;
$this->POWNER = $patch->POWNER; $this->POWNER = $patch->POWNER;
$this->POWNERNAME = $patch->user->first_name ?? '';
$this->PAPPROVEDATE = $patch->PAPPROVEDATE; $this->PAPPROVEDATE = $patch->PAPPROVEDATE;
$this->PTYPE = $patch->PTYPE; $this->PTYPE = $patch->PTYPE;
$this->PATCHCODE = $patch->PATCHCODE; $this->PATCHCODE = $patch->PATCHCODE;
......
...@@ -45,11 +45,11 @@ class ConfSmartupdate extends Model ...@@ -45,11 +45,11 @@ class ConfSmartupdate extends Model
} }
public function servers() public function servers()
{ {
return $this->hasMany(ConfServerPendding::class, 'PatchID', 'PID'); return $this->hasMany(ConfServerPendding::class, 'PatchID', 'PID');
} }
public function user() public function user()
{ {
return $this->belongsTo(User::class, 'POWNER', 'uid'); return $this->belongsTo(User::class, 'POWNER' , 'uid');
} }
} }
...@@ -20,11 +20,11 @@ class User extends Authenticatable ...@@ -20,11 +20,11 @@ class User extends Authenticatable
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = [ protected $fillable = [
'uid',
'username', 'username',
'first_name', 'first_name',
'last_name', 'last_name',
'phone', 'phone',
'uid',
'email', 'email',
'password', 'password',
]; ];
...@@ -52,7 +52,10 @@ class User extends Authenticatable ...@@ -52,7 +52,10 @@ class User extends Authenticatable
{ {
return $this->belongsToMany(Group::class); return $this->belongsToMany(Group::class);
} }
public function patches()
{
return $this->hasMany(ConfSmartupdate::class , 'uid', 'POWNER');
}
public function permissions() public function permissions()
{ {
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
branches: @entangle('branches').defer, branches: @entangle('branches').defer,
fileChanges: @entangle('fileChanges').defer, fileChanges: @entangle('fileChanges').defer,
isLoading: false, isLoading: false,
showChangeFile : false
fetchProjects() { fetchProjects() {
this.isLoading = true; this.isLoading = true;
this.selectedProject = '60'; this.selectedProject = '60';
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
<input type="text" value="254e87" wire:model.defer="endCommit" placeholder="End Commit" <input type="text" value="254e87" wire:model.defer="endCommit" placeholder="End Commit"
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" @click="showChangeFile = true"
class="btn mx-auto mt-3 text-white bg-primary px-3 py-2">Get class="btn mx-auto mt-3 text-white bg-primary px-3 py-2">Get
Changed Changed
Files</button> Files</button>
...@@ -99,7 +100,7 @@ ...@@ -99,7 +100,7 @@
</div> </div>
</div> </div>
</template> --}} </template> --}}
<div class="mt-5 bg-gray-100 p-4 rounded-lg shadow"> <div class="mt-5 bg-gray-100 p-4 rounded-lg shadow" x-show="showChangeFile">
<h3 class="text-lg mb-3">Changed Files</h3> <h3 class="text-lg mb-3">Changed Files</h3>
<div class="file-tree"> <div class="file-tree">
<ul class='pl-4 mt-1'> <ul class='pl-4 mt-1'>
...@@ -121,68 +122,118 @@ ...@@ -121,68 +122,118 @@
<label for="patch_name" class="block text-gray-700">Patch name</label> <label for="patch_name" class="block text-gray-700">Patch name</label>
<input type="text" id="patch_name" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <input type="text" id="patch_name" class="w-full mt-1 p-2 border border-gray-300 rounded-md"
wire:model.defer="PATCHNAME"> wire:model.defer="PATCHNAME">
@error('PATCHNAME')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</div> </div>
<div class="mb-4"> {{-- <div class="mb-4">
<label for="patch_date" class="block text-gray-700">Patch date</label> <label for="patch_date" class="block text-gray-700">Patch date</label>
<input type="datetime-local" id="patch_date" <input type="datetime-local" id="patch_date"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PDATE"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PDATE">
</div> @error('PDATE')
<div class="mb-4"> <span class="text-tiny+ text-error">{{ $message }}</span>
<label for="php_version" class="block text-gray-700">PHP Version</label> @enderror
<select id="php_version" wire:model.defer="PHP_VERSION" </div> --}}
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <div class="grid grid-cols-6 space-x-2 mb-4">
<option value="0">ALL</option> <div class="col-span-2">
<option value="1">32Bits (PHP 5.2)</option> <label for="major_version" class="block text-gray-700">Major version</label>
<option value="2">64Bits (PHP 5.6)</option> <input type="text" id="major_version"
<option value="3">64Bits (PHP 8.0)</option> class="w-full mt-1 p-2 border border-gray-300 rounded-md"
</select> wire:model.defer="MAJOR_VERSION">
</div> @error('MAJOR_VERSION')
<div class="mb-4"> <span class="text-tiny+ text-error">{{ $message }}</span>
<label for="patch_level" class="block text-gray-700">Patch level</label> @enderror
<input type="text" id="patch_level" </div>
class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PLEVEL"> <div class="col-span-2">
</div> <label for="php_version" class="block text-gray-700">PHP Version</label>
<div class="mb-4"> <select id="php_version" wire:model.defer="PHP_VERSION"
<label for="code" class="block text-gray-700">Patch Code</label> class="w-full mt-1 p-2 border border-gray-300 rounded-md">
<input type="text" id="code" wire:model.defer="PCODE" <option value="0">ALL</option>
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <option value="1">32Bits (PHP 5.2)</option>
</div> <option value="2">64Bits (PHP 5.6)</option>
<div class="mb-4"> <option value="3">64Bits (PHP 8.0)</option>
<label for="major_version" class="block text-gray-700">Major version</label> </select>
<input type="text" id="major_version" @error('PHP_VERSION')
class="w-full mt-1 p-2 border border-gray-300 rounded-md" <span class="text-tiny+ text-error">{{ $message }}</span>
wire:model.defer="MAJOR_VERSION"> @enderror
</div>
<div class="col-span-2">
<label for="patch_level" class="block text-gray-700">Patch level</label>
<select id="patch_level" wire:model.defer="PLEVEL"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
<option value="High">High</option>
<option value="Auto">Auto</option>
<option value="Critical">Critical</option>
</select>
@error('PLEVEL')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</div>
</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" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <textarea id="pdesc" wire:model.defer="PDESC" class="w-full mt-1 p-2 border border-gray-300 rounded-md"
rows="3"></textarea> rows="3"></textarea>
@error('PDESC')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</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>
<input type="text" id="remark" wire:model.defer="Remark" <input type="text" id="remark" wire:model.defer="Remark"
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">
@error('Remark')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</div> </div>
<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="POWNERNAME"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" value="aom"> class="w-full mt-1 p-2 border border-gray-300 rounded-md bg-gray-300" readonly>
</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>
<input type="datetime-local" id="papprovedate" wire:model.defer="PAPPROVEDATE" <input type="datetime-local" id="papprovedate" wire:model.defer="PAPPROVEDATE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" value="2024-03-27T15:00"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" value="2024-03-27T15:00">
</div> </div>
<div class="mb-4"> <div x-data="{ isOpen: false }" class="mb-4">
<label for="ptype" class="block text-gray-700">Ptype</label> <button @click="isOpen = !isOpen"
<input type="text" id="ptype" wire:model.defer="PTYPE" class="flex items-center space-x-2 bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus justify-self-end">
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <span x-text="isOpen ? 'Hide Details' : 'More Details'"></span>
</div> <svg x-show="!isOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none"
<div class="mb-4"> viewBox="0 0 24 24" stroke="currentColor">
<label for="specific_customer" class="block text-gray-700">Specific Customer</label> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
<input type="text" id="specific_customer" d="M12 4v16m8-8H4" />
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> </svg>
<svg x-show="isOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 12H4" />
</svg>
</button>
<div id="specialBox" x-show="isOpen" x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform scale-90"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-90" class="">
<div class="mb-4">
<label for="code" class="block text-gray-700">Patch Code</label>
<input type="text" id="code" wire:model.defer="PCODE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
<div class="mb-4">
<label for="ptype" class="block text-gray-700">Ptype</label>
<input type="text" id="ptype" wire:model.defer="PTYPE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
<div class="mb-4">
<label for="specific_customer" class="block text-gray-700">Specific Customer</label>
<input type="text" id="specific_customer"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
</div>
</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" @click="showModal = true" x-model="tempPathCode" wire:model.defer="PATCHCODE" <textarea id="patchcode" @click="showModal = true" x-model="tempPathCode" wire:model.defer="PATCHCODE"
...@@ -200,7 +251,7 @@ ...@@ -200,7 +251,7 @@
</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-primary text-white px-4 py-2 rounded-md hover:bg-primary-focus">Save</button>
</div> </div>
<div x-show="showModal" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto"> <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="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
transition: width 0.5s; transition: width 0.5s;
} }
</style> </style>
<a href="/patch" type="button" class="btn mx-auto m-3 text-white bg-primary px-3 py-2">Back</a> <a href="/patch" type="button" class="btn mx-auto m-1 text-white bg-primary px-3 py-2">Back</a>
<div x-show="progress > 0" x-text="progress + '%'"></div> <div x-show="progress > 0" x-text="progress + '%'"></div>
...@@ -152,10 +152,10 @@ ...@@ -152,10 +152,10 @@
<div x-show="activeTab === 'tab2'" class="" x-data="{ selectedDeleteFiles: [], showDeleteListModal: false }"> <div x-show="activeTab === 'tab2'" class="" x-data="{ selectedDeleteFiles: [], showDeleteListModal: false }">
<div class="py-2 "> <div class="py-2 ">
<button type="button" <button type="button"
class="py-2 px-3 bg-white border border-primary text-primary rounded-md hover:text-main-container hover:bg-primary-focus" class="py-2 px-3 bg-primary border border-primary text-white rounded-md hover:bg-primary-focus"
wire:click="$emit('openModalFormPatchFile', '', '{{ $patchId }}')">Add</button> wire:click="$emit('openModalFormPatchFile', '', '{{ $patchId }}')">Add</button>
<button type="button" <button type="button"
class="py-2 px-3 bg-white border-error border rounded-md text-error hover:text-main-container hover:bg-error-focus" class="py-2 px-3 bg-error border-error border rounded-md text-white hover:bg-error-focus"
@click="showDeleteListModal = true">Delete</button> @click="showDeleteListModal = true">Delete</button>
</div> </div>
<div x-show="showDeleteListModal" <div x-show="showDeleteListModal"
...@@ -232,49 +232,67 @@ ...@@ -232,49 +232,67 @@
</div> </div>
</div> </div>
<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="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">
<label for="patch_name" class="block text-gray-700">Patch name</label> <label for="patch_name" class="block text-gray-700">Patch name</label>
<input type="text" id="patch_name" <input type="text" id="patch_name"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PATCHNAME"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PATCHNAME">
@error('PATCHNAME')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label for="patch_date" class="block text-gray-700">Patch date</label> <label for="patch_date" class="block text-gray-700">Patch date</label>
<input type="datetime-local" id="patch_date" <input type="datetime-local" id="patch_date"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PDATE"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PDATE">
</div> </div>
<div class="mb-4">
<label for="php_version" class="block text-gray-700">PHP Version</label> <div class="grid grid-cols-6 space-x-2 mb-4">
<select id="php_version" wire:model.defer="PHP_VERSION" <div class="col-span-2">
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <label for="major_version" class="block text-gray-700">Major version</label>
<option value="0">ALL</option> <input type="text" id="major_version"
<option value="1">32Bits (PHP 5.2)</option> class="w-full mt-1 p-2 border border-gray-300 rounded-md"
<option value="2">64Bits (PHP 5.6)</option> wire:model.defer="MAJOR_VERSION">
<option value="3">64Bits (PHP 8.0)</option> @error('MAJOR_VERSION')
</select> <span class="text-tiny+ text-error">{{ $message }}</span>
</div> @enderror
<div class="mb-4"> </div>
<label for="patch_level" class="block text-gray-700">Patch level</label> <div class="col-span-2">
<input type="text" id="patch_level" <label for="php_version" class="block text-gray-700">PHP Version</label>
class="w-full mt-1 p-2 border border-gray-300 rounded-md" wire:model.defer="PLEVEL"> <select id="php_version" wire:model.defer="PHP_VERSION"
</div> class="w-full mt-1 p-2 border border-gray-300 rounded-md">
<div class="mb-4"> <option value="0">ALL</option>
<label for="code" class="block text-gray-700">Patch Code</label> <option value="1">32Bits (PHP 5.2)</option>
<input type="text" id="code" wire:model.defer="PCODE" <option value="2">64Bits (PHP 5.6)</option>
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <option value="3">64Bits (PHP 8.0)</option>
</div> </select>
<div class="mb-4"> @error('PHP_VERSION')
<label for="major_version" class="block text-gray-700">Major version</label> <span class="text-tiny+ text-error">{{ $message }}</span>
<input type="text" id="major_version" @enderror
class="w-full mt-1 p-2 border border-gray-300 rounded-md" </div>
wire:model.defer="MAJOR_VERSION"> <div class="col-span-2">
<label for="patch_level" class="block text-gray-700">Patch level</label>
<select id="patch_level" wire:model.defer="PLEVEL"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
<option value="High">High</option>
<option value="Auto">Auto</option>
<option value="Critical">Critical</option>
</select>
@error('PLEVEL')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</div>
</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" class="w-full mt-1 p-2 border border-gray-300 rounded-md" <textarea id="pdesc" wire:model.defer="PDESC" class="w-full mt-1 p-2 border border-gray-300 rounded-md"
rows="3"></textarea> rows="3"></textarea>
@error('PDESC')
<span class="text-tiny+ text-error">{{ $message }}</span>
@enderror
</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>
...@@ -283,23 +301,50 @@ ...@@ -283,23 +301,50 @@
</div> </div>
<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="POWNERNAME" readonly <input type="text" id="owner" wire:model.defer="POWNERNAME" readonly
class="w-full mt-1 p-2 border border-gray-300 rounded-md bg-slate-300"> class="w-full mt-1 p-2 border border-gray-300 rounded-md bg-gray-300">
</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>
<input type="datetime-local" id="papprovedate" wire:model.defer="PAPPROVEDATE" <input type="datetime-local" id="papprovedate" wire:model.defer="PAPPROVEDATE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md" value="2024-03-27T15:00"> class="w-full mt-1 p-2 border border-gray-300 rounded-md" value="2024-03-27T15:00">
</div> </div>
<div class="mb-4"> <div x-data="{ isOpen: false }" class="mb-4">
<label for="ptype" class="block text-gray-700">Ptype</label> <button @click="isOpen = !isOpen"
<input type="text" id="ptype" wire:model.defer="PTYPE" class="flex items-center space-x-2 bg-primary text-white px-4 py-2 rounded hover:bg-primary-focus justify-self-end">
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> <span x-text="isOpen ? 'Hide Details' : 'More Details'"></span>
</div> <svg x-show="!isOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none"
<div class="mb-4"> viewBox="0 0 24 24" stroke="currentColor">
<label for="specific_customer" class="block text-gray-700">Specific Customer</label> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
<input type="text" id="specific_customer" d="M12 4v16m8-8H4" />
class="w-full mt-1 p-2 border border-gray-300 rounded-md"> </svg>
<svg x-show="isOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 12H4" />
</svg>
</button>
<div id="specialBox" x-show="isOpen" x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="opacity-0 transform scale-90"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-90" class="">
<div class="mb-4">
<label for="code" class="block text-gray-700">Patch Code</label>
<input type="text" id="code" wire:model.defer="PCODE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
<div class="mb-4">
<label for="ptype" class="block text-gray-700">Ptype</label>
<input type="text" id="ptype" wire:model.defer="PTYPE"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
<div class="mb-4">
<label for="specific_customer" class="block text-gray-700">Specific Customer</label>
<input type="text" id="specific_customer"
class="w-full mt-1 p-2 border border-gray-300 rounded-md">
</div>
</div>
</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>
...@@ -313,8 +358,8 @@ ...@@ -313,8 +358,8 @@
</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" @click="showModal2 = true" x-model="tempPathCodeServer" 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" @click="$wire.call('startProcess')" <button type="button" @click="$wire.call('startProcess')"
...@@ -322,29 +367,31 @@ ...@@ -322,29 +367,31 @@
</div> </div>
<div x-show="showModal" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto"> <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"> <div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code</h2> <div class="w-full p-4">
<textarea x-model="tempPathCode" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30" <h2 class="text-xl font-semibold mb-4">Edit Patch Code</h2>
style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea> <textarea x-model="tempPathCode" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30"
<div class="mt-4 flex justify-end space-x-2"> style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<button @click="showModal = false" <div class="mt-4 flex justify-end space-x-2">
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button> <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> </div>
</div> </div>
<div x-show="showModal2" class="fixed inset-0 z-50 bg-gray-800/40 overflow-auto"> <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"> <div class="bg-white rounded-lg w-4/5 mx-auto mt-10 mb-10 pb-4">
<h2 class="text-xl font-semibold mb-4">Edit Patch Code Server</h2> <div class="w-full p-4">
<textarea x-model="tempPathCodeServer" class="w-full h-full p-2 bg-white rounded border border-gray-300" rows="30" <h2 class="text-xl font-semibold mb-4">Edit Patch Code Server</h2>
style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea> <textarea x-model="tempPathCodeServer" class="w-full h-full p-2 bg-white rounded border border-gray-300"
<div class="mt-4 flex justify-end space-x-2"> rows="30" style="font-family: monospace; white-space: pre; overflow-wrap: normal; overflow-x: auto;">></textarea>
<button @click="showModal2 = false" <div class="mt-4 flex justify-end space-x-2">
class="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600">Close</button> <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>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
wire:model.debounce.500ms="serverkey" placeholder="Search for a server key"> wire:model.debounce.500ms="serverkey" placeholder="Search for a server key">
@if (!empty($serverkey) && $showSearch) @if (!empty($serverkey) && $showSearch)
<ul class="mt-2 border border-gray-200 rounded-md max-h-64 overflow-auto"> <ul class="border border-gray-200 rounded-md max-h-64 overflow-auto">
@forelse($results as $result) @forelse($results as $result)
<li class="p-2 hover:bg-gray-100 cursor-pointer" <li class="p-2 hover:bg-gray-100 cursor-pointer"
wire:click="selectResult('{{ $result->SNKEY }}')"> wire:click="selectResult('{{ $result->SNKEY }}')">
......
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