consts.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package consts
  2. import (
  3. "html/template"
  4. )
  5. const ServerVersion = "1.0.0"
  6. const AssetsVersion = "14"
  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. }
  45. type TmplError struct {
  46. ErrorMessage string
  47. }
  48. type TmplData struct {
  49. System TmplSystem
  50. Data interface{}
  51. }
  52. type TmplDataCpBase struct {
  53. Title string
  54. Caption string
  55. BodyClasses string
  56. UserId int
  57. UserFirstName string
  58. UserLastName string
  59. UserEmail string
  60. UserPassword string
  61. UserAvatarLink string
  62. NavBarModules template.HTML
  63. NavBarModulesSys template.HTML
  64. ModuleCurrentAlias string
  65. SidebarLeft template.HTML
  66. Content template.HTML
  67. SidebarRight template.HTML
  68. }
  69. type TmplDataMainMenuItem struct {
  70. Name string
  71. Link string
  72. Active bool
  73. }
  74. type TmplDataModIndex struct {
  75. Name string
  76. Alias string
  77. Content template.HTML
  78. MetaTitle string
  79. MetaKeywords string
  80. MetaDescription string
  81. }