diff --git a/frontend/public/SigNoz-dark.svg b/frontend/public/SigNoz-dark.svg new file mode 100644 index 0000000000..41a6fb8258 --- /dev/null +++ b/frontend/public/SigNoz-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/public/SigNoz-white.svg b/frontend/public/SigNoz-white.svg new file mode 100644 index 0000000000..17cc833d12 --- /dev/null +++ b/frontend/public/SigNoz-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/api/metricsAPI.js b/frontend/src/api/metricsAPI.js index 5c3954c693..f27dbcc1df 100644 --- a/frontend/src/api/metricsAPI.js +++ b/frontend/src/api/metricsAPI.js @@ -1,16 +1,10 @@ import axios from 'axios'; export default axios.create({ - - // baseURL: 'http://104.211.113.204:8080/api/v1/', - - // baseURL: 'http://localhost:3000/api/v1/', - - - // baseURL: 'http://104.211.113.204:8080/api/v1/', + // baseURL: 'http://104.211.113.204:8080/api/v1/', // baseURL: process.env.REACT_APP_QUERY_SERVICE_URL, - baseURL: '/api/v1/', // console.log('in metrics API', process.env.QUERY_SERVICE_URL) - + baseURL: '/api/v1/', + } ); \ No newline at end of file diff --git a/frontend/src/api/submitForm.js b/frontend/src/api/submitForm.js new file mode 100644 index 0000000000..46a65ae6de --- /dev/null +++ b/frontend/src/api/submitForm.js @@ -0,0 +1,16 @@ +import axios from 'axios'; + +export default axios.create({ + // baseURL: 'https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/', + // baseURL: 'http://104.211.113.204:8080/api/v1/', + baseURL: '/api/v1/', + +} +); + + + +//https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/sendMessage?chat_id=351813222&text=Hello%20there + +// Chat ID can be obtained from here +//https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/getUpdates \ No newline at end of file diff --git a/frontend/src/api/tracesAPI.js b/frontend/src/api/tracesAPI.js index 0f475ff702..974466045c 100644 --- a/frontend/src/api/tracesAPI.js +++ b/frontend/src/api/tracesAPI.js @@ -2,13 +2,11 @@ import axios from 'axios'; //import { format } from 'path'; export default axios.create({ - // baseURL: 'http://104.211.113.204:8080/api/v1/' - - // baseURL: 'http://localhost:3000/api/v1/', // toggle to this before pushing - + // baseURL: 'http://104.211.113.204:8080/api/v1/' //comment this line and remove this comment before pushing // baseURL: process.env.QUERY_SERVICE_URL, // console.log('in traces API', process.env.QUERY_SERVICE_URL) baseURL: '/api/v1/', + }); diff --git a/frontend/src/components/App.tsx b/frontend/src/components/App.tsx index e22dc786f3..5b00987d12 100644 --- a/frontend/src/components/App.tsx +++ b/frontend/src/components/App.tsx @@ -27,6 +27,8 @@ const TraceDetail = React.lazy(() => import('./traces/TraceDetail')); const TraceGraph = React.lazy(() => import ('./traces/TraceGraphDef' )); const UsageExplorer = React.lazy(() => import ('./usage/UsageExplorerDef' )); const ServicesTable = React.lazy(() => import('./metrics/ServicesTableDef')); +// const Signup = React.lazy(() => import('./Signup')); + //PNOTE @@ -54,6 +56,7 @@ const App = () => { return ( +
@@ -98,7 +101,9 @@ const App = () => { - + + + {/* */} diff --git a/frontend/src/components/AppWrapper.tsx b/frontend/src/components/AppWrapper.tsx new file mode 100644 index 0000000000..1b42f3f59f --- /dev/null +++ b/frontend/src/components/AppWrapper.tsx @@ -0,0 +1,53 @@ +import React,{Suspense, useState} from 'react'; +import {Spin} from 'antd'; + + +import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'; + + +const Signup = React.lazy(() => import('./Signup')); +const App = React.lazy(() => import('./App')); + + + +const AppWrapper = () => { + + const [isUserAuthenticated, setIsUserAuthenticated] = useState(false); + + return( + + + + }> + + + + + + + + + + { + return ( + localStorage.getItem('isLoggedIn')==='yes' ? + : + + ) + }} + + /> + + + + + + + + ); + + +} + +export default AppWrapper; diff --git a/frontend/src/components/Signup.tsx b/frontend/src/components/Signup.tsx new file mode 100644 index 0000000000..c87163f1e4 --- /dev/null +++ b/frontend/src/components/Signup.tsx @@ -0,0 +1,235 @@ +import React, { useState,useRef, Suspense } from 'react'; +import { Row, Space, Button, Input, Checkbox } from 'antd' +import submitForm from '../api/submitForm'; +import { withRouter } from "react-router"; +import { RouteComponentProps } from 'react-router-dom'; + + +interface SignUpProps extends RouteComponentProps { + +} + +const Signup = (props:SignUpProps) => { + + const [state, setState] = useState({ submitted: false }) + const [formState, setFormState] = useState({ + firstName: {value:''}, + companyName: {value:''}, + email: {value:''}, + password: {value:'',valid:true}, + emailOptIn: { value: true }, + }) + const passwordInput = useRef(null) + // const { createAccount } = useActions(signupLogic) + // const { accountLoading } = useValues(signupLogic) + // const { plan } = fromParams() + + const updateForm = (name:any, target:any, valueAttr = 'value') => { + /* Validate password (if applicable) */ + if (name === 'password') { + let password = target[valueAttr] + const valid = password.length >= 8 + setFormState({ ...formState, password: { ...formState.password, valid, value: target[valueAttr] } }) + } else + if (name === 'firstName') { + + setFormState({ ...formState, firstName: { ...formState.firstName, value: target[valueAttr] } }) + } else + if (name === 'companyName') { + + setFormState({ ...formState, companyName: { ...formState.companyName, value: target[valueAttr] } }) + } else + if (name === 'email') { + + setFormState({ ...formState, email: { ...formState.email, value: target[valueAttr] } }) + } else + if (name === 'emailOptIn') { + + setFormState({ ...formState, emailOptIn: { ...formState.emailOptIn, value: target[valueAttr] } }) + } + } + + const handleSubmit = (e:any) => { + e.preventDefault() + + console.log('in handle submit'); + + setState({ ...state, submitted: true }) + + /* Password has custom validation */ + if (!formState.password.valid) { + // if (passwordInput.current){ + // passwordInput.current.focus() + // } + + // return + } + const payload = { + first_name: formState.firstName, + company_name: formState.companyName || undefined, + email: formState.email, + password: formState.password, + email_opt_in: formState.emailOptIn.value, + // plan, // Pass it along if on QS, won't have any effect unless on multitenancy + } + // createAccount(payload) + + + + // axios.get(`https://jsonplaceholder.typicode.com/users`) + // .then(res => { + // console.log(res); + // console.log(res.data); + // }) + + let texttolog = JSON.stringify(payload) + + // submitForm.get('sendMessage', { + // params: { + // chat_id: 351813222, + // text:texttolog, + // } + // } + // ).then(res => { + // console.log(res); + // console.log(res.data); + // }) + + + submitForm.post('user?email='+texttolog + ).then(res => { + console.log(res); + console.log(res.data); + }) + + localStorage.setItem('isLoggedIn', 'yes'); + props.history.push('/application') + }; + + + return ( +
+ +

+ {/* */} + Create your account +

+
Monitor your applications. Find what is causing issues.
+
+ +
+ +
+
+
+
+ + updateForm('email', e.target)} + required + // disabled={accountLoading} + id="signupEmail" + /> +
+ +
+ + updateForm('password', e.target)} + required + ref={passwordInput} + // disabled={accountLoading} + id="signupPassword" + /> + }> + {/* */} + + {!formState.password && ( + Your password must have at least 8 characters. + )} +
+ +
+ + updateForm('firstName', e.target)} + required + // disabled={accountLoading} + id="signupFirstName" + /> +
+ +
+ + updateForm('companyName', e.target)} + // disabled={accountLoading} + id="signupCompanyName" + /> +
+ +
+ updateForm('emailOptIn', e.target, 'checked')} + // disabled={accountLoading} + > + Send me occasional emails about security and product updates. You may unsubscribe at any + time. + +
+
+ +
+ + {/*
+ By clicking the button above you agree to our{' '} + + Terms of Service + {' '} + and{' '} + + Privacy Policy + + . +
*/} +
+
+
+
+ + ); +} + +export default withRouter(Signup); \ No newline at end of file diff --git a/frontend/src/components/servicemap/ServiceGraph.tsx b/frontend/src/components/servicemap/ServiceGraph.tsx index 57652ea756..335ac15f4b 100644 --- a/frontend/src/components/servicemap/ServiceGraph.tsx +++ b/frontend/src/components/servicemap/ServiceGraph.tsx @@ -48,7 +48,8 @@ const ServiceGraph = () => { return ( -
Service Graph Component
+
Updated Service Graph module coming soon..
+ { // // if you want access to vis.js network api you can set the state in a parent component using this property // }} /> +
); @@ -64,4 +66,6 @@ const ServiceGraph = () => { -export default ServiceGraph; \ No newline at end of file +export default ServiceGraph; + + diff --git a/frontend/src/components/servicemap/ServiceMap.tsx b/frontend/src/components/servicemap/ServiceMap.tsx index 622c7b76d2..2919087b39 100644 --- a/frontend/src/components/servicemap/ServiceMap.tsx +++ b/frontend/src/components/servicemap/ServiceMap.tsx @@ -5,10 +5,11 @@ const ServiceMap = () => { return ( -
- +
Service Map module coming soon... + {/* */}
+ ); } diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 0dd4771c65..354c54983f 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -4,11 +4,14 @@ import { Provider } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; import { ThemeSwitcherProvider } from "react-css-theme-switcher"; import thunk from 'redux-thunk'; +// import { NavLink, BrowserRouter as Router, Route, Switch } from 'react-router-dom'; -import App from './components/App'; + +import AppWrapper from './components/AppWrapper'; import './assets/index.css'; import { reducers } from './reducers'; +// import Signup from './components/Signup'; const store = createStore(reducers, applyMiddleware(thunk)) @@ -21,7 +24,9 @@ ReactDOM.render( - + + + {/* */} ,