Add FM version to interface; close #221
							parent
							
								
									011d5aee46
								
							
						
					
					
						commit
						59bd6e97bf
					
				|  | @ -7,6 +7,7 @@ | |||
|   <meta name="base" content="{{ .BaseURL }}"> | ||||
|   <meta name="staticgen" content="{{ .StaticGen }}"> | ||||
|   <meta name="noauth" content="{{ .NoAuth }}"> | ||||
|   <meta name="version" content="{{ .Version }}"> | ||||
|   <title>File Manager</title> | ||||
|   <link rel="icon" type="image/png" sizes="32x32" href="{{ .BaseURL }}/static/img/icons/favicon-32x32.png"> | ||||
|   <link rel="icon" type="image/png" sizes="16x16" href="{{ .BaseURL }}/static/img/icons/favicon-16x16.png"> | ||||
|  |  | |||
|  | @ -59,7 +59,7 @@ | |||
|     </div> | ||||
| 
 | ||||
|     <p class="credits"> | ||||
|       <span>{{ $t('sidebar.servedWith') }} <a rel="noopener noreferrer" href="https://github.com/hacdias/filemanager">File Manager</a>.</span> | ||||
|       <span><a rel="noopener noreferrer" href="https://github.com/hacdias/filemanager">File Manager</a> v{{ version }}</span> | ||||
|       <span><a @click="help">{{ $t('sidebar.help') }}</a></span> | ||||
|     </p> | ||||
|   </nav> | ||||
|  | @ -72,7 +72,7 @@ import auth from '@/utils/auth' | |||
| export default { | ||||
|   name: 'sidebar', | ||||
|   computed: { | ||||
|     ...mapState(['user', 'staticGen']), | ||||
|     ...mapState(['user', 'staticGen', 'version']), | ||||
|     active () { | ||||
|       return this.$store.state.show === 'sidebar' | ||||
|     } | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ const state = { | |||
|   staticGen: document.querySelector('meta[name="staticgen"]').getAttribute('content'), | ||||
|   baseURL: document.querySelector('meta[name="base"]').getAttribute('content'), | ||||
|   noAuth: (document.querySelector('meta[name="noauth"]').getAttribute('content') === 'true'), | ||||
|   version: document.querySelector('meta[name="version"]').getAttribute('content'), | ||||
|   jwt: '', | ||||
|   progress: 0, | ||||
|   schedule: '', | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ import ( | |||
| ) | ||||
| 
 | ||||
| // Version is the current File Manager version.
 | ||||
| const Version = "(untracked version)" | ||||
| const Version = "(untracked)" | ||||
| 
 | ||||
| var ( | ||||
| 	ErrExist              = errors.New("the resource already exists") | ||||
|  |  | |||
|  | @ -228,6 +228,7 @@ func renderFile(c *fm.Context, w http.ResponseWriter, file string) (int, error) | |||
| 	data := map[string]interface{}{ | ||||
| 		"BaseURL": c.RootURL(), | ||||
| 		"NoAuth":  c.NoAuth, | ||||
| 		"Version": fm.Version, | ||||
| 	} | ||||
| 
 | ||||
| 	if c.StaticGen != nil { | ||||
|  |  | |||
|  | @ -1,11 +1,11 @@ | |||
| #!/bin/bash | ||||
| 
 | ||||
| echo "Releasing version $1" | ||||
| sed -i "s|(untracked version)|$1|g" filemanager.go | ||||
| 
 | ||||
| echo "Building assets" | ||||
| ./build.sh | ||||
| 
 | ||||
| echo "Updating version number to $1..." | ||||
| sed -i "s|(untracked)|$1|g" filemanager.go | ||||
| 
 | ||||
| echo "Commiting..." | ||||
| git add -A | ||||
| git commit -m "Version $1" | ||||
|  | @ -16,7 +16,7 @@ git tag "v$1" | |||
| git push --tags | ||||
| 
 | ||||
| echo "Commiting untracked version notice..." | ||||
| sed -i "s|$1|(untracked version)|g" filemanager.go | ||||
| sed -i "s|$1|(untracked)|g" filemanager.go | ||||
| git add -A | ||||
| git commit -m "untracked version `date`" | ||||
| git push | ||||
|  |  | |||
							
								
								
									
										2342
									
								
								rice-box.go
								
								
								
								
							
							
						
						
									
										2342
									
								
								rice-box.go
								
								
								
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	 Henrique Dias
						Henrique Dias