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
3dca194a
Commit
3dca194a
authored
Jan 02, 2025
by
Sarun Mungthanya
Browse files
fix:after deploy production
parent
8f31e6c3
Changes
9
Hide whitespace changes
Inline
Side-by-side
app/Http/Livewire/Pages/News/NewsIndex.php
View file @
3dca194a
...
...
@@ -120,6 +120,24 @@ class NewsIndex extends Component
}
public
function
deleteSelected
(
$selectedNews
)
{
if
(
!
\
Auth
::
user
()
->
hasPermissions
([
'delete-news'
]))
{
$this
->
showNoPermissionModal
=
TRUE
;
return
;
}
$newsDeleted
=
Shippingnetnews
::
whereIn
(
"id"
,
$selectedNews
)
->
pluck
(
'topic'
)
->
toArray
();
$newsStr
=
implode
(
","
,
$newsDeleted
);
Shippingnetnews
::
destroy
(
$selectedNews
);
$message
=
"Deleted : ("
.
$newsStr
.
" )Successfully"
;
$this
->
message
=
$message
;
$this
->
selectedNews
=
[];
if
(
$this
->
message
)
{
$this
->
dispatchBrowserEvent
(
'show-message'
,
[
'message'
=>
$this
->
message
]);
}
}
public
function
render
()
{
...
...
app/Http/Livewire/Pages/SendPatch/SendPatchEdit.php
View file @
3dca194a
...
...
@@ -72,7 +72,7 @@ class SendPatchEdit extends Component
$this
->
searchInProgress
=
true
;
$query
=
ConfServerLicense
::
query
();
if
(
!
empty
(
$this
->
serverkey
))
{
$query
->
where
(
'SNKEY'
,
'LIKE'
,
'
%
'
.
$this
->
serverkey
.
'%'
);
$query
->
where
(
'SNKEY'
,
'LIKE'
,
''
.
$this
->
serverkey
.
'%'
);
}
if
(
!
empty
(
$this
->
company
))
{
$query
->
where
(
'COMPANY'
,
'LIKE'
,
'%'
.
$this
->
company
.
'%'
);
...
...
@@ -87,8 +87,9 @@ class SendPatchEdit extends Component
if
(
!
empty
(
$this
->
selectedOwnerType
))
{
$query
->
where
(
'OWNERTYPE'
,
$this
->
selectedOwnerType
);
}
$this
->
resultsServerkey
=
$query
->
get
();
$this
->
resultsServerkeyArr
=
$query
->
get
()
->
toArray
();
$tmp
=
$query
->
get
();
$this
->
resultsServerkey
=
$tmp
;
$this
->
resultsServerkeyArr
=
$tmp
->
toArray
();
$this
->
showSearch
=
true
;
$this
->
searchInProgress
=
false
;
}
...
...
app/Http/Livewire/Pages/ServerLicense/ServerLicenseEdit.php
View file @
3dca194a
...
...
@@ -90,6 +90,8 @@ class ServerLicenseEdit extends Component
{
$this
->
licenseId
=
$editId
;
$this
->
loadData
();
$this
->
fileDownloads
=
$this
->
info
[
'FileDownload'
]
??
[];
}
...
...
@@ -118,12 +120,15 @@ class ServerLicenseEdit extends Component
$this
->
contactCustomerName
=
$license
->
CONTACTCUSTOMERNAME
;
if
(
$license
&&
!
empty
(
$license
->
BACKUP_FEEDBACK
))
{
$compressedData
=
gzuncompress
(
base64_decode
(
$license
->
BACKUP_FEEDBACK
));
$this
->
backupFeedback
=
$compressedData
;
$currentEncoding
=
mb_detect_encoding
(
$compressedData
,
mb_detect_order
(),
true
);
$this
->
info
=
null
;
eval
(
'$this->info = '
.
trim
(
$compressedData
)
.
';'
);
}
}
...
...
@@ -634,13 +639,34 @@ class ServerLicenseEdit extends Component
public
function
loadFileDownload
()
{
$this
->
tab
=
'fileDownload'
;
if
(
$this
->
info
&&
isset
(
$this
->
info
[
'FileDownload'
]))
{
$this
->
fileDownloads
=
$this
->
info
[
'FileDownload'
]
??
[];
$this
->
fileNameList
=
$this
->
info
[
'Filename'
]
??
[];
}
}
public
function
downloadFile
(
$index
)
{
$this
->
loadData
();
$codeFile
=
$this
->
info
[
'FileDownload'
][
$index
]
??
''
;
$filename
=
$this
->
fileNameList
[
$index
]
??
'unknown_file'
.
$index
.
'.txt'
;
$codeFileUtf8
=
iconv
(
'TIS-620'
,
'UTF-8//IGNORE'
,
$codeFile
);
$filename
=
ltrim
(
$filename
,
'./'
);
$tempFilePath
=
storage_path
(
'app/temp/'
.
$filename
);
$dirname
=
dirname
(
$tempFilePath
);
if
(
!
is_dir
(
$dirname
))
{
mkdir
(
$dirname
,
0777
,
true
);
}
if
(
file_put_contents
(
$tempFilePath
,
$codeFileUtf8
)
!==
false
)
{
return
response
()
->
download
(
$tempFilePath
)
->
deleteFileAfterSend
(
true
);
}
else
{
session
()
->
flash
(
'error'
,
"Failed to create temporary file for
$filename
"
);
}
}
public
function
downloadAllFile
()
{
$dateCurrent
=
now
()
->
format
(
'Y-m-d H:i:s'
);
...
...
@@ -657,12 +683,15 @@ class ServerLicenseEdit extends Component
if
(
$zip
->
open
(
$zipFilePath
,
ZipArchive
::
CREATE
)
!==
true
)
{
return
response
()
->
json
([
'error'
=>
"Cannot open <
$zipFilePath
>"
],
500
);
}
$this
->
loadData
();
$fileDownloads
=
$this
->
info
[
'FileDownload'
]
??
[];
$filenames
=
$this
->
info
[
'Filename'
]
??
[];
$textLog
=
"
\n
{
$dateCurrent
}
{
$this
->
SNKEY
}
??TempUser?? [ "
;
foreach
(
$fileDownloads
as
$key
=>
$codeFile
)
{
// Convert $codeFile from TIS-620 to UTF-8
$codeFileUtf8
=
iconv
(
'TIS-620'
,
'UTF-8//IGNORE'
,
$codeFile
);
$filename
=
$filenames
[
$key
]
??
'unknown_file'
.
$key
.
'.txt'
;
$filename
=
ltrim
(
$filename
,
'./'
);
$tempFilePath
=
storage_path
(
'app/temp/'
.
$filename
);
...
...
@@ -672,7 +701,7 @@ class ServerLicenseEdit extends Component
mkdir
(
$dirname
,
0777
,
true
);
}
if
(
file_put_contents
(
$tempFilePath
,
$codeFile
)
!==
false
)
{
if
(
file_put_contents
(
$tempFilePath
,
$codeFile
Utf8
)
!==
false
)
{
$tempFiles
[]
=
$tempFilePath
;
if
(
!
$zip
->
addFile
(
$tempFilePath
,
$filename
))
{
session
()
->
flash
(
'error'
,
"Failed to add
$filename
to ZIP"
);
...
...
@@ -752,7 +781,6 @@ class ServerLicenseEdit extends Component
public
function
render
()
{
$this
->
loadHistoryPatchData
();
return
view
(
'livewire.pages.server-license.server-license-edit'
,
[
'historyPatchList'
=>
$this
->
historyPatchList
,
]);
...
...
resources/views/livewire/pages/news/news-index.blade.php
View file @
3dca194a
...
...
@@ -28,7 +28,24 @@
</div>
</div>
@endif
<div
class=
"grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md"
x-data=
"{ showDeleteListModal : false}"
>
<div
class=
"grid grid-cols-1 gap-4 sm:gap-5 lg:gap-6 bg-main-container rounded-md"
x-data=
"{
showDeleteListModal: @entangle('showDeleteListModal'),
showAlert: false,
toggleGroup(event) {
const groupId = event.target.value;
if (event.target.checked) {
if (!this.selectedNewsAlpine.includes(groupId)) {
this.selectedNewsAlpine.push(groupId);
}
} else {
this.selectedNewsAlpine = this.selectedNewsAlpine.filter(id => id !== groupId);
}
},
selectedNewsAlpine: [],
selectedNews: @entangle('selectedNews')
}"
>
<div
class=
"pb-4 pt-5 bg-white rounded-lg shadow-lg"
>
<div
class=
"flex justify-between"
>
...
...
resources/views/livewire/pages/role/role-index.blade.php
View file @
3dca194a
<div>
<div
x-cloak
>
@include('components.no-permission')
<div
class=
"flex items-center space-x-4 py-5 lg:py-6 "
>
...
...
resources/views/livewire/pages/send-patch/send-patch-edit.blade.php
View file @
3dca194a
...
...
@@ -63,7 +63,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.100ms=
"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"
>
...
...
resources/views/livewire/pages/send-patch/send-patch-index.blade.php
View file @
3dca194a
...
...
@@ -18,7 +18,7 @@
console.log(show, message);
setTimeout(() => { show = false, console.log(show, message); }, 3000);
});"
>
<div
x-show.transition.duration.500ms=
"show"
<div
x-show.transition.duration.500ms=
"show"
x-cloak
class=
"fixed top-5 right-5 z-50 bg-green-500 text-white py-2 px-4 rounded-md shadow-lg"
>
{{ $message }}
</div>
...
...
resources/views/livewire/pages/server-license/file-download.blade.php
View file @
3dca194a
...
...
@@ -39,7 +39,7 @@
<td
class=
"whitespace-nowrap px-1 py-1 sm:px-2"
>
<div
class=
"flex justify-center space-x-2"
>
<a
<a
wire:click=
"downloadFile('{{ $key }}')"
href=
"javascript:void(0)"
class=
"btn h-8 w-8 p-0 hover:text-main-container active:text-main-container hover:primary-focus focus:primary-focus active:bg-info/25"
>
<i
aria-hidden=
"true"
class=
"fa fa-download"
></i>
</a>
...
...
resources/views/livewire/pages/user/user-create.blade.php
View file @
3dca194a
...
...
@@ -79,7 +79,9 @@
<div
wire:ignore
class=
"mb-2"
>
<label
for=
"group"
class=
"block text-sm font-medium text-gray-700"
>
Add Groups:
</label>
<span
class=
"relative flex w-full"
>
<input
class=
"mt-1.5 relative flex w-full"
x-data=
"{ groupLists: @entangle('group_lists') }"
x-init=
"groupLists = [];
<input
class=
"mt-1.5 relative flex w-full"
wire:ignore
x-data=
"{ groupLists: @entangle('group_lists') }"
x-init=
"groupLists = [];
const tempGroup = pages.groupSelect;
pages.fetchGroups(tempGroup).then(() => {
$el._x_tom = new Tom($el, {
...
...
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