HM-70 Оживил кнопку удаления апи / изменил способ открытия информации об апи на даблклик (#34)
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user