Skip to content

Commit

Permalink
Update build file & remove unwanted code
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiDy committed Oct 1, 2024
1 parent 85d4073 commit a5fff49
Show file tree
Hide file tree
Showing 20 changed files with 122 additions and 1,056 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextbuild/activity-tracker",
"description": "Agent activity tracker for laravel.",
"description": "A Laravel package for tracking user activity",
"keywords": ["laravel", "monitoring", "tracker"],
"license": "MIT",
"authors": [
Expand Down
39 changes: 0 additions & 39 deletions database/factories/EntryModelFactory.php

This file was deleted.

2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/app.js": "/app.js?id=8e5463711a711dcf3b6e373cede2fdf3",
"/app.js": "/app.js?id=35df8bc3315480e6c248649da992415c",
"/app.css": "/app.css?id=0e04a1f8062bc3dc5ac8278d633d09e6"
}
4 changes: 2 additions & 2 deletions resources/js/screens/visitors/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@
{{ data.item.content?.response_status }}
</template>
<template #created_at="data">
<!-- {{ dateFormat(data.item.created_at, "hh:MM:ss TT, mm-dd-yyyy") }} -->
{{ dateFormat(data.item.created_at, "mmmm dS yyyy, hh:MM:ss TT") }}
{{ timeAgo(data.item.created_at) }}
</template>
<template #action="data">
<router-link :to="`/visitors/${entry.uuid}/requests/${data.item.uuid}`">
Expand All @@ -180,6 +179,7 @@ import Tab from '@/components/Tab.vue';
import axios from 'axios';
import { useRoute } from 'vue-router';
import dateFormat, { masks } from "dateformat";
import { timeAgo } from '@/base.js';

import {
ArrowRightCircleIcon,
Expand Down
7 changes: 2 additions & 5 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

use Illuminate\Support\Facades\Route;

// Dump entries...
Route::post('/activity-tracker-api/dump', 'DumpController@index');

// Requests entries...
Route::get('/activity-tracker-api/requests', 'RequestsController@index');
Route::get('/activity-tracker-api/requests/{telescopeEntryId}', 'RequestsController@show');
Route::get('/activity-tracker-api/requests/{uuid}', 'RequestsController@show');
Route::get('/activity-tracker-api/visitor-ip/{uuid}/requests', 'RequestsController@requestIndex');
Route::get('/activity-tracker-api/visitor-ip/{visitor_uuid}/requests/{request_uuid}', 'RequestsController@requestShow');

// Toggle Recording...
Route::post('/activity-tracker-api/toggle-recording', 'RecordingController@toggle');

// Clear Entries...
Route::delete('/activity-tracker-api/entries', 'EntriesController@destroy');
Route::delete('/activity-tracker-api/dump', 'RequestsController@destroy');

Route::get('/{view?}', 'HomeController@index')->where('view', '(.*)')->name('activity-tracker');
Binary file modified src/.DS_Store
Binary file not shown.
219 changes: 7 additions & 212 deletions src/ActivityTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static function start($app)
(static::runningApprovedArtisanCommand($app) ||
static::handlingApprovedRequest($app))
) {
static::startRecording($loadMonitoredTags = false);
static::startRecording();
}
}

Expand Down Expand Up @@ -238,15 +238,10 @@ protected static function requestIsToApprovedUri($request)
/**
* Start recording entries.
*
* @param bool $loadMonitoredTags
* @return void
*/
public static function startRecording($loadMonitoredTags = true)
public static function startRecording()
{
if ($loadMonitoredTags) {
app(EntriesRepository::class)->loadMonitoredTags();
}

$recordingPaused = false;

try {
Expand Down Expand Up @@ -335,173 +330,6 @@ protected static function record(string $type, IncomingEntry $entry)
});
}

/**
* Record the given entry update.
*
* @param \NextBuild\ActivityTracker\EntryUpdate $update
* @return void
*/
public static function recordUpdate(EntryUpdate $update)
{
if (static::$shouldRecord) {
static::$updatesQueue[] = $update;
}
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordBatch($entry)
{
static::record(EntryType::BATCH, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordCache(IncomingEntry $entry)
{
static::record(EntryType::CACHE, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordCommand(IncomingEntry $entry)
{
static::record(EntryType::COMMAND, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordDump(IncomingEntry $entry)
{
static::record(EntryType::DUMP, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordEvent(IncomingEntry $entry)
{
static::record(EntryType::EVENT, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordException(IncomingEntry $entry)
{
static::record(EntryType::EXCEPTION, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordGate(IncomingEntry $entry)
{
static::record(EntryType::GATE, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordJob($entry)
{
static::record(EntryType::JOB, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordLog(IncomingEntry $entry)
{
static::record(EntryType::LOG, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordMail(IncomingEntry $entry)
{
static::record(EntryType::MAIL, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordNotification($entry)
{
static::record(EntryType::NOTIFICATION, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordQuery(IncomingEntry $entry)
{
static::record(EntryType::QUERY, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordModelEvent(IncomingEntry $entry)
{
static::record(EntryType::MODEL, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordRedis(IncomingEntry $entry)
{
static::record(EntryType::REDIS, $entry);
}

/**
* Record the given entry.
*
Expand All @@ -513,39 +341,6 @@ public static function recordRequest(IncomingEntry $entry)
static::record(EntryType::REQUEST, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordScheduledCommand(IncomingEntry $entry)
{
static::record(EntryType::SCHEDULED_TASK, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordView(IncomingEntry $entry)
{
static::record(EntryType::VIEW, $entry);
}

/**
* Record the given entry.
*
* @param \NextBuild\ActivityTracker\IncomingEntry $entry
* @return void
*/
public static function recordClientRequest(IncomingEntry $entry)
{
static::record(EntryType::CLIENT_REQUEST, $entry);
}

/**
* Flush all entries in the queue.
*
Expand Down Expand Up @@ -786,12 +581,12 @@ public static function night()
* @param \Closure $callback
* @return static
*/
public static function avatar(Closure $callback)
{
Avatar::register($callback);
// public static function avatar(Closure $callback)
// {
// Avatar::register($callback);

return new static;
}
// return new static;
// }

/**
* Get the default JavaScript variables for Activity Tracker.
Expand Down
Loading

0 comments on commit a5fff49

Please sign in to comment.