2019-06-02 13:28:13 +00:00
|
|
|
package admin
|
|
|
|
|
|
|
|
var varIndex = `
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<!-- Load required Bootstrap and BootstrapVue CSS -->
|
|
|
|
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap/dist/css/bootstrap.min.css" />
|
|
|
|
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.css" />
|
|
|
|
|
|
|
|
<!-- Load polyfills to support older browsers -->
|
|
|
|
<script src="//polyfill.io/v3/polyfill.min.js?features=es2015%2CMutationObserver"></script>
|
|
|
|
|
|
|
|
<!-- Load Vue followed by BootstrapVue -->
|
|
|
|
<script src="//unpkg.com/vue@latest/dist/vue.min.js"></script>
|
|
|
|
<script src="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.js"></script>
|
|
|
|
<script src="//unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Vars</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="app">
|
2019-06-09 04:15:06 +00:00
|
|
|
<b-navbar>
|
|
|
|
<b-navbar-brand>Variables</b-navbar-brand>
|
|
|
|
<b-navbar-nav>
|
2021-01-09 18:46:28 +00:00
|
|
|
<b-nav-item v-for="item in nav" :href="item.url" :active="item.name === 'Variables'">{{ item.name }}</b-nav-item>
|
2019-06-09 04:15:06 +00:00
|
|
|
</b-navbar-nav>
|
|
|
|
</b-navbar>
|
2019-06-02 13:28:13 +00:00
|
|
|
<b-alert
|
|
|
|
dismissable
|
|
|
|
variant="error"
|
|
|
|
v-if="err"
|
|
|
|
@dismissed="err = ''">
|
2021-01-09 18:46:28 +00:00
|
|
|
{{ err }}
|
2019-06-02 13:28:13 +00:00
|
|
|
</b-alert>
|
|
|
|
<b-container>
|
|
|
|
<b-table
|
|
|
|
fixed
|
|
|
|
:items="vars"
|
|
|
|
:sort-by.sync="sortBy"
|
|
|
|
:fields="fields"></b-table>
|
|
|
|
</b-container>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var app = new Vue({
|
|
|
|
el: '#app',
|
|
|
|
data: {
|
|
|
|
err: '',
|
2021-01-09 18:46:28 +00:00
|
|
|
nav: [],
|
2019-06-09 04:15:06 +00:00
|
|
|
vars: [],
|
2019-06-02 13:28:13 +00:00
|
|
|
sortBy: 'key',
|
|
|
|
fields: [
|
|
|
|
{ key: { sortable: true } },
|
|
|
|
'value'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.getData();
|
2021-01-09 18:46:28 +00:00
|
|
|
axios.get('/nav')
|
|
|
|
.then(resp => {
|
|
|
|
this.nav = resp.data;
|
|
|
|
})
|
|
|
|
.catch(err => console.log(err))
|
2019-06-02 13:28:13 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getData: function() {
|
|
|
|
axios.get('/vars/api')
|
|
|
|
.then(resp => {
|
|
|
|
this.vars = resp.data;
|
|
|
|
})
|
|
|
|
.catch(err => this.err = err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
`
|