|
|
@@ -45,7 +45,11 @@ export default class Templates extends Component<PropsType, StateType> {
|
|
|
if (err) {
|
|
|
this.setState({ loading: false, error: true });
|
|
|
} else {
|
|
|
- this.setState({ porterTemplates: res.data, loading: false, error: false });
|
|
|
+ this.setState({ porterTemplates: res.data, error: false }, () => {
|
|
|
+ this.state.porterTemplates.sort((a, b) => (a.name > b.name) ? 1 : -1);
|
|
|
+ this.state.porterTemplates.sort((a,b) => (a.name === 'docker') ? -1 : (b.name === 'docker') ? 1 : 0);
|
|
|
+ this.setState({ loading: false });
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
}
|