Add FM version to interface; close #221

Former-commit-id: 0d8cdc850ea970ecb73bb6ce5af85ca517dabba2 [formerly 9adaffca71250d6e350914e90965ea07198be2f0] [formerly 4c982e090fe2809829c35d574b75023ec384ba26 [formerly 59bd6e97bf]]
Former-commit-id: 959919b2c265757a9dde9f34ae06373468ebae0a [formerly 120c5d413404a70885ea597d93469cc3b93bf26a]
Former-commit-id: ebf8abfcf0003babcad11185da96dede783d25a9
pull/726/head
Henrique Dias 2017-09-03 10:50:49 +01:00
parent bf6e0abd96
commit c236db329f
7 changed files with 10 additions and 8 deletions

View File

@ -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">

View File

@ -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'
}

View File

@ -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: '',

View File

@ -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")

View File

@ -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 {

View File

@ -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

View File

@ -1 +0,0 @@
ff1dc93e7042a5be07b719f0a1b7d1aca3f13b08