consts.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package consts
  2. import (
  3. "html/template"
  4. )
  5. const ServerVersion = "1.0.2"
  6. const AssetsVersion = "16"
  7. const AssetsPath = "assets"
  8. const DirIndexFile = "index.html"
  9. // Bootstrap resources
  10. const AssetsBootstrapCss = AssetsPath + "/bootstrap.css"
  11. const AssetsBootstrapJs = AssetsPath + "/bootstrap.js"
  12. const AssetsJqueryJs = AssetsPath + "/jquery.js"
  13. const AssetsPopperJs = AssetsPath + "/popper.js"
  14. // System resources
  15. const AssetsCpScriptsJs = AssetsPath + "/cp/scripts.js"
  16. const AssetsCpStylesCss = AssetsPath + "/cp/styles.css"
  17. const AssetsSysBgPng = AssetsPath + "/sys/bg.png"
  18. const AssetsSysFaveIco = AssetsPath + "/sys/fave.ico"
  19. const AssetsSysLogoPng = AssetsPath + "/sys/logo.png"
  20. const AssetsSysLogoSvg = AssetsPath + "/sys/logo.svg"
  21. const AssetsSysStylesCss = AssetsPath + "/sys/styles.css"
  22. // Make global for other packages
  23. var ParamHost string
  24. var ParamPort int
  25. var ParamWwwDir string
  26. var ParamDebug bool
  27. var ParamKeepAlive bool
  28. // For admin panel
  29. type BreadCrumb struct {
  30. Name string
  31. Link string
  32. }
  33. // Template data
  34. type TmplSystem struct {
  35. PathIcoFav string
  36. PathSvgLogo string
  37. PathCssStyles string
  38. PathCssCpStyles string
  39. PathCssBootstrap string
  40. PathJsJquery string
  41. PathJsPopper string
  42. PathJsBootstrap string
  43. PathJsCpScripts string
  44. PathThemeStyles string
  45. PathThemeScripts string
  46. InfoVersion string
  47. }
  48. type TmplError struct {
  49. ErrorMessage string
  50. }
  51. type TmplData struct {
  52. System TmplSystem
  53. Data interface{}
  54. }
  55. type TmplDataCpBase struct {
  56. Title string
  57. Caption string
  58. BodyClasses string
  59. UserId int
  60. UserFirstName string
  61. UserLastName string
  62. UserEmail string
  63. UserPassword string
  64. UserAvatarLink string
  65. NavBarModules template.HTML
  66. NavBarModulesSys template.HTML
  67. ModuleCurrentAlias string
  68. SidebarLeft template.HTML
  69. Content template.HTML
  70. SidebarRight template.HTML
  71. }
  72. type TmplDataMainMenuItem struct {
  73. Name string
  74. Link string
  75. Active bool
  76. }
  77. type TmplDataModIndex struct {
  78. Name string
  79. Alias string
  80. Content template.HTML
  81. MetaTitle string
  82. MetaKeywords string
  83. MetaDescription string
  84. }