Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM: Add S3 support to UI #614

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ bin/
yarn.lock
npm-debug.log
*.DS_Store

.idea/
48 changes: 47 additions & 1 deletion src/models/volume.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
import { create, deleteVolume, query, execAction, createVolumePV, createVolumePVC, createVolumeAllPVC, volumeActivate, getNodeTags, getDiskTags, expandVolume, cancelExpansion, createRecurringJob, recurringJobAdd, getVolumeRecurringJobList, removeVolumeRecurringJob, updateRecurringJob } from '../services/volume'
import {
create,
deleteVolume,
query,
execAction,
createVolumePV,
createVolumePVC,
createVolumeAllPVC,
volumeActivate,
getNodeTags,
getDiskTags,
expandVolume,
cancelExpansion,
createRecurringJob,
recurringJobAdd,
getVolumeRecurringJobList,
removeVolumeRecurringJob,
updateRecurringJob,
createObjectEndpoint,
} from '../services/volume'
import { query as getRecurringJob } from '../services/recurringJob'
import { wsChanges, updateState } from '../utils/websocket'
import { sortVolume } from '../utils/sort'
Expand Down Expand Up @@ -98,6 +117,8 @@ export default {
socketStatus: 'closed',
sorter: getSorter('volumeList.sorter'),
customColumnList: window.__column__, // eslint-disable-line no-underscore-dangle
createObjectEndpointModalVisible: false,
createObjectEndpointModalKey: Math.random(),
},
subscriptions: {
setup({ dispatch, history }) {
Expand Down Expand Up @@ -613,6 +634,25 @@ export default {
ws.close(1000)
}
},
*createObjectEndpoint({
payload,
}, { call, put }) {
yield put({ type: 'hideCreateObjectEndpointModal' })
yield call(createObjectEndpoint, payload)
yield put({ type: 'query' })
},
*showCreateObjectEndpointModalBefore({
payload,
}, { call, put }) {
yield put({ type: 'showCreateObjectEndpointModal' })
const nodeTags = yield call(getNodeTags, payload)
const diskTags = yield call(getDiskTags, payload)
if (nodeTags.status === 200 && diskTags.status === 200) {
yield put({ type: 'changeTagsLoading', payload: { nodeTags: nodeTags.data, diskTags: diskTags.data, tagsLoading: false } })
} else {
yield put({ type: 'changeTagsLoading', payload: { tagsLoading: false } })
}
},
},
reducers: {
queryVolume(state, action) {
Expand Down Expand Up @@ -858,5 +898,11 @@ export default {
updateWs(state, action) {
return { ...state, ws: action.payload }
},
showCreateObjectEndpointModal(state, action) {
return { ...state, ...action.payload, createObjectEndpointModalVisible: true, createObjectEndpointModalKey: Math.random() }
},
hideCreateObjectEndpointModal(state) {
return { ...state, createObjectEndpointModalVisible: false, tagsLoading: true }
},
},
}
Loading