Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
72d4a1d8
Commit
72d4a1d8
authored
Oct 10, 2023
by
Jhunel Adam Calub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specific element get and add go back to element list viewer during
return commit
parent
42ad8096
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
returnElement.js
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
+2
-0
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+15
-12
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-0
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
View file @
72d4a1d8
import
{
createLoadingScreen
,
removeLoadingScreen
,
resetGDE
}
from
"../../script.js"
;
import
{
SCHEMA_FILE_PATH
}
from
"../DataInputWidget/config.js"
;
import
{
validateInput
}
from
"../DataInputWidget/validateInput.js"
;
import
{
goBackToElementListViewer
}
from
"../ElementListWidget/ElementListWidget.js"
;
import
{
removePrompt
,
showPrompt
}
from
"../LogInWidget/LogInPrompt.js"
;
import
{
PROJECT_CODE
}
from
"../Submit/config.js"
;
import
{
interval
}
from
"../captureMetrics/captureMetrics.js"
;
...
...
@@ -117,6 +118,7 @@ export function createReturnWindow() {
sessionStorage
.
removeItem
(
"doctype"
);
removePrompt
();
document
.
getElementById
(
"returnWindow"
).
remove
();
goBackToElementListViewer
();
}
else
{
function
errorReturn
(){
...
...
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
72d4a1d8
import
{
createWebGdeInterface
}
from
'../../script.js'
;
import
{
ADD_NEW_OPTION
,
DOMAIN
}
from
'../config.js'
;
import
{
DocumentControlWidget
}
from
"../documentControlWidget/documentControlWidget.js"
;
import
{
INDEXED_DB_STORAGE
,
HIGHLIGHT_OBJECT
,
IMAGE_VIEWER_OBJECT
,
INDEXED_DB_NAME
,
INDEXED_DB_TBL_NAME
,
setIndexedDBStorage
,
setHighlightObject
,
setImageViewerObject
,
setBPOObject
,
BPO_OBJECT
,
DISPLAY_FIELD_OBJECT
,
setDisplayFieldObject
,
activateGDE
,
setDocumentControlObject
,
DOCUMENT_CONTROL_OBJECT
,
IS_GDE_ACTIVATED
}
from
"../globalVariable.js"
;
const
API_ROOT
=
"http://3.83.246.74:8080/bpo/req"
;
const
API_ROOT
=
`
${
DOMAIN
}
/bpo/req`
;
export
class
ElementListWidget
{
global
=
{
...
...
@@ -139,14 +139,18 @@ export class ElementListWidget {
buttonContainer
.
appendChild
(
this
.
global
.
encodeButton
);
const
newButton
=
document
.
createElement
(
"button"
);
newButton
.
id
=
"new-btn"
;
newButton
.
textContent
=
"NEW"
;
newButton
.
addEventListener
(
"click"
,
()
=>
this
.
handleNewClick
());
buttonContainer
.
appendChild
(
newButton
);
if
(
ADD_NEW_OPTION
===
'Y'
){
const
newButton
=
document
.
createElement
(
"button"
);
newButton
.
id
=
"new-btn"
;
newButton
.
textContent
=
"NEW"
;
newButton
.
addEventListener
(
"click"
,
()
=>
this
.
handleNewClick
());
buttonContainer
.
appendChild
(
newButton
);
this
.
global
.
newButton
=
newButton
;
}
this
.
global
.
container
.
appendChild
(
buttonContainer
);
this
.
global
.
newButton
=
newButton
;
}
...
...
@@ -236,7 +240,7 @@ export class ElementListWidget {
inputContainer
.
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
// Call assignElementToWorker to assign the selected element to the current worker
const
assignResponse
=
await
assignElementToWorker
(
this
.
global
.
workerId
,
this
.
nodeId
,
this
.
global
.
queueIndex
);
const
assignResponse
=
await
assignElementToWorker
(
this
.
global
.
workerId
,
this
.
nodeId
,
this
.
global
.
queueIndex
,
elementId
);
if
(
!
assignResponse
.
successful
)
{
console
.
error
(
'Failed to assign element to worker:'
,
assignResponse
);
return
;
...
...
@@ -254,9 +258,8 @@ async function fetchElementsForNode(nodeId) {
return
await
response
.
json
();
}
async
function
assignElementToWorker
(
workerId
,
nodeId
,
queueIndex
)
{
const
response
=
await
fetch
(
`
${
API_ROOT
}
/workers/
${
workerId
}
/nodes/
${
nodeId
}
/elements/
${
queueIndex
}
`
);
async
function
assignElementToWorker
(
workerId
,
nodeId
,
queueIndex
,
elementId
)
{
const
response
=
await
fetch
(
`
${
API_ROOT
}
/workers/
${
workerId
}
/nodes/
${
nodeId
}
/elements/
${
queueIndex
}
/
${
elementId
}
`
);
return
await
response
.
json
();
}
...
...
WebGde/WebContent/WebGde-Widgets/config.js
View file @
72d4a1d8
...
...
@@ -29,6 +29,7 @@ export const ENCODING_PASS = "PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
EXCEPTION_NODE
=
"Exception"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"Y"
export
const
ADD_NEW_OPTION
=
"Y"
export
const
PDF_EXTENSION
=
".pdf"
export
const
JPG_EXTENSION
=
".jpg"
...
...
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