diff --git a/README.md b/README.md index fcda6b9..ab24f54 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ # InspectorWeb -Web interface for the Inspector project. +[![release](https://img.shields.io/github/v/release/pakerwreah/InspectorWeb)](https://github.com/pakerwreah/InspectorWeb/releases/latest) +[![vue](https://img.shields.io/badge/Vue.js-2.6-brightgreen.svg?logo=vue.js)](https://vuejs.org) +[![vuetify](https://img.shields.io/badge/Vuetify-2.1-4695EF.svg?logo=vuetify&logoColor=5cbbf6)](https://vuetifyjs.com) + +### Web interface for the Inspector project. Tool to inspect SQLite databases and intercept network requests from mobile applications. https://github.com/pakerwreah/Inspector +[![inspector](https://img.shields.io/github/v/release/pakerwreah/Inspector?label=Inspector)](https://github.com/pakerwreah/Inspector/releases/latest) + ![alt text](screenshots/database.png "Database") ![alt text](screenshots/network.png "Network") diff --git a/package-lock.json b/package-lock.json index 0ea5b09..8445350 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "inspector", - "version": "1.7.0", + "version": "1.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b88cab7..16c2eba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inspector", - "version": "1.7.0", + "version": "1.7.1", "author": { "name": "Carlos Enumo", "email": "paker_wreah@hotmail.com", diff --git a/src/views/database/Database.vue b/src/views/database/Database.vue index c6d6859..b851b0c 100644 --- a/src/views/database/Database.vue +++ b/src/views/database/Database.vue @@ -112,28 +112,45 @@ } this.loading = false }, + shouldRetry (error) { + return ![400, 500].includes(get(error, 'response.status', 500)) + }, async getDatabases () { const m_id = this.m_id while (m_id === this.m_id) { if (this.$http.defaults.baseURL) { try { + this.error = null this.progress = -1 const r = await this.$http.get('/database/list') this.databases = r.data.databases this.currentdb = r.data.current - await this.loadSchema(m_id) + if (this.databases.length) { + await this.loadSchema(m_id) + } else { + this.schema = { tables: {} } + } return } catch (error) { + if (!this.shouldRetry(error)) { + this.schema = { tables: {} } + this.error = get(error, 'response.data.msg') + return + } } } await sleep(3000) } }, async selectDB (index) { + if (index < 0) { + return this.getDatabases().catch(() => false) + } const m_id = this.m_id const max_tries = 3 for (let tries = 0; tries < max_tries && m_id === this.m_id; tries++) { try { + this.error = null this.progress = -1 this.schema = {} await this.$http.put('/database/current/' + index) @@ -141,7 +158,11 @@ await this.loadSchema(m_id) return } catch (error) { - if (tries < max_tries - 1) { + if (!this.shouldRetry(error)) { + this.schema = { tables: {} } + this.error = get(error, 'response.data.msg') + return + } else if (tries < max_tries - 1) { await sleep(500) } else { // start over @@ -239,7 +260,7 @@ return } catch (error) { - if (tries < max_tries - 1) { + if (tries < max_tries - 1 && this.shouldRetry(error)) { await sleep(500) } else { throw error diff --git a/src/views/database/TreeView.vue b/src/views/database/TreeView.vue index 39b0832..008eb2f 100644 --- a/src/views/database/TreeView.vue +++ b/src/views/database/TreeView.vue @@ -2,12 +2,14 @@