Commit 5fc7bb44 authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

issue serverlicense

parent 06b1d970
...@@ -48,17 +48,17 @@ class ServerLicenseCreate extends Component ...@@ -48,17 +48,17 @@ class ServerLicenseCreate extends Component
'company' => 'required|string|max:255', 'company' => 'required|string|max:255',
'branch' => 'nullable|string|max:255', 'branch' => 'nullable|string|max:255',
'status' => 'required|in:Y,N', 'status' => 'required|in:Y,N',
'licenseDate' => 'required|date', 'licenseDate' => 'nullable|date',
'phpVersionId' => 'required|integer', 'phpVersionId' => 'required|integer',
'currentVersion' => 'required|string|max:255', 'currentVersion' => 'nullable|string|max:255',
'installDate' => 'required|date', 'installDate' => 'nullable|date',
'installVersion' => 'required|string|max:255', 'installVersion' => 'nullable|string|max:255',
'databaseType' => 'required', 'databaseType' => 'required',
'ownerType' => 'required', 'ownerType' => 'nullable',
// 'hscodeMethod' => 'required|integer|in:1,2', // 'hscodeMethod' => 'required|integer|in:1,2',
'customerUrl' => 'required|string|max:255', 'customerUrl' => 'nullable|string|max:255',
'contact' => 'required|string|max:255', 'contact' => 'nullable|string|max:255',
'contactCustomerName' => 'required|string|max:255', 'contactCustomerName' => 'nullable|string|max:255',
]; ];
public function mount() public function mount()
{ {
......
...@@ -60,7 +60,26 @@ class ServerLicenseEdit extends Component ...@@ -60,7 +60,26 @@ class ServerLicenseEdit extends Component
public $mainvarCode; public $mainvarCode;
public $fileDownloads = []; public $fileDownloads = [];
protected $rules = [
'serverKey' => 'required|string|max:255',
'teamId' => 'required|integer',
'customerSize' => 'required|integer',
'customerTypes' => 'required',
'company' => 'required|string|max:255',
'branch' => 'nullable|string|max:255',
'status' => 'required|in:Y,N',
'licenseDate' => 'nullable|date',
'phpVersionId' => 'required|integer',
'currentVersion' => 'nullable|string|max:255',
'installDate' => 'nullable|date',
'installVersion' => 'nullable|string|max:255',
'databaseType' => 'required',
'ownerType' => 'nullable',
// 'hscodeMethod' => 'required|integer|in:1,2',
'customerUrl' => 'nullable|string|max:255',
'contact' => 'nullable|string|max:255',
'contactCustomerName' => 'nullable|string|max:255',
];
public function loadModal() public function loadModal()
{ {
...@@ -134,6 +153,7 @@ class ServerLicenseEdit extends Component ...@@ -134,6 +153,7 @@ class ServerLicenseEdit extends Component
public function updateLicense() public function updateLicense()
{ {
// dd( $this->teamId); // dd( $this->teamId);
$this->validate();
$license = ConfServerLicense::find($this->licenseId); $license = ConfServerLicense::find($this->licenseId);
if ($license) { if ($license) {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="teamId" wire:model.defer="teamId" <select id="teamId" wire:model.defer="teamId"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($teams as $team) @foreach ($teams as $team)
<option value="{{ $team->id }}">{{ $team->teamName }}</option> <option value="{{ $team->id }}">{{ $team->teamName }}</option>
@endforeach @endforeach
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="customerSize" wire:model.defer="customerSize" <select id="customerSize" wire:model.defer="customerSize"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($sizings as $size) @foreach ($sizings as $size)
<option value="{{ $size->id }}">{{ $size->sizeName }}</option> <option value="{{ $size->id }}">{{ $size->sizeName }}</option>
@endforeach @endforeach
...@@ -64,6 +66,7 @@ ...@@ -64,6 +66,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="customerType" wire:model.defer="customerType" <select id="customerType" wire:model.defer="customerType"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($customerTypes as $type) @foreach ($customerTypes as $type)
<option value="{{ $type->id }}">{{ $type->sizeTypeName }}</option> <option value="{{ $type->id }}">{{ $type->sizeTypeName }}</option>
@endforeach @endforeach
...@@ -139,6 +142,7 @@ ...@@ -139,6 +142,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="phpVersionId" wire:model.defer="phpVersionId" <select id="phpVersionId" wire:model.defer="phpVersionId"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($phpVersions as $version) @foreach ($phpVersions as $version)
<option value="{{ $version->id }}">{{ $version->version }}</option> <option value="{{ $version->id }}">{{ $version->version }}</option>
@endforeach @endforeach
...@@ -195,6 +199,7 @@ ...@@ -195,6 +199,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="databaseType" wire:model.defer="databaseType" <select id="databaseType" wire:model.defer="databaseType"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($dbTypes as $db) @foreach ($dbTypes as $db)
<option value="{{ $db->id }}">{{ $db->dbName }}</option> <option value="{{ $db->id }}">{{ $db->dbName }}</option>
@endforeach @endforeach
...@@ -212,6 +217,7 @@ ...@@ -212,6 +217,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="ownerType" wire:model.defer="ownerType" <select id="ownerType" wire:model.defer="ownerType"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($ownerTypes as $owner) @foreach ($ownerTypes as $owner)
<option value="{{ $owner->owntype_code }}">{{ $owner->owntype_description }} <option value="{{ $owner->owntype_code }}">{{ $owner->owntype_description }}
</option> </option>
...@@ -230,6 +236,7 @@ ...@@ -230,6 +236,7 @@
<div class="flex flex-col w-3/4"> <div class="flex flex-col w-3/4">
<select id="hscodeMethod" wire:model.defer="hscodeMethod" <select id="hscodeMethod" wire:model.defer="hscodeMethod"
class=" p-2 border border-gray-300 rounded-md"> class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
<option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option> <option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option>
<option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script <option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script
</option> </option>
......
<div class="bg-main-container"> <div class="bg-main-container">
<div class="max-w-full mx-auto p-5 "> <div class="max-w-full mx-auto p-5 ">
<div x-data="{ messages: @entangle('messages') }"> <div x-data="{ messages: @entangle('messages') }">
<template x-for="(message, index) in messages" :key="index"> <template x-for="(message, index) in messages" :key="index">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
class="inline-block py-2 px-4">File Download</a> class="inline-block py-2 px-4">File Download</a>
</li> </li>
<li class="mr-2"> <li class="mr-2">
<a href="#" @click.prevent="activeTab = 'historyPatch'" wire:click="loadHistoryPatch" <a href="#" @click.prevent="activeTab = 'historyPatch'" wire:click="loadHistoryPatch"
:class="{ 'border-b-2 border-blue-600 text-blue-600': activeTab === 'historyPatch' }" :class="{ 'border-b-2 border-blue-600 text-blue-600': activeTab === 'historyPatch' }"
class="inline-block py-2 px-4">History Patch</a> class="inline-block py-2 px-4">History Patch</a>
</li> </li>
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
<!-- Server Key --> <!-- Server Key -->
<div class="mb-4 flex items-center"> <div class="mb-4 flex items-center">
<label for="serverKey" class="w-1/4 text-gray-700">Server Key</label> <label for="serverKey" class="w-1/4 text-gray-700">Server Key</label>
<input type="text" id="serverKey" <input type="text" id="serverKey" class="w-3/4 p-2 border border-gray-300 rounded-md"
class="w-3/4 p-2 border border-gray-300 rounded-md" wire:model.defer="serverKey"> wire:model.defer="serverKey">
</div> </div>
<!-- Team --> <!-- Team -->
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<label for="teamId" class="w-1/4 text-gray-700">Team</label> <label for="teamId" class="w-1/4 text-gray-700">Team</label>
<select id="teamId" wire:model.defer="teamId" <select id="teamId" wire:model.defer="teamId"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($teams as $team) @foreach ($teams as $team)
<option value="{{ is_object($team) ? $team->id : $team['id'] }}"> <option value="{{ is_object($team) ? $team->id : $team['id'] }}">
{{ is_object($team) ? $team->teamName : $team['teamName'] }}</option> {{ is_object($team) ? $team->teamName : $team['teamName'] }}</option>
...@@ -112,6 +113,7 @@ ...@@ -112,6 +113,7 @@
<label for="customerSize" class="w-1/4 text-gray-700">Customer Sizing</label> <label for="customerSize" class="w-1/4 text-gray-700">Customer Sizing</label>
<select id="customerSize" wire:model.defer="customerSize" <select id="customerSize" wire:model.defer="customerSize"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($sizings as $size) @foreach ($sizings as $size)
<option value="{{ is_object($size) ? $size->id : $size['id'] }}"> <option value="{{ is_object($size) ? $size->id : $size['id'] }}">
{{ is_object($size) ? $size->sizeName : $size['sizeName'] }}</option> {{ is_object($size) ? $size->sizeName : $size['sizeName'] }}</option>
...@@ -124,6 +126,7 @@ ...@@ -124,6 +126,7 @@
<label for="customerType" class="w-1/4 text-gray-700">Customer Type</label> <label for="customerType" class="w-1/4 text-gray-700">Customer Type</label>
<select id="customerType" wire:model.defer="customerType" <select id="customerType" wire:model.defer="customerType"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($customerTypes as $type) @foreach ($customerTypes as $type)
<option value="{{ is_object($type) ? $type->id : $type['id'] }}"> <option value="{{ is_object($type) ? $type->id : $type['id'] }}">
{{ is_object($type) ? $type->sizeTypeName : $type['sizeTypeName'] }} {{ is_object($type) ? $type->sizeTypeName : $type['sizeTypeName'] }}
...@@ -174,6 +177,7 @@ ...@@ -174,6 +177,7 @@
<label for="phpVersionId" class="w-1/4 text-gray-700">PHP Version</label> <label for="phpVersionId" class="w-1/4 text-gray-700">PHP Version</label>
<select id="phpVersionId" wire:model.defer="phpVersionId" <select id="phpVersionId" wire:model.defer="phpVersionId"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($phpVersions as $version) @foreach ($phpVersions as $version)
<option value="{{ is_object($version) ? $version->id : $version['id'] }}"> <option value="{{ is_object($version) ? $version->id : $version['id'] }}">
{{ is_object($version) ? $version->version : $version['version'] }}</option> {{ is_object($version) ? $version->version : $version['version'] }}</option>
...@@ -207,6 +211,7 @@ ...@@ -207,6 +211,7 @@
<label for="databaseType" class="w-1/4 text-gray-700">Database Type</label> <label for="databaseType" class="w-1/4 text-gray-700">Database Type</label>
<select id="databaseType" wire:model.defer="databaseType" <select id="databaseType" wire:model.defer="databaseType"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($dbTypes as $db) @foreach ($dbTypes as $db)
<option value="{{ is_object($db) ? $db->id : $db['id'] }}"> <option value="{{ is_object($db) ? $db->id : $db['id'] }}">
{{ is_object($db) ? $db->dbName : $db['dbName'] }}</option> {{ is_object($db) ? $db->dbName : $db['dbName'] }}</option>
...@@ -219,6 +224,7 @@ ...@@ -219,6 +224,7 @@
<label for="ownerType" class="w-1/4 text-gray-700">Server of</label> <label for="ownerType" class="w-1/4 text-gray-700">Server of</label>
<select id="ownerType" wire:model.defer="ownerType" <select id="ownerType" wire:model.defer="ownerType"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($ownerTypes as $owner) @foreach ($ownerTypes as $owner)
<option <option
value="{{ is_object($owner) ? $owner->owntype_code : $owner['owntype_code'] }}"> value="{{ is_object($owner) ? $owner->owntype_code : $owner['owntype_code'] }}">
...@@ -232,6 +238,7 @@ ...@@ -232,6 +238,7 @@
<label for="hscodeMethod" class="w-1/4 text-gray-700">HSCODE 2017 Method</label> <label for="hscodeMethod" class="w-1/4 text-gray-700">HSCODE 2017 Method</label>
<select id="hscodeMethod" wire:model.defer="hscodeMethod" <select id="hscodeMethod" wire:model.defer="hscodeMethod"
class="w-3/4 p-2 border border-gray-300 rounded-md"> class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
<option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option> <option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option>
<option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script <option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script
</option> </option>
...@@ -257,7 +264,7 @@ ...@@ -257,7 +264,7 @@
</div> </div>
<div class="flex justify-center space-x-2"> <div class="flex justify-center space-x-2">
<a type="button" href="/server-license" <a type="button" href="/server-license"
class="bg-slate-700 text-white px-4 py-2 rounded-md hover:bg-slate-900">Back</a> class="bg-slate-700 text-white px-4 py-2 rounded-md hover:bg-slate-900">Back</a>
<button type="button" wire:click="updateLicense" <button type="button" wire:click="updateLicense"
class="bg-primary text-white px-4 py-2 rounded-md hover:bg-primary-focus">Save</button> class="bg-primary text-white px-4 py-2 rounded-md hover:bg-primary-focus">Save</button>
</div> </div>
...@@ -321,7 +328,9 @@ ...@@ -321,7 +328,9 @@
</div> </div>
<div x-show="activeTab === 'historyPatch'"> <div x-show="activeTab === 'historyPatch'">
@if ($tab === 'historyPatch') @if ($tab === 'historyPatch')
@include('livewire.pages.server-license.history-patch', ['historyPatchList' => $historyPatchList]) @include('livewire.pages.server-license.history-patch', [
'historyPatchList' => $historyPatchList,
])
@endif @endif
</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