Compare commits
No commits in common. "58eb2cb472b7449df7256767dcf7d6331c3130e3" and "44cde5e63fbd8dd86b3d5ba49246358e3050a943" have entirely different histories.
58eb2cb472
...
44cde5e63f
12 changed files with 9 additions and 132 deletions
|
|
@ -79,16 +79,18 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.String(http.StatusOK, "Connection is OK")
|
c.String(http.StatusOK, "Connection is OK")
|
||||||
|
|
||||||
case "check-connection":
|
case "check-connection":
|
||||||
err = db.QueryRow("SELECT 1 AS result").Scan(&result)
|
err = db.QueryRow("SELECT 1 AS result").Scan(&result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadGateway, err)
|
// c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
// c.String(http.StatusBadRequest, err.Error())
|
||||||
|
// c.String(http.StatusBadGateway, "false")
|
||||||
c.JSON(http.StatusBadGateway, gin.H{"result": false})
|
c.JSON(http.StatusBadGateway, gin.H{"result": false})
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{"result": true})
|
c.JSON(http.StatusOK, gin.H{"result": true})
|
||||||
|
|
||||||
|
|
@ -103,14 +105,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2)
|
err = results.Scan(&result, &result2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -127,14 +127,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result)
|
err = results.Scan(&result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
}
|
}
|
||||||
|
|
@ -152,14 +150,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2)
|
err = results.Scan(&result, &result2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -176,14 +172,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result)
|
err = results.Scan(&result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
}
|
}
|
||||||
|
|
@ -213,7 +207,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -224,7 +217,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -235,7 +227,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -246,7 +237,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -257,7 +247,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -270,7 +259,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -288,7 +276,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -304,7 +291,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -324,14 +310,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2)
|
err = results.Scan(&result, &result2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -352,14 +336,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2)
|
err = results.Scan(&result, &result2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -380,14 +362,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2)
|
err = results.Scan(&result, &result2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -409,14 +389,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2, &result3, &result4)
|
err = results.Scan(&result, &result2, &result3, &result4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -446,7 +424,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -457,7 +434,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -468,7 +444,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -479,7 +454,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -490,7 +464,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -501,7 +474,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
@ -515,7 +487,6 @@ func connect() {
|
||||||
} else {
|
} else {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -531,7 +502,6 @@ func connect() {
|
||||||
} else {
|
} else {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -547,7 +517,6 @@ func connect() {
|
||||||
} else {
|
} else {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
|
@ -574,14 +543,12 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for results.Next() {
|
for results.Next() {
|
||||||
err = results.Scan(&result, &result2, &result3, &result4, &result5, &result6, &result7, &result8, &result9, &result10, &result11, &result12)
|
err = results.Scan(&result, &result2, &result3, &result4, &result5, &result6, &result7, &result8, &result9, &result10, &result11, &result12)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
array = append(array, result)
|
array = append(array, result)
|
||||||
array2 = append(array2, result2)
|
array2 = append(array2, result2)
|
||||||
|
|
@ -617,7 +584,6 @@ func connect() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithError(http.StatusBadRequest, err)
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
c.String(http.StatusBadRequest, err.Error())
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"result": result,
|
"result": result,
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 KiB |
|
|
@ -1,14 +0,0 @@
|
||||||
interface Props {
|
|
||||||
year: string
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (props: Props) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<span>
|
|
||||||
Copyright © {props.year} {props.name} All Rights Reserved.
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
.footer
|
.footer
|
||||||
padding: 1rem 0
|
padding: 1rem 0
|
||||||
// margin: 0 2rem 0 0
|
margin: 0 2rem
|
||||||
position: fixed
|
position: fixed
|
||||||
bottom: 0
|
bottom: 0
|
||||||
width: 95vw
|
width: 100%
|
||||||
opacity: 0.8
|
opacity: 0.8
|
||||||
font-size: 1rem
|
font-size: 1rem
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ export { default as File } from './File/File'
|
||||||
export { default as QR } from './QR/QR'
|
export { default as QR } from './QR/QR'
|
||||||
export { default as Input } from './Input/Input'
|
export { default as Input } from './Input/Input'
|
||||||
export { default as Radio } from './Radio/Radio'
|
export { default as Radio } from './Radio/Radio'
|
||||||
export { default as Copyright } from './Copyright/Copyright'
|
|
||||||
// export { default as OptimizeBackground } from './Optimizers/OptimizeBackground'
|
// export { default as OptimizeBackground } from './Optimizers/OptimizeBackground'
|
||||||
// export { default as OptimizeImage } from './Optimizers/OptimizeImage'
|
// export { default as OptimizeImage } from './Optimizers/OptimizeImage'
|
||||||
// export { default as OptimizeLogo } from './Optimizers/OptimizeLogo'
|
// export { default as OptimizeLogo } from './Optimizers/OptimizeLogo'
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
import './Index.sass'
|
import './Index.sass'
|
||||||
import { Button, Page, Padding, Display, Row, Logo, Footer, Image, Copyright } from '../../components'
|
import { Button, Page, Padding, Display, Row, Logo } from '../../components'
|
||||||
import { onMount } from 'solid-js'
|
import { onMount } from 'solid-js'
|
||||||
import { ofetch } from 'ofetch'
|
import { ofetch } from 'ofetch'
|
||||||
import ocboAvif from '../../assets/images/optimized/ocbologo.avif'
|
|
||||||
import ocboWebp from '../../assets/images/optimized/ocbologo.webp'
|
|
||||||
import patAvif from '../../assets/images/optimized/pat-alcala.avif'
|
|
||||||
import patWebp from '../../assets/images/optimized/pat-alcala.webp'
|
|
||||||
|
|
||||||
const API = import.meta.env.VITE_BACKEND
|
const API = import.meta.env.VITE_BACKEND
|
||||||
let assessorsNameList: string[]
|
let assessorsNameList: string[]
|
||||||
|
|
@ -63,24 +59,6 @@ export default () => {
|
||||||
</Row>
|
</Row>
|
||||||
</Display>
|
</Display>
|
||||||
</Padding>
|
</Padding>
|
||||||
|
|
||||||
<Footer>
|
|
||||||
<Row content="split">
|
|
||||||
<Row gap={0.5}>
|
|
||||||
<Image avif={ocboAvif} webp={ocboWebp} size={30}></Image>
|
|
||||||
<Row gap={0.25}>
|
|
||||||
<Copyright year="2025" name="Office of the City Building Official" />
|
|
||||||
<span>Davao City, Philippines</span>
|
|
||||||
</Row>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row gap={0.25}>
|
|
||||||
<span>Developed by:</span>
|
|
||||||
<Image avif={patAvif} webp={patWebp} size={90}></Image>
|
|
||||||
<span>Pat Alcala</span>
|
|
||||||
</Row>
|
|
||||||
</Row>
|
|
||||||
</Footer>
|
|
||||||
</Page>
|
</Page>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { createSignal, Show, createEffect } from 'solid-js'
|
||||||
import { ofetch } from 'ofetch'
|
import { ofetch } from 'ofetch'
|
||||||
import { SHA1, SHA3 } from 'crypto-js'
|
import { SHA1, SHA3 } from 'crypto-js'
|
||||||
import { useNavigate } from '@solidjs/router'
|
import { useNavigate } from '@solidjs/router'
|
||||||
import { checkConnection } from '../../utils/functions'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const API = import.meta.env.VITE_BACKEND
|
const API = import.meta.env.VITE_BACKEND
|
||||||
|
|
@ -19,15 +18,8 @@ export default () => {
|
||||||
const [password, setPassword] = createSignal('')
|
const [password, setPassword] = createSignal('')
|
||||||
const [loggedin, setLoggedin] = createSignal(0)
|
const [loggedin, setLoggedin] = createSignal(0)
|
||||||
const [errorMessage, setErrorMessage] = createSignal('')
|
const [errorMessage, setErrorMessage] = createSignal('')
|
||||||
const [connected, setConnected] = createSignal(true)
|
|
||||||
|
|
||||||
const login = async () => {
|
const login = async () => {
|
||||||
setConnected(await checkConnection())
|
|
||||||
if (connected() === false) {
|
|
||||||
setErrorMessage('No Connection on Server')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const employeeid = await ofetch(API + 'get-employeeid/' + name(), { parseResponse: JSON.parse })
|
const employeeid = await ofetch(API + 'get-employeeid/' + name(), { parseResponse: JSON.parse })
|
||||||
const dbpassword = await ofetch(API + 'get-password/' + employeeid.result, { parseResponse: JSON.parse })
|
const dbpassword = await ofetch(API + 'get-password/' + employeeid.result, { parseResponse: JSON.parse })
|
||||||
const hashPassword = await securePassword()
|
const hashPassword = await securePassword()
|
||||||
|
|
@ -174,28 +166,6 @@ export default () => {
|
||||||
</Padding>
|
</Padding>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div onClick={() => setConnected(true)}>
|
|
||||||
<Modal trigger={connected() === false} background="#562020ff" color="#ffebebe6" opacity={0.8}>
|
|
||||||
<Padding top={1} bottom={1} left={4} right={4}>
|
|
||||||
<Column>
|
|
||||||
<Row>
|
|
||||||
<Box curved thickness={3} color="#ffebebe6" padding="1rem">
|
|
||||||
<h2>Connection Error</h2>
|
|
||||||
</Box>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row>
|
|
||||||
<h3>{errorMessage()}</h3>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row>
|
|
||||||
<span class="close-text">Click anywhere to close</span>
|
|
||||||
</Row>
|
|
||||||
</Column>
|
|
||||||
</Padding>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { Tabs } from '@kobalte/core/tabs'
|
||||||
import { ofetch } from 'ofetch'
|
import { ofetch } from 'ofetch'
|
||||||
import { onMount, createSignal } from 'solid-js'
|
import { onMount, createSignal } from 'solid-js'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { checkConnection } from '../../utils/functions'
|
|
||||||
|
|
||||||
const API = import.meta.env.VITE_BACKEND
|
const API = import.meta.env.VITE_BACKEND
|
||||||
const PESO = import.meta.env.VITE_PESO
|
const PESO = import.meta.env.VITE_PESO
|
||||||
|
|
@ -31,9 +30,6 @@ export default () => {
|
||||||
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
||||||
const [nameList, setNameList] = createSignal<string[]>([])
|
const [nameList, setNameList] = createSignal<string[]>([])
|
||||||
|
|
||||||
const [errorMessage, setErrorMessage] = createSignal('')
|
|
||||||
const [connected, setConnected] = createSignal(true)
|
|
||||||
|
|
||||||
const getListForApproval = async () => {
|
const getListForApproval = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await ofetch(API + 'get-listopapproval-electrical', { parseResponse: JSON.parse })
|
const response = await ofetch(API + 'get-listopapproval-electrical', { parseResponse: JSON.parse })
|
||||||
|
|
@ -45,12 +41,6 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const load = async () => {
|
const load = async () => {
|
||||||
setConnected(await checkConnection())
|
|
||||||
if (connected() === false) {
|
|
||||||
setErrorMessage('Could not gather list of applicaitons')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await getListForApproval()
|
await getListForApproval()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,9 +86,11 @@ export default () => {
|
||||||
|
|
||||||
signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED')
|
signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED')
|
||||||
if (signed) {
|
if (signed) {
|
||||||
|
console.log('Signed')
|
||||||
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
||||||
}
|
}
|
||||||
if (forprinting) {
|
if (forprinting) {
|
||||||
|
console.log('For Printing')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
import { ofetch } from 'ofetch'
|
|
||||||
|
|
||||||
const API = import.meta.env.VITE_BACKEND
|
|
||||||
|
|
||||||
export default async () => {
|
|
||||||
try {
|
|
||||||
const check = await ofetch(API + 'check-connection')
|
|
||||||
const result = check.result
|
|
||||||
return result
|
|
||||||
} catch {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { default as checkConnection } from './checkConnection'
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue