Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sarun Mungthanya
SpnPatch-Laravel
Commits
61193e4d
Commit
61193e4d
authored
Dec 12, 2024
by
Sarun Mungthanya
Browse files
issue select all send patch
parent
78e85313
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Http/Livewire/Pages/SendPatch/SendPatchEdit.php
View file @
61193e4d
...
...
@@ -23,7 +23,7 @@ class SendPatchEdit extends Component
public
$searchSelected
=
'SNKEY'
;
public
$keyword
=
''
;
public
$selectedPenddings
=
[];
public
$serverkey
=
''
,
$showSearch
=
false
,
$searchInProgress
=
false
,
$resultsServerkey
=
[];
public
$serverkey
=
''
,
$showSearch
=
false
,
$searchInProgress
=
false
,
$resultsServerkey
=
[]
,
$resultsServerkeyArr
=
[];
public
$serverKeyWaitingSend
=
[],
$serverKeySuccess
=
[];
protected
$listeners
=
[
'deletePatch'
,
'refreshComponent'
=>
'$refresh'
,
'sendPatch'
];
public
function
mount
(
$editPid
)
...
...
@@ -67,6 +67,7 @@ class SendPatchEdit extends Component
{
if
(
$this
->
searchInProgress
)
{
$this
->
reset
(
'resultsServerkey'
);
$this
->
reset
(
'resultsServerkeyArr'
);
}
$this
->
searchInProgress
=
true
;
$query
=
ConfServerLicense
::
query
();
...
...
@@ -87,6 +88,7 @@ class SendPatchEdit extends Component
$query
->
where
(
'OWNERTYPE'
,
$this
->
selectedOwnerType
);
}
$this
->
resultsServerkey
=
$query
->
get
();
$this
->
resultsServerkeyArr
=
$query
->
get
()
->
toArray
();
$this
->
showSearch
=
true
;
$this
->
searchInProgress
=
false
;
}
...
...
resources/views/livewire/pages/send-patch/send-patch-edit.blade.php
View file @
61193e4d
...
...
@@ -3,6 +3,15 @@
serverKeySuccess: [],
serverKeyWaitingSend: [],
loading: false,
allKeys: @entangle('resultsServerkeyArr'),
serverKeySelectAll() {
console.log('test');
this.allKeys.forEach(key => {
if (!this.serverKeyWaitingSend.some(item => item.id === key.ID)) {
this.serverKeyWaitingSend.push({ id: key.ID, value: key.SNKEY });
}
});
},
serverKeySelect(id, value) {
this.serverKeyWaitingSend.push({ id, value });
},
...
...
@@ -71,7 +80,8 @@
<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"
>
{{
--
wire:click=
"selectAllResults"
--
}}
@
click=
"serverKeySelectAll()"
>
Select All
</li>
@forelse($resultsServerkey as $result)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment