Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavin committed Jan 31, 2019
0 parents commit 4e052b1
Show file tree
Hide file tree
Showing 34 changed files with 9,770 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/vendor
composer.lock
.php_cs.cache
31 changes: 31 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "bhavinjr/auditor-view",
"description": "laravel-auditor view",
"type": "library",
"keywords": [
"mongo", "audit", "laravel", "log", "user", "activity", "log viewer", "activity log viewer", "vue js log viewer", "laravel mongo"
],
"license": "MIT",
"authors": [
{
"name": "bhavin",
"email": "bhavinrudani94@gmail.com"
}
],
"minimum-stability": "stable",
"require": {
"msonowal/laravel-auditor": "^0.2"
},
"autoload": {
"psr-4": {
"Bhavinjr\\Viewdit\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Bhavinjr\\Viewdit\\Providers\\ViewditServiceProvider"
]
}
}
}
25 changes: 25 additions & 0 deletions config/viewdit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Viewdit Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will get attached onto each Viewdit route, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
|
*/
'middleware' => ['web'],

/*
|--------------------------------------------------------------------------
| List resources
|--------------------------------------------------------------------------
| Paginate for the list resources with number of items per page
*/
'paginate_limit' => 25,

];
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"axios": "^0.15.3",
"bootstrap": "^4.0.0-beta.2",
"jquery": "^3.1.0",
"moment": "^2.10.6",
"popper.js": "^1.12",
"vue": "^2.2.0",
"vue-router": "^2.2.0",
"vue2-datepicker": "^2.9.0"
},
"devDependencies": {
"cross-env": "^5.0.1",
"es6-promise": "^4.0.5",
"laravel-mix": "^1.4.2"
}
}
7 changes: 7 additions & 0 deletions public/css/app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/css/app.css.map

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

Binary file added public/img/horizon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/img/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/js/app.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/app.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"/js/app.js": "/js/app.js?id=80af38476508cc981a24",
"/css/app.css": "/css/app.css?id=bcec80ad96af3cb8f987",
"/js/app.js.map": "/js/app.js.map?id=7c557247be41e92ef8b9",
"/css/app.css.map": "/css/app.css.map?id=5d0439ebaab1434c7ea0"
}
39 changes: 39 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Auditor view

Auditor view provides a dashboard for [msonowal/laravel-auditor](https://github.com/msonowal/laravel-auditor) package which is used for an activity log(Mongo DB)

Auditor view is created using Vue Component. Structure and theme from [(laravel/horizon)](https://github.com/laravel/horizon)

## Installation


```bash
composer require bhavinjr/auditor-view
```

After installing Auditor view, publish its assets using the `vendor:publish` Artisan command:


## Dashboard Authorization
Auditor view exposes a dashboard at `/viewdit`. By default, you will only be able to access this dashboard in the local environment. To define a more specific access policy for the dashboard, you should use the `Viewdit::auth` method. The auth method accepts a callback which should return `true` or `false`, indicating whether the user should have access to the Viewdit dashboard:

```bash
use Bhavinjr\Viewdit\Viewdit;

Viewdit::auth(function ($request) {
return //true or false
});

```

## Credits

[laravel/horizon](https://github.com/laravel/horizon) and [msonowal/laravel-auditor](https://github.com/msonowal/laravel-auditor)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)
Binary file added resources/assets/img/horizon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions resources/assets/img/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Vue from 'vue';
import axios from 'axios'
import moment from 'moment';
import router from './router';
import App from './components/App.vue';

window.$ = window.jQuery = require('jquery');

require('bootstrap');

$('body').tooltip({
selector: '[data-toggle=tooltip]'
});

Vue.prototype.$http = axios.create();

Vue.component('loader', require('./components/Loader.vue'));

Vue.config.errorHandler = function (err, vm, info) {
console.error(err);
};

Vue.filter('truncate', function (text, stop, clamp) {
return text.slice(0, stop) + (stop < text.length ? clamp || '...' : '')
})

new Vue({
el: '#root',

router,

/**
* The component's data.
*/
data() {
return {}
},

render: h => h(App),
});
9 changes: 9 additions & 0 deletions resources/assets/js/components/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<router-view/>
</template>

<script>
export default {
name: 'App'
};
</script>
16 changes: 16 additions & 0 deletions resources/assets/js/components/Loader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<div v-if="yes" class="d-flex justify-content-center p-4">
<i class="icon mr-2">
<svg class="fill-primary spin">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#zondicon-refresh"></use>
</svg>
</i>
<span>Loading...</span>
</div>
</template>

<script>
export default {
props: ['yes'],
}
</script>
34 changes: 34 additions & 0 deletions resources/assets/js/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div class="container-fluid">
<div id="mainHeader" class="pt-4 pb-4">
<div class="row">
<div class="col">
<img src="/vendor/viewdit/img/horizon.png">
<strong>Auditor</strong> <span>View</span>
</div>
</div>
</div>

<main class="mt-4 mb-4">
<div class="row">
<div class="col-md-1">
<main-sidebar/>
</div>

<div class="col-md-11">
<slot/>
</div>
</div>
</main>
</div>
</template>

<script>
import MainSidebar from './MainSidebar.vue'
export default {
components: {
MainSidebar,
}
}
</script>
17 changes: 17 additions & 0 deletions resources/assets/js/layouts/MainSidebar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<aside id="mainSidebar">
<ul class="nav flex-column">
<router-link tag="li" to="/dashboard" active-class="active" class="nav-item">
<a class="nav-link">
<i>
<svg>
<use xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="#zondicon-dashboard"></use>
</svg>
</i>
Dashboard
</a>
</router-link>
</ul>
</aside>
</template>
Loading

0 comments on commit 4e052b1

Please sign in to comment.