Skip to content

Commit

Permalink
Merge pull request #22 from pakerwreah/develop
Browse files Browse the repository at this point in the history
v1.7.1
  • Loading branch information
pakerwreah authored Nov 3, 2020
2 parents e8acd23 + 4adb220 commit 450408b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inspector",
"version": "1.7.0",
"version": "1.7.1",
"author": {
"name": "Carlos Enumo",
"email": "[email protected]",
Expand Down
27 changes: 24 additions & 3 deletions src/views/database/Database.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,36 +112,57 @@
}
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)
this.currentdb = index
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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/views/database/TreeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<div class="tree-container">
<v-select class="database-picker"
background-color="panel"
v-model="selected"
:items="databases"
placeholder="No databases available"
prepend-inner-icon="mdi-database"
:append-icon="null"
v-model="selected"
:items="databases"
:disabled="!items"
:readonly="databases.length === 1"
:menu-props="{ offsetY: true, disabled: databases.length < 1 }"
hide-details
hide-selected
filled solo dense flat />
Expand Down

0 comments on commit 450408b

Please sign in to comment.