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

issue serverlicense

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