mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
- upgraded react from v16.2.0 - upgraded react-router to v4.2.0 and re-writen the routes - using prettier to format the code - added jest to unit test components/reducers/selectors This provides a skeleton to start of with. Only basic unit test cases are added, remaining needs to be added. In terms of functionality, it provides login, listing and searching buckets. Remaining functionalities will be added in upcoming patches.
This commit is contained in:
committed by
Harshavardhana
parent
76be54551f
commit
9ab6a8035f
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Minio Cloud Storage (C) 2016 Minio, Inc.
|
||||
* Minio Cloud Storage (C) 2016, 2018 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,17 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserHistory } from 'react-router'
|
||||
import JSONrpc from './jsonrpc'
|
||||
import * as actions from './actions'
|
||||
import { minioBrowserPrefix } from './constants.js'
|
||||
import Moment from 'moment'
|
||||
import storage from 'local-storage-fallback'
|
||||
|
||||
export default class Web {
|
||||
constructor(endpoint, dispatch) {
|
||||
class Web {
|
||||
constructor(endpoint) {
|
||||
const namespace = 'Web'
|
||||
this.dispatch = dispatch
|
||||
this.JSONrpc = new JSONrpc({
|
||||
endpoint,
|
||||
namespace
|
||||
@@ -37,7 +34,7 @@ export default class Web {
|
||||
.catch(err => {
|
||||
if (err.status === 401) {
|
||||
storage.removeItem('token')
|
||||
browserHistory.push(`${minioBrowserPrefix}/login`)
|
||||
location.reload()
|
||||
throw new Error('Please re-login.')
|
||||
}
|
||||
if (err.status)
|
||||
@@ -128,3 +125,7 @@ export default class Web {
|
||||
return this.makeCall('ListAllBucketPolicies', args)
|
||||
}
|
||||
}
|
||||
|
||||
const web = new Web(`${window.location.protocol}//${window.location.host}${minioBrowserPrefix}/webrpc`);
|
||||
|
||||
export default web;
|
||||
Reference in New Issue
Block a user