Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
Import registry records
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
develop
Import registry records
Commits
c8f65f80
Commit
c8f65f80
authored
Jul 24, 2020
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] отображение ошибок в UI, фикс экранирования
parent
3b06e44f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
100 deletions
+106
-100
src/main/java/kz/arta/ext/sap/util/ImportBean.java
src/main/java/kz/arta/ext/sap/util/ImportBean.java
+53
-82
src/main/webapp/index.html
src/main/webapp/index.html
+2
-2
src/main/webapp/index.js
src/main/webapp/index.js
+51
-16
No files found.
src/main/java/kz/arta/ext/sap/util/ImportBean.java
View file @
c8f65f80
This diff is collapsed.
Click to expand it.
src/main/webapp/index.html
View file @
c8f65f80
...
...
@@ -102,7 +102,7 @@
<button
class=
"uk-button uk-button-default start_import"
style=
"width: 250px;"
>
Импортировать
</button>
<div
id=
"modal-center"
class=
"uk-flex-top"
uk-modal
>
<div
class=
"uk-modal-dialog uk-modal-body uk-margin-auto-vertical"
>
<div
class=
"uk-modal-dialog uk-modal-body uk-margin-auto-vertical"
style=
"width: 50%;"
>
<button
class=
"uk-modal-close-default"
type=
"button"
uk-close
></button>
...
...
@@ -111,7 +111,7 @@
<div
class=
"uk-form-label"
>
Сообщения и ошибки:
</div>
<div
class=
"uk-margin"
>
<textarea
class=
"uk-textarea"
id=
"errors-area"
rows=
"
8
"
placeholder=
"..."
></textarea>
<textarea
class=
"uk-textarea"
id=
"errors-area"
rows=
"
13
"
placeholder=
"..."
></textarea>
</div>
</div>
</div>
...
...
src/main/webapp/index.js
View file @
c8f65f80
...
...
@@ -3,37 +3,70 @@ var isInProcess = false;
function
showProcess
(
firstmessage
,
iserror
){
UIkit
.
modal
(
$
(
"
#modal-center
"
)).
show
();
if
(
firstmessage
)
$
(
"
#errors-area
"
).
val
(
firstmessage
);
var
df
=
UIkit
.
modal
(
$
(
"
#modal-center
"
));
df
.
bgClose
=
false
;
df
.
show
();
var
progressbar
=
$
(
"
#js-progressbar
"
);
var
errorsfield
=
$
(
"
#errors-area
"
);
if
(
firstmessage
)
errorsfield
.
val
(
firstmessage
);
var
progressbar
=
$
(
"
#js-progressbar
"
);
if
(
!
iserror
){
//отправляем запрос за прогрессом и возникшими ошибками каждые 5 секунд, пока прогресс обработки записей не достигнет 100%
var
percentage
=
0
;
$
.
ajax
({
url
:
window
.
location
.
origin
+
"
/import/api/registry/info
"
,
type
:
'
GET
'
,
success
:
function
(
data
)
{
errorsfield
.
val
(
data
.
errors
);
percentage
=
data
.
count
/
(
data
.
total
/
100
);
progressbar
.
val
(
percentage
);
if
(
data
.
count
===
data
.
total
)
return
;
},
error
:
function
(
error
)
{
errorsfield
.
val
(
error
.
responseText
);
var
timerId
=
setInterval
(
function
(){
if
(
percentage
>=
100
){
clearInterval
(
timerId
);
isInProcess
=
false
;
return
;
}
});
$
.
ajax
({
url
:
window
.
location
.
origin
+
"
/import/api/registry/info
"
,
type
:
'
GET
'
,
success
:
function
(
data
)
{
var
str
=
""
;
data
.
errors
.
forEach
(
function
(
item
){
str
+=
item
;
});
errorsfield
.
val
(
str
);
percentage
=
data
.
count
/
(
data
.
total
/
100
);
progressbar
.
val
(
percentage
);
if
(
data
.
count
===
data
.
total
)
return
;
},
error
:
function
(
error
)
{
try
{
var
str2
=
""
;
var
json
=
JSON
.
parse
(
error
.
responseText
);
json
.
errors
.
forEach
(
function
(
item
)
{
str2
+=
item
;
});
errorsfield
.
val
(
str2
);
percentage
=
data
.
count
/
(
data
.
total
/
100
);
progressbar
.
val
(
percentage
);
if
(
data
.
count
===
data
.
total
)
return
;
}
catch
(
e
){
errorsfield
.
val
(
e
);
clearInterval
(
timerId
);
isInProcess
=
false
;
return
;
}
}
});
},
3000
);
}
};
$
(
document
).
ready
(
function
(){
$
(
"
#spin
"
).
hide
();
...
...
@@ -67,6 +100,8 @@ $(document).ready(function(){
$
(
"
.start_import
"
).
click
(
function
(){
$
(
"
#js-progressbar
"
).
val
(
0
);
if
(
isInProcess
){
showProcess
();
}
else
{
...
...
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