0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-09-11 12:24:27 +00:00

add version in back and front #16 / client can ignore global PK #17 / #18 email is now optional

This commit is contained in:
vx3r
2020-02-25 17:45:44 +09:00
parent a98c39ad04
commit 3e1cd8389d
9 changed files with 61 additions and 31 deletions

View File

@ -8,7 +8,6 @@
},
"dependencies": {
"axios": "^0.19.2",
"git-describe": "^4.0.4",
"is-cidr": "^3.1.0",
"moment": "^2.24.0",
"vue": "^2.6.10",

View File

@ -24,29 +24,59 @@
<v-container>
<router-view />
</v-container>
<Notification v-bind:notification="notification"/>
</v-content>
<v-footer app>
<span>License <a class="pr-1 pl-1" href="http://www.wtfpl.net/" target="_blank">WTFPL</a> &copy; {{ new Date().getFullYear() }} Created with</span><v-icon class="pr-1 pl-1">mdi-heart</v-icon><span>by</span><a class="pr-1 pl-1" href="mailto:vx3r@127-0-0-1.fr">vx3r</a><v-spacer></v-spacer><span>Version: {{ VersionGitCommit }}</span>
<span>License <a class="pr-1 pl-1" href="http://www.wtfpl.net/" target="_blank">WTFPL</a> &copy; {{ new Date().getFullYear() }} Created with</span><v-icon class="pr-1 pl-1">mdi-heart</v-icon><span>by</span><a class="pr-1 pl-1" href="mailto:vx3r@127-0-0-1.fr">vx3r</a><v-spacer></v-spacer><span>Version: {{ version }}</span>
</v-footer>
</v-app>
</template>
<script>
export default {
name: 'App',
import {ApiService} from "./services/ApiService";
import Notification from './components/Notification'
data: () => ({
VersionGitCommit: process.env.VUE_APP_GIT_HASH
}),
export default {
name: 'App',
mounted() {
console.log("Starting Wg Gen Web version: " + process.env.VUE_APP_GIT_HASH)
},
components: {
Notification
},
created () {
this.$vuetify.theme.dark = true
},
};
data: () => ({
api: null,
version:'N/A',
notification: {
show: false,
color: '',
text: '',
},
}),
mounted() {
this.api = new ApiService();
this.getVersion()
},
created () {
this.$vuetify.theme.dark = true
},
methods: {
getVersion() {
this.api.get('/server/version').then((res) => {
this.version = res.version;
}).catch((e) => {
this.notify('error', e.response.status + ' ' + e.response.statusText);
});
},
notify(color, msg) {
this.notification.show = true;
this.notification.color = color;
this.notification.text = msg;
}
}
};
</script>

View File

@ -1,6 +1,3 @@
const {gitDescribe, gitDescribeSync} = require('git-describe');
process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
module.exports = {
devServer: {
port: 8081,