Added doc scrolling

This commit is contained in:
frikky
2020-05-22 12:56:36 +02:00
parent aef77d278a
commit 668557b52b
8 changed files with 127 additions and 13 deletions
+1 -1
View File
@@ -1980,7 +1980,7 @@ func handleLogin(resp http.ResponseWriter, request *http.Request) {
})
loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, Userdata.Session, expiration.Unix())
log.Printf("SESSION LENGTH MORE THAN 0 IN LOGIN: %s", Userdata.Session)
//log.Printf("SESSION LENGTH MORE THAN 0 IN LOGIN: %s", Userdata.Session)
err = SetSession(ctx, *Userdata, Userdata.Session)
if err != nil {
+2
View File
@@ -17,6 +17,8 @@ services:
image: frikky/shuffle:database
container_name: shuffle-database
hostname: shuffle-database
ports:
- "8000:8000"
networks:
- shuffle
restart: unless-stopped
+107 -2
View File
@@ -41,6 +41,7 @@ const Apps = (props) => {
const [openApi, setOpenApi] = React.useState("")
const [openApiData, setOpenApiData] = React.useState("")
const [appValidation, setAppValidation] = React.useState("")
const [loadAppsModalOpen, setLoadAppsModalOpen] = React.useState(false);
const [openApiModal, setOpenApiModal] = React.useState(false);
const [openApiModalType, setOpenApiModalType] = React.useState("");
const [openApiError, setOpenApiError] = React.useState("")
@@ -400,16 +401,27 @@ const Apps = (props) => {
</div>
{isLoading ? <CircularProgress style={{marginTop: 13, marginRight: 15}} /> : null}
<Button
variant="contained"
variant="outlined"
component="label"
color="primary"
style={{maxHeight: 50, marginTop: 10}}
style={{margin: 5, maxHeight: 50, marginTop: 10}}
onClick={() => {
getExistingApps()
}}
>
Load existing apps
</Button>
<Button
variant="outlined"
component="label"
color="primary"
style={{margin: 5, maxHeight: 50, marginTop: 10}}
onClick={() => {
setLoadAppsModalOpen(true)
}}
>
Upload from github
</Button>
</div>
<TextField
style={{backgroundColor: inputColor}}
@@ -621,6 +633,98 @@ const Apps = (props) => {
window.location.href = "/apps/new?id="+appValidation
}
const handleGithubValidation = () => {
console.log("VALIDATE")
setValidation(true)
//const circularLoader = validation ? <CircularProgress color="primary" /> : null
}
const appsModalLoad = loadAppsModalOpen ?
<Dialog modal
open={loadAppsModalOpen}
onClose={() => {
setOpenApi("")
setLoadAppsModalOpen(false)
}}
PaperProps={{
style: {
backgroundColor: surfaceColor,
color: "white",
minWidth: "800px",
minHeight: "320px",
},
}}
>
<DialogTitle>
<div style={{color: "rgba(255,255,255,0.9)"}}>
Load from github repo
</div>
</DialogTitle>
<DialogContent style={{color: "rgba(255,255,255,0.65)"}}>
Github repository
<TextField
style={{backgroundColor: inputColor}}
variant="outlined"
margin="normal"
InputProps={{
style:{
color: "white",
height: "50px",
fontSize: "1em",
},
}}
onChange={e => setOpenApi(e.target.value)}
placeholder="https://github.com/frikky/shuffle-apps"
fullWidth
/>
<div style={{display: "flex"}}>
<TextField
style={{flex: 1, backgroundColor: inputColor}}
variant="outlined"
margin="normal"
InputProps={{
style:{
color: "white",
height: "50px",
fontSize: "1em",
},
}}
onChange={e => setOpenApi(e.target.value)}
placeholder="https://github.com/frikky/shuffle-apps"
fullWidth
/>
<TextField
style={{flex: 1, backgroundColor: inputColor}}
variant="outlined"
margin="normal"
InputProps={{
style:{
color: "white",
height: "50px",
fontSize: "1em",
},
}}
onChange={e => setOpenApi(e.target.value)}
placeholder="https://github.com/frikky/shuffle-apps"
fullWidth
/>
</div>
</DialogContent>
<DialogActions>
{circularLoader}
<Button style={{borderRadius: "0px"}} onClick={() => setLoadAppsModalOpen(false)} color="primary">
Cancel
</Button>
<Button style={{borderRadius: "0px"}} disabled={openApi.length === 0 || !openApi.includes("http")} onClick={() => {
}} color="primary">
Submit
</Button>
</DialogActions>
</Dialog>
: null
const errorText = openApiError.length > 0 ? <div>Error: {openApiError}</div> : null
const circularLoader = validation ? <CircularProgress color="primary" /> : null
const modalView = openApiModal ?
@@ -708,6 +812,7 @@ const Apps = (props) => {
<div>
{appView}
{modalView}
{appsModalLoad}
</div>
:
<div>
+4 -1
View File
@@ -64,7 +64,7 @@ const Docs = (props) => {
if (parent !== null) {
var elements = parent.getElementsByTagName('h2')
const name = window.location.hash.slice(1, window.location.hash.lenth).toLowerCase().split("%20").join(" ")
const name = window.location.hash.slice(1, window.location.hash.lenth).toLowerCase().split("%20").join(" ").split("_").join(" ")
console.log(name)
var found = false
@@ -167,6 +167,9 @@ const Docs = (props) => {
}
function OuterLink(props) {
if (props.href.includes("http") || props.href.includes("mailto")) {
return <a href={props.href} style={{color: "#f85a3e", textDecoration: "none"}}>{props.children}</a>
}
return <Link to={props.href} style={{color: "#f85a3e", textDecoration: "none"}}>{props.children}</Link>
}
+5 -2
View File
@@ -28,7 +28,7 @@ import (
var baseUrl = os.Getenv("BASE_URL")
var baseimagename = "frikky/shuffle"
//var dockerApiVersion = os.Getenv("DOCKER_API_VERSION")
var dockerApiVersion = os.Getenv("DOCKER_API_VERSION")
var environment = os.Getenv("ENVIRONMENT_NAME")
var orgId = os.Getenv("ORG_ID")
@@ -310,7 +310,10 @@ func main() {
fmt.Sprintf("ENVIRONMENT_NAME=%s", environment),
fmt.Sprintf("BASE_URL=%s", baseUrl),
}
//fmt.Sprintf("DOCKER_API_VERSION=%s", dockerApiVersion),
if dockerApiVersion != "" {
env = append(env, fmt.Sprintf("DOCKER_API_VERSION=%s", dockerApiVersion))
}
err = deployWorker(dockercli, workerImage, containerName, env)
if err != nil {
+1
View File
@@ -2,6 +2,7 @@ docker run \
--env ORG_ID=$ORG_ID \
--env ENVIRONMENT_NAME="Shuffle" \
--env BASE_URL=http://shuffle-backend:5001 \
--env DOCKER_API_VERSION=1.42 \
--network "shuffle_shuffle" \
-v /var/run/docker.sock:/var/run/docker.sock \
frikky/shuffle:orborus