[release] v0.9.0-unstable6
This commit is contained in:
parent
a6c6e2b524
commit
1b22ca65fc
|
@ -9,7 +9,8 @@ import logo from './assets/images/icons/cosmos.png';
|
||||||
|
|
||||||
import * as API from './api';
|
import * as API from './api';
|
||||||
|
|
||||||
import { setSnackit } from './api/wrap';
|
import { setSnackit, snackit } from './api/wrap';
|
||||||
|
import { DisconnectOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
|
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ const App = () => {
|
||||||
const [statusLoaded, setStatusLoaded] = React.useState(false);
|
const [statusLoaded, setStatusLoaded] = React.useState(false);
|
||||||
const [PrimaryColor, setPrimaryColor] = React.useState(API.PRIMARY_COLOR);
|
const [PrimaryColor, setPrimaryColor] = React.useState(API.PRIMARY_COLOR);
|
||||||
const [SecondaryColor, setSecondaryColor] = React.useState(API.SECONDARY_COLOR);
|
const [SecondaryColor, setSecondaryColor] = React.useState(API.SECONDARY_COLOR);
|
||||||
|
const [timeoutError, setTimeoutError] = React.useState(false);
|
||||||
|
|
||||||
SetPrimaryColor = (color) => {
|
SetPrimaryColor = (color) => {
|
||||||
setPrimaryColor(color);
|
setPrimaryColor(color);
|
||||||
|
@ -45,13 +47,24 @@ const App = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
const timeout = setTimeout(
|
||||||
|
() => {
|
||||||
|
setTimeoutError(true);
|
||||||
|
}, 10000
|
||||||
|
)
|
||||||
API.getStatus(true).then((r) => {
|
API.getStatus(true).then((r) => {
|
||||||
if(r) {
|
clearTimeout(timeout);
|
||||||
|
if(r == "NOT_AVAILABLE") {
|
||||||
|
setTimeoutError(true);
|
||||||
|
}
|
||||||
|
else if(r) {
|
||||||
setStatusLoaded(true);
|
setStatusLoaded(true);
|
||||||
}
|
}
|
||||||
setPrimaryColor(API.PRIMARY_COLOR);
|
setPrimaryColor(API.PRIMARY_COLOR);
|
||||||
setSecondaryColor(API.SECONDARY_COLOR);
|
setSecondaryColor(API.SECONDARY_COLOR);
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
clearTimeout(timeout);
|
||||||
setStatusLoaded(true);
|
setStatusLoaded(true);
|
||||||
setPrimaryColor(API.PRIMARY_COLOR);
|
setPrimaryColor(API.PRIMARY_COLOR);
|
||||||
setSecondaryColor(API.SECONDARY_COLOR);
|
setSecondaryColor(API.SECONDARY_COLOR);
|
||||||
|
@ -84,7 +97,11 @@ const App = () => {
|
||||||
: <div>
|
: <div>
|
||||||
<Box sx={{ position: 'fixed', top: 0, bottom: 0, left: 0, right: 0, display: 'flex', justifyContent: 'center', alignItems: 'center'}}>
|
<Box sx={{ position: 'fixed', top: 0, bottom: 0, left: 0, right: 0, display: 'flex', justifyContent: 'center', alignItems: 'center'}}>
|
||||||
{/* <img src={logo} style={{ display:'inline', height: '200px'}} className='pulsing' /> */}
|
{/* <img src={logo} style={{ display:'inline', height: '200px'}} className='pulsing' /> */}
|
||||||
<LoadingAnimation />
|
{!timeoutError && <LoadingAnimation />}
|
||||||
|
{timeoutError && <DisconnectOutlined style={{
|
||||||
|
fontSize: '200px',
|
||||||
|
color: 'red',
|
||||||
|
}}/>}
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ let getStatus = (initial) => {
|
||||||
return "nothing";
|
return "nothing";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return "NOT_AVAILABLE";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,41 +8,34 @@ import {
|
||||||
Alert,
|
Alert,
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
Divider,
|
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
Grid,
|
Grid,
|
||||||
IconButton,
|
|
||||||
InputAdornment,
|
|
||||||
InputLabel,
|
InputLabel,
|
||||||
Link,
|
|
||||||
OutlinedInput,
|
OutlinedInput,
|
||||||
Stack,
|
Stack,
|
||||||
Typography,
|
|
||||||
FormHelperText,
|
FormHelperText,
|
||||||
Collapse,
|
|
||||||
TextField,
|
TextField,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
|
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
|
|
||||||
import AnimateButton from '../../../components/@extended/AnimateButton';
|
|
||||||
import RestartModal from './restart';
|
import RestartModal from './restart';
|
||||||
import { WarningOutlined, PlusCircleOutlined, CopyOutlined, ExclamationCircleOutlined , SyncOutlined, UserOutlined, KeyOutlined } from '@ant-design/icons';
|
import { SyncOutlined } from '@ant-design/icons';
|
||||||
import { CosmosCheckbox, CosmosFormDivider, CosmosInputPassword, CosmosInputText, CosmosSelect } from './formShortcuts';
|
import { CosmosCheckbox, CosmosFormDivider, CosmosInputPassword, CosmosInputText, CosmosSelect } from './formShortcuts';
|
||||||
import CountrySelect, { countries } from '../../../components/countrySelect';
|
import CountrySelect from '../../../components/countrySelect';
|
||||||
import { DnsChallengeComp } from '../../../utils/dns-challenge-comp';
|
import { DnsChallengeComp } from '../../../utils/dns-challenge-comp';
|
||||||
import { values } from 'lodash';
|
|
||||||
import UploadButtons from '../../../components/fileUpload';
|
import UploadButtons from '../../../components/fileUpload';
|
||||||
import { TwitterPicker
|
import { TwitterPicker
|
||||||
} from 'react-color';
|
} from 'react-color';
|
||||||
import {SetPrimaryColor, SetSecondaryColor} from '../../../App';
|
import { LoadingButton } from '@mui/lab';
|
||||||
import { LoadingButton } from '@mui/lab';
|
|
||||||
|
|
||||||
|
// TODO: Remove circular deps
|
||||||
|
import {SetPrimaryColor, SetSecondaryColor} from '../../../App';
|
||||||
|
|
||||||
const ConfigManagement = () => {
|
const ConfigManagement = () => {
|
||||||
const [config, setConfig] = React.useState(null);
|
const [config, setConfig] = React.useState(null);
|
||||||
const [openModal, setOpenModal] = React.useState(false);
|
const [openModal, setOpenModal] = React.useState(false);
|
||||||
|
const [openResartModal, setOpenRestartModal] = React.useState(false);
|
||||||
const [uploadingBackground, setUploadingBackground] = React.useState(false);
|
const [uploadingBackground, setUploadingBackground] = React.useState(false);
|
||||||
const [saveLabel, setSaveLabel] = React.useState("Save");
|
const [saveLabel, setSaveLabel] = React.useState("Save");
|
||||||
|
|
||||||
|
@ -58,11 +51,21 @@ const ConfigManagement = () => {
|
||||||
|
|
||||||
return <div style={{maxWidth: '1000px', margin: ''}}>
|
return <div style={{maxWidth: '1000px', margin: ''}}>
|
||||||
<IsLoggedIn />
|
<IsLoggedIn />
|
||||||
<Button variant="contained" color="primary" startIcon={<SyncOutlined />} onClick={() => {
|
|
||||||
refresh();
|
<Stack direction="row" spacing={2} style={{marginBottom: '15px'}}>
|
||||||
}}>Refresh</Button><br /><br />
|
<Button variant="contained" color="primary" startIcon={<SyncOutlined />} onClick={() => {
|
||||||
|
refresh();
|
||||||
|
}}>Refresh</Button>
|
||||||
|
|
||||||
|
<Button variant="outlined" color="primary" startIcon={<SyncOutlined />} onClick={() => {
|
||||||
|
setOpenRestartModal(true);
|
||||||
|
}}>Restart Server</Button>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
{config && <>
|
{config && <>
|
||||||
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} />
|
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} />
|
||||||
|
<RestartModal openModal={openResartModal} setOpenModal={setOpenRestartModal} />
|
||||||
|
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{
|
initialValues={{
|
||||||
MongoDB: config.MongoDB,
|
MongoDB: config.MongoDB,
|
||||||
|
@ -98,6 +101,7 @@ const ConfigManagement = () => {
|
||||||
PrimaryColor: config && config.ThemeConfig && config.ThemeConfig.PrimaryColor,
|
PrimaryColor: config && config.ThemeConfig && config.ThemeConfig.PrimaryColor,
|
||||||
SecondaryColor: config && config.ThemeConfig && config.ThemeConfig.SecondaryColor,
|
SecondaryColor: config && config.ThemeConfig && config.ThemeConfig.SecondaryColor,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
validationSchema={Yup.object().shape({
|
validationSchema={Yup.object().shape({
|
||||||
Hostname: Yup.string().max(255).required('Hostname is required'),
|
Hostname: Yup.string().max(255).required('Hostname is required'),
|
||||||
MongoDB: Yup.string().max(512),
|
MongoDB: Yup.string().max(512),
|
||||||
|
|
|
@ -70,7 +70,7 @@ const RestartModal = ({openModal, setOpenModal, config}) => {
|
||||||
<div style={{textAlign: 'center', padding: '20px'}}>
|
<div style={{textAlign: 'center', padding: '20px'}}>
|
||||||
<CircularProgress />
|
<CircularProgress />
|
||||||
</div>
|
</div>
|
||||||
: 'A restart is required to apply changes. Do you want to restart?'}
|
: 'Do you want to restart your server?'}
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
{!isRestarting && <DialogActions>
|
{!isRestarting && <DialogActions>
|
||||||
|
|
|
@ -12,7 +12,6 @@ import RouteConfigPage from '../pages/config/routeConfigPage';
|
||||||
import logo from '../assets/images/icons/cosmos.png';
|
import logo from '../assets/images/icons/cosmos.png';
|
||||||
import HomePage from '../pages/home';
|
import HomePage from '../pages/home';
|
||||||
import ContainerIndex from '../pages/servapps/containers';
|
import ContainerIndex from '../pages/servapps/containers';
|
||||||
import NewDockerService from '../pages/servapps/containers/newService';
|
|
||||||
import NewDockerServiceForm from '../pages/servapps/containers/newServiceForm';
|
import NewDockerServiceForm from '../pages/servapps/containers/newServiceForm';
|
||||||
import OpenIdList from '../pages/openid/openid-list';
|
import OpenIdList from '../pages/openid/openid-list';
|
||||||
import MarketPage from '../pages/market/listing';
|
import MarketPage from '../pages/market/listing';
|
||||||
|
@ -21,16 +20,6 @@ import MarketPage from '../pages/market/listing';
|
||||||
// render - dashboard
|
// render - dashboard
|
||||||
const DashboardDefault = Loadable(lazy(() => import('../pages/dashboard')));
|
const DashboardDefault = Loadable(lazy(() => import('../pages/dashboard')));
|
||||||
|
|
||||||
// render - sample page
|
|
||||||
const SamplePage = Loadable(lazy(() => import('../pages/extra-pages/SamplePage')));
|
|
||||||
|
|
||||||
// render - utilities
|
|
||||||
const Typography = Loadable(lazy(() => import('../pages/components-overview/Typography')));
|
|
||||||
const Color = Loadable(lazy(() => import('../pages/components-overview/Color')));
|
|
||||||
const Shadow = Loadable(lazy(() => import('../pages/components-overview/Shadow')));
|
|
||||||
const AntIcons = Loadable(lazy(() => import('../pages/components-overview/AntIcons')));
|
|
||||||
|
|
||||||
|
|
||||||
// ==============================|| MAIN ROUTING ||============================== //
|
// ==============================|| MAIN ROUTING ||============================== //
|
||||||
|
|
||||||
const MainRoutes = {
|
const MainRoutes = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.9.0-unstable5",
|
"version": "0.9.0-unstable6",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ func Init() {
|
||||||
store.Clients[client.ID] = &fosite.DefaultClient{
|
store.Clients[client.ID] = &fosite.DefaultClient{
|
||||||
ID: client.ID,
|
ID: client.ID,
|
||||||
Secret: []byte(client.Secret),
|
Secret: []byte(client.Secret),
|
||||||
RedirectURIs: []string{client.Redirect},
|
RedirectURIs: strings.Split(client.Redirect, ","),
|
||||||
Scopes: []string{"openid", "email", "profile", "offline", "roles", "groups", "address", "phone", "role"},
|
Scopes: []string{"openid", "email", "profile", "offline", "roles", "groups", "address", "phone", "role"},
|
||||||
ResponseTypes: []string{"id_token", "code", "token", "id_token token", "code id_token", "code token", "code id_token token"},
|
ResponseTypes: []string{"id_token", "code", "token", "id_token token", "code id_token", "code token", "code id_token token"},
|
||||||
GrantTypes: []string{"implicit", "refresh_token", "authorization_code", "password", "client_credentials"},
|
GrantTypes: []string{"implicit", "refresh_token", "authorization_code", "password", "client_credentials"},
|
||||||
|
|
|
@ -358,9 +358,12 @@ func GetAllHostnames(applyWildCard bool, removePorts bool) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if applyWildCard && MainConfig.HTTPConfig.UseWildcardCertificate {
|
if applyWildCard && MainConfig.HTTPConfig.UseWildcardCertificate {
|
||||||
|
// remove subdomains, keep domain.extension
|
||||||
|
bareMainHostname := strings.Split(mainHostname, ".")[len(strings.Split(mainHostname, "."))-2] + "." + strings.Split(mainHostname, ".")[len(strings.Split(mainHostname, "."))-1]
|
||||||
|
|
||||||
filteredHostnames := []string{
|
filteredHostnames := []string{
|
||||||
mainHostname,
|
bareMainHostname,
|
||||||
"*." + mainHostname,
|
"*." + bareMainHostname,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, hostname := range uniqueHostnames {
|
for _, hostname := range uniqueHostnames {
|
||||||
|
|
Loading…
Reference in a new issue