mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Added glyphicons
Former-commit-id: b7045022ff9128b3d32a958a294a16158a5669d4 [formerly 774be82430b875ad21498c483946cf807bcc4427] [formerly a10bc079587134fa06b5a7b105e4118c9388a6b9 [formerly 9c45d3e5d425317a7446c6df4a4b060615d5fcf8 [formerlyb0b5bd7319
]]] Former-commit-id: 7c05f30e2b0066ff4735dce9b8c7f0bdede12ea5 [formerly ac4102a9d1130d95b252d36d975e253d8756d7b2] Former-commit-id: 64f8c575047515cd1ffcb6fe2f950184eee64aac Former-commit-id:e232016b53
This commit is contained in:
parent
38ad2f59f6
commit
f0483086cc
2
main.go
2
main.go
@ -21,6 +21,7 @@ var AllowedIPs = map[string]bool{
|
|||||||
// RuntimeArgs contains all runtime
|
// RuntimeArgs contains all runtime
|
||||||
// arguments available
|
// arguments available
|
||||||
var RuntimeArgs struct {
|
var RuntimeArgs struct {
|
||||||
|
WikiName string
|
||||||
ExternalIP string
|
ExternalIP string
|
||||||
Port string
|
Port string
|
||||||
DatabaseLocation string
|
DatabaseLocation string
|
||||||
@ -40,6 +41,7 @@ func main() {
|
|||||||
flag.StringVar(&RuntimeArgs.AdminKey, "a", "", "key to access admin priveleges")
|
flag.StringVar(&RuntimeArgs.AdminKey, "a", "", "key to access admin priveleges")
|
||||||
flag.StringVar(&RuntimeArgs.ServerCRT, "crt", "", "location of ssl crt")
|
flag.StringVar(&RuntimeArgs.ServerCRT, "crt", "", "location of ssl crt")
|
||||||
flag.StringVar(&RuntimeArgs.ServerKey, "key", "", "location of ssl key")
|
flag.StringVar(&RuntimeArgs.ServerKey, "key", "", "location of ssl key")
|
||||||
|
flag.StringVar(&RuntimeArgs.WikiName, "w", "AwwKoala", "custom name for wiki")
|
||||||
flag.CommandLine.Usage = func() {
|
flag.CommandLine.Usage = func() {
|
||||||
fmt.Println(`AwwKoala: A Websocket Wiki and Kind Of A List Application
|
fmt.Println(`AwwKoala: A Websocket Wiki and Kind Of A List Application
|
||||||
run this to start the server and then visit localhost at the port you specify
|
run this to start the server and then visit localhost at the port you specify
|
||||||
|
@ -40,6 +40,7 @@ func editNote(c *gin.Context) {
|
|||||||
if currentVersion {
|
if currentVersion {
|
||||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||||
"Title": title,
|
"Title": title,
|
||||||
|
"WikiName": RuntimeArgs.WikiName,
|
||||||
"ExternalIP": RuntimeArgs.ExternalIP,
|
"ExternalIP": RuntimeArgs.ExternalIP,
|
||||||
"CurrentText": currentText,
|
"CurrentText": currentText,
|
||||||
"NumRows": numRows,
|
"NumRows": numRows,
|
||||||
@ -48,6 +49,7 @@ func editNote(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||||
"Title": title,
|
"Title": title,
|
||||||
|
"WikiName": RuntimeArgs.WikiName,
|
||||||
"ExternalIP": RuntimeArgs.ExternalIP,
|
"ExternalIP": RuntimeArgs.ExternalIP,
|
||||||
"CurrentText": currentText,
|
"CurrentText": currentText,
|
||||||
"NumRows": numRows,
|
"NumRows": numRows,
|
||||||
@ -112,6 +114,7 @@ func renderMarkdown(c *gin.Context, currentText string, title string, versions [
|
|||||||
html2 = strings.Replace(html2, "$", "$", -1)
|
html2 = strings.Replace(html2, "$", "$", -1)
|
||||||
c.HTML(http.StatusOK, "view.tmpl", gin.H{
|
c.HTML(http.StatusOK, "view.tmpl", gin.H{
|
||||||
"Title": title,
|
"Title": title,
|
||||||
|
"WikiName": RuntimeArgs.WikiName,
|
||||||
"Body": template.HTML([]byte(html2)),
|
"Body": template.HTML([]byte(html2)),
|
||||||
"Versions": versions,
|
"Versions": versions,
|
||||||
})
|
})
|
||||||
@ -172,6 +175,7 @@ func renderList(c *gin.Context, title string) {
|
|||||||
|
|
||||||
c.HTML(http.StatusOK, "list.tmpl", gin.H{
|
c.HTML(http.StatusOK, "list.tmpl", gin.H{
|
||||||
"Title": title,
|
"Title": title,
|
||||||
|
"WikiName": RuntimeArgs.WikiName,
|
||||||
"ListItems": listItems,
|
"ListItems": listItems,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">AwwKoala</a>
|
<a class="navbar-brand" href="/">{{ .WikiName }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
@ -82,7 +82,7 @@
|
|||||||
<form action='#' id="emit" method="post" name="emit">
|
<form action='#' id="emit" method="post" name="emit">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<textarea autofocus rows={{ .NumRows }} class='auto_submit_item' id="emit_data" name="emit_data" placeholder="Start typing, it will save automatically. Go to awwkoala.com/{{ .Title }} to reload your note. Do not post anything private since anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
|
<textarea autofocus rows={{ .NumRows }} class='auto_submit_item' id="emit_data" name="emit_data" placeholder="Start typing, it will save automatically. Go to {{ .ExternalIP }}/{{ .Title }} to reload your note. Do not post anything private since anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">AwwKoala</a>
|
<a class="navbar-brand" href="/">{{ .WikiName }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">AwwKoala</a>
|
<a class="navbar-brand" href="/">{{ .WikiName }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
|
Loading…
Reference in New Issue
Block a user