Commit c2410d6e authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

fix:issue prod

parent 3dca194a
......@@ -259,6 +259,10 @@ class SmartUpdateController extends Controller
$file_name_0 = '';
$file_data_0 = '';
}
if(!isset($file_name_0)) {
$file_name_0 = '';
$file_data_0 = '';
}
$patchCodeServer = str_replace('Query2Var', 'static::Query2Var', $patchDetails->PATCHCODE_SERVER);
$patchCodeServer = str_replace('Query2SQL', 'static::Query2SQL', $patchCodeServer);
if ($checkExchangeRate !== false) {
......@@ -293,7 +297,7 @@ class SmartUpdateController extends Controller
eval('$patchCode=<<<EOF2' . chr(13) . $patchCode . chr(13) . 'EOF2;' . chr(13));
$patchCode = str_replace('#', '$', $patchCode);
$patchCode = iconv("UTF-8" , "TIS-620" , $patchCode);
if (isset($mode) && $mode === 'AUTO') {
$pid = DB::table('conf_server_pendding as t0')
->join('conf_smartupdate as t1', 't0.PatchID', '=', 't1.PID')
......
......@@ -25,6 +25,19 @@
Livewire.on('updateSelectPatchAfterDeleted', () => {
this.clearAllSelections();
});
Livewire.hook('message.processed', () => {
this.loadSelectedPatch();
this.resetCheckAllCheckbox();
this.bindCheckboxEvents();
});
},
bindCheckboxEvents() {
const checkboxes = document.querySelectorAll('.individual-checkbox');
checkboxes.forEach((checkbox) => {
checkbox.addEventListener('click', (event) => {
this.updateSelectedPatch(event);
});
});
},
toggleAllCheckboxes(event) {
const checkboxes = document.querySelectorAll('.individual-checkbox');
......@@ -90,7 +103,7 @@
.length;
}
}" x-init="$watch('selectedPatch', () => resetCheckAllCheckbox())" class="w-full mb-6">
<div class="p-6 bg-white shadow-md rounded-lg">
<div x-show="true" class="">
<div class="flex justify-end mb-5">
......@@ -128,36 +141,36 @@
<div class="mt-3 ">
<div class="is-scrollbar-hidden min-w-full table-responsive">
<table aria-describedby="mydesc" class="is-hoverable table w-full text-left">
<table aria-describedby="mydesc" class="is-hoverable table w-full text-left">
<thead>
<tr>
<th scope="col"
<th scope="col"
class="whitespace-nowrap rounded-tl-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">
<input
class="form-checkbox is-basic h-4 w-4 rounded border-slate-400/70 checked:bg-primary checked:border-primary hover: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" id="check-all" @click="toggleAllCheckboxes" />
</th>
<th scope="col"
<th scope="col"
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 ID
</th>
<th scope="col"
<th scope="col"
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 scope="col"
<th scope="col"
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 scope="col"
<th scope="col"
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 scope="col"
<th scope="col"
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 scope="col"
<th scope="col"
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">
Remark
</th>
......
......@@ -13,8 +13,12 @@
});
},
serverKeySelect(id, value) {
console.log('Selected:', id, value);
if (!this.serverKeyWaitingSend.some(item => item.id == id)) {
this.serverKeyWaitingSend.push({ id, value });
console.log('Added:', this.serverKeyWaitingSend);
} else {
this.serverKeyWaitingSend = this.serverKeyWaitingSend.filter(item => item.id !== id);
}
},
removeServerKey(id) {
......@@ -63,8 +67,8 @@
<div class="relative flex items-center w-full">
<input type="text"
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"
wire:model.debounce.1000ms="serverkey" placeholder="Search for a server key">
wire:model.debounce.1000ms="serverkey"
placeholder="Search for a server key">
<span wire:loading
wire:target="serverkey, selectedOwnerType, company, db_type, cur_ver, selectAllResults"
class="absolute right-3">
......@@ -79,24 +83,19 @@
</span>
</div>
@if ($showSearch)
<ul x-show="open" @click.away="open = false"
class="absolute left-0 right-0 border border-gray-200 rounded-md max-h-64 overflow-auto z-50 bg-white">
<li class="p-2 bg-gray-200 hover:bg-gray-300 cursor-pointer font-semibold"
{{-- wire:click="selectAllResults" --}} @click="serverKeySelectAll()">
Select All
<ul x-show="open" @click.away="open = false"
class="absolute left-0 right-0 border border-gray-200 rounded-md max-h-64 overflow-auto z-50 bg-white">
<li class="p-2 bg-gray-200 hover:bg-gray-300 cursor-pointer font-semibold"
{{-- wire:click="selectAllResults" --}} @click="serverKeySelectAll()">
Select All
</li>
<template x-for="key in allKeys" :key="key.ID">
<li class="p-2 hover:bg-gray-100 cursor-pointer active:bg-[#065f46]"
@click="serverKeySelect(key.ID, key.SNKEY)">
<span x-text="key.SNKEY"></span>
</li>
@forelse($resultsServerkey as $result)
<li class="p-2 hover:bg-gray-100 cursor-pointer active:bg-[#065f46]"
@click="serverKeySelect('{{ $result->ID }}', '{{ $result->SNKEY }}')"
value="{{ $result->SNKEY }}">
{{ $result->SNKEY }}
</li>
@empty
<li class="p-2 text-gray-500">No results found</li>
@endforelse
</ul>
@endif
</template>
</ul>
</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