|
|
|
@ -2,14 +2,7 @@ import { actionCreator } from '@/lib/store';
@@ -2,14 +2,7 @@ import { actionCreator } from '@/lib/store';
|
|
|
|
|
|
|
|
|
|
export const state = () => ({ |
|
|
|
|
apps: [], |
|
|
|
|
/* |
|
|
|
|
appTypeMap: { |
|
|
|
|
WINDOWS_10_WORKSPACE: { |
|
|
|
|
component: 'windows-10-workspace', |
|
|
|
|
slug: 'windows-vdi', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
*/ |
|
|
|
|
app_profiles: [], |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
export const actions = { |
|
|
|
@ -20,13 +13,21 @@ export const actions = {
@@ -20,13 +13,21 @@ export const actions = {
|
|
|
|
|
}, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
getStudyApps: actionCreator({ |
|
|
|
|
name: 'getStudyApps', |
|
|
|
|
method({ studyId, appType }) { |
|
|
|
|
return this.$axios.get(`/api/v1/studies/${studyId}/app-types/${appType}/`) |
|
|
|
|
}, |
|
|
|
|
getMyStudyApps: actionCreator({ |
|
|
|
|
name: 'getMyStudyApps', |
|
|
|
|
method({ studyId }) { |
|
|
|
|
return this.$axios.get(`/api/v1/studies/${studyId}/apps/me/`) |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
getStudyApps: actionCreator({ |
|
|
|
|
name: 'getStudyApps', |
|
|
|
|
method({ studyId, appType }) { |
|
|
|
|
return this.$axios.get(`/api/v1/studies/${studyId}/app-types/${appType}/`) |
|
|
|
|
}, |
|
|
|
|
}), |
|
|
|
|
*/ |
|
|
|
|
getAppTypeProfiles: actionCreator({ |
|
|
|
|
name: 'getAppTypeProfiles', |
|
|
|
|
method(data) { |
|
|
|
@ -34,24 +35,7 @@ export const actions = {
@@ -34,24 +35,7 @@ export const actions = {
|
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
getAppsTest: actionCreator({ |
|
|
|
|
name: 'getAppsTest', |
|
|
|
|
method() { |
|
|
|
|
return Promise.resolve({ |
|
|
|
|
data: [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: 'Windows 10 workspace', |
|
|
|
|
description: 'Windows VDI', |
|
|
|
|
avatar: 'https://banner2.cleanpng.com/20180328/skq/kisspng-logo-windows-8-windows-7-microsoft-8-5abc1c77a59fe7.0872489215222774956784.jpg', |
|
|
|
|
type: 'WINDOWS_10_WORKSPACE', |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const mutations = { |
|
|
|
@ -69,8 +53,8 @@ export const mutations = {
@@ -69,8 +53,8 @@ export const mutations = {
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getStudyAppsSuccess(state, { result }) { |
|
|
|
|
state.apps = result.map((app) => { |
|
|
|
|
getMyStudyAppsSuccess(state, { result }) { |
|
|
|
|
state.study_apps = result.map((app) => { |
|
|
|
|
return { |
|
|
|
|
id: app.id, |
|
|
|
|
src: app.avatar, |
|
|
|
@ -78,9 +62,9 @@ export const mutations = {
@@ -78,9 +62,9 @@ export const mutations = {
|
|
|
|
|
login: app.login_url |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAppTypeProfilesSuccess(state, { result }) { |
|
|
|
|
state.app_profiles = result.map((profile) => { |
|
|
|
|
return { |
|
|
|
@ -98,64 +82,18 @@ export const getters = {
@@ -98,64 +82,18 @@ export const getters = {
|
|
|
|
|
getAvailableAppTypes(state) { |
|
|
|
|
return state.apps; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getMyStudyApps(state) { |
|
|
|
|
console.log('getMyStudyApps', state.study_apps) |
|
|
|
|
return state.study_apps; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getAppsForStudy: state => studyId => { |
|
|
|
|
// studyId = parseInt(studyId, 10);
|
|
|
|
|
// return state.apps.filter(app => app.study.id === studyId)
|
|
|
|
|
return [] |
|
|
|
|
}, |
|
|
|
|
getAppTypeProfiles(state) { |
|
|
|
|
console.log(state.app_profiles) |
|
|
|
|
return state.app_profiles; |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
/* |
|
|
|
|
export const state = () => ({ |
|
|
|
|
|
|
|
|
|
appTypeMap: { |
|
|
|
|
WINDOWS_10_WORKSPACE: { |
|
|
|
|
component: 'windows-10-workspace', |
|
|
|
|
slug: 'windows-vdi', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
apps: [], |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
export const actions = { |
|
|
|
|
getApps: actionCreator({ |
|
|
|
|
name: 'getApps', |
|
|
|
|
method() { |
|
|
|
|
return Promise.resolve({data: [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: 'Windows 10 workspace', |
|
|
|
|
description: 'Windows VDI', |
|
|
|
|
avatar: 'https://banner2.cleanpng.com/20180328/skq/kisspng-logo-windows-8-windows-7-microsoft-8-5abc1c77a59fe7.0872489215222774956784.jpg', |
|
|
|
|
type: 'WINDOWS_10_WORKSPACE', |
|
|
|
|
} |
|
|
|
|
]}) |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const mutations = { |
|
|
|
|
getAppsSuccess(state, {result}) { |
|
|
|
|
state.apps = result.map(mappers.addComponentToApp(state)) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getters = { |
|
|
|
|
getApps: state => { |
|
|
|
|
return state.apps; |
|
|
|
|
}, |
|
|
|
|
getAppsForStudy: state => studyId => { |
|
|
|
|
// studyId = parseInt(studyId, 10);
|
|
|
|
|
// return state.apps.filter(app => app.study.id === studyId)
|
|
|
|
|
return [] |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const mappers = {Profiles |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|