()
| 92 | } |
| 93 | |
| 94 | #createAPISetting() { |
| 95 | this.apisTable = new EditableTable<APICredential>([ |
| 96 | {title: 'Type', key: 'type'}, |
| 97 | {title: 'Name', key: 'name'}, |
| 98 | ]); |
| 99 | this.apisTable.view.setStyle({ |
| 100 | gap: basicStyle.padding, |
| 101 | padding: basicStyle.padding, |
| 102 | }); |
| 103 | |
| 104 | this.apisTable.onRemoveRow.connect((index, credential) => apiManager.removeCredentialById(credential.id)); |
| 105 | this.apisTable.onEditRow.connect((index, credential) => { |
| 106 | const win = new NewAPIWindow(credential); |
| 107 | win.window.center(); |
| 108 | win.window.activate(); |
| 109 | }); |
| 110 | |
| 111 | const addButton = this.apisTable.buttonsArea.addButton('Add'); |
| 112 | addButton.onClick = () => windowManager.showNamedWindow('newAPI'); |
| 113 | |
| 114 | // Fill table with existing credentials. |
| 115 | const update = () => this.apisTable.setData(apiManager.getCredentials()); |
| 116 | update(); |
| 117 | this.connections.add(apiManager.onAddCredential.connect(update)); |
| 118 | this.connections.add(apiManager.onUpdateCredential.connect(update)); |
| 119 | this.connections.add(apiManager.onRemoveCredential.connect(update)); |
| 120 | |
| 121 | return this.apisTable.view; |
| 122 | } |
| 123 | |
| 124 | #createExtensionSetting() { |
| 125 | this.extensionsTable = new EditableTable<Extension>([ |
no test coverage detected