Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Dump visibility toggling, search, etc. #959

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions resources/js/screens/dumps/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script type="text/ecmascript-6">
import axios from 'axios';
import sfdump from './sfdump';

export default {
/**
Expand All @@ -12,7 +13,9 @@
ready: false,
newEntriesTimeout: null,
newEntriesTimer: 2000,
recordingStatus: 'enabled'
recordingStatus: 'enabled',
sfDump: null,
triggered: [],
};
},

Expand All @@ -23,6 +26,8 @@
mounted() {
document.title = "Dumps - Telescope";

this.initDumperJs();

this.loadEntries();

},
Expand All @@ -44,6 +49,8 @@
this.entries = response.data.entries;
this.recordingStatus = response.data.status;

this.$nextTick(() => this.triggerDumps());

this.checkForNewEntries();
});
},
Expand All @@ -67,6 +74,33 @@
})
}, this.newEntriesTimer);
},


/**
* Initialize the VarDumper JS functions.
*/
initDumperJs() {
this.sfDump = sfdump(document);
},


/**
* Trigger the Sfdump() for every newly dumped <pre> tag.
*/
triggerDumps() {
const divs = this.$refs.dumps;

if (! divs) return;

divs.forEach(el => {
const id = el.children[0].id;

if (this.triggered.includes(id)) return;

this.sfDump(id);
this.triggered.push(id);
});
}
}
}
</script>
Expand Down Expand Up @@ -126,7 +160,7 @@
<span class="text-white text-monospace" style="font-size: 12px;">{{timeAgo(entry.created_at)}}</span>
</div>

<div v-html="entry.content.dump"></div>
<div v-html="entry.content.dump" ref="dumps"></div>
</div>
</transition-group>
</div>
Expand Down
Loading