mirror of https://github.com/openspug/spug
U 优化发布申请Tag排序及展示
parent
b08a3e7000
commit
122188c35e
|
@ -27,8 +27,14 @@ class Git:
|
|||
'author': ref.tag.tagger.name,
|
||||
'date': ref.tag.tagged_date,
|
||||
'message': ref.tag.message.strip()
|
||||
} if ref.tag else {}
|
||||
return branches, tags
|
||||
} if ref.tag else {
|
||||
'id': ref.commit.binsha.hex(),
|
||||
'author': ref.commit.author.name,
|
||||
'date': ref.commit.authored_date,
|
||||
'message': ref.commit.message.strip()
|
||||
}
|
||||
tags = sorted(tags.items(), key=lambda x: x[1]['date'], reverse=True)
|
||||
return branches, dict(tags)
|
||||
|
||||
def _get_repo(self, git_repo, repo_dir):
|
||||
if os.path.exists(repo_dir):
|
||||
|
|
|
@ -79,7 +79,7 @@ class Ext1Form extends React.Component {
|
|||
};
|
||||
|
||||
switchType = (v) => {
|
||||
this.setState({git_type: v, extra1: null}, this._initExtra1)
|
||||
this.setState({git_type: v, extra1: undefined}, this._initExtra1)
|
||||
};
|
||||
|
||||
switchExtra1 = (v) => {
|
||||
|
@ -157,7 +157,7 @@ class Ext1Form extends React.Component {
|
|||
Object.keys(branches || {}).map(b => <Select.Option key={b} value={b}>{b}</Select.Option>)
|
||||
) : (
|
||||
Object.entries(tags || {}).map(([tag, info]) => (
|
||||
<Select.Option key={tag} value={tag}>{tag} {info.author}</Select.Option>
|
||||
<Select.Option key={tag} value={tag}>{tag} {info.author} {info.message}</Select.Option>
|
||||
))
|
||||
)}
|
||||
</Select>
|
||||
|
|
Loading…
Reference in New Issue