|
|
@ -26,6 +26,8 @@ export const SET_BUCKETS = 'SET_BUCKETS' |
|
|
|
export const ADD_BUCKET = 'ADD_BUCKET' |
|
|
|
export const ADD_BUCKET = 'ADD_BUCKET' |
|
|
|
export const SET_VISIBLE_BUCKETS = 'SET_VISIBLE_BUCKETS' |
|
|
|
export const SET_VISIBLE_BUCKETS = 'SET_VISIBLE_BUCKETS' |
|
|
|
export const SET_OBJECTS = 'SET_OBJECTS' |
|
|
|
export const SET_OBJECTS = 'SET_OBJECTS' |
|
|
|
|
|
|
|
export const APPEND_OBJECTS = 'APPEND_OBJECTS' |
|
|
|
|
|
|
|
export const RESET_OBJECTS = 'RESET_OBJECTS' |
|
|
|
export const SET_STORAGE_INFO = 'SET_STORAGE_INFO' |
|
|
|
export const SET_STORAGE_INFO = 'SET_STORAGE_INFO' |
|
|
|
export const SET_SERVER_INFO = 'SET_SERVER_INFO' |
|
|
|
export const SET_SERVER_INFO = 'SET_SERVER_INFO' |
|
|
|
export const SHOW_MAKEBUCKET_MODAL = 'SHOW_MAKEBUCKET_MODAL' |
|
|
|
export const SHOW_MAKEBUCKET_MODAL = 'SHOW_MAKEBUCKET_MODAL' |
|
|
@ -240,15 +242,28 @@ export const setVisibleBuckets = visibleBuckets => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const setObjects = (objects, marker, istruncated) => { |
|
|
|
const appendObjects = (objects, marker, istruncated) => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: SET_OBJECTS, |
|
|
|
type: APPEND_OBJECTS, |
|
|
|
objects, |
|
|
|
objects, |
|
|
|
marker, |
|
|
|
marker, |
|
|
|
istruncated |
|
|
|
istruncated |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const setObjects = (objects) => { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
type: SET_OBJECTS, |
|
|
|
|
|
|
|
objects, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const resetObjects = () => { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
type: RESET_OBJECTS |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const setCurrentBucket = currentBucket => { |
|
|
|
export const setCurrentBucket = currentBucket => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: SET_CURRENT_BUCKET, |
|
|
|
type: SET_CURRENT_BUCKET, |
|
|
@ -316,7 +331,7 @@ export const listObjects = () => { |
|
|
|
object.name = object.name.replace(`${currentPath}`, ''); |
|
|
|
object.name = object.name.replace(`${currentPath}`, ''); |
|
|
|
return object |
|
|
|
return object |
|
|
|
}) |
|
|
|
}) |
|
|
|
dispatch(setObjects(objects, res.nextmarker, res.istruncated)) |
|
|
|
dispatch(appendObjects(objects, res.nextmarker, res.istruncated)) |
|
|
|
dispatch(setPrefixWritable(res.writable)) |
|
|
|
dispatch(setPrefixWritable(res.writable)) |
|
|
|
dispatch(setLoadBucket('')) |
|
|
|
dispatch(setLoadBucket('')) |
|
|
|
dispatch(setLoadPath('')) |
|
|
|
dispatch(setLoadPath('')) |
|
|
@ -337,7 +352,7 @@ export const listObjects = () => { |
|
|
|
export const selectPrefix = prefix => { |
|
|
|
export const selectPrefix = prefix => { |
|
|
|
return (dispatch, getState) => { |
|
|
|
return (dispatch, getState) => { |
|
|
|
const {currentBucket, web} = getState() |
|
|
|
const {currentBucket, web} = getState() |
|
|
|
dispatch(setObjects([], "", false)) |
|
|
|
dispatch(resetObjects()) |
|
|
|
dispatch(setLoadPath(prefix)) |
|
|
|
dispatch(setLoadPath(prefix)) |
|
|
|
web.ListObjects({ |
|
|
|
web.ListObjects({ |
|
|
|
bucketName: currentBucket, |
|
|
|
bucketName: currentBucket, |
|
|
@ -352,7 +367,7 @@ export const selectPrefix = prefix => { |
|
|
|
object.name = object.name.replace(`${prefix}`, ''); |
|
|
|
object.name = object.name.replace(`${prefix}`, ''); |
|
|
|
return object |
|
|
|
return object |
|
|
|
}) |
|
|
|
}) |
|
|
|
dispatch(setObjects( |
|
|
|
dispatch(appendObjects( |
|
|
|
objects, |
|
|
|
objects, |
|
|
|
res.nextmarker, |
|
|
|
res.nextmarker, |
|
|
|
res.istruncated |
|
|
|
res.istruncated |
|
|
|