Push 'Account' and 'Security' pages as well as 'My Servers'

This commit is contained in:
Dane Everitt 2017-01-15 14:09:57 -05:00
parent 1c85b1fbc4
commit 2fc852c6a4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
19 changed files with 1068 additions and 3 deletions

View file

@ -0,0 +1,98 @@
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
{{-- of this software and associated documentation files (the "Software"), to deal --}}
{{-- in the Software without restriction, including without limitation the rights --}}
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
{{-- copies of the Software, and to permit persons to whom the Software is --}}
{{-- furnished to do so, subject to the following conditions: --}}
{{-- The above copyright notice and this permission notice shall be included in all --}}
{{-- copies or substantial portions of the Software. --}}
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
{{-- SOFTWARE. --}}
@extends('layouts.master')
@section('title')
{{ trans('base.account.header') }}
@endsection
@section('content-header')
<h1>{{ trans('base.account.header') }}<small>{{ trans('base.account.header_sub')}}</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('index') }}">{{ trans('strings.home') }}</a></li>
<li class="active">{{ trans('strings.account') }}</li>
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('base.account.update_pass') }}</h3>
</div>
<form action="{{ route('account.password') }}" method="post">
<div class="box-body">
<div class="form-group">
<label for="current_password" class="control-label">{{ trans('base.account.current_password') }}</label>
<div>
<input type="password" class="form-control" name="current_password" />
</div>
</div>
<div class="form-group">
<label for="new_password" class="control-label">{{ trans('base.account.new_password') }}</label>
<div>
<input type="password" class="form-control" name="new_password" />
<p class="text-muted"><small>{{ trans('auth.password_requirements') }}</small></p>
</div>
</div>
<div class="form-group">
<label for="new_password_again" class="control-label">{{ trans('base.account.new_password_again') }}</label>
<div>
<input type="password" class="form-control" name="new_password_confirmation" />
</div>
</div>
</div>
<div class="box-footer">
{!! csrf_field() !!}
<input type="submit" class="btn btn-primary btn-sm" value="{{ trans('base.account.update_pass') }}" />
</div>
</form>
</div>
</div>
<div class="col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('base.account.update_email') }}</h3>
</div>
<form action="{{ route('account.email') }}" method="post">
<div class="box-body">
<div class="form-group">
<label for="new_email" class="control-label">{{ trans('base.account.new_email') }}</label>
<div>
<input type="text" class="form-control" name="new_email" />
</div>
</div>
<div class="form-group">
<label for="password" class="control-label">{{ trans('base.account.current_password') }}</label>
<div>
<input type="password" class="form-control" name="password" />
</div>
</div>
</div>
<div class="box-footer">
{!! csrf_field() !!}
<input type="submit" class="btn btn-primary btn-sm" value="{{ trans('base.account.update_email') }}" />
</div>
</form>
</div>
</div>
</div>
@endsection

View file

@ -0,0 +1,89 @@
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
{{-- of this software and associated documentation files (the "Software"), to deal --}}
{{-- in the Software without restriction, including without limitation the rights --}}
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
{{-- copies of the Software, and to permit persons to whom the Software is --}}
{{-- furnished to do so, subject to the following conditions: --}}
{{-- The above copyright notice and this permission notice shall be included in all --}}
{{-- copies or substantial portions of the Software. --}}
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
{{-- SOFTWARE. --}}
@extends('layouts.master')
@section('title')
{{ trans('base.index.header') }}
@endsection
@section('content-header')
<h1>{{ trans('base.index.header') }}<small>{{ trans('base.index.header_sub')}}</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('index') }}">{{ trans('strings.home') }}</a></li>
<li class="active">{{ trans('strings.servers') }}</li>
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">{{ trans('base.index.list') }}</h3>
<div class="box-tools">
<div class="input-group input-group-sm" style="width: 150px;">
<input type="text" name="table_search" class="form-control pull-right" placeholder="{{ trans('strings.search') }}">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tbody>
<tr>
<th>{{ trans('strings.id') }}</th>
<th>{{ trans('strings.name') }}</th>
<th>{{ trans('strings.node') }}</th>
<th>{{ trans('strings.connection') }}</th>
<th class="text-center hidden-sm hidden-xs">{{ trans('strings.memory') }}</th>
<th class="text-center hidden-sm hidden-xs">{{ trans('strings.cpu') }}</th>
<th class="text-center">{{ trans('strings.status') }}</th>
</tr>
@foreach($servers as $server)
<tr class="dynamic-update" data-server="{{ $server->uuidShort }}">
<td><code>{{ $server->uuidShort }}</code></td>
<td><a href="/server/{{ $server->uuidShort }}">{{ $server->name }}</a></td>
<td>{{ $server->nodeName }}</td>
<td><code>@if(!is_null($server->ip_alias)){{ $server->ip_alias }}@else{{ $server->ip }}@endif:{{ $server->port }}</code></td>
<td class="text-center hidden-sm hidden-xs"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '&infin;' : $server->memory }} MB</td>
<td class="text-center hidden-sm hidden-xs"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
<td class="text-center" data-action="status">
@if($server->suspended === 1)
<span class="label label-warning">{{ trans('strings.suspended') }}</span>
@else
<span class="label label-default"><i class="fa fa-refresh fa-fw fa-spin"></i></span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@section('footer-scripts')
@parent
{!! Theme::js('js/frontend/serverlist.js') !!}
@endsection

View file

@ -0,0 +1,143 @@
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
{{-- of this software and associated documentation files (the "Software"), to deal --}}
{{-- in the Software without restriction, including without limitation the rights --}}
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
{{-- copies of the Software, and to permit persons to whom the Software is --}}
{{-- furnished to do so, subject to the following conditions: --}}
{{-- The above copyright notice and this permission notice shall be included in all --}}
{{-- copies or substantial portions of the Software. --}}
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
{{-- SOFTWARE. --}}
@extends('layouts.master')
@section('title')
{{ trans('base.security.header') }}
@endsection
@section('content-header')
<h1>{{ trans('base.security.header') }}<small>{{ trans('base.security.header_sub')}}</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('index') }}">{{ trans('strings.home') }}</a></li>
<li><a href="{{ route('account') }}">{{ trans('strings.account') }}</a></li>
<li class="active">{{ trans('strings.security') }}</li>
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('base.security.sessions') }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tbody>
<tr>
<th>{{ trans('strings.id') }}</th>
<th>{{ trans('strings.ip') }}</th>
<th>{{ trans('strings.last_activity') }}</th>
<th></th>
</tr>
@foreach($sessions as $session)
<tr>
<td><code>{{ substr($session->id, 0, 6) }}</code></td>
<td>{{ $session->ip_address }}</td>
<td>{{ Carbon::createFromTimestamp($session->last_activity)->diffForHumans() }}</td>
<td>
<a href="{{ route('account.security.revoke', $session->id) }}">
<button class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i> {{ trans('strings.revoke') }}</button>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-6">
<div class="box {{ (Auth::user()->use_totp) ? 'box-success' : 'box-danger' }}">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('base.security.2fa_header') }}</h3>
</div>
@if(Auth::user()->use_totp)
<form action="{{ route('account.security.totp') }}" method="post">
<div class="box-body">
<p>{{ trans('base.security.2fa_enabled') }}</p>
<div class="form-group">
<label for="new_password_again" class="control-label">{{ trans('strings.2fa_token') }}</label>
<div>
<input type="text" class="form-control" name="token" />
<p class="text-muted small">{{ trans('base.security.2fa_token_help') }}</p>
</div>
</div>
</div>
<div class="box-footer">
{!! csrf_field() !!}
{{ method_field('DELETE') }}
<button type="submit" class="btn btn-danger btn-sm">{{ trans('base.security.disable_2fa') }}</button>
</div>
</form>
@else
<form action="#" method="post" id="do_2fa">
<div class="box-body">
{{ trans('base.security.2fa_disabled') }}
</div>
<div class="box-footer">
{!! csrf_field() !!}
<button type="submit" class="btn btn-success btn-sm">{{ trans('base.security.enable_2fa') }}</button>
</div>
</form>
@endif
</div>
</div>
</div>
<div class="modal fade" id="open2fa" tabindex="-1" role="dialog" aria-labelledby="open2fa" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="#" method="post" id="2fa_token_verify">
<div class="modal-header">
<h4 class="modal-title">{{ trans('base.security.2fa_qr') }}</h4>
</div>
<div class="modal-body" id="modal_insert_content">
<div class="row">
<div class="col-md-12" id="notice_box_2fa" style="display:none;"></div>
</div>
<div class="row">
<div class="col-md-6">
<center><span id="hide_img_load"><i class="fa fa-spinner fa-spin"></i> Loading QR Code...</span><img src="" id="qr_image_insert" style="display:none;"/><br /><code id="2fa_secret_insert"></code></center>
</div>
<div class="col-md-6">
<div class="alert alert-info">{{ trans('base.security.2fa_checkpoint_help') }}</div>
<div class="form-group">
<label class="control-label" for="2fa_token">{{ trans('strings.2fa_token') }}</label>
{!! csrf_field() !!}
<input class="form-control" type="text" name="2fa_token" id="2fa_token" />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-sm" id="submit_action">{{ trans('strings.submit') }}</button>
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal" id="close_reload">{{ trans('strings.close') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('footer-scripts')
@parent
{!! Theme::js('js/frontend/2fa-modal.js') !!}
@endsection