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
b1e2349a
Commit
b1e2349a
authored
Oct 10, 2023
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
program structure changes
parent
42ad8096
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
14 deletions
+88
-14
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+2
-1
LoginJavaInterface.js
...bContent/WebGde-Widgets/LogInWidget/LoginJavaInterface.js
+43
-0
config.js
WebGde/WebContent/WebGde-Widgets/config.js
+15
-8
index.html
WebGde/WebContent/index.html
+1
-1
script.js
WebGde/WebContent/script.js
+10
-4
startup.js
WebGde/WebContent/startup.js
+17
-0
No files found.
WebGde/WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
b1e2349a
import
{
createWebGdeInterface
}
from
'../../script.js'
;
import
{
BPO_URL
}
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
=
`
${
BPO_URL
}
req`
;
export
class
ElementListWidget
{
global
=
{
...
...
WebGde/WebContent/WebGde-Widgets/LogInWidget/LoginJavaInterface.js
0 → 100644
View file @
b1e2349a
import
{
initializeWebpage
}
from
"../../startup.js"
;
import
{
initializeConfig
}
from
"../config.js"
;
export
function
loginGde
(
token
){
sessionStorage
.
setItem
(
"token"
,
token
);
var
decodedToken
=
parseJwt
(
token
);
// Check if the decodedToken contains the desired properties
if
(
decodedToken
)
{
const
{
preferred_username
,
domain
,
node
}
=
decodedToken
;
// Now you can use these variables as needed
console
.
log
(
"Preferred Username:"
,
preferred_username
);
sessionStorage
.
setItem
(
"user_id"
,
preferred_username
);
console
.
log
(
"Domain:"
,
domain
);
console
.
log
(
"Node:"
,
node
);
initializeConfig
(
domain
,
node
);
initializeWebpage
();
// You can return these values or perform any other actions with them here
}
else
{
// Handle the case where the token couldn't be decoded or doesn't contain the expected properties
console
.
error
(
"Invalid token or missing properties."
);
}
}
export
function
fallbackLogin
(
user_id
,
domain
,
node
){
sessionStorage
.
setItem
(
"user_id"
,
user_id
);
initializeConfig
(
domain
,
node
);
initializeWebpage
();
}
function
parseJwt
(
token
)
{
var
base64Url
=
token
.
split
(
'.'
)[
1
];
var
base64
=
base64Url
.
replace
(
/-/g
,
'+'
).
replace
(
/_/g
,
'/'
);
var
jsonPayload
=
decodeURIComponent
(
window
.
atob
(
base64
).
split
(
''
).
map
(
function
(
c
)
{
return
'%'
+
(
'00'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
''
));
return
JSON
.
parse
(
jsonPayload
);
}
\ No newline at end of file
WebGde/WebContent/WebGde-Widgets/config.js
View file @
b1e2349a
...
...
@@ -10,11 +10,12 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.x
export
const
ROOT_FOLDER
=
"/WebGde-Widgets"
;
//this determines if the images will be retrieved from the gfs
export
const
DOMAIN
=
"http://3.83.246.74:8080"
// export const DOMAIN = "http://3.83.246.74:8080"
export
var
DOMAIN
=
""
export
const
CONTEXTROOT
=
"gfs-explorer-ws"
export
cons
t
GDE_URL
=
DOMAIN
+
"/MobileGdeDev/svc/gfs-rest"
export
cons
t
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
export
cons
t
DOWNLOAD_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
export
le
t
GDE_URL
=
DOMAIN
+
"/MobileGdeDev/svc/gfs-rest"
export
le
t
FOLDER_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
export
le
t
DOWNLOAD_URL
=
DOMAIN
+
"/"
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
export
const
IS_RETRIEVE_FROM_GFS
=
"N"
export
const
INVALID_KEYS
=
"F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen,ScrollLock,Pause,PageUp,PageDown,Insert,Delete,Control"
...
...
@@ -23,8 +24,9 @@ export const INVALID_KEYS = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen,
export
const
IS_RETRIEVE_FROM_BPO
=
"Y"
// export const BPO_URL = "http://35.171.20.94:8080/bpo-sqa/"
// export const CURRENT_NODE = "Web GDE"
export
const
BPO_URL
=
DOMAIN
+
"/bpo/"
;
export
const
CURRENT_NODE
=
"Web_GDE_DEV"
export
let
BPO_URL
=
DOMAIN
+
"bpo/"
;
// export const CURRENT_NODE = "Web_GDE_DEV"
export
let
CURRENT_NODE
=
""
export
const
ENCODING_PASS
=
"PASS1"
export
const
NEXT_NODE
=
"Complete"
export
const
EXCEPTION_NODE
=
"Exception"
...
...
@@ -39,6 +41,11 @@ export const REASON_LIST = "Reason1,Reason2,Reason3,Reason4"
//KEYCLOAK CONFIG
window
.
REDIRECT_URL
=
'http://auth-server/auth/realms/GFS/protocol/openid-connect/logout?redirect_uri=encodedRedirectUri'
;
export
function
initializeConfig
(){
export
function
initializeConfig
(
domain
,
node
){
DOMAIN
=
domain
;
CURRENT_NODE
=
node
;
GDE_URL
=
DOMAIN
+
"MobileGdeDev/svc/gfs-rest"
FOLDER_URL
=
DOMAIN
+
CONTEXTROOT
+
"/svc/gfs-rest/get-folder?parentPath=/Users/"
DOWNLOAD_URL
=
DOMAIN
+
CONTEXTROOT
+
"/svc/gfs-rest/get-download-link"
BPO_URL
=
DOMAIN
+
"bpo/"
;
}
WebGde/WebContent/index.html
View file @
b1e2349a
...
...
@@ -10,7 +10,7 @@
<link
rel=
"stylesheet"
href=
"./WebGde-Widgets/ImageViewerWidget/modules/imageViewer/imageViewer.css"
>
<link
rel=
"stylesheet"
href=
"./WebGde-Widgets/ElementListWidget/ElementListWidget.css"
>
<link
id=
"loginStylesheet"
rel=
"stylesheet"
href=
"./WebGde-Widgets/LogInWidget/LoginStyle.css"
>
<script
type=
"module"
src=
"./s
cript
.js"
></script>
<script
type=
"module"
src=
"./s
tartup
.js"
></script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
integrity=
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin=
"anonymous"
></script>
<link
href=
"https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css"
rel=
"stylesheet"
/>
...
...
WebGde/WebContent/script.js
View file @
b1e2349a
...
...
@@ -7,12 +7,14 @@ import { ElementListWidget } from "./WebGde-Widgets/ElementListWidget/ElementLis
// import { DocumentControlWidget } from "./WebGde-Widgets/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
"./WebGde-Widgets/globalVariable.js"
;
import
{
SHOW_ELEMENT_LIST_VIEWER
,
CURRENT_NODE
}
from
"./WebGde-Widgets/config.js"
;
import
{
fallbackLogin
}
from
"./WebGde-Widgets/LogInWidget/LoginJavaInterface.js"
;
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
const
LOG_IN_COMPONENT
=
new
LogInClass
(
startApplication
);
LOG_IN_COMPONENT
.
establishEventListeners
();
startApplication
();
});
startApplication
();
export
async
function
startApplication
()
{
createLoadingScreen
();
await
initializeWebGDE
();
...
...
@@ -50,7 +52,9 @@ async function initializeWebGDE() {
setDocumentControlObject
(
new
DocumentControlWidget
());
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
if
(
mainLogInScreenContainer
){
mainLogInScreenContainer
.
remove
();
}
removeLoadingScreen
();
new
ElementListWidget
(
CURRENT_NODE
,
'containerId'
);
...
...
@@ -60,7 +64,9 @@ async function initializeWebGDE() {
document
.
getElementById
(
"input-field-container"
).
appendChild
(
DOCUMENT_CONTROL_OBJECT
.
getWidget
());
var
mainLogInScreenContainer
=
document
.
getElementById
(
"logInMainContainer"
);
mainLogInScreenContainer
.
remove
();
if
(
mainLogInScreenContainer
){
mainLogInScreenContainer
.
remove
();
}
removeLoadingScreen
();
}
}
...
...
WebGde/WebContent/startup.js
0 → 100644
View file @
b1e2349a
import
{
fallbackLogin
,
loginGde
}
from
"./WebGde-Widgets/LogInWidget/LoginJavaInterface.js"
;
const
scriptElement
=
document
.
createElement
(
"script"
);
scriptElement
.
type
=
"module"
;
scriptElement
.
src
=
"script.js"
;
document
.
addEventListener
(
"DOMContentLoaded"
,
function
()
{
window
.
fallbackLogin
=
fallbackLogin
;
window
.
loginGde
=
loginGde
;
// const LOG_IN_COMPONENT = new LogInClass(startApplication);
// LOG_IN_COMPONENT.establishEventListeners();
});
export
function
initializeWebpage
(){
document
.
head
.
appendChild
(
scriptElement
);
}
\ No newline at end of file
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