consts.go 2.1 KB

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