[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 { setSnackit } from './api/wrap';
|
||||
import { setSnackit, snackit } from './api/wrap';
|
||||
import { DisconnectOutlined } from '@ant-design/icons';
|
||||
|
||||
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
|
||||
|
||||
|
@ -33,6 +34,7 @@ const App = () => {
|
|||
const [statusLoaded, setStatusLoaded] = React.useState(false);
|
||||
const [PrimaryColor, setPrimaryColor] = React.useState(API.PRIMARY_COLOR);
|
||||
const [SecondaryColor, setSecondaryColor] = React.useState(API.SECONDARY_COLOR);
|
||||
const [timeoutError, setTimeoutError] = React.useState(false);
|
||||
|
||||
SetPrimaryColor = (color) => {
|
||||
setPrimaryColor(color);
|
||||
|
@ -45,13 +47,24 @@ const App = () => {
|
|||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
const timeout = setTimeout(
|
||||
() => {
|
||||
setTimeoutError(true);
|
||||
}, 10000
|
||||
)
|
||||
API.getStatus(true).then((r) => {
|
||||
if(r) {
|
||||
clearTimeout(timeout);
|
||||
if(r == "NOT_AVAILABLE") {
|
||||
setTimeoutError(true);
|
||||
}
|
||||
else if(r) {
|
||||
setStatusLoaded(true);
|
||||
}
|
||||
setPrimaryColor(API.PRIMARY_COLOR);
|
||||
setSecondaryColor(API.SECONDARY_COLOR);
|
||||
|
||||
}).catch(() => {
|
||||
clearTimeout(timeout);
|
||||
setStatusLoaded(true);
|
||||
setPrimaryColor(API.PRIMARY_COLOR);
|
||||
setSecondaryColor(API.SECONDARY_COLOR);
|
||||
|
@ -84,7 +97,11 @@ const App = () => {
|
|||
: <div>
|
||||
<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' /> */}
|
||||
<LoadingAnimation />
|
||||
{!timeoutError && <LoadingAnimation />}
|
||||
{timeoutError && <DisconnectOutlined style={{
|
||||
fontSize: '200px',
|
||||
color: 'red',
|
||||
}}/>}
|
||||
</Box>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ let getStatus = (initial) => {
|
|||
return "nothing";
|
||||
}
|
||||
}
|
||||
|
||||
return "NOT_AVAILABLE";
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -8,41 +8,34 @@ import {
|
|||
Alert,
|
||||
Button,
|
||||
Checkbox,
|
||||
Divider,
|
||||
FormControlLabel,
|
||||
Grid,
|
||||
IconButton,
|
||||
InputAdornment,
|
||||
InputLabel,
|
||||
Link,
|
||||
OutlinedInput,
|
||||
Stack,
|
||||
Typography,
|
||||
FormHelperText,
|
||||
Collapse,
|
||||
TextField,
|
||||
MenuItem,
|
||||
Skeleton,
|
||||
|
||||
} from '@mui/material';
|
||||
import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
|
||||
import AnimateButton from '../../../components/@extended/AnimateButton';
|
||||
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 CountrySelect, { countries } from '../../../components/countrySelect';
|
||||
import CountrySelect from '../../../components/countrySelect';
|
||||
import { DnsChallengeComp } from '../../../utils/dns-challenge-comp';
|
||||
import { values } from 'lodash';
|
||||
|
||||
import UploadButtons from '../../../components/fileUpload';
|
||||
import { TwitterPicker
|
||||
} 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 [config, setConfig] = React.useState(null);
|
||||
const [openModal, setOpenModal] = React.useState(false);
|
||||
const [openResartModal, setOpenRestartModal] = React.useState(false);
|
||||
const [uploadingBackground, setUploadingBackground] = React.useState(false);
|
||||
const [saveLabel, setSaveLabel] = React.useState("Save");
|
||||
|
||||
|
@ -58,11 +51,21 @@ const ConfigManagement = () => {
|
|||
|
||||
return <div style={{maxWidth: '1000px', margin: ''}}>
|
||||
<IsLoggedIn />
|
||||
|
||||
<Stack direction="row" spacing={2} style={{marginBottom: '15px'}}>
|
||||
<Button variant="contained" color="primary" startIcon={<SyncOutlined />} onClick={() => {
|
||||
refresh();
|
||||
}}>Refresh</Button><br /><br />
|
||||
}}>Refresh</Button>
|
||||
|
||||
<Button variant="outlined" color="primary" startIcon={<SyncOutlined />} onClick={() => {
|
||||
setOpenRestartModal(true);
|
||||
}}>Restart Server</Button>
|
||||
</Stack>
|
||||
|
||||
{config && <>
|
||||
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} />
|
||||
<RestartModal openModal={openResartModal} setOpenModal={setOpenRestartModal} />
|
||||
|
||||
<Formik
|
||||
initialValues={{
|
||||
MongoDB: config.MongoDB,
|
||||
|
@ -98,6 +101,7 @@ const ConfigManagement = () => {
|
|||
PrimaryColor: config && config.ThemeConfig && config.ThemeConfig.PrimaryColor,
|
||||
SecondaryColor: config && config.ThemeConfig && config.ThemeConfig.SecondaryColor,
|
||||
}}
|
||||
|
||||
validationSchema={Yup.object().shape({
|
||||
Hostname: Yup.string().max(255).required('Hostname is required'),
|
||||
MongoDB: Yup.string().max(512),
|
||||
|
|
|
@ -70,7 +70,7 @@ const RestartModal = ({openModal, setOpenModal, config}) => {
|
|||
<div style={{textAlign: 'center', padding: '20px'}}>
|
||||
<CircularProgress />
|
||||
</div>
|
||||
: 'A restart is required to apply changes. Do you want to restart?'}
|
||||
: 'Do you want to restart your server?'}
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
{!isRestarting && <DialogActions>
|
||||
|
|
|
@ -12,7 +12,6 @@ import RouteConfigPage from '../pages/config/routeConfigPage';
|
|||
import logo from '../assets/images/icons/cosmos.png';
|
||||
import HomePage from '../pages/home';
|
||||
import ContainerIndex from '../pages/servapps/containers';
|
||||
import NewDockerService from '../pages/servapps/containers/newService';
|
||||
import NewDockerServiceForm from '../pages/servapps/containers/newServiceForm';
|
||||
import OpenIdList from '../pages/openid/openid-list';
|
||||
import MarketPage from '../pages/market/listing';
|
||||
|
@ -21,16 +20,6 @@ import MarketPage from '../pages/market/listing';
|
|||
// render - 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 ||============================== //
|
||||
|
||||
const MainRoutes = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.9.0-unstable5",
|
||||
"version": "0.9.0-unstable6",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"time"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
|
||||
|
@ -49,7 +50,7 @@ func Init() {
|
|||
store.Clients[client.ID] = &fosite.DefaultClient{
|
||||
ID: client.ID,
|
||||
Secret: []byte(client.Secret),
|
||||
RedirectURIs: []string{client.Redirect},
|
||||
RedirectURIs: strings.Split(client.Redirect, ","),
|
||||
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"},
|
||||
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 {
|
||||
// remove subdomains, keep domain.extension
|
||||
bareMainHostname := strings.Split(mainHostname, ".")[len(strings.Split(mainHostname, "."))-2] + "." + strings.Split(mainHostname, ".")[len(strings.Split(mainHostname, "."))-1]
|
||||
|
||||
filteredHostnames := []string{
|
||||
mainHostname,
|
||||
"*." + mainHostname,
|
||||
bareMainHostname,
|
||||
"*." + bareMainHostname,
|
||||
}
|
||||
|
||||
for _, hostname := range uniqueHostnames {
|
||||
|
|
Loading…
Reference in a new issue