當前位置: 首頁>>代碼示例>>Golang>>正文


Golang guimessagedisplay.GetGUIMessage函數代碼示例

本文整理匯總了Golang中github.com/cloudawan/cloudone_gui/controllers/utility/guimessagedisplay.GetGUIMessage函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetGUIMessage函數的具體用法?Golang GetGUIMessage怎麽用?Golang GetGUIMessage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetGUIMessage函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Post

func (c *EditController) Post() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	name := c.GetString("name")

	namespace := Namespace{name, false, false, "", "", "", ""}

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort + "/api/v1/namespaces"

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestPostWithStructure(url, namespace, nil, tokenHeaderMap)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Namespace " + name + " is edited")
	}

	c.Ctx.Redirect(302, "/gui/system/namespace/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:32,代碼來源:edit.go

示例2: Get

func (c *DeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	imageInformation := c.GetString("imageInformation")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/deploybluegreens/" + imageInformation

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Deploy blue green deployment " + imageInformation + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/deploy/deploybluegreen/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:32,代碼來源:delete.go

示例3: Post

func (c *ResizeController) Post() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	namespace, _ := c.GetSession("namespace").(string)

	name := c.GetString("name")
	size, _ := c.GetInt("size")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/deploys/resize/" + namespace + "/" + name + "?size=" + strconv.Itoa(size)

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestPut(url, make(map[string]interface{}), tokenHeaderMap, false)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Application " + name + " is resized")
	}

	c.Ctx.Redirect(302, "/gui/deploy/deploy/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:34,代碼來源:resize.go

示例4: Get

func (c *DeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	ip := c.GetString("ip")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/hosts/credentials/" + ip

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Credential " + ip + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/system/host/credential/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:32,代碼來源:delete.go

示例5: Get

func (c *MainController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	c.Ctx.Redirect(302, "/gui/login")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:7,代碼來源:index.go

示例6: Get

func (c *PodDeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	namespace := c.GetString("namespace")
	pod := c.GetString("pod")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/pods/" + namespace + "/" + pod

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Pod " + pod + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/inventory/replicationcontroller/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:33,代碼來源:pod_delete.go

示例7: Get

func (c *TerminalController) Get() {
	c.TplName = "inventory/replicationcontroller/docker_terminal.html"
	guimessage := guimessagedisplay.GetGUIMessage(c)

	// Authorization for web page display
	c.Data["layoutMenu"] = c.GetSession("layoutMenu")

	cloudoneGUIHost, cloudoneGUIPort := dashboard.GetServerHostAndPortFromUserRequest(c.Ctx.Input)

	hostIP := c.GetString("hostIP")
	containerID := c.GetString("containerID")

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)
	token, _ := tokenHeaderMap["token"]

	c.Data["cloudoneGUIHost"] = cloudoneGUIHost
	c.Data["cloudoneGUIPort"] = cloudoneGUIPort

	c.Data["hostIP"] = hostIP
	c.Data["containerID"] = containerID

	c.Data["token"] = token

	guimessage.OutputMessage(c.Data)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:25,代碼來源:docker_terminal.go

示例8: Get

func (c *DeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	name := c.GetString("name")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/notifiers/emailserversmtp/" + name

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Email server configuration " + name + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/system/notification/emailserver/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:32,代碼來源:delete.go

示例9: Post

func (c *UpgradeController) Post() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	imageInformationName := c.GetString("name")
	description := c.GetString("description")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/imageinformations/upgrade"

	deployUpgradeInput := DeployUpgradeInput{imageInformationName, description}

	resultJsonMap := make(map[string]interface{})

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestPutWithStructure(url, deployUpgradeInput, &resultJsonMap, tokenHeaderMap)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess(imageInformationName + " is launched")
	}

	c.Ctx.Redirect(302, "/gui/repository/imageinformation/log?imageInformation="+imageInformationName)

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:35,代碼來源:upgrade.go

示例10: Get

func (c *EditController) Get() {
	c.TplName = "system/host/credential/edit.html"
	guimessage := guimessagedisplay.GetGUIMessage(c)

	// Authorization for web page display
	c.Data["layoutMenu"] = c.GetSession("layoutMenu")

	ip := c.GetString("ip")

	if ip == "" {
		c.Data["actionButtonValue"] = "Create"
		c.Data["pageHeader"] = "Create Host Credential"
		c.Data["createOrUpdate"] = "create"
		c.Data["fieldDisabledChecked"] = ""

		c.Data["sshPort"] = 22
	} else {
		cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
		cloudoneHost := beego.AppConfig.String("cloudoneHost")
		cloudonePort := beego.AppConfig.String("cloudonePort")

		url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
			"/api/v1/hosts/credentials/" + ip

		credential := Credential{}

		tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

		_, err := restclient.RequestGetWithStructure(url, &credential, tokenHeaderMap)

		if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
			return
		}

		if err != nil {
			// Error
			guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
			guimessage.OutputMessage(c.Data)
			return
		}

		c.Data["actionButtonValue"] = "Update"
		c.Data["pageHeader"] = "Update Host Credential"
		c.Data["createOrUpdate"] = "update"

		c.Data["ip"] = credential.IP
		c.Data["sshPort"] = credential.SSH.Port
		c.Data["sshUser"] = credential.SSH.User
		c.Data["sshPassword"] = credential.SSH.Password
		if credential.Disabled {
			c.Data["fieldDisabledChecked"] = "checked"
		} else {
			c.Data["fieldDisabledChecked"] = ""
		}

		c.Data["ipFieldReadOnly"] = "readonly"
	}

	guimessage.OutputMessage(c.Data)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:60,代碼來源:edit.go

示例11: Get

func (c *ResetController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	clusterName := c.GetString("clusterName")
	glusterfsVolume := c.GetString("glusterfsVolume")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/glusterfs/clusters/" + clusterName + "/volumes/" + glusterfsVolume

	jsonMap := make(map[string]interface{})

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestPut(url, jsonMap, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Glusterfs volume " + glusterfsVolume + " is reset")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/filesystem/glusterfs/volume/list?clusterName="+clusterName)

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:35,代碼來源:reset.go

示例12: Get

func (c *LogController) Get() {
	c.TplName = "repository/imageinformation/log.html"
	guimessage := guimessagedisplay.GetGUIMessage(c)

	// Authorization for web page display
	c.Data["layoutMenu"] = c.GetSession("layoutMenu")

	cloudoneGUIHost, cloudoneGUIPort := dashboard.GetServerHostAndPortFromUserRequest(c.Ctx.Input)

	imageInformation := c.GetString("imageInformation")

	if _, err := os.Stat(GetProcessingOutMessageFilePathAndName(imageInformation)); os.IsNotExist(err) {
		// does not exist
		guimessage.AddInfo("No ongoing building process.")
		c.Ctx.Redirect(302, "/gui/repository/imageinformation/list")
		guimessage.RedirectMessage(c)
		return
	}

	c.Data["cloudoneGUIHost"] = cloudoneGUIHost
	c.Data["cloudoneGUIPort"] = cloudoneGUIPort
	c.Data["imageInformation"] = imageInformation

	guimessage.OutputMessage(c.Data)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:25,代碼來源:log.go

示例13: Get

func (c *DeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	imageInformationName := c.GetString("name")
	imageRecordVersion := c.GetString("version")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/imagerecords/" + imageInformationName + "/" + imageRecordVersion

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Image record " + imageRecordVersion + " belonging to " + imageInformationName + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/repository/imagerecord/list?name="+imageInformationName)

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:33,代碼來源:delete.go

示例14: Get

func (c *ConfigureController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	name := c.GetString("name")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/slbs/daemons/" + name + "/configure"

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestPut(url, make(map[string]interface{}), tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("SLB daemon " + name + " is configured")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/system/slb/daemon/list")

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:32,代碼來源:configure.go

示例15: Get

func (c *DeleteController) Get() {
	guimessage := guimessagedisplay.GetGUIMessage(c)

	cloudoneProtocol := beego.AppConfig.String("cloudoneProtocol")
	cloudoneHost := beego.AppConfig.String("cloudoneHost")
	cloudonePort := beego.AppConfig.String("cloudonePort")

	serverName := c.GetString("serverName")
	repositoryName := c.GetString("repositoryName")
	tag := c.GetString("tag")

	url := cloudoneProtocol + "://" + cloudoneHost + ":" + cloudonePort +
		"/api/v1/privateregistries/servers/" + serverName + "/repositories/" + repositoryName + "/tags/" + tag

	tokenHeaderMap, _ := c.GetSession("tokenHeaderMap").(map[string]string)

	_, err := restclient.RequestDelete(url, nil, tokenHeaderMap, true)

	if identity.IsTokenInvalidAndRedirect(c, c.Ctx, err) {
		return
	}

	if err != nil {
		// Error
		guimessage.AddDanger(guimessagedisplay.GetErrorMessage(err))
	} else {
		guimessage.AddSuccess("Image labeled with the tag " + tag + " is deleted")
	}

	// Redirect to list
	c.Ctx.Redirect(302, "/gui/system/privateregistry/image/list?serverName="+serverName+"&repositoryName="+repositoryName)

	guimessage.RedirectMessage(c)
}
開發者ID:cloudawan,項目名稱:cloudone_gui,代碼行數:34,代碼來源:delete.go


注:本文中的github.com/cloudawan/cloudone_gui/controllers/utility/guimessagedisplay.GetGUIMessage函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。