Fixed admin issues with cloud
This commit is contained in:
@@ -423,7 +423,6 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Use lowercase when checking
|
// Use lowercase when checking
|
||||||
log.Println(data)
|
|
||||||
/*
|
/*
|
||||||
if strings.Contains(functionname, "filter") {
|
if strings.Contains(functionname, "filter") {
|
||||||
//log.Printf("FUNCTION: %s", data)
|
//log.Printf("FUNCTION: %s", data)
|
||||||
|
|||||||
@@ -151,9 +151,10 @@ const Header = props => {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</span>
|
</span>
|
||||||
const logoCheck = !homePage ? null : null
|
|
||||||
|
|
||||||
// Handle top bar or something
|
// Handle top bar or something
|
||||||
|
const logoCheck = !homePage ? null : null
|
||||||
const loginTextBrowser = !isLoggedIn ?
|
const loginTextBrowser = !isLoggedIn ?
|
||||||
<div style={{display: "flex"}}>
|
<div style={{display: "flex"}}>
|
||||||
<List style={{display: "flex", flexDirect: "row"}} component="nav">
|
<List style={{display: "flex", flexDirect: "row"}} component="nav">
|
||||||
|
|||||||
@@ -430,11 +430,13 @@ const Admin = (props) => {
|
|||||||
|
|
||||||
const submitUser = (data) => {
|
const submitUser = (data) => {
|
||||||
console.log("INPUT: ", data)
|
console.log("INPUT: ", data)
|
||||||
|
setLoginInfo("")
|
||||||
|
|
||||||
// Just use this one?
|
// Just use this one?
|
||||||
var data = { "username": data.Username, "password": data.Password }
|
var data = { "username": data.Username, "password": data.Password }
|
||||||
var baseurl = globalUrl
|
var baseurl = globalUrl
|
||||||
const url = baseurl + '/api/v1/users/register';
|
const url = baseurl + '/api/v1/users/register';
|
||||||
|
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
@@ -446,7 +448,7 @@ const Admin = (props) => {
|
|||||||
.then(response =>
|
.then(response =>
|
||||||
response.json().then(responseJson => {
|
response.json().then(responseJson => {
|
||||||
if (responseJson["success"] === false) {
|
if (responseJson["success"] === false) {
|
||||||
setLoginInfo("Error in input: " + responseJson.reason)
|
setLoginInfo("Error: " + responseJson.reason)
|
||||||
} else {
|
} else {
|
||||||
setLoginInfo("")
|
setLoginInfo("")
|
||||||
setModalOpen(false)
|
setModalOpen(false)
|
||||||
@@ -912,11 +914,11 @@ const Admin = (props) => {
|
|||||||
} else if (newValue === 2) {
|
} else if (newValue === 2) {
|
||||||
getAppAuthentication()
|
getAppAuthentication()
|
||||||
} else if (newValue === 3) {
|
} else if (newValue === 3) {
|
||||||
getEnvironments()
|
getFiles()
|
||||||
} else if (newValue === 4) {
|
} else if (newValue === 4) {
|
||||||
getSchedules()
|
getSchedules()
|
||||||
} else if (newValue === 5) {
|
} else if (newValue === 5) {
|
||||||
getFiles()
|
getEnvironments()
|
||||||
} else if (newValue === 6) {
|
} else if (newValue === 6) {
|
||||||
getOrgs()
|
getOrgs()
|
||||||
}
|
}
|
||||||
@@ -1157,11 +1159,11 @@ const Admin = (props) => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DialogTitle><span style={{ color: "white" }}><EditIcon /></span></DialogTitle>
|
<DialogTitle><span style={{ color: "white" }}><EditIcon /> Edit user</span></DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<div style={{ display: "flex" }}>
|
<div style={{ display: "flex" }}>
|
||||||
<TextField
|
<TextField
|
||||||
style={{ marginTop: 0, backgroundColor: theme.palette.inputColor, flex: 3 }}
|
style={{ marginTop: 0, backgroundColor: theme.palette.inputColor, flex: 3 , marginRight: 10,}}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
style: {
|
style: {
|
||||||
height: 50,
|
height: 50,
|
||||||
@@ -1720,7 +1722,6 @@ const Admin = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div />
|
<div />
|
||||||
<Button
|
<Button
|
||||||
disabled={isCloud}
|
|
||||||
style={{}}
|
style={{}}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -1728,6 +1729,14 @@ const Admin = (props) => {
|
|||||||
>
|
>
|
||||||
Add user
|
Add user
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
style={{marginLeft: 5, marginRight: 15, }}
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => getUsers()}
|
||||||
|
>
|
||||||
|
<CachedIcon />
|
||||||
|
</Button>
|
||||||
<Divider style={{ marginTop: 20, marginBottom: 20, backgroundColor: theme.palette.inputColor }} />
|
<Divider style={{ marginTop: 20, marginBottom: 20, backgroundColor: theme.palette.inputColor }} />
|
||||||
<List>
|
<List>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
@@ -1738,7 +1747,7 @@ const Admin = (props) => {
|
|||||||
|
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="API key"
|
primary="API key"
|
||||||
style={{ minWidth: 350, maxWidth: 350, overflow: "hidden" }}
|
style={{ minWidth: 360, maxWidth: 360, overflow: "hidden" }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ListItemText
|
<ListItemText
|
||||||
@@ -1769,7 +1778,7 @@ const Admin = (props) => {
|
|||||||
|
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={data.apikey === undefined || data.apikey.length === 0 ? "" : data.apikey}
|
primary={data.apikey === undefined || data.apikey.length === 0 ? "" : data.apikey}
|
||||||
style={{ maxWidth: 350, minWidth: 350, }}
|
style={{ maxWidth: 360, minWidth: 360, }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ListItemText
|
<ListItemText
|
||||||
@@ -1784,7 +1793,12 @@ const Admin = (props) => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
console.log("VALUE: ", e.target.value)
|
console.log("VALUE: ", e.target.value)
|
||||||
|
|
||||||
|
if (isCloud) {
|
||||||
|
setUser(data.username, "role", e.target.value)
|
||||||
|
} else {
|
||||||
setUser(data.id, "role", e.target.value)
|
setUser(data.id, "role", e.target.value)
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
style={{ backgroundColor: theme.palette.surfaceColor, color: "white", height: "50px" }}
|
style={{ backgroundColor: theme.palette.surfaceColor, color: "white", height: "50px" }}
|
||||||
>
|
>
|
||||||
@@ -1795,31 +1809,27 @@ const Admin = (props) => {
|
|||||||
User
|
User
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Select>}
|
</Select>}
|
||||||
style = {{ minWidth: 150, maxWidth: 150}}
|
style ={{ minWidth: 135, maxWidth: 135, marginRight: 15,}}
|
||||||
/>
|
/>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={data.active ? "True" : "False"}
|
primary={data.active ? "True" : "False"}
|
||||||
style={{ minWidth: 180, maxWidth: 180 }}
|
style={{ minWidth: 180, maxWidth: 180 }}
|
||||||
/>
|
/>
|
||||||
<ListItemText style={{ display: "flex" }}>
|
<ListItemText style={{ display: "flex" }}>
|
||||||
<Button
|
<IconButton
|
||||||
style={{}}
|
|
||||||
variant="outlined"
|
|
||||||
color="primary"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSelectedUserModalOpen(true)
|
setSelectedUserModalOpen(true)
|
||||||
setSelectedUser(data)
|
setSelectedUser(data)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Edit user
|
<EditIcon color="primary"/>
|
||||||
</Button>
|
</IconButton>
|
||||||
<Button
|
<Button
|
||||||
style={{}}
|
onClick={() => generateApikey(data.id)}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => generateApikey(data.id)}
|
|
||||||
>
|
>
|
||||||
Get new API key
|
New apikey
|
||||||
</Button>
|
</Button>
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
@@ -1867,7 +1877,7 @@ const Admin = (props) => {
|
|||||||
uploadFiles(files)
|
uploadFiles(files)
|
||||||
}
|
}
|
||||||
|
|
||||||
const filesView = curTab === 5 ?
|
const filesView = curTab === 3 ?
|
||||||
<Dropzone style={{maxWidth: window.innerWidth > 1366 ? 1366 : 1200, margin: "auto", padding: 20 }} onDrop={uploadFile}>
|
<Dropzone style={{maxWidth: window.innerWidth > 1366 ? 1366 : 1200, margin: "auto", padding: 20 }} onDrop={uploadFile}>
|
||||||
<div>
|
<div>
|
||||||
<div style={{marginTop: 20, marginBottom: 20,}}>
|
<div style={{marginTop: 20, marginBottom: 20,}}>
|
||||||
@@ -2311,7 +2321,7 @@ const Admin = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const environmentView = curTab === 3 ?
|
const environmentView = curTab === 5 ?
|
||||||
<div>
|
<div>
|
||||||
<div style={{marginTop: 20, marginBottom: 20,}}>
|
<div style={{marginTop: 20, marginBottom: 20,}}>
|
||||||
<h2 style={{display: "inline",}}>Environments</h2>
|
<h2 style={{display: "inline",}}>Environments</h2>
|
||||||
@@ -2555,10 +2565,10 @@ const Admin = (props) => {
|
|||||||
>
|
>
|
||||||
<Tab label=<span><BusinessIcon style={iconStyle} /> Organization</span>/>
|
<Tab label=<span><BusinessIcon style={iconStyle} /> Organization</span>/>
|
||||||
<Tab label=<span><AccessibilityNewIcon style={iconStyle} />Users</span> />
|
<Tab label=<span><AccessibilityNewIcon style={iconStyle} />Users</span> />
|
||||||
{isCloud ? null : <Tab label=<span><LockIcon style={iconStyle} />App Authentication</span>/>}
|
<Tab label=<span><LockIcon style={iconStyle} />App Authentication</span>/>
|
||||||
|
<Tab label=<span><DescriptionIcon style={iconStyle} />Files</span> />
|
||||||
|
<Tab label=<span><ScheduleIcon style={iconStyle} />Schedules</span> />
|
||||||
{isCloud ? null : <Tab label=<span><EcoIcon style={iconStyle} />Environments</span>/>}
|
{isCloud ? null : <Tab label=<span><EcoIcon style={iconStyle} />Environments</span>/>}
|
||||||
{isCloud ? null : <Tab label=<span><ScheduleIcon style={iconStyle} />Schedules</span> />}
|
|
||||||
{isCloud ? null : <Tab label=<span><DescriptionIcon style={iconStyle} />Files</span> />}
|
|
||||||
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><CloudIcon style={iconStyle} /> Hybrid</span>/> : null}
|
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><CloudIcon style={iconStyle} /> Hybrid</span>/> : null}
|
||||||
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><BusinessIcon style={iconStyle} /> Organizations</span>/> : null}
|
{window.location.protocol == "http:" && window.location.port === "3000" ? <Tab label=<span><BusinessIcon style={iconStyle} /> Organizations</span>/> : null}
|
||||||
{window.location.protocol === "http:" && window.location.port === "3000" ? <Tab label=<span><LockIcon style={iconStyle} />Categories</span>/> : null}
|
{window.location.protocol === "http:" && window.location.port === "3000" ? <Tab label=<span><LockIcon style={iconStyle} />Categories</span>/> : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user