-
Notifications
You must be signed in to change notification settings - Fork 446
Add admin heal api and ui #142
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
Conversation
7f2adab
to
cb57152
Compare
// interface HealStatus { | ||
// beforeHeal: number[]; | ||
// afterHeal: number[]; | ||
// objectsHealed: number; | ||
// objectsScanned: number; | ||
// healDuration: number; | ||
// sizeScanned: string; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this code is not need it please delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
interface colorH { | ||
[Green: string]: number; | ||
Yellow: number; | ||
Red: number; | ||
Grey: number; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be moved to the heal/types.ts file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
restapi/admin_heal.go
Outdated
if req.FormValue("force-start") != "" { | ||
boolVal, err := strconv.ParseBool(req.FormValue("force-start")) | ||
if err != nil { | ||
return healOptions{}, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return nil
instead of an empty
struct? in the case of yes func
return should be changed to *healOptions
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
restapi/admin_heal.go
Outdated
|
||
// getHealOptionsFromReq return options from request for healing process | ||
// path come as : `/heal/bucket1` and query params come on request form | ||
func getHealOptionsFromReq(req *http.Request) (hOptions healOptions, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should return pointer to struct to be consistent with the functions called by the other endpoints
func getHealOptionsFromReq(req *http.Request) (hOptions healOptions, err error) { | |
func getHealOptionsFromReq(req *http.Request) (hOptions *healOptions, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
createStyles({ | ||
watchList: { | ||
background: "white", | ||
maxHeight: "400px", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use only numeric values in createStyles function when using pixels
maxHeight: "400px", | |
maxHeight: 400, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
maxHeight: "400px", | ||
overflow: "auto", | ||
"& ul": { | ||
margin: "4px", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
margin: "4px", | |
margin: 4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
overflow: "auto", | ||
"& ul": { | ||
margin: "4px", | ||
padding: "0px", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding: "0px", | |
padding: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
borderRadius: 5, | ||
marginLeft: 10, | ||
textAlign: "left", | ||
minWidth: "206px", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minWidth: "206px", | |
minWidth: 206, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
interface colorH { | ||
[Green: string]: number; | ||
Yellow: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we have the same structure as Green for all the elements in the interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it seems that it should be only on the first one which will define the signature index :
else it shows Duplicate string index signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Test Steps:
Heal
minio server ./dat{1...4}
rm -rf ./dat4