Merge pull request #12799 from snipe/features/bm_script

Added BM JS
This commit is contained in:
snipe 2023-04-06 18:46:16 -07:00 committed by GitHub
commit 38a2f535ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 954 additions and 885 deletions

View file

@ -43,10 +43,10 @@ return [
'secret' => env('STRIPE_SECRET'),
],
'stunning' => [
'enabled' => env('ENABLE_STUNNING', false),
'app_key' => env('STUNNING_APP_KEY'),
'stripe_id' => env('STUNNING_STRIPE_ID'),
'baremetrics' => [
'enabled' => env('ENABLE_BMPAY', false),
'app_key' => env('BMPAY_PUBLIC_KEY', null),
'stripe_id' => env('BMPAY_STRIPE_ID', null),
],
'google' => [

View file

@ -14,10 +14,12 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->logo)) : config('app.url').'/img/snipe-logo-bug.png' }}">
<link rel="apple-touch-startup-image" href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->logo)) : config('app.url').'/img/snipe-logo-bug.png' }}">
<link rel="shortcut icon" type="image/ico" href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->favicon)) : config('app.url').'/favicon.ico' }} ">
<link rel="apple-touch-icon"
href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->logo)) : config('app.url').'/img/snipe-logo-bug.png' }}">
<link rel="apple-touch-startup-image"
href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->logo)) : config('app.url').'/img/snipe-logo-bug.png' }}">
<link rel="shortcut icon" type="image/ico"
href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->favicon)) : config('app.url').'/favicon.ico' }} ">
<meta name="csrf-token" content="{{ csrf_token() }}">
@ -32,7 +34,8 @@
@if (($snipeSettings) && ($snipeSettings->allow_user_skin==1) && Auth::check() && Auth::user()->present()->skin != '')
<link rel="stylesheet" href="{{ url(mix('css/dist/skins/skin-'.Auth::user()->present()->skin.'.min.css')) }}">
@else
<link rel="stylesheet" href="{{ url(mix('css/dist/skins/skin-'.($snipeSettings->skin!='' ? $snipeSettings->skin : 'blue').'.css')) }}">
<link rel="stylesheet"
href="{{ url(mix('css/dist/skins/skin-'.($snipeSettings->skin!='' ? $snipeSettings->skin : 'blue').'.css')) }}">
@endif
{{-- page level css --}}
@stack('css')
@ -47,6 +50,7 @@
background: linear-gradient(to bottom, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%);
border-color: {{ $snipeSettings->header_color }};
}
.skin-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} .sidebar-menu > li:hover > a, .skin-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} .sidebar-menu > li.active > a {
border-left-color: {{ $snipeSettings->header_color }};
}
@ -88,6 +92,7 @@
<body class="sidebar-mini skin-{{ $snipeSettings->skin!='' ? $snipeSettings->skin : 'blue' }} {{ (session('menu_state')!='open') ? 'sidebar-mini sidebar-collapse' : '' }}">
@endif
<a class="skip-main" href="#main">{{ trans('general.skip_to_main_content') }}</a>
<div class="wrapper">
@ -99,7 +104,8 @@
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button above the compact sidenav -->
<a href="#" style="color: white" class="sidebar-toggle btn btn-white" data-toggle="push-menu" role="button">
<a href="#" style="color: white" class="sidebar-toggle btn btn-white" data-toggle="push-menu"
role="button">
<span class="sr-only">{{ trans('general.toggle_navigation') }}</span>
</a>
<div class="nav navbar-nav navbar-left">
@ -107,14 +113,18 @@
@if ($snipeSettings->brand == '3')
<a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">
<img class="navbar-brand-img"
src="{{ Storage::disk('public')->url($snipeSettings->logo) }}"
alt="{{ $snipeSettings->site_name }} logo">
@endif
{{ $snipeSettings->site_name }}
</a>
@elseif ($snipeSettings->brand == '2')
<a class="logo navbar-brand no-hover" href="{{ config('app.url') }}">
@if ($snipeSettings->logo!='')
<img class="navbar-brand-img" src="{{ Storage::disk('public')->url($snipeSettings->logo) }}" alt="{{ $snipeSettings->site_name }} logo">
<img class="navbar-brand-img"
src="{{ Storage::disk('public')->url($snipeSettings->logo) }}"
alt="{{ $snipeSettings->site_name }} logo">
@endif
<span class="sr-only">{{ $snipeSettings->site_name }}</span>
</a>
@ -130,7 +140,8 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
@can('index', \App\Models\Asset::class)
<li aria-hidden="true"{!! (Request::is('hardware*') ? ' class="active"' : '') !!} tabindex="-1">
<li aria-hidden="true"
{!! (Request::is('hardware*') ? ' class="active"' : '') !!} tabindex="-1">
<a href="{{ url('hardware') }}" accesskey="1" tabindex="-1">
<i class="fas fa-barcode fa-fw" aria-hidden="true"></i>
<span class="sr-only">{{ trans('general.assets') }}</span>
@ -138,7 +149,8 @@
</li>
@endcan
@can('view', \App\Models\License::class)
<li aria-hidden="true"{!! (Request::is('licenses*') ? ' class="active"' : '') !!} tabindex="-1">
<li aria-hidden="true"
{!! (Request::is('licenses*') ? ' class="active"' : '') !!} tabindex="-1">
<a href="{{ route('licenses.index') }}" accesskey="2" tabindex="-1">
<i class="far fa-save fa-fw"></i>
<span class="sr-only">{{ trans('general.licenses') }}</span>
@ -146,7 +158,8 @@
</li>
@endcan
@can('index', \App\Models\Accessory::class)
<li aria-hidden="true"{!! (Request::is('accessories*') ? ' class="active"' : '') !!} tabindex="-1">
<li aria-hidden="true"
{!! (Request::is('accessories*') ? ' class="active"' : '') !!} tabindex="-1">
<a href="{{ route('accessories.index') }}" accesskey="3" tabindex="-1">
<i class="far fa-keyboard fa-fw"></i>
<span class="sr-only">{{ trans('general.accessories') }}</span>
@ -172,11 +185,14 @@
@can('index', \App\Models\Asset::class)
<li>
<form class="navbar-form navbar-left form-horizontal" role="search" action="{{ route('findbytag/hardware') }}" method="get">
<form class="navbar-form navbar-left form-horizontal" role="search"
action="{{ route('findbytag/hardware') }}" method="get">
<div class="col-xs-12 col-md-12">
<div class="col-xs-12 form-group">
<label class="sr-only" for="tagSearch">{{ trans('general.lookup_by_tag') }}</label>
<input type="text" class="form-control" id="tagSearch" name="assetTag" placeholder="{{ trans('general.lookup_by_tag') }}">
<label class="sr-only"
for="tagSearch">{{ trans('general.lookup_by_tag') }}</label>
<input type="text" class="form-control" id="tagSearch" name="assetTag"
placeholder="{{ trans('general.lookup_by_tag') }}">
<input type="hidden" name="topsearch" value="true" id="search">
</div>
<div class="col-xs-1">
@ -277,7 +293,11 @@
</small>
</h2>
<div class="progress xs">
<div class="progress-bar progress-bar-yellow" style="width: {{ $alert_items[$i]['percent'] }}%" role="progressbar" aria-valuenow="{{ $alert_items[$i]['percent'] }}" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-yellow"
style="width: {{ $alert_items[$i]['percent'] }}%"
role="progressbar"
aria-valuenow="{{ $alert_items[$i]['percent'] }}"
aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">{{ $alert_items[$i]['percent'] }}% Complete</span>
</div>
</div>
@ -302,12 +322,14 @@
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@if (Auth::user()->present()->gravatar())
<img src="{{ Auth::user()->present()->gravatar() }}" class="user-image" alt="">
<img src="{{ Auth::user()->present()->gravatar() }}" class="user-image"
alt="">
@else
<i class="fas fa-users" aria-hidden="true"></i>
@endif
<span class="hidden-xs">{{ Auth::user()->first_name }} <strong class="caret"></strong></span>
<span class="hidden-xs">{{ Auth::user()->first_name }} <strong
class="caret"></strong></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
@ -332,7 +354,6 @@
</a></li>
<li>
<a href="{{ route('profile') }}">
<i class="fas fa-user fa-fw" aria-hidden="true"></i>
@ -347,22 +368,24 @@
</li>
@can('self.api')
<li>
<a href="{{ route('user.api') }}">
<i class="fa-solid fa-user-secret fa-fw" aria-hidden="true"></i></i> {{ trans('general.manage_api_keys') }}
<i class="fa-solid fa-user-secret fa-fw"
aria-hidden="true"></i></i> {{ trans('general.manage_api_keys') }}
</a>
</li>
@endcan
<li class="divider"></li>
<li>
<a href="{{ route('logout.get') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<a href="{{ route('logout.get') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<i class="fa fa-sign-out fa-fw"></i> {{ trans('general.logout') }}
</a>
<form id="logout-form" action="{{ route('logout.post') }}" method="POST" style="display: none;">
<form id="logout-form" action="{{ route('logout.post') }}" method="POST"
style="display: none;">
{{ csrf_field() }}
</form>
@ -383,7 +406,8 @@
</ul>
</div>
</nav>
<a href="#" style="float:left" class="sidebar-toggle-mobile visible-xs btn" data-toggle="push-menu" role="button">
<a href="#" style="float:left" class="sidebar-toggle-mobile visible-xs btn" data-toggle="push-menu"
role="button">
<span class="sr-only">{{ trans('general.toggle_navigation') }}</span>
<i class="fas fa-bars"></i>
</a>
@ -399,7 +423,8 @@
@can('admin')
<li {!! (\Request::route()->getName()=='home' ? ' class="active"' : '') !!} class="firstnav">
<a href="{{ route('home') }}">
<i class="fas fa-tachometer-alt fa-fw" aria-hidden="true"></i> <span>{{ trans('general.dashboard') }}</span>
<i class="fas fa-tachometer-alt fa-fw" aria-hidden="true"></i>
<span>{{ trans('general.dashboard') }}</span>
</a>
</li>
@endcan
@ -420,8 +445,10 @@
<?php $status_navs = \App\Models\Statuslabel::where('show_in_nav', '=', 1)->withCount('assets as asset_count')->get(); ?>
@if (count($status_navs) > 0)
@foreach ($status_navs as $status_nav)
<li{!! (Request::is('statuslabels/'.$status_nav->id) ? ' class="active"' : '') !!}><a href="{{ route('statuslabels.show', ['statuslabel' => $status_nav->id]) }}">
<i class="fas fa-circle text-grey fa-fw" aria-hidden="true"{!! ($status_nav->color!='' ? ' style="color: '.e($status_nav->color).'"' : '') !!}></i>
<li{!! (Request::is('statuslabels/'.$status_nav->id) ? ' class="active"' : '') !!}>
<a href="{{ route('statuslabels.show', ['statuslabel' => $status_nav->id]) }}">
<i class="fas fa-circle text-grey fa-fw"
aria-hidden="true"{!! ($status_nav->color!='' ? ' style="color: '.e($status_nav->color).'"' : '') !!}></i>
{{ $status_nav->name }} ({{ $status_nav->asset_count }})</a></li>
@endforeach
@endif
@ -443,31 +470,42 @@
({{ (isset($total_rtd_sidebar)) ? $total_rtd_sidebar : '' }})
</a>
</li>
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Pending') }}"><i class="far fa-circle text-orange fa-fw"></i>
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a
href="{{ url('hardware?status=Pending') }}"><i
class="far fa-circle text-orange fa-fw"></i>
{{ trans('general.all') }}
{{ trans('general.pending') }}
({{ (isset($total_pending_sidebar)) ? $total_pending_sidebar : '' }})
</a>
</li>
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a href="{{ url('hardware?status=Undeployable') }}"><i class="fas fa-times text-red fa-fw"></i>
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a
href="{{ url('hardware?status=Undeployable') }}"><i
class="fas fa-times text-red fa-fw"></i>
{{ trans('general.all') }}
{{ trans('general.undeployable') }}
({{ (isset($total_undeployable_sidebar)) ? $total_undeployable_sidebar : '' }})
({{ (isset($total_undeployable_sidebar)) ? $total_undeployable_sidebar : '' }}
)
</a>
</li>
<li{!! (Request::query('status') == 'byod' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=byod') }}"><i class="fas fa-times text-red fa-fw"></i>
<li{!! (Request::query('status') == 'byod' ? ' class="active"' : '') !!}><a
href="{{ url('hardware?status=byod') }}"><i
class="fas fa-times text-red fa-fw"></i>
{{ trans('general.all') }}
{{ trans('general.byod') }}
({{ (isset($total_byod_sidebar)) ? $total_byod_sidebar : '' }})
</a>
</li>
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fas fa-times text-red fa-fw"></i>
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a
href="{{ url('hardware?status=Archived') }}"><i
class="fas fa-times text-red fa-fw"></i>
{{ trans('general.all') }}
{{ trans('admin/hardware/general.archived') }}
({{ (isset($total_archived_sidebar)) ? $total_archived_sidebar : '' }})
</a>
</li>
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Requestable') }}"><i class="fas fa-check text-blue fa-fw"></i>
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a
href="{{ url('hardware?status=Requestable') }}"><i
class="fas fa-check text-blue fa-fw"></i>
{{ trans('admin/hardware/general.requestable') }}
</a>
</li>
@ -700,7 +738,8 @@
</a>
</li>
<li><a href="{{ route('reports.audit') }}" {{ (Request::is('reports.audit') ? ' class="active"' : '') }}>
<li>
<a href="{{ route('reports.audit') }}" {{ (Request::is('reports.audit') ? ' class="active"' : '') }}>
{{ trans('general.audit_report') }}</a>
</li>
<li>
@ -755,11 +794,14 @@
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" role="main" id="setting-list">
<barepay></barepay>
@if ($debug_in_production)
<div class="row" style="margin-bottom: 0px; background-color: red; color: white; font-size: 15px;">
<div class="col-md-12" style="margin-bottom: 0px; background-color: #b50408 ; color: white; padding: 10px 20px 10px 30px; font-size: 16px;">
<i class="fas fa-exclamation-triangle fa-3x pull-left"></i> <strong>{{ strtoupper(trans('general.debug_warning')) }}:</strong>
<div class="col-md-12"
style="margin-bottom: 0px; background-color: #b50408 ; color: white; padding: 10px 20px 10px 30px; font-size: 16px;">
<i class="fas fa-exclamation-triangle fa-3x pull-left"></i>
<strong>{{ strtoupper(trans('general.debug_warning')) }}:</strong>
{!! trans('general.debug_warning_text') !!}
</div>
</div>
@ -781,7 +823,6 @@
</div>
</section>
@ -815,19 +856,25 @@
<div class="pull-right hidden-xs">
@if ($snipeSettings->version_footer!='off')
@if (($snipeSettings->version_footer=='on') || (($snipeSettings->version_footer=='admin') && (Auth::user()->isSuperUser()=='1')))
&nbsp; <strong>Version</strong> {{ config('version.app_version') }} - build {{ config('version.build_version') }} ({{ config('version.branch') }})
&nbsp; <strong>Version</strong> {{ config('version.app_version') }} -
build {{ config('version.build_version') }} ({{ config('version.branch') }})
@endif
@endif
@if ($snipeSettings->support_footer!='off')
@if (($snipeSettings->support_footer=='on') || (($snipeSettings->support_footer=='admin') && (Auth::user()->isSuperUser()=='1')))
<a target="_blank" class="btn btn-default btn-xs" href="https://snipe-it.readme.io/docs/overview" rel="noopener">{{ trans('general.user_manual') }}</a>
<a target="_blank" class="btn btn-default btn-xs" href="https://snipeitapp.com/support/" rel="noopener">{{ trans('general.bug_report') }}</a>
<a target="_blank" class="btn btn-default btn-xs"
href="https://snipe-it.readme.io/docs/overview"
rel="noopener">{{ trans('general.user_manual') }}</a>
<a target="_blank" class="btn btn-default btn-xs" href="https://snipeitapp.com/support/"
rel="noopener">{{ trans('general.bug_report') }}</a>
@endif
@endif
@if ($snipeSettings->privacy_policy_link!='')
<a target="_blank" class="btn btn-default btn-xs" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
<a target="_blank" class="btn btn-default btn-xs" rel="noopener"
href="{{ $snipeSettings->privacy_policy_link }}"
target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
@ -839,17 +886,19 @@
@endif
<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is open source software, made with <i class="fas fa-heart" style="color: #a94442; font-size: 10px" aria-hidden="true"></i><span class="sr-only">love</span> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a>.
<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is open source software,
made with <i class="fas fa-heart" style="color: #a94442; font-size: 10px" aria-hidden="true"></i><span
class="sr-only">love</span> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a>.
</footer>
</div><!-- ./wrapper -->
<!-- end main container -->
<div class="modal modal-danger fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal modal-danger fade" id="dataConfirmModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -862,8 +911,10 @@
{{ csrf_field() }}
{{ method_field('DELETE') }}
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('general.cancel') }}</button>
<button type="submit" class="btn btn-outline" id="dataConfirmOK">{{ trans('general.yes') }}</button>
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">{{ trans('general.cancel') }}</button>
<button type="submit" class="btn btn-outline"
id="dataConfirmOK">{{ trans('general.yes') }}</button>
</form>
</div>
</div>
@ -871,7 +922,8 @@
</div>
<div class="modal modal-warning fade" id="restoreConfirmModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">
<div class="modal modal-warning fade" id="restoreConfirmModal" tabindex="-1" role="dialog"
aria-labelledby="confirmModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -884,8 +936,10 @@
{{ csrf_field() }}
{{ method_field('POST') }}
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('general.cancel') }}</button>
<button type="submit" class="btn btn-outline" id="dataConfirmOK">{{ trans('general.yes') }}</button>
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">{{ trans('general.cancel') }}</button>
<button type="submit" class="btn btn-outline"
id="dataConfirmOK">{{ trans('general.yes') }}</button>
</form>
</div>
</div>
@ -918,9 +972,6 @@
});
$(function () {
$('[data-toggle="tooltip"]').tooltip();
@ -955,7 +1006,6 @@
});
</script>
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
@ -964,8 +1014,10 @@
</script>
@endif
@include('partials.bpay')
@livewireScripts
</body>
</html>

View file

@ -0,0 +1,17 @@
@can('admin')
@if ((config('services.baremetrics.enabled')=='true') && (config('services.baremetrics.app_key')) && (config('services.baremetrics.stripe_id')))
<script>
!function(){if(window.barepay&&window.barepay.created)window.console&&console.error&&console.error("Barepay snippet included twice.");else{window.barepay={created:!0};var a=document.createElement("script");a.src="https://baremetrics-dunning.baremetrics.com/js/application.js",a.async=!0;var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b),
window.barepay.params = {
access_token_id: "{{ config('services.baremetrics.app_key') }}", // Your Recover API public key
customer_oid: "{{ config('services.baremetrics.stripe_id') }}" // Customer ID whose card you're looking to update
}
}}();
</script>
@else
FARTS
@endif
@endcan