Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Component Sharing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gagandeep Singh Bhatia
Component Sharing
Commits
001e0377
Commit
001e0377
authored
Jan 23, 2024
by
Sonawane Amol Madhjuar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
04bd8751
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
0 deletions
+129
-0
Amol/CreateDataModel/BatchLoadLogDownload.jsp
Amol/CreateDataModel/BatchLoadLogDownload.jsp
+129
-0
No files found.
Amol/CreateDataModel/BatchLoadLogDownload.jsp
0 → 100644
View file @
001e0377
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
VisionEDI Log
</title>
<style>
input
[
type
=
"button"
]
{
margin
:
0px
0px
0px
1100px
;
font-size
:
15px
;
text-align
:
bottom
;
display
:
inline-block
;
border-radius
:
4px
;
}
h2
{
font-size
:
20px
;
text-align
:
bottom
;
display
:
inline-block
;
margin
:
0px
0px
0px
0px
;
}
</style>
</head>
<body
style=
"font-family : calibri;margin: 0;padding: 0;overflow: hidden;"
>
<%@page
import=
"javax.servlet.*, javax.servlet.http.*, java.io.*, ibase.utility.CommonConstants, org.apache.commons.lang.StringEscapeUtils"
%>
<%
String
fileName
=
request
.
getParameter
(
"FileName"
);
String
sep
=
File
.
separator
;
File
file
=
new
File
(
CommonConstants
.
JBOSSHOME
+
sep
+
"upload_failed"
+
sep
+
fileName
);
String
filePath
=
file
.
getAbsolutePath
();
%>
<div
style=
"
/* padding: 1em; */
/* width: calc(100% - 2em); */
/* height: calc(100% - 2em); */
overflow: hidden;
"
>
<div
style=
"
display: flex;
align-items: center;
height: 50px;
padding: 0 16px;
"
><form
style=
"
margin: 0;
padding: 0;
display: flex;
width: 100%;
align-items: center;
position: relative;
"
><div
style=
"
font-size: 1.5em;
font-weight: 600;
text-align: left;
min-height: 50px;
display: flex;
align-items: center;
width: calc(100% - 100px);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
"
>
File Name :
<%=
fileName
%></div><input
type=
"button"
value=
"Return"
onclick=
"history.back()"
size=
"40"
style=
"
border-style: none;
margin: 0;
font-size: 12px;
border-radius: 4px;
box-shadow: 1px 1px 5px 2px rgba(0,0,0,.2);
height: 30px;
padding: 0 12px;
background-color: #4286f5;
color: #fff;
letter-spacing: 1px;
font-weight: 600;
text-transform: uppercase;
position: absolute;
right: 0;
"
></form></div><div
style=
"
padding: 16px;
height: calc(100% - 98px);
overflow: auto;
box-shadow: 0px 0px 1px 1px rgba(0,0,0,.2);
margin: 0 16px 16px 16px;
border-radius: 3px;
"
>
<!-- ... existing code ... -->
<div
style=
"padding: 16px; height: calc(100% - 98px); overflow: auto; box-shadow: 0px 0px 1px 1px rgba(0,0,0,.2); margin: 0 16px 16px 16px; border-radius: 3px;"
>
<%
if
(!
filePath
.
endsWith
(
".log"
))
{
//file = new File(CommonConstants.JBOSSHOME+sep+"server"+sep+"default"+sep+"ExceptionLog"+sep+fileName+".txt");
file
=
new
File
(
CommonConstants
.
JBOSSHOME
+
sep
+
"upload_failed"
+
sep
+
fileName
);
}
if
(
file
.
exists
())
{
BufferedReader
br
=
new
BufferedReader
(
new
FileReader
(
file
));
String
fileContents
=
""
;
while
((
fileContents
=
br
.
readLine
())
!=
null
)
{
out
.
println
(
StringEscapeUtils
.
escapeXml
(
fileContents
.
toString
())
+
"
<
br
>"
);
}
%>
</div>
<!-- Add the styled download button outside the div -->
<button
style=
"margin: 16px; background-color: #4286f5; color: #fff; border: none; padding: 10px; border-radius: 4px; cursor: pointer;"
onclick=
"downloadLogFile('
<%=
StringEscapeUtils
.
escapeJavaScript
(
fileContents
)
%>
')"
>
Download Log
</button>
<%
}
else
{
%>
<%=
fileName
+
" file not found"
%>
<%
}
%>
<script>
function
downloadLogFile
(
logContent
)
{
var
blob
=
new
Blob
([
logContent
],
{
type
:
'
text/plain
'
});
var
url
=
window
.
URL
.
createObjectURL
(
blob
);
var
a
=
document
.
createElement
(
'
a
'
);
a
.
href
=
url
;
a
.
download
=
'
<%=
fileName
%>
'
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
// Cleanup
window
.
URL
.
revokeObjectURL
(
url
);
document
.
body
.
removeChild
(
a
);
}
</script>
</div>
</body>
</html>
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