-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor(back) Single backend for kube and docker (#336)
* refactor(back) merge both backends * fix(back) minor fixes * fix(back) adjust flows
- Loading branch information
1 parent
ae6733c
commit 4f2bc98
Showing
103 changed files
with
1,327 additions
and
1,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+17.5 MB
BACK/kube-backend/kube-admin/kube-admin → BACK/app/app
100644 → 100755
Binary file not shown.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package docker | ||
|
||
import ( | ||
"back-admin/models" | ||
"net/http" | ||
"os" | ||
"text/template" | ||
|
||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
var tmplt *template.Template | ||
var apptmplt *template.Template | ||
var servertmplt *template.Template | ||
var netboxtmplt *template.Template | ||
var opendcimtmplt *template.Template | ||
var DEPLOY_DIR string | ||
var DOCKER_DIR string | ||
|
||
func init() { | ||
DEPLOY_DIR = os.Getenv("DEPLOY_DIR") | ||
if DEPLOY_DIR == "" { | ||
DEPLOY_DIR = "../../deploy/" | ||
} | ||
DOCKER_DIR = DEPLOY_DIR + "docker/" | ||
// hashedPassword, _ := bcrypt.GenerateFromPassword( | ||
// []byte("password"), bcrypt.DefaultCost) | ||
// println(string(hashedPassword)) | ||
tmpltPrefixPath := "handlers/docker/" | ||
tmplt = template.Must(template.ParseFiles(tmpltPrefixPath + "backend-assets/docker-env-template.txt")) | ||
apptmplt = template.Must(template.ParseFiles(tmpltPrefixPath + "flutter-assets/flutter-env-template.txt")) | ||
servertmplt = template.Must(template.ParseFiles(tmpltPrefixPath + "backend-assets/template.service")) | ||
netboxtmplt = template.Must(template.ParseFiles(tmpltPrefixPath + "tools-assets/netbox-docker-template.txt")) | ||
opendcimtmplt = template.Must(template.ParseFiles(tmpltPrefixPath + "tools-assets/opendcim-env-template.txt")) | ||
} | ||
|
||
func GetAllApps(c *gin.Context) { | ||
response := make(map[string]interface{}) | ||
response["tenants"] = getTenantsFromJSON() | ||
response["tools"] = []models.ContainerInfo{} | ||
if netbox, err := getDockerInfo("netbox"); err != nil { | ||
println(err.Error()) | ||
} else { | ||
response["tools"] = netbox | ||
} | ||
if opendcim, err := getDockerInfo("opendcim"); err != nil { | ||
println(err.Error()) | ||
} else { | ||
response["tools"] = append(response["tools"].([]models.ContainerInfo), opendcim...) | ||
} | ||
c.IndentedJSON(http.StatusOK, response) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Oops, something went wrong.