Base attempt at using vuex to handle logins

This commit is contained in:
Dane Everitt 2018-06-05 23:00:01 -07:00
parent cc58bc9bd5
commit e948d81d8a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
12 changed files with 218 additions and 202 deletions

View file

@ -29,7 +29,7 @@
<script>
import { DateTime } from 'luxon';
import { ServerCollection } from '../../models/server';
import Server from '../../models/server';
import _ from 'lodash';
import Flash from '../Flash';
import ServerBox from './ServerBox';
@ -44,7 +44,7 @@
documentVisible: true,
loading: true,
search: '',
servers: new ServerCollection,
servers: [],
}
},
@ -83,14 +83,14 @@
this.clearFlashes();
})
.then(response => {
this.servers = new ServerCollection;
this.servers = [];
response.data.data.forEach(obj => {
this.getResourceUse(
this.servers.add(obj.attributes)
);
const s = new Server(obj.attributes);
this.servers.push(s);
this.getResourceUse(s);
});
if (this.servers.models.length === 0) {
if (this.servers.length === 0) {
this.info(this.$t('dashboard.index.no_matches'));
}
})