Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@ https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installa

- Populate the "client build" environment configuration file (i.e. `webapp/client/.env`).

You can initialize it based upon the corresponding development/production example file:
You can initialize it based upon the corresponding example file:
```shell
cp webapp/client/.env.development.example \
cp webapp/client/.env.example \
webapp/client/.env
```
> Those environment variables are used within `webapp/client/src/config.js`.

- Create a build directory with a production build of the client:
```shell
cd webapp/client
npm run build
```

- Populate the server environment configuration file (i.e. `webapp/server/.env`).

You can initialize it based upon the corresponding development/production example file:
You can initialize it based upon the corresponding example file:
```shell
cp webapp/server/.env.development.example \
cp webapp/server/.env.example \
webapp/server/.env
```
> Those environment variables are used within `webapp/server/config.js`.
Expand Down
17 changes: 10 additions & 7 deletions installation/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ do
done

echo "Setup LANL EDGE webapp ..."
#build client
echo "build client..."
#install client
echo "install client..."
cd $app_home/webapp/client
npm install --legacy-peer-deps
npm run build
#build server
echo "build server..."
#install server
echo "install server..."
cd $app_home/webapp/server
npm install

echo "LANL EDGE webapp successfully installed!"
echo "To start the webapp in EDGEv3's root directory:"
echo "pm2 start pm2.config.js"
echo "Next steps:"
echo "1. copy webapp/client/.env.example to webapp/client/.env and update settings in the .env file"
echo "2. inside webapp/client, run command: npm run build"
echo "3. copy webapp/server/.env.example to webapp/server/.env and update settings in the .env file"
echo "4. start MongoDB if it's not started yet"
echo "5. start the webapp in EDGEv3's root directory: pm2 start pm2.config.js"
34 changes: 12 additions & 22 deletions webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,28 @@
## Install the webapp

cd installation
./install-local.sh
./install.sh

## Configure and start ui client

cd webapp/client
cp .env.example .env
(update settings in .env)
npm start

## Start api server
## Configure and start api server

cd webapp/server
(change NODE_ENV=prod to NODE_ENV=dev in .env)
cp .env.example .env
(update settings in .env)
npm start

## Start ui client

cd webapp/client
npm start

## View the website

http://localhost:3000

## Note

- Have to restart the client when any changes made in client/.env.
- Have to restart the server when any changes made in server code or server/.env.

#### Restart api server

cd webapp/server
use Ctrl-C to stop the webapp server
npm start

#### Restart ui client

cd webapp/client
use Ctrl-C to stop the webapp client
npm start

- Have to restart the api server when any changes made in webapp/server code or webapp/server/.env.

8 changes: 0 additions & 8 deletions webapp/client/.env.development.example

This file was deleted.

13 changes: 13 additions & 0 deletions webapp/client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###############################################################################
# Refer to `./src/config.js` to see all supported environment variables. #
###############################################################################
VITE_NAME=EDGE V3
VITE_EMAIL_NOTIFICATION_ENABLED=false
VITE_FILEUPLOAD_ENABLED=true

# for development only
# VITE_API_URL=http://localhost:5000

# ORCiD login
VITE_IS_ORCID_AUTH_ENABLED=false
VITE_ORCID_CLIENT_ID=="__POPULATE_ME_IF_ENABLING_ORCID_AUTH__"
7 changes: 0 additions & 7 deletions webapp/client/.env.production.example

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/client/src/edge/common/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { colors } from './util'
export const ConfirmDialog = (props) => {
return (
<Modal isOpen={props.isOpen} centered>
<ModalHeader>{props.title}</ModalHeader>
<ModalHeader>{props.header}</ModalHeader>
<ModalBody>{props.message}</ModalBody>
<ModalFooter>
<Button color="primary" onClick={props.handleClickYes}>
Expand Down
4 changes: 4 additions & 0 deletions webapp/client/src/edge/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,16 @@ export const notify = (type, msg, timeout) => {
toast.success(msg, {
position: 'top-center',
autoClose: timeout,
rtl: false,
hideProgressBar: false,
})
}
if (type === 'error') {
toast.error(msg, {
position: 'top-center',
autoClose: false,
rtl: false,
hideProgressBar: false,
})
}
}
Expand Down
8 changes: 2 additions & 6 deletions webapp/client/src/edge/um/user/JobQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ const JobQueue = () => {
accessorKey: 'name', //access nested data with dot notation
header: 'project',
},
{
accessorKey: 'owner',
header: 'Owner',
},
{
accessorKey: 'type', //normal accessorKey
header: 'Type',
Expand Down Expand Up @@ -79,8 +75,8 @@ const JobQueue = () => {
data={tableData}
enableFullScreenToggle={false}
enableColumnActions={false}
enableSorting={false}
enableColumnFilters={false}
enableSorting={true}
enableColumnFilters={true}
state={{
isLoading: loading,
}}
Expand Down
22 changes: 20 additions & 2 deletions webapp/client/src/edge/um/user/UploadFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const UploadFiles = (props) => {
const [allowedExtensions, setAllowedExtensions] = useState([])
const [files, setFiles] = useState([])
const [updateSize, setUpdateSize] = useState(0)
const [files2upload, setFiles2Upload] = useState(0)
const [filesUploaded, setFilesUploaded] = useState(0)
let uploaded = 0

useEffect(() => {
//get upload info
Expand Down Expand Up @@ -124,6 +127,8 @@ const UploadFiles = (props) => {
}

//upload files
setFiles2Upload(files.length)

let promises = []
for (var i = 0; i < files.length; i++) {
let curr = files[i]
Expand All @@ -143,9 +148,13 @@ const UploadFiles = (props) => {
},
})
.then((response) => {
uploaded += 1
setFilesUploaded(uploaded)
resolve('Upload ' + curr.meta.name + ' successfully!')
})
.catch((error) => {
uploaded += 1
setFilesUploaded(uploaded)
resolve('Upload ' + curr.meta.name + ' failed! ' + error)
})
}),
Expand All @@ -155,13 +164,19 @@ const UploadFiles = (props) => {
Promise.all(promises)
.then((response) => {
allFiles.forEach((f) => f.remove())
let errors = 0
response.forEach((e) => {
if (e.includes('failed')) {
notify('error', e)
errors += 1
} else {
notify('success', e)
//notify('success', e)
}
})
if (errors === 0) {
notify('success', 'Files uploaded successfully!', 2000)
//setTimeout(() => props.history.push("/user/files"), 2000);
}
setSubmitting(false)
props.reloadTableData()
})
Expand All @@ -173,7 +188,10 @@ const UploadFiles = (props) => {

return (
<>
<LoaderDialog loading={submitting} text="Uploading..." />
<LoaderDialog
loading={submitting}
text={'Uploading...' + Math.round((filesUploaded / files2upload) * 100) + '%'}
/>
<ToastContainer />
<div className="clearfix">
<h4 className="pt-3">Upload Files</h4>
Expand Down
2 changes: 1 addition & 1 deletion webapp/client/src/edge/um/user/forms/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const RegisterForm = (props) => {

return (
<Form onSubmit={handleSubmit(props.onSubmit)}>
<h1>Register</h1>
<h1>Sign Up</h1>
<p className="text-muted">Create your account</p>
<InputGroup className="mb-3">
<InputGroupText className="text-muted"> First Name </InputGroupText>
Expand Down
7 changes: 2 additions & 5 deletions webapp/client/src/edge/workflows/sra/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ const Main = (props) => {
}, [])

return (
<div
className="animated fadeIn"
style={disabled ? { pointerEvents: 'none', opacity: '0.4' } : {}}
>
<div className="animated fadeIn">
<MessageDialog
className="modal-lg modal-danger"
title="System Message"
Expand All @@ -128,7 +125,7 @@ const Main = (props) => {
e.preventDefault()
}}
>
<div className="clearfix">
<div className="clearfix" style={disabled ? { pointerEvents: 'none', opacity: '0.4' } : {}}>
<h4 className="pt-3">Retrieve SRA Data</h4>
{workflow && (
<>
Expand Down
9 changes: 9 additions & 0 deletions webapp/client/src/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ button:hover {
.modal-success .modal-header {
background-color: $success;
}
.modal-warning .modal-header {
background-color: $warning;
}
.modal-danger .modal-header {
background-color: $danger;
}
.modal-info .modal-header {
background-color: $info;
}

// EDGE
.edge-header {
Expand Down
18 changes: 0 additions & 18 deletions webapp/server/.env.development.example

This file was deleted.

40 changes: 40 additions & 0 deletions webapp/server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# uncomment 'SYSTEM_MESSAGE' and restart pm2 to disable workflow submission
# SYSTEM_MESSAGE=Workflow submission is temporarily unavailable. You can still browse/view your submitted projects.

###############################################################################
# Refer to `./config.js` to see all supported environment variables. #
###############################################################################

# Networking:
# -----------
PORT=5000
CRON_PORT=5555

# default is 'production'
# NODE_ENV=development

# Base URL at which visitors can access the web UI server
# Example url for development
# APP_UI_BASE_URL=http://localhost:3000
APP_UI_BASE_URL="__POPULATE_ME__"

# Secrets:
# --------
#
# Note: You can generate a secret by running the following shell command:
# $ node -e 'console.log(require("crypto").randomBytes(20).toString("hex"))'
#
JWT_SECRET="__POPULATE_ME__"

# Database
DB_NAME="__POPULATE_ME_IN_PRODUCTION__"

# upload file, file extensions
FILEUPLOAD_ALLOWED_EXTENSIONS=fastq|fq|faa|fa|fasta|fna|contigs|fastq.gz|fq.gz|fa.gz|fasta.gz|fna.gz|contigs.gz|fa.bz2|fasta.bz2|contigs.bz2|fna.bz2|fa.xz|fasta.xz|contigs.xz|fna.xz|gbk|gff|genbank|gb|xlsx|txt|bed|config|tsv|csv|raw|d|bam|sam

# Email:
# ------
SEND_PROJECT_STATUS_EMAILS=false
PROJECT_STATUS_SUBJECT=Your EDGE project status
EMAIL_MAILGUN_API_KEY="__POPULATE_ME_IF_ENABLING_EMAIL__"
EMAIL_MAILGUN_DOMAIN="__POPULATE_ME_IF_ENABLING_EMAIL__"
16 changes: 0 additions & 16 deletions webapp/server/.env.production.example

This file was deleted.

4 changes: 2 additions & 2 deletions webapp/server/edge-api/controllers/auth-user-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const sysError = config.APP.API_ERROR;
const info = async (req, res) => {
try {
logger.debug(`/api/auth-user/info: ${JSON.stringify(req.user.email)}`);
if (config.SYSTEM_MESSAGE) {
if (config.APP.SYSTEM_MESSAGE) {
return res.send({
info: {
allowNewRuns: false,
message: config.SYSTEM_MESSAGE,
message: config.APP.SYSTEM_MESSAGE,
},
message: 'Action successful',
success: true,
Expand Down
Loading