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
1a65bd81
Commit
1a65bd81
authored
Oct 09, 2023
by
Jhunel Adam Calub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functionality for encode button
parent
e5814719
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
27 deletions
+103
-27
ElementListWidget.css
...nt/WebGde-Widgets/ElementListWidget/ElementListWidget.css
+37
-14
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+59
-2
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+1
-1
script.js
WebGde/WebContent/script.js
+6
-10
style.css
WebGde/WebContent/style.css
+0
-0
No files found.
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.css
View file @
1a65bd81
...
...
@@ -86,8 +86,8 @@ body {
color
:
#7d7d7d
;
}
/*
Buttons
*/
butto
n
{
/*
Specific styles for the encode button
*/
#encode-bt
n
{
padding
:
1rem
2rem
;
border
:
none
;
border-radius
:
50px
;
...
...
@@ -98,22 +98,48 @@ button {
transition
:
background-color
0.3s
ease
,
transform
0.1s
ease
;
}
butto
n
:active
{
#encode-bt
n
:active
{
transform
:
scale
(
0.95
);
}
button
.encode
:hover
,
button
.encode
:active
{
#encode-btn
:hover
{
background-color
:
#0056b3
;
}
button
.new
{
background-color
:
#28a745
;
#encode-btn
:active
{
background-color
:
#0056b3
;
}
/* Style for disabled encode button */
#encode-btn
.disabled
{
background-color
:
#9fb3c8
;
/* Grayed out color */
cursor
:
not-allowed
;
}
/* Specific styles for the new button */
#new-btn
{
padding
:
1rem
2rem
;
border
:
none
;
border-radius
:
50px
;
font-size
:
1rem
;
color
:
#fff
;
background-color
:
#007bff
;
/* Green color */
cursor
:
pointer
;
transition
:
background-color
0.3s
ease
,
transform
0.1s
ease
;
}
#new-btn
:active
{
transform
:
scale
(
0.95
);
}
#new-btn
:hover
{
background-color
:
#0056b3
;
}
button
.new
:hover
,
button
.new
:active
{
background-color
:
#218838
;
#new-btn
:active
{
background-color
:
#0056b3
;
}
.button-container
{
...
...
@@ -124,10 +150,7 @@ button.new:active {
gap
:
2rem
;
}
button
.disabled
{
background-color
:
#ccc
;
cursor
:
not-allowed
;
}
/* Media Queries */
@media
(
max-width
:
768px
)
{
...
...
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
1a65bd81
const
API_ROOT
=
"http://18.233.158.67:8080/bpo/req"
;
import
{
createWebGdeInterface
}
from
'../../script.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://52.207.220.74:8080/bpo/req"
;
export
class
ElementListWidget
{
global
=
{
...
...
@@ -75,6 +80,7 @@ export class ElementListWidget {
// Initialize the encode button as disabled
this
.
global
.
encodeButton
=
document
.
createElement
(
"button"
);
this
.
global
.
encodeButton
.
textContent
=
"ENCODE"
;
this
.
global
.
encodeButton
.
id
=
"encode-btn"
;
this
.
global
.
encodeButton
.
disabled
=
true
;
this
.
global
.
encodeButton
.
classList
.
add
(
"disabled"
);
...
...
@@ -122,13 +128,16 @@ export class ElementListWidget {
return
;
}
if
(
this
.
global
.
selectedElement
)
{
this
.
handleEncode
Click
(
this
.
global
.
selectedElement
);
this
.
handleEncode
Logic
();
// Only invoke this method
}
});
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
);
...
...
@@ -181,6 +190,50 @@ export class ElementListWidget {
}
}
async
handleEncodeLogic
()
{
// Store the selected element's details in the session storage
if
(
this
.
global
.
selectedElement
)
{
sessionStorage
.
setItem
(
'selectedElementId'
,
this
.
global
.
selectedElement
.
elementId
);
sessionStorage
.
setItem
(
'selectedElementExtraDetails'
,
JSON
.
stringify
(
this
.
global
.
selectedElement
.
extraDetails
));
}
// Remove the current container from the DOM
this
.
global
.
container
.
remove
();
// Continue with the original logic
await
createWebGdeInterface
(
null
);
// Create and style a new container for the selected element's details
const
detailsContainer
=
document
.
createElement
(
'div'
);
detailsContainer
.
classList
.
add
(
'details-container'
);
// Retrieve and display the selected element's ID
const
elementId
=
sessionStorage
.
getItem
(
'selectedElementId'
);
const
elementIdDiv
=
document
.
createElement
(
'div'
);
elementIdDiv
.
textContent
=
`Element ID:
${
elementId
}
`
;
elementIdDiv
.
classList
.
add
(
'element-id'
);
detailsContainer
.
appendChild
(
elementIdDiv
);
// Retrieve and display the selected element's extra details
const
extraDetails
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'selectedElementExtraDetails'
));
for
(
const
[
key
,
value
]
of
Object
.
entries
(
extraDetails
))
{
const
detailDiv
=
document
.
createElement
(
'div'
);
detailDiv
.
textContent
=
`
${
key
}
:
${
value
}
`
;
detailDiv
.
classList
.
add
(
'extra-detail'
);
detailsContainer
.
appendChild
(
detailDiv
);
}
// Insert the details container above the input container in the DOM
const
inputContainer
=
document
.
getElementById
(
"input-field-container"
);
inputContainer
.
parentElement
.
insertBefore
(
detailsContainer
,
inputContainer
);
// Append the DocumentControlWidget
setDocumentControlObject
(
new
DocumentControlWidget
());
inputContainer
.
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
}
}
async
function
fetchWorkersForNode
(
nodeId
)
{
...
...
@@ -193,6 +246,10 @@ async function fetchElementsForNode(nodeId) {
return
await
response
.
json
();
}
/*await createWebGdeInterface(null);
setDocumentControlObject(new DocumentControlWidget());
document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
WebGde/WebContent/WebGde-Widgets/config.js
View file @
1a65bd81
...
...
@@ -10,7 +10,7 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
export
const
ROOT_FOLDER
=
"/WebGde-Widgets"
;
//this determines if the images will be retrieved from the gfs
export
const
DOMAIN
=
"http://5
4.208.45.179
:8080"
export
const
DOMAIN
=
"http://5
2.207.220.74
:8080"
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
const
GDE_URL
=
DOMAIN
+
"/MobileGde/svc/gfs-rest"
export
const
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
...
...
WebGde/WebContent/script.js
View file @
1a65bd81
...
...
@@ -45,9 +45,9 @@ async function initializeWebGDE() {
// UNCOMMENTED BY ADAM 9/25/2023
/*
await createWebGdeInterface(null);*/
/*
await createWebGdeInterface(null);*/
setDocumentControlObject
(
new
DocumentControlWidget
());
/*
document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
/*
document.getElementById("input-field-container").appendChild(DOCUMENT_CONTROL_OBJECT.getWidget());*/
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
...
...
@@ -57,7 +57,7 @@ async function initializeWebGDE() {
}
async
function
createWebGdeInterface
(
GDEContainer
)
{
export
async
function
createWebGdeInterface
(
GDEContainer
)
{
let
gdeContainer
=
document
.
createElement
(
"div"
);
gdeContainer
.
setAttribute
(
"class"
,
"container web-gde-container"
);
...
...
@@ -135,19 +135,15 @@ export function removeLoadingScreen() {
}
<<<<<<<
WebGde
/
WebContent
/
script
.
js
export
async
function
resetGDE
(){
// TO-DO
export
async
function
resetGDE
()
{
// TO-DO
}
function
init
(){
console
.
log
(
"Application Started"
);
=======
function
init
()
{
console
.
log
(
"Application Started"
);
>>>>>>>
WebGde
/
WebContent
/
script
.
js
}
function
testFunction
()
{
try
{
let
doctype
;
...
...
WebGde/WebContent/style.css
View file @
1a65bd81
This diff is collapsed.
Click to expand it.
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