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
57fdbd7e
Commit
57fdbd7e
authored
Oct 10, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-WG-399b2' into 'feature-WG-337-b3'
merge See merge request
!72
parents
b1e2349a
0c554d5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
returnElement.js
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
+2
-0
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+15
-13
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-0
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/returnElement.js
View file @
57fdbd7e
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 @
57fdbd7e
import
{
createWebGdeInterface
}
from
'../../script.js'
;
import
{
BPO_URL
}
from
'../config.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
=
`
${
BPO_URL
}
req`
;
const
API_ROOT
=
`
${
DOMAIN
}
/bpo/req`
;
export
class
ElementListWidget
{
global
=
{
...
...
@@ -140,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
;
}
...
...
@@ -237,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
;
...
...
@@ -255,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 @
57fdbd7e
...
...
@@ -31,6 +31,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