本文整理汇总了Golang中github.com/blackmady/NoneCMS/app/models.Admin.GetMysqlVer方法的典型用法代码示例。如果您正苦于以下问题:Golang Admin.GetMysqlVer方法的具体用法?Golang Admin.GetMysqlVer怎么用?Golang Admin.GetMysqlVer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/blackmady/NoneCMS/app/models.Admin
的用法示例。
在下文中一共展示了Admin.GetMysqlVer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Main
func (c App) Main(admin *models.Admin) revel.Result {
title := "首页--GoCMS管理系统"
UserID := utils.GetSession("UserID", c.Session)
if len(UserID) > 0 {
UserID, err := strconv.ParseInt(UserID, 10, 64)
if err != nil {
revel.WARN.Println(err)
}
admin_info := admin.GetById(UserID)
//判断是否是系统的分隔符
separator := "/"
if os.IsPathSeparator('\\') {
separator = "\\"
} else {
separator = "/"
}
config_file := (revel.BasePath + "/conf/config.conf")
config_file = strings.Replace(config_file, "/", separator, -1)
config_conf, _ := config.ReadDefault(config_file)
system_info := make(map[string]string)
//版本
version, _ := config_conf.String("website", "website.version")
system_info["version"] = version
//前台网站地址
sitedomain, _ := config_conf.String("website", "website.sitedomain")
system_info["sitedomain"] = sitedomain
//操作系统
system_info["os"] = strings.ToUpper(runtime.GOOS + " " + runtime.GOARCH)
//Go版本
system_info["go_varsion"] = strings.ToUpper(runtime.Version())
//Revel版本
system_info["revel_varsion"] = strings.ToUpper("Revel 0.11")
//MySQL版本
system_info["mysql_varsion"] = admin.GetMysqlVer()
//服务器监控
// memory_info, _ := gopsutil.VirtualMemory()
// system_info["main_server_total_memory"] = utils.FileSize(int(memory_info.Total))
// system_info["main_server_free_memory"] = utils.FileSize(int(memory_info.Free))
// system_info["main_server_available_memory"] = utils.FileSize(int(memory_info.Available))
// system_info["main_server_UsedPercent_memory"] = fmt.Sprintf("%10.2f%%", memory_info.UsedPercent)
// host, _ := gopsutil.HostInfo()
// system_info["main_server_Hostname"] = host.Hostname
// system_info["main_server_OS"] = host.OS
// system_info["main_server_Platform"] = host.Platform
// system_info["main_server_PlatformVersion"] = host.PlatformVersion
// system_info["main_server_PlatformFamily"] = host.PlatformFamily
//快捷面板
admin_panel := new(models.Admin_Panel)
panel_list := admin_panel.GetPanelList(admin_info)
c.Render(title, admin_info, system_info, panel_list)
} else {
c.Render(title)
}
return c.RenderTemplate("App/Main.html")
}