Commit b78059ec authored by Pavel Taskov's avatar Pavel Taskov

updated from gitlab

parent b2a9c6a0
......@@ -18,7 +18,7 @@ services:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
ES_JAVA_OPTS: "-Xmx4g -Xms4g"
ELASTIC_PASSWORD: changeme
networks:
- elk
......@@ -41,7 +41,7 @@ services:
- "5000:5000"
- "9600:9600"
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
LS_JAVA_OPTS: "-Xmx4g -Xms4g"
networks:
- elk
depends_on:
......
test
\ No newline at end of file
.idea/
.vscode/
node_modules/
build
.DS_Store
*.tgz
my-app*
template/src/__tests__/__snapshots__/
lerna-debug.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/.changelog
.npm/
yarn.lock
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
This diff is collapsed.
{
"homepage": "http://mirsat1.github.io/articonf-ui",
"name": "articonf1",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.19.2",
"elasticsearch": "^16.7.1",
"emailjs-com": "^2.6.3",
"firebase": "^7.17.2",
"https": "^1.0.0",
"js-yaml": "^3.14.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-iframe": "^1.8.0",
"react-json-prettify": "^0.2.0",
"react-loader-spinner": "^3.1.14",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"reactjs-heap": "^1.0.3",
"reactjs-popup": "^2.0.4",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^1.2.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/emailjs-com@2.4.1/dist/email.min.js"></script>
<script type="text/javascript">
(function(){
emailjs.init('user_ngGaDPIoYOmfyhxEzDTPE');
})();
</script>
<script type="text/javascript">
window.onload = function() {
document.getElementById('contact-form').addEventListener('submit', function(event) {
event.preventDefault();
// generate the contact number value
this.contact_number.value = Math.random() * 100000 | 0;
emailjs.sendForm('contact_service', 'contact_form', this);
});
}
</script> -->
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/images/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Powered by UNIVERSITY OF INFORMATION SCIENCE AND TECHNOLOGY
'ST. PAUL THE APOSTLE' and ARTICONF"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="stylesheet" href="%PUBLIC_URL%/styles.css" />
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/pure-min.css" integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>ARTICONF</title>
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
heap.load("3168635468");
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro);
.contactForm {
margin-left:auto;
margin-right:auto;
width: 343px;
height: 333px;
padding:30px;
border: 1px solid rgba(0,0,0,.2);
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background: #08335e;
-moz-box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
box-shadow: 0 0 13px 3px rgba(0,0,0,.5);
overflow: hidden;
}
.contactTextarea{
background: rgba(255, 255, 255, 0.4) url(http://luismruiz.com/img/gemicon_message.png) no-repeat scroll 16px 16px;
width: 276px;
height: 110px;
border: 1px solid rgba(255,255,255,.6);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
display:block;
font-family: 'Source Sans Pro', sans-serif;
font-size:18px;
color:#fff;
padding-left:45px;
padding-right:20px;
padding-top:12px;
margin-bottom:20px;
overflow:hidden;
}
.contactInput {
width: 276px;
height: 48px;
border: 1px solid rgba(255,255,255,.4);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
display:block;
font-family: 'Source Sans Pro', sans-serif;
font-size:18px;
color:#fff;
padding-left:20px;
padding-right:20px;
margin-bottom:20px;
}
.contactInput[type=submit] {
cursor:pointer;
}
.contactInput.name {
background: rgba(255, 255, 255, 0.4) url(http://luismruiz.com/img/gemicon_name.png) no-repeat scroll 16px 16px;
padding-left:45px;
}
.contactInput.email {
background: rgba(255, 255, 255, 0.4) url(http://luismruiz.com/img/gemicon_email.png) no-repeat scroll 16px 20px;
padding-left:45px;
}
.contactInput.message {
background: rgba(255, 255, 255, 0.4) url(http://luismruiz.com/img/gemicon_message.png) no-repeat scroll 16px 16px;
padding-left:45px;
}
::-webkit-input-placeholder {
color: #fff;
}
:-moz-placeholder{
color: #fff;
}
::-moz-placeholder {
color: #fff;
}
:-ms-input-placeholder {
color: #fff;
}
.contactInput:focus, .contactTextarea:focus {
background-color: rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 0 5px 1px rgba(255,255,255,.5);
-webkit-box-shadow: 0 0 5px 1px rgba(255,255,255,.5);
box-shadow: 0 0 5px 1px rgba(255,255,255,.5);
overflow: hidden;
}
.contactInput.btn {
width: 138px;
height: 44px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
float:right;
border: 1px solid #253737;
background: #416b68;
background: -webkit-gradient(linear, left top, left bottom, from(#6da5a3), to(#416b68));
background: -webkit-linear-gradient(top, #6da5a3, #416b68);
background: -moz-linear-gradient(top, #6da5a3, #416b68);
background: -ms-linear-gradient(top, #6da5a3, #416b68);
background: -o-linear-gradient(top, #6da5a3, #416b68);
background-image: -ms-linear-gradient(top, #6da5a3 0%, #416b68 100%);
padding: 10.5px 21px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: rgba(255,255,255,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
-moz-box-shadow: rgba(255,255,255,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
box-shadow: rgba(255,255,255,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
text-shadow: #333333 0 1px 0;
color: #e1e1e1;
}
.contactInput.btn:hover {
border: 1px solid #253737;
text-shadow: #333333 0 1px 0;
background: #416b68;
background: -webkit-gradient(linear, left top, left bottom, from(#77b2b0), to(#416b68));
background: -webkit-linear-gradient(top, #77b2b0, #416b68);
background: -moz-linear-gradient(top, #77b2b0, #416b68);
background: -ms-linear-gradient(top, #77b2b0, #416b68);
background: -o-linear-gradient(top, #77b2b0, #416b68);
background-image: -ms-linear-gradient(top, #77b2b0 0%, #416b68 100%);
color: #fff;
}
.contactInput.btn:active {
margin-top:1px;
text-shadow: #333333 0 -1px 0;
border: 1px solid #253737;
background: #6da5a3;
background: -webkit-gradient(linear, left top, left bottom, from(#416b68), to(#416b68));
background: -webkit-linear-gradient(top, #416b68, #609391);
background: -moz-linear-gradient(top, #416b68, #6da5a3);
background: -ms-linear-gradient(top, #416b68, #6da5a3);
background: -o-linear-gradient(top, #416b68, #6da5a3);
background-image: -ms-linear-gradient(top, #416b68 0%, #6da5a3 100%);
color: #fff;
-webkit-box-shadow: rgba(255,255,255,0) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
-moz-box-shadow: rgba(255,255,255,0) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
box-shadow: rgba(255,255,255,0) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
}
\ No newline at end of file
@import 'https://cdn.jsdelivr.net/npm/remixicon@2.3.0/fonts/remixicon.css';
.footer {
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
height: 249px;
background-color: #08335e;
align-content: center;
text-align: left;
padding-bottom: 15px;;
}
.footer .footerImg {
float: left;
margin-top: 15px;
}
.footer p {
text-align: left;
color: #FFF;
}
.footer i {
font-size: xx-large;
margin-left: 5px;
}
.footer a:link {
text-decoration: none;
}
\ No newline at end of file
@import 'https://fonts.googleapis.com/css?family=Raleway';
html, body
{
background: #FFF !important;
margin: 0px;
}
div.container
{
font-family: Raleway;
margin: 0 auto;
padding: 2em 3em;
text-align: left;
}
div.container .a
{
color: #FFF;
text-decoration: none;
font: 20px Raleway;
margin: 0px 10px;
padding: 10px 10px;
position: relative;
z-index: 0;
cursor: pointer;
}
.blue
{
background: #08335e;
}
div.circleBehind a:before, div.circleBehind a:after
{
position: absolute;
top: 22px;
left: 50%;
width: 50px;
height: 50px;
border: 4px solid #0277bd;
transform: translateX(-50%) translateY(-50%) scale(0.8);
border-radius: 50%;
background: transparent;
content: "";
opacity: 0;
transition: all 0.3s;
z-index: -1;
}
div.circleBehind a:after
{
border-width: 2px;
transition: all 0.4s;
}
div.circleBehind a:hover:before
{
opacity: 1;
transform: translateX(-50%) translateY(-50%) scale(1);
}
div.circleBehind a:hover:after
{
opacity: 1;
transform: translateX(-50%) translateY(-50%) scale(1.3);
}
\ No newline at end of file
.theBody {
margin-left: 10%;
margin-right: 10%;
margin-top: 1%;
align-content: center;
text-align: justify;
}
.theBody .bank {
margin-left: 30%;
margin-right: 30%;
margin-bottom: 3%;
}
.theBody .login-form {
margin-left: 30%;
margin-right: 30%;
margin-top: 1.5em;
}
.text-section {
margin: 3em auto;
}
.theBody .deployLinks {
text-align: right;
}
.theBody .deployLinks button {
margin-right: 5px;
}
.theBody .homeDeploy {
text-align: center;
}
.theBody .deployed {
text-align: center;
}
.theBody .deployed button {
margin-right: 5px;
}
.theBody .btncontactus {
color: blue;
background: brown;
}
\ No newline at end of file
@charset 'UTF-8';
@import "./style/header.css";
@import "./style/home.css";
@import "./style/home1.css";
@import "./style/footer.css";
@import "./style/contactus.css";
@import "./style//timer.css";
@import "./style/modal.css";
\ No newline at end of file
import React, { memo, useEffect } from "react"
import { Route } from "react-router-dom"
import Header from "./components/Header"
import Footer from "./components/Footer"
import Dashboard from "./pages/Dashboard"
import Deploy from "./pages/Deploy"
import Deployment from "./pages/Deployment"
import Deployed from "./pages/Deployed"
import ContactUs from "./pages/ContactUs"
import Home from "./pages/Home"
import PrivateRoute from "./PrivateRoute"
import Login from "./pages/Login"
import SingUp from "./pages/SingUp"
import TokenBank from "./pages/TokenBank"
import Heap from "reactjs-heap"
function App() {
Heap.initialize('3168635468');
useEffect(() => {
window.$crisp=[];
window.CRISP_WEBSITE_ID="6d88474b-e371-4d77-bf41-8e0a5500e3d7";
(function(){
const d=document;
const s=d.createElement("script");
s.src="https://client.crisp.chat/l.js";
s.async=1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
}, [])
return (
<div>
<Header />
<PrivateRoute exact path="/" component={Home} />
<PrivateRoute exact path="/beta/testing" component={Home} />
<PrivateRoute exact path="/beta/testing/dashboard" component={Dashboard} />
<PrivateRoute exact path="/beta/testing/deploy" component={Deploy} />
<PrivateRoute exact path="/beta/testing/deploy/deployment" component={Deployment} />
<PrivateRoute exact path="/beta/testing/deployed" component={Deployed} />
<PrivateRoute exact path="/beta/testing/bank" component={TokenBank} />
<Route exact path="/beta/testing/contact" component={ContactUs} />
<Route exact path="/login" component={Login} />
<Route exact path="/singup" component={SingUp} />
<Footer />
</div>
)
}
export default memo(App)
This diff is collapsed.
import axios from "axios"
const instance = axios.create({
baseURL: "http://fry.lab.uvalight.net:30000/manager/",
})
export default instance
\ No newline at end of file
import React from "react"
import useToggler from "../hooks/useToggler"
import { Button } from 'semantic-ui-react'
// import {Context} from "../Context"
export default function Dummy(props) {
const [show, toggle] = useToggler()
return (
<div>
<Button style={{marginRight: '5px'}} onClick={props.callApi}>{props.btnName}</Button>
<Button onClick={toggle}>Show Info</Button><br />
<p style={{display: show ? "block" : "none"}}>{props.info}</p><hr />
</div>
)
}
\ No newline at end of file
import React from "react"
import flag from "../eu-flag.jpg"
// import logo from "../articonf-logo.jpg"
function Footer() {
return (
<footer className="footer">
<img className="footerImg" src={flag} alt="Flag"/>
<p className="footerP"><strong>This project has received funding from the European Unions Horizon 2020 research
and innovation programme under grant agreement No 825134, the ARTICONF Project.</strong></p>
<div>
<p>Follow us on Twitter:
<a style={{color: "#00acee"}} href="https://twitter.com/articonf/"><i className="ri-twitter-fill"></i></a>
</p>
<p>Subscribe on YouTube:
<a style={{color: "#FF0000"}} href="https://www.youtube.com/channel/UCPvfXuOgmtrq8psLQb9yFVA"><i className="ri-youtube-fill"></i></a>
</p>
<p>Visit our page for more details about us: <a href={"https://articonf.eu/"}><img src="https://i.imgur.com/tgkmCTc.png" alt="articonflogo" /></a></p>
</div>
</footer>
)
}
export default Footer
\ No newline at end of file
import React, { useContext } from "react"
import {Link} from "react-router-dom"
import { Context } from "../Context"
import app from "../firebase"
// import firebase from "firebase/app";
// import logo from "../articonf-logo.jpg"
export default function Header() {
const {currentUser, usersRef} = useContext(Context)
// const countDown = count === 0 ? 0 : count - 1
return (
<div className="container blue circleBehind">
<Link to="/beta/testing"className="img"><img src="https://i.imgur.com/tgkmCTc.png" alt="articonflogo" /></Link>
<Link to="/beta/testing"className="a">Home</Link>
<Link to="/beta/testing/deploy" className="a">Deploy</Link>
<Link to="/beta/testing/dashboard" className="a">Advance Configuration</Link>
<Link to="/beta/testing/deployed" className="a">Find Deployed Topology</Link>
<Link to="/beta/testing/bank" className="a">SMART and TAC</Link>
<Link to="/beta/testing/contact" className="a">Contact Us</Link>
{currentUser ?
<Link to="/login" className="a" onClick={async () => {
app.auth().signOut()
usersRef.remove();
}}>Sign Out</Link>
:
<Link to="/login" className="a">Sign In</Link>
}
</div>
)
}
\ No newline at end of file
import {useState} from "react"
function useToggler(defaultOnValue = false) {
const [isToggledOn, setIsToggledOn] = useState(defaultOnValue)
function toggle() {
setIsToggledOn(prev => !prev)
}
return [isToggledOn, toggle]
}
export default useToggler
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {ContextProvider} from "./Context"
import {BrowserRouter as Router} from "react-router-dom"
import * as serviceWorker from './serviceWorker';
import axios from "axios"
import 'semantic-ui-css/semantic.min.css'
// import https from "https"
// const proxyurl = "https://damp-coast-51800.herokuapp.com/"
// const url = "http://fry.lab.uvalight.net:30000/manager/"
axios.defaults.baseURL = ("http://fry.lab.uvalight.net:30000/manager/")
// const agent = new https.Agent({
// rejectUnauthorized: false,
// })
let encoded = window.btoa('articonf_ui:NzA4ZDA1ZWNjNTc0NTIxNGI0NjM2OWQ5')
let auth = 'Basic ' + encoded
axios.defaults.headers.common['Authorization'] = auth;
ReactDOM.render(
<ContextProvider>
<Router>
<App />
</Router>
</ContextProvider>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
import React, { useState } from 'react';
import emailjs from 'emailjs-com';
import { Button, Form, Label, Icon } from "semantic-ui-react";
export default function ContactUs() {
const [status, setStatus] = useState("")
const [isLoading, setIsLoading] = useState(false)
const [hasError, setHasError] = useState(false)
function sendEmail(e) {
e.preventDefault();
setIsLoading(true)
emailjs.sendForm('gmail', 'contact_form', e.target, 'user_ngGaDPIoYOmfyhxEzDTPE')
.then((result) => {
console.log(result.text);
setStatus("OK")
setIsLoading(false)
}, (error) => {
console.log(error.text);
setHasError(true)
});
e.target.reset();
}
return (
<div className="theBody">
<h1 style={{textAlign: "center"}}>Contact us by filling out the form below.</h1>
<div className="login-form">
<Form onSubmit={sendEmail}>
<Form.Field>
<input type="hidden" name="contact_number" />
</Form.Field>
<Form.Field>
<input name="user_name" placeholder="What is your name?" required />
<Label pointing>Please enter your full name</Label>
</Form.Field>
<Form.Field>
<input name="user_email" placeholder="What is your email?" type="email" required />
<Label pointing>Please enter your email</Label>
</Form.Field>
<Form.Field>
<textarea rows="4" cols="50" name="message" placeholder="Please enter your message" required></textarea>
<Label pointing>Please enter your message here</Label>
</Form.Field>
<div style={{textAlign: "center"}}><Button icon className="btncontactus" name="submit" type="submit" labelPosition="right">Send<Icon name="paper plane"/></Button></div>
{/*<input name="submit" className="contactInput btn" type="submit" value="Send" />*/}
</Form>
</div>
<h1 style={{textAlign: "center"}}>{status === "OK" && "We recived your email. Thank you for your feedback!"}</h1>
<h1 style={{textAlign: "center"}}>{isLoading && "Sending..."}</h1>
<h1 style={{textAlign: "center"}}>{hasError && "Something went wrong! We didn't recived your email. Please try again"}</h1>
</div>
);
}
\ No newline at end of file
import React, { useContext, memo } from "react"
import Dummy from "../components/DummyApi"
import {Context} from "../Context"
import Loader from 'react-loader-spinner'
import JSONPretty from 'react-json-prettify'
function Dashboard() {
const {
topologyTemplate,
plannedTopologyTemplate,
provisionedToscaTemplate,
ecBtnClick,
uploadToscaButton,
topoBtnClick,
planTopoBtn,
findProvisioned,
callDummyButton,
isLoading,
findDeleted,
deleted
} = useContext(Context)
return (
<div className="theBody">
<Dummy
callApi={ecBtnClick}
btnName={"Create EC2 credentials"}
info={"Creates credentials EC2 credentials. This call is optional deployments will probably have credentials set by the admin"}
/>
<Dummy
callApi={uploadToscaButton}
btnName={"Upload Tosca"}
info={"Uploads and validates TOSCA template file. Depending on the type of CONF deployment CONF will have a set of pre-uploaded TOSCA templates"}
/>
<Dummy
callApi={topoBtnClick}
btnName={"Find topolog template by ID"}
info={"Returns a single topology template."}
/>
<Dummy
callApi={planTopoBtn}
btnName={"Find planed topolog template by ID"}
info={"Returns a single topolog template."}
/>
<Dummy
callApi={findProvisioned}
btnName={"Find provisioned topolog template by ID"}
info={"Returns a single topolog template."}
/>
<Dummy
callApi={findDeleted}
btnName={"Find deleted provision topology template"}
info={"Finds and returns a deleted provision topology template"}
/>
<Dummy
callApi={callDummyButton}
btnName={"Dummy API"}
info={"This is just for testing!"}
/>
<h1 style={{display: isLoading ? "block" : "none"}}>
Please wait...
<Loader
type="Watch"
color="#08335e"
height={100}
width={100}
/></h1>
<h5 style={{display: topologyTemplate ? "block" : "none"}}>Topology template: <JSONPretty json={topologyTemplate}/></h5>
<h5 style={{display: plannedTopologyTemplate ? "block" : "none"}}>Planned topology template: <JSONPretty json={plannedTopologyTemplate}/></h5>
<h5 style={{display: provisionedToscaTemplate ? "block" : "none"}}>Provisioned topology template: <JSONPretty json={provisionedToscaTemplate}/></h5>
<h5 style={{display: deleted ? "block" : "none"}}>Provisioned topology template: <JSONPretty json={deleted}/></h5>
</div>
)
}
export default memo(Dashboard)
\ No newline at end of file
import React from "react"
import { Link } from "react-router-dom"
import { Button, Header } from "semantic-ui-react"
function Deploy() {
return (
<div className="theBody">
<h1>Please consider the following: </h1><br />
<p>
Please consider that this GUI is still in early development and there will be flaws, bugs and erros.
So please, if you encounter any bug report it trough the "Contac Us" button above in the navigation bar.
Also the ARTICONF platfrom is in early development, so there will be limitations.<br />
If you want to deploy our software, the only thing you need to do for now is to press the "Deploy" button which
is presented bellow.<br />
</p>
<Header as="h3">While using this demo, <em>please DO NOT leave or refresh this UI </em>
because you will lose all progress that you made so far. Thank you in advance</Header>
<Link to="/beta/testing/deploy/deployment">
<Button>Deploy</Button>
</Link>
</div>
)
}
export default Deploy
\ No newline at end of file
import React, { useContext } from "react"
import {Link} from "react-router-dom"
import {Context} from "../Context"
import Loader from 'react-loader-spinner'
import { Button, Icon } from "semantic-ui-react"
import CopyToClipboard from "../components/CopyToClipboard"
// import axios from "../axios-conf"
function Deployment() {
const {
plannedToscaTemplate,
provisionToscaTemplate,
planToscaBtn,
provisionToscaBtn,
isLoading,
deploymentLoading,
platformDeployer,
deployedToscaId,
timeRemaining,
isTimeRemaining,
cancelRequest
} = useContext(Context)
const hours = Math.floor(timeRemaining / 60 / 60)
const minutes = Math.floor(timeRemaining / 60) - (hours * 60)
const secounds = timeRemaining % 60
function downloadTxtFile() {
const element = document.createElement("a");
const file = new Blob([document.getElementById('toBeDownloaded').innerHTML], {type: 'text/plain;charset=utf-8'});
element.href = URL.createObjectURL(file);
element.download = "myArticonfIDs.html";
document.body.appendChild(element);
element.click();
}
const bottomText = <div>
{deploymentLoading && (isTimeRemaining ?
<div>
<h3>
The server needs 15 to 25 minutes to deploy the platform. Please wait<br />Time elapsed: {hours}h:{minutes}m:{secounds}s
</h3>
<Loader
type="Watch"
color="#08335e"
height={100}
width={100}
/>
</div>
:
alert(`The software is deployed with ID: ${deployedToscaId}`))}
{
plannedToscaTemplate &&
<div>
<h1>Planned tosca topology template ID: {plannedToscaTemplate}</h1><br />
<CopyToClipboard name="Plan ID" inputValue={plannedToscaTemplate} />
</div>
}
{
provisionToscaTemplate &&
<div>
<h1>Provisioned tosca topology template ID: {provisionToscaTemplate}</h1><br />
<CopyToClipboard name="Provision ID" inputValue={provisionToscaTemplate} />
</div>
}
{
deployedToscaId &&
<div>
<h1>Deployment ID: {deployedToscaId}</h1>
<CopyToClipboard name="Deployment ID" inputValue={deployedToscaId} />
</div>
}
</div>
const disabler = !plannedToscaTemplate || provisionToscaTemplate || isLoading ? true : false
const deploymentDisabler = deployedToscaId || !provisionToscaTemplate || deploymentLoading ? true : false
const plannerDisabler = plannedToscaTemplate || isLoading ? true : false
const downloadDisabler = plannedToscaTemplate || provisionToscaTemplate || deployedToscaId ? false : true
return (
<div className="theBody">
<div><strong>Instructions how to use (deploy) the platform:</strong><br />
<h3>Tutorial video for deployment: <a href="https://youtu.be/2J_b4oVjWgs" target="_blank" rel="noopener noreferrer">Introduction to ARTICONF and deploying the platform (using the CONF tool)</a></h3>
<h3>Plan the Infrastructure</h3>
<p>To deploy our platform first press the "Plan" button so CONF will generate an optimal virtual inftaracure on the Cloud. After the planning phase
is finished you will get back an ID of the planned virtual infrastructure.</p>
<h3>Provision the Infrastructure</h3>
<p>To provision the virtual infrastructure you will need to press the "Provision" button. By clicking the "Provision" button CONF will create the virtual
infrastructure. This process takes around 1-3 minutes.</p>
<h3>Deploy the Platform</h3>
<p>In this stage you need to press the "Deploy" button to call the CONF API that will deploy the ARTICONF platform and return a deployment ID. This process
takes around 15 minutes</p>
<h3>Cancel all requests</h3>
<p><strong>If by any chance you need to leave or refresh this UI and the process is already in progress, please press this button to clear the virtual infrastructure.</strong>
</p>
<h3>Intercat with the Deployment</h3>
<p>After you have finished with deployment and you've got an ID, which you can use to <Link to="/beta/testing/deployed">find your deployment.</Link></p>
<p>After the deployment is over you will see 4 icons: </p><br />
<ul>
<li>HyperLedger explorer</li>
<li>Portainer</li>
<li>Swarm Visualizer</li>
<li>Sample bank application</li>
</ul>
<p>Further instructions will be presented at that page. If you already have a deployment ID you can use it <Link to="/beta/testing/deployed">here.</Link></p>
<p><strong>Tip: When you get your IDs, store them somewhere or you can download them by using the "Download ID's" button presented bellow. So when you come back
to our platform you can navigate directly <Link to="/beta/testing/deployed">here.</Link> and just enter them to continue with your work.</strong></p>
</div>
<div style={{textAlign: "center", paddingBottom: "20px"}}>
<Button onClick={planToscaBtn} disabled={plannerDisabler}>Plan</Button>
{plannedToscaTemplate ? <Icon name="arrow alternate circle right" size="big"></Icon> : <Icon name="arrow alternate circle right outline" size="big"/>}
<Button onClick={provisionToscaBtn} disabled={disabler}>Provision</Button>
{provisionToscaTemplate ? <Icon name="arrow alternate circle right" size="big"></Icon> : <Icon name="arrow alternate circle right outline" size="big"/>}
<Button onClick={platformDeployer} disabled={deploymentDisabler}>Deploy</Button>
<Button icon labelPosition="left" color="red" onClick={cancelRequest}><Icon name="cancel"/>Cancel all requests</Button>
</div>
<div style={{textAlign: "center"}}>
{
isLoading ?
<div>
<h3>Just a moment please! The request is beeing processed in the server.
<Loader
type="ThreeDots"
color="#08335e"
height={50}
width={50}
/>
</h3>
</div>
:
bottomText
}
</div>
<div style={{textAlign: "center"}}>
<pre><p id="toBeDownloaded" style={{display: "none"}}>
Planned tosca topology template ID: {plannedToscaTemplate}<br />
Provisioned tosca topology template ID: {provisionToscaTemplate}<br />
Deployment ID: {deployedToscaId}
</p>
</pre>
<Button onClick={downloadTxtFile} disabled={downloadDisabler}>Download ID's</Button>
</div>
{/* <div className="login-form">
{
!name
&&
<Form onSubmit={e => setUserName(uname)}>
<Form.Field>
<Input action={<Button type="submit">SET your name</Button>} placeholder="Name" onChange={e => setUName(e.target.value)}/>
<Label pointing style={{textAlign: "start"}}>Enter your name here if you want to save your ID's on our database</Label>
</Form.Field>
</Form>
}
<Button onClick={saveIds} disabled={!name}>Save</Button>
</div> */}
{/* <div className="deployLinks">
<Link to="/beta/testing/"><Button icon labelPosition="left"><Icon name="home"/>Home</Button></Link>
<Link to="/beta/testing/dashboard"><Button icon labelPosition="left"><Icon name="setting"/>Advanced configuration</Button></Link>
<Link to="/beta/testing/contact"><Button icon labelPosition="left"><Icon name="mail"/>Contact Us</Button></Link>
</div> */}
{/*
timeRemaining !== 0 ?
`The server needs time to deploy the platfrom so please wait: ${Math.floor(timeRemaining / 60)}:${timeRemaining - minutes * 60} until deployed`
:
`The software is deployed with id: ${plannedToscaTemplate}`
*/}
</div>
)
}
export default Deployment
\ No newline at end of file
import React from "react"
import { Link } from "react-router-dom"
import { Button } from "semantic-ui-react"
function Home() {
return (
<article className="theBody">
<div>
<section className='text-section'>
<h1>Welcome to ARTICONF!</h1>
<h3>Welcome to ARTICONF and thank you for using our platform. If you want to deploy our platfrom please go to <Link to="/beta/testing/deploy">deploy page</Link> and follow the instructions and steps presented there or watch our tutorial videos:<br />
Part 1: <a href="https://youtu.be/2J_b4oVjWgs" target="_blank" rel="noopener noreferrer">Introduction to ARTICONF and deploying the platform (using the CONF tool)</a><br />
Part 2: <a href="https://youtu.be/gdBDajWyUFY" target="_blank" rel="noopener noreferrer">Interacting with the ARTICONF platform (using the TIC tool)</a>
</h3>
<h3>This application demonstrates the ARTICONF platform, which is a collection of 4 different tools:</h3>
<ul>
<li>CONF
<p>Co-located and Orchestrated Network Fabric (CONF) provides adaptive infrastructure provisioning for social media applications over an orchestrated network. It seamlessly integrates with the Cloud edge infrastructure, able to intelligently provision services based on abstract application service requirements, operational conditions at infrastructure level, and time-critical event triggering. The distribution of the networked infrastructure provisioned by CONF receives information from the intelligent community analytics of SMART and TAC services, and supports them for a smooth and optimised operation.</p>
</li>
<li>TIC
<p>Trust and Integration Controller (TIC) provides support for creating an open and agile decentralised social media interface using blockchain technology to simplify integration and federation of fragmented social media platforms with increased participants outreach. In coordination with SMART service, this allows customers, consumers, prosumers and businesses engage in a safe, transparent and trustful environment with monetisation opportunities.</p>
</li>
<li>SMART
<p>Semantic Model with self-adaptive and Autonomous Relevant Technology (SMART) service provides an abstraction framework, capable of finding relevant interest group communities through graph anonymization techniques without violating users privacy and anonymity. The service adaptively responds to changes in the social media with the changing needs and requirements, and provides inputs to CONF. SMART researches decentralised decision making and reputation mechanisms together with TIC for solving disputes in collaborative models, preserving the trustful and autonomous users-centric environment.</p>
</li>
<li>TAC
<p>Tools for Analytics and Cognition (TAC) provides guided analytics by coupling with inputs from TIC to social media consumer, prosumers and businesses, aggregating contextualised data over spatial-temporal boundaries based on socio-cultural abstraction and extracting knowledge. Its goal is to provide automated cognitive learning to predict user engagement with inputs from TIC, CONF and SMART, and evaluate the risk quantification for all participants to enable, track and control the ROI for each participant.</p>
</li>
</ul>
<Link to="/beta/testing/deploy" style={{textAlign: "center"}}><Button>Deploy</Button></Link>
</section>
</div>
</article>
)
}
export default Home
\ No newline at end of file
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
}
}
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- nodes: https://raw.githubusercontent.com/QCDIS/sdia-tosca/master/types/nodes.yaml
- data: https://raw.githubusercontent.com/QCDIS/sdia-tosca/master/types/data.yml
- capabilities: https://raw.githubusercontent.com/QCDIS/sdia-tosca/master/types/capabilities.yaml
- policies: https://raw.githubusercontent.com/QCDIS/sdia-tosca/master/types/policies.yaml
- interfaces: https://raw.githubusercontent.com/QCDIS/sdia-tosca/master/types/interfaces.yml
repositories:
docker_hub: https://hub.docker.com/
description: >
TOSCA example
topology_template:
node_templates:
mongo:
type: tosca.nodes.QC.Container.Application.Docker
properties:
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
ports:
- "27017:27017"
artifacts:
image:
type: tosca.artifacts.Deployment.Image.Container.Docker
file: mongo
repository: docker_hub
interfaces:
Kubernetes:
delete:
inputs:
repository: https://github.com/QCAPI-DRIP/playbooks.git
resources:
- k8s/delete_service.yml
create:
inputs:
repository: https://github.com/QCAPI-DRIP/playbooks.git
resources:
- k8s/create_service.yml
scale:
inputs:
repository: https://github.com/QCAPI-DRIP/playbooks.git
resources:
- k8s/scale_service.yml
replicas: 1
autoscale:
inputs:
repository: https://github.com/QCAPI-DRIP/playbooks.git
resources:
- k8s/autoscale_service.yml
horizontal_pod_autoscaler: horizontal_pod_autoscaler.yml
info:
inputs:
repository: https://github.com/QCAPI-DRIP/playbooks.git
resources:
- k8s/get_info_service.yml
......@@ -18,7 +18,7 @@ services:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
ES_JAVA_OPTS: "-Xmx4g -Xms4g"
ELASTIC_PASSWORD: changeme
networks:
- elk
......@@ -41,7 +41,7 @@ services:
- "5000:5000"
- "9600:9600"
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
LS_JAVA_OPTS: "-Xmx4g -Xms4g"
networks:
- elk
depends_on:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment