HM-70 Оживил кнопку удаления апи / изменил способ открытия информации об апи на даблклик (#34)

This commit is contained in:
mrPadre
2020-07-29 23:28:29 +03:00
committed by GitHub
parent 0d0342926f
commit a9282a38e5
7 changed files with 61 additions and 22 deletions

View File

@ -2,21 +2,30 @@ import Component from '../component/index';
import TableComponent from '../table-component';
import storageApi from '../../api/StorageServiceAPI';
import FilterApiComponent from '../search-component/index';
import ApiInfoComponent from '../api-info-component/index';
class ApiPage extends Component {
constructor (mainNodeSelector, parentNode) {
super(mainNodeSelector, parentNode);
this.filterBox = new FilterApiComponent(this.mainNode);
this.storageListTable = new TableComponent(this.mainNode);
this.infoBox = new ApiInfoComponent();
this.addSubscribe(this.storageListTable, 'showInfo', (obj) => {
this.infoBox.render(obj);
});
const initStorageListTable = async () => {
const list = await storageApi.request();
const storageListTable = new TableComponent(this.mainNode);
return storageListTable.render(list);
};
this.initStorageListTable();
initStorageListTable();
this.addSubscribe(this.infoBox, 'deleteApi', () => {
this.initStorageListTable();
});
}
initStorageListTable = async () => {
const list = await storageApi.request();
return this.storageListTable.render(list);
};
}
export default ApiPage;