Generating thumbnails. Added site overview page.
This commit is contained in:
22
assets/js/sites/actions.js
Normal file
22
assets/js/sites/actions.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { get } from '../api';
|
||||
|
||||
function initSitesActions(_store, _router) {
|
||||
async function fetchSites({ _commit }, siteId) {
|
||||
const sites = await get(`/sites/${siteId || ''}`);
|
||||
|
||||
return sites;
|
||||
}
|
||||
|
||||
async function fetchSiteReleases({ _commit }, siteId) {
|
||||
const releases = await get(`/sites/${siteId}/releases`);
|
||||
|
||||
return releases;
|
||||
}
|
||||
|
||||
return {
|
||||
fetchSites,
|
||||
fetchSiteReleases,
|
||||
};
|
||||
}
|
||||
|
||||
export default initSitesActions;
|
||||
1
assets/js/sites/mutations.js
Normal file
1
assets/js/sites/mutations.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
13
assets/js/sites/sites.js
Normal file
13
assets/js/sites/sites.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import state from './state';
|
||||
import mutations from './mutations';
|
||||
import actions from './actions';
|
||||
|
||||
function initSitesStore(store, router) {
|
||||
return {
|
||||
state,
|
||||
mutations,
|
||||
actions: actions(store, router),
|
||||
};
|
||||
}
|
||||
|
||||
export default initSitesStore;
|
||||
1
assets/js/sites/state.js
Normal file
1
assets/js/sites/state.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
@@ -3,6 +3,7 @@ import Vuex from 'vuex';
|
||||
|
||||
import initAuthStore from './auth/auth';
|
||||
import initReleasesStore from './releases/releases';
|
||||
import initSitesStore from './sites/sites';
|
||||
import initNetworksStore from './networks/networks';
|
||||
import initActorsStore from './actors/actors';
|
||||
|
||||
@@ -14,6 +15,7 @@ function initStore(router) {
|
||||
store.registerModule('auth', initAuthStore(store, router));
|
||||
store.registerModule('releases', initReleasesStore(store, router));
|
||||
store.registerModule('actors', initActorsStore(store, router));
|
||||
store.registerModule('sites', initSitesStore(store, router));
|
||||
store.registerModule('networks', initNetworksStore(store, router));
|
||||
|
||||
return store;
|
||||
|
||||
Reference in New Issue
Block a user