mirror of https://github.com/statping/statping
vue
parent
d89175a340
commit
a22f24fccb
|
@ -66,7 +66,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<draggable tag="tbody" v-model="groupsList" class="sortable_groups" handle=".drag_icon">
|
<draggable tag="tbody" v-model="groupsList" class="sortable_groups" handle=".drag_icon">
|
||||||
<tr v-for="(group, index) in $store.getters.groupsInOrder" v-bind:key="index">
|
<tr v-for="(group, index) in $store.getters.groupsClean" v-bind:key="index">
|
||||||
<td><span class="drag_icon d-none d-md-inline"><font-awesome-icon icon="bars" /></span> {{group.name}}</td>
|
<td><span class="drag_icon d-none d-md-inline"><font-awesome-icon icon="bars" /></span> {{group.name}}</td>
|
||||||
<td>{{$store.getters.servicesInGroup(group.id).length}}</td>
|
<td>{{$store.getters.servicesInGroup(group.id).length}}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -81,10 +81,7 @@
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
in_user() {
|
in_user() {
|
||||||
const u = this.in_user
|
this.user = this.in_user
|
||||||
delete u.password
|
|
||||||
delete u.confirm_password
|
|
||||||
this.user = u
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<Header/>
|
<Header/>
|
||||||
|
|
||||||
<div v-for="(group, index) in $store.getters.groups" v-bind:key="index">
|
<div v-for="(group, index) in $store.getters.groupsInOrder" v-bind:key="index">
|
||||||
<Group :group=group />
|
<Group :group=group />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -146,11 +146,12 @@
|
||||||
cache: [],
|
cache: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async mounted () {
|
||||||
|
this.cache = await Api.cache()
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
const qrurl = `statping://setup?domain=${core.domain}&api=${core.api_secret}`
|
const qrurl = `statping://setup?domain=${core.domain}&api=${core.api_secret}`
|
||||||
this.qrcode = "https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=" + encodeURI(qrurl)
|
this.qrcode = "https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=" + encodeURI(qrurl)
|
||||||
|
|
||||||
this.cache = await Api.cache()
|
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ export default new Vuex.Store({
|
||||||
integrations: state => state.integrations,
|
integrations: state => state.integrations,
|
||||||
|
|
||||||
servicesInOrder: state => state.services.sort((a, b) => a.order_id - b.order_id),
|
servicesInOrder: state => state.services.sort((a, b) => a.order_id - b.order_id),
|
||||||
groupsInOrder: state => state.groups.filter(g => g.name !== '').sort((a, b) => a.order_id - b.order_id),
|
groupsInOrder: state => state.groups.sort((a, b) => a.order_id - b.order_id),
|
||||||
|
groupsClean: state => state.groups.filter(g => g.name !== '').sort((a, b) => a.order_id - b.order_id),
|
||||||
|
|
||||||
serviceById: (state) => (id) => {
|
serviceById: (state) => (id) => {
|
||||||
return state.services.find(s => s.id === id)
|
return state.services.find(s => s.id === id)
|
||||||
|
@ -50,7 +51,7 @@ export default new Vuex.Store({
|
||||||
return state.services.find(s => s.permalink === permalink)
|
return state.services.find(s => s.permalink === permalink)
|
||||||
},
|
},
|
||||||
servicesInGroup: (state) => (id) => {
|
servicesInGroup: (state) => (id) => {
|
||||||
return state.services.filter(s => s.group_id === id)
|
return state.services.filter(s => s.group_id === id).sort((a, b) => a.order_id - b.order_id)
|
||||||
},
|
},
|
||||||
onlineServices: (state) => (online) => {
|
onlineServices: (state) => (online) => {
|
||||||
return state.services.filter(s => s.online === online)
|
return state.services.filter(s => s.online === online)
|
||||||
|
@ -59,7 +60,7 @@ export default new Vuex.Store({
|
||||||
return state.groups.find(g => g.id === id)
|
return state.groups.find(g => g.id === id)
|
||||||
},
|
},
|
||||||
cleanGroups: (state) => () => {
|
cleanGroups: (state) => () => {
|
||||||
return state.groups.filter(g => g.name !== 'Empty Group')
|
return state.groups.filter(g => g.name !== '').sort((a, b) => a.order_id - b.order_id)
|
||||||
},
|
},
|
||||||
userById: (state) => (id) => {
|
userById: (state) => (id) => {
|
||||||
return state.users.find(u => u.id === id)
|
return state.users.find(u => u.id === id)
|
||||||
|
|
Loading…
Reference in New Issue