PHP Classes

File: resources/js/components/Logs/LogsTool.vue

Recommend this page to a friend!
  Classes of Nyi Nyi Lwin  >  Laravel Nova Log Viewer  >  resources/js/components/Logs/LogsTool.vue  >  Download  
File: resources/js/components/Logs/LogsTool.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Nova Log Viewer
Display information about logs in Laravel Nova
Author: By
Last change:
Date: 3 years ago
Size: 4,019 bytes


Class file image Download
        <heading class="mb-6">Nova Log Viewer</heading>

        <card class="flex flex-col items-center justify-center">
            <table class="table w-full" cellpadding="0" cellspacing="0">
                        <th v-for="(header, key) in headers" :key="key">
                            <span :style="{ 'background-color' : key !== 'date' ? getColor(key) : '#1976D2' }" class="inline-block p-1  text-sm text-white">
                                {{ header }}

                        v-for="(log, date) in logs"

        <card class="flex mt-6 justify-end" v-if="prev != null || next != null">
            <div class="inline-flex">
                <button @click="getListLogs(prev)" v-if="prev != null" class="bg-grey-light hover:bg-grey text-grey-darkest font-bold py-2 px-4 rounded-l">
                <button @click="getListLogs(next)" v-if="next != null" class="bg-grey-light hover:bg-grey text-grey-darkest font-bold py-2 px-4 rounded-r">

        <portal to="modals">
            <transition name="fade">
                    <div class="p-8">
                        <heading :level="2" class="mb-6">
                            Delete Log File
                        <p class="text-80 leading-normal">
                            Are you sure you want to delete this log file {{ }}?

import axios from 'axios';
import Log from './Log';
import color from '../../utils/color'

export default {
    data() {
        return {
            headers: null,
            rows: null,
            logs: null,
            deleteModalOpen: false,
            deleting: null,
            next: null,
            prev: null,
    components: {
    mounted() {
    methods: {
        getColor (level) {
            return color(level)
        async getListLogs(url) {
            url = url || '/nova-vendor/php-junior/nova-log-viewer/get_list_logs';
            const { data } = await axios.get(url);
            this.headers = data.headers;
            this.rows = data.rows;
            this.logs =;
            this.prev = data.rows.prev_page_url;
   = data.rows.next_page_url;

        openDeleteModal(log) {
            this.deleteModalOpen = true;
            this.deleting = log;

        closeDeleteModal() {
            this.deleteModalOpen = false;
            this.deleting = null;

        confirmDelete() {
                method: 'delete',
                url: '/nova-vendor/php-junior/nova-log-viewer/delete',
                data: {
            }).then(res => {
                this.deleteModalOpen = false;
                delete this.logs[];

<style scoped>
For more information send a message to info at phpclasses dot org.