Sean Rhee 5 роки тому
батько
коміт
01f212bc59
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      dashboard/src/main/home/templates/Templates.tsx

+ 5 - 1
dashboard/src/main/home/templates/Templates.tsx

@@ -45,7 +45,11 @@ export default class Templates extends Component<PropsType, StateType> {
       if (err) {
       if (err) {
         this.setState({ loading: false, error: true });
         this.setState({ loading: false, error: true });
       } else {
       } 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 });
+        });
       }
       }
     });
     });
   }
   }