Add FM version to interface; close #221
parent
011d5aee46
commit
59bd6e97bf
|
@ -7,6 +7,7 @@
|
||||||
<meta name="base" content="{{ .BaseURL }}">
|
<meta name="base" content="{{ .BaseURL }}">
|
||||||
<meta name="staticgen" content="{{ .StaticGen }}">
|
<meta name="staticgen" content="{{ .StaticGen }}">
|
||||||
<meta name="noauth" content="{{ .NoAuth }}">
|
<meta name="noauth" content="{{ .NoAuth }}">
|
||||||
|
<meta name="version" content="{{ .Version }}">
|
||||||
<title>File Manager</title>
|
<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="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">
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ .BaseURL }}/static/img/icons/favicon-16x16.png">
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="credits">
|
<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>
|
<span><a @click="help">{{ $t('sidebar.help') }}</a></span>
|
||||||
</p>
|
</p>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -72,7 +72,7 @@ import auth from '@/utils/auth'
|
||||||
export default {
|
export default {
|
||||||
name: 'sidebar',
|
name: 'sidebar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', 'staticGen']),
|
...mapState(['user', 'staticGen', 'version']),
|
||||||
active () {
|
active () {
|
||||||
return this.$store.state.show === 'sidebar'
|
return this.$store.state.show === 'sidebar'
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ const state = {
|
||||||
staticGen: document.querySelector('meta[name="staticgen"]').getAttribute('content'),
|
staticGen: document.querySelector('meta[name="staticgen"]').getAttribute('content'),
|
||||||
baseURL: document.querySelector('meta[name="base"]').getAttribute('content'),
|
baseURL: document.querySelector('meta[name="base"]').getAttribute('content'),
|
||||||
noAuth: (document.querySelector('meta[name="noauth"]').getAttribute('content') === 'true'),
|
noAuth: (document.querySelector('meta[name="noauth"]').getAttribute('content') === 'true'),
|
||||||
|
version: document.querySelector('meta[name="version"]').getAttribute('content'),
|
||||||
jwt: '',
|
jwt: '',
|
||||||
progress: 0,
|
progress: 0,
|
||||||
schedule: '',
|
schedule: '',
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the current File Manager version.
|
// Version is the current File Manager version.
|
||||||
const Version = "(untracked version)"
|
const Version = "(untracked)"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrExist = errors.New("the resource already exists")
|
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{}{
|
data := map[string]interface{}{
|
||||||
"BaseURL": c.RootURL(),
|
"BaseURL": c.RootURL(),
|
||||||
"NoAuth": c.NoAuth,
|
"NoAuth": c.NoAuth,
|
||||||
|
"Version": fm.Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.StaticGen != nil {
|
if c.StaticGen != nil {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Releasing version $1"
|
|
||||||
sed -i "s|(untracked version)|$1|g" filemanager.go
|
|
||||||
|
|
||||||
echo "Building assets"
|
echo "Building assets"
|
||||||
./build.sh
|
./build.sh
|
||||||
|
|
||||||
|
echo "Updating version number to $1..."
|
||||||
|
sed -i "s|(untracked)|$1|g" filemanager.go
|
||||||
|
|
||||||
echo "Commiting..."
|
echo "Commiting..."
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Version $1"
|
git commit -m "Version $1"
|
||||||
|
@ -16,7 +16,7 @@ git tag "v$1"
|
||||||
git push --tags
|
git push --tags
|
||||||
|
|
||||||
echo "Commiting untracked version notice..."
|
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 add -A
|
||||||
git commit -m "untracked version `date`"
|
git commit -m "untracked version `date`"
|
||||||
git push
|
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