fix generate script, fix some style bugs, add settings page