mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
Fixed Article submit bugs & improve layout
This commit is contained in:
@@ -32,8 +32,6 @@ class ArticleController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$data['content'] = json_encode($data['content']);
|
||||
|
||||
if ($article = Article::create($data)) {
|
||||
return redirect(route('admin.article.edit', $article))->with('successMsg', '添加成功');
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class UserController extends Controller
|
||||
'expireTime' => $user->expiration_date,
|
||||
'banedTime' => $user->ban_time,
|
||||
'unusedPercent' => $totalTransfer > 0 ? round($unusedTraffic / $totalTransfer, 2) * 100 : 0,
|
||||
'announcements' => Article::type(2)->latest()->simplePaginate(1), // 公告
|
||||
'announcements' => Article::type(2)->lang()->latest()->simplePaginate(1), // 公告
|
||||
'isTrafficWarning' => $user->isTrafficWarning(), // 流量异常判断
|
||||
'paying_user' => $userService->isActivePaying(), // 付费用户判断
|
||||
'userLoginLog' => $user->loginLogs()->latest()->first(), // 近期登录日志
|
||||
@@ -461,7 +461,7 @@ class UserController extends Controller
|
||||
'subType' => $data,
|
||||
'subUrl' => route('sub', $subscribe->code),
|
||||
'subStatus' => $subscribe->status,
|
||||
'knowledges' => Article::type(1)->lang()->latest()->orderByDesc('sort')->get()->groupBy('category'),
|
||||
'knowledges' => Article::type(1)->lang()->orderByDesc('sort')->latest()->get()->groupBy('category'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,9 @@ return [
|
||||
'link' => 'Subscribe Link',
|
||||
'tips' => 'Warning:Subscribe Link is for personal used only, Please do not show to anyone else. Otherwise, they may using your service without your permission',
|
||||
'exchange_warning' => 'Exchange Link:\n1. Old Link will be disabled\n2. Proxy connection password will be reset',
|
||||
'ss_only' => 'Subscribe SS/SSR Only',
|
||||
'custom' => 'Custom Subscribe',
|
||||
'ss_only' => 'Subscribe SS Only',
|
||||
'ssr_only' => 'Subscribe SS/SSR Only',
|
||||
'v2ray_only' => 'Subscribe V2Ray Only',
|
||||
'trojan_only' => 'Subscribe Trojan Only',
|
||||
'error' => 'Exchange Link Error',
|
||||
@@ -234,4 +236,8 @@ return [
|
||||
'client' => 'Clients',
|
||||
'tutorials' => 'Tutorials',
|
||||
'current_role' => 'Current Role as',
|
||||
'knowledge' => [
|
||||
'title' => 'Knowledge Base',
|
||||
'basic' => 'Basic',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -203,7 +203,9 @@ return [
|
||||
'link' => '订阅链接',
|
||||
'tips' => '警告:该订阅链接仅限个人使用,请勿传播该链接,否则会导致您的账号流量使用情况异常触发自动封号机制。',
|
||||
'exchange_warning' => '更换订阅地址将导致:\n1.旧地址立即失效\n2.连接密码被更改',
|
||||
'ss_only' => '只订阅SS/SSR',
|
||||
'custom' => '自定义订阅',
|
||||
'ss_only' => '只订阅SS',
|
||||
'ssr_only' => '只订阅SSR (包含SS)',
|
||||
'v2ray_only' => '只订阅V2Ray',
|
||||
'trojan_only' => '只订阅Trojan',
|
||||
'error' => '更换订阅地址异常',
|
||||
@@ -234,4 +236,8 @@ return [
|
||||
'client' => '客户端',
|
||||
'tutorials' => '教程',
|
||||
'current_role' => '当前身份',
|
||||
'knowledge' => [
|
||||
'title' => '知 识 库',
|
||||
'basic' => '基 础',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -18,9 +18,11 @@
|
||||
<thead class="thead-default">
|
||||
<tr>
|
||||
<th> #</th>
|
||||
<th> 类型</th>
|
||||
<th> 标题</th>
|
||||
<th> 排序</th>
|
||||
<th> 类 型</th>
|
||||
<th> 分 类</th>
|
||||
<th> 标 题</th>
|
||||
<th> 语 言</th>
|
||||
<th> 排 序</th>
|
||||
<th> 发布日期</th>
|
||||
<th> {{trans('common.action')}}</th>
|
||||
</tr>
|
||||
@@ -33,25 +35,27 @@
|
||||
<td> 文章</td>
|
||||
@elseif ($article->type === 2)
|
||||
<td> 公告</td>
|
||||
@elseif ($article->type === 3)
|
||||
<td> 购买说明</td>
|
||||
@elseif ($article->type === 4)
|
||||
<td> 使用教程</td>
|
||||
@else
|
||||
<td> 未知</td>
|
||||
@endif
|
||||
<td>
|
||||
@can('admin.article.show')
|
||||
<a href="{{route('admin.article.show',$article)}}" target="_blank"> {{Str::limit($article->title, 80)}} </a>
|
||||
@else
|
||||
{{Str::limit($article->title, 80)}}
|
||||
@endcan
|
||||
<td class="text-left">
|
||||
{{ Str::limit($article->category, 30) }}
|
||||
</td>
|
||||
<td class="text-left">
|
||||
{{ Str::limit($article->title, 50) }}
|
||||
</td>
|
||||
<td>
|
||||
{!! isset(config('common.language')[$article->language]) ? '<i class="fi fi-'.config('common.language')[$article->language][1].'"></i>
|
||||
<span style="padding: inherit;">'.config('common.language')[$article->language][0].'</span>': __('user.unknown') !!}
|
||||
<td> {{$article->sort}} </td>
|
||||
<td> {{$article->created_at}} </td>
|
||||
<td>
|
||||
@canany(['admin.article.edit', 'admin.article.destroy'])
|
||||
<div class="btn-group">
|
||||
@can('admin.article.show')
|
||||
<a href="{{route('admin.article.show',$article)}}" class="btn btn-outline-success">
|
||||
<i class="icon wb-eye"></i></a>
|
||||
@endcan
|
||||
@can('admin.article.edit')
|
||||
<a href="{{route('admin.article.edit',['article'=>$article->id, 'page'=>Request::query('page')])}}" class="btn btn-outline-primary">
|
||||
<i class="icon wb-edit"></i></a>
|
||||
@@ -88,32 +92,32 @@
|
||||
<script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
|
||||
@can('admin.article.destroy')
|
||||
<script>
|
||||
// 删除文章
|
||||
function delArticle(url) {
|
||||
swal.fire({
|
||||
title: '确定删除文章?',
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: '{{trans('common.close')}}',
|
||||
confirmButtonText: '{{trans('common.confirm')}}',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: url,
|
||||
data: {_token: '{{csrf_token()}}'},
|
||||
dataType: 'json',
|
||||
success: function(ret) {
|
||||
if (ret.status === 'success') {
|
||||
swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
|
||||
} else {
|
||||
swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
|
||||
}
|
||||
},
|
||||
});
|
||||
// 删除文章
|
||||
function delArticle(url) {
|
||||
swal.fire({
|
||||
title: '确定删除文章?',
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: '{{trans('common.close')}}',
|
||||
confirmButtonText: '{{trans('common.confirm')}}',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
url: url,
|
||||
data: {_token: '{{csrf_token()}}'},
|
||||
dataType: 'json',
|
||||
success: function(ret) {
|
||||
if (ret.status === 'success') {
|
||||
swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
|
||||
} else {
|
||||
swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endcan
|
||||
@endsection
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<div class="form-group row article">
|
||||
<label class="col-form-label col-md-2" for="sort"> 排 序 </label>
|
||||
<div class="col-md-2">
|
||||
<input type="number" class="form-control" name="sort" id="sort" required/>
|
||||
<input type="number" class="form-control" name="sort" id="sort" value="10" required/>
|
||||
<span class="text-help"> 值越高显示时越靠前 </span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,7 +85,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-2" for="content"> 内 容 </label>
|
||||
<div class="col-md-10">
|
||||
<textarea class="form-control" name="content" rows="15">@isset($article) {!! $article->content !!} @endisset</textarea>
|
||||
<textarea class="form-control" name="content">@isset($article) {!! $article->content !!} @endisset</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions text-right">
|
||||
@@ -109,7 +109,7 @@
|
||||
@isset($article)
|
||||
$(document).ready(function() {
|
||||
$("input[name='type'][value='{{$article->type}}']").click();
|
||||
$('#title').val('{{$article->title}}');
|
||||
$('#title').val('{!! $article->title !!}');
|
||||
$('#category').val('{{$article->category}}');
|
||||
$('#language').selectpicker('val', '{{$article->language}}');
|
||||
$('#sort').val('{{$article->sort}}');
|
||||
@@ -118,9 +118,10 @@
|
||||
|
||||
tinymce.init({
|
||||
selector: 'textarea', // change this value according to your HTML
|
||||
plugins: 'advlist autolink code emoticons help image importcss link lists media preview quickbars searchreplace table visualblocks visualchars wordcount',
|
||||
toolbar: 'undo redo | styles | bold italic forecolor backcolor emoticons| alignleft aligncenter alignright alignjustify | bullist numlist outdent ' +
|
||||
'indent | link image media',
|
||||
plugins: 'advlist autolink autoresize autosave code emoticons help image importcss link lists media ' +
|
||||
'preview quickbars searchreplace table visualblocks visualchars wordcount',
|
||||
toolbar: 'restoredraft undo redo | styles | bold italic forecolor backcolor emoticons| alignleft aligncenter alignright alignjustify' +
|
||||
' | bullist numlist outdent indent | link image media',
|
||||
menubar: 'view edit insert format table tools help',
|
||||
link_default_target: '_blank',
|
||||
quickbars_insert_toolbar: 'quicktable image media',
|
||||
@@ -128,6 +129,8 @@
|
||||
extended_valid_elements: 'i[class|aria-hidden]',
|
||||
language: '{{app()->getLocale()}}',
|
||||
content_css: '/assets/bundle/app.min.css',
|
||||
min_height: 500,
|
||||
max_height: 800,
|
||||
});
|
||||
|
||||
$('input:radio[name=\'type\']').on('change', function() {
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{{$article->title}}<sub class="ml-30">{{$article->created_at}}</sub></h3>
|
||||
<h3 class="panel-title">{{$article->title}} {!! $article->category ?'<sub class="ml-20">'.$article->category.'</sub>':'' !!}</h3>
|
||||
<div class="panel-actions"><code>{{$article->created_at}}</code></div>
|
||||
</div>
|
||||
<div class="panel-body pt-0 pb-60">
|
||||
<div style="padding: 10px;">{!! $article->content !!}</div>
|
||||
|
||||
@@ -6,11 +6,15 @@
|
||||
ol > li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.panel-group .panel-title {
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">问题解决库</h1>
|
||||
<h1 class="page-title">{{ __('user.knowledge.title') }}</h1>
|
||||
</div>
|
||||
<div class="page-content container-fluid">
|
||||
<div class="row">
|
||||
@@ -19,7 +23,7 @@
|
||||
<div class="panel-body">
|
||||
<div class="list-group faq-list" role="tablist">
|
||||
<a class="list-group-item list-group-item-action active" data-toggle="tab"
|
||||
href="#basic" aria-controls="basic" role="tab">基础</a>
|
||||
href="#basic" aria-controls="basic" role="tab">{{ __('user.knowledge.basic') }}</a>
|
||||
@foreach($knowledges as $category => $articles)
|
||||
<a class="list-group-item list-group-item-action" data-toggle="tab"
|
||||
href="#{{$category}}" aria-controls="{{$category}}" role="tab">{{$category}}</a>
|
||||
@@ -57,20 +61,24 @@
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" id="sublink" data-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
自定义订阅
|
||||
{{ __('user.subscribe.custom') }}
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="sublink" role="menu">
|
||||
@if(in_array('ss', $subType, true))
|
||||
<a class="dropdown-item" onclick="linkManager('0')" role="menuitem">只订阅SS</a>
|
||||
<a class="dropdown-item" onclick="linkManager('0')"
|
||||
role="menuitem">{{ __('user.subscribe.ss_only') }}</a>
|
||||
@endif
|
||||
@if(in_array('ssr', $subType, true))
|
||||
<a class="dropdown-item" onclick="linkManager('1')" role="menuitem">只订阅SSR (包含ss)</a>
|
||||
<a class="dropdown-item" onclick="linkManager('1')"
|
||||
role="menuitem">{{ __('user.subscribe.ssr_only') }}</a>
|
||||
@endif
|
||||
@if(in_array('v2', $subType, true))
|
||||
<a class="dropdown-item" onclick="linkManager('2')" role="menuitem">只订阅V2Ray</a>
|
||||
<a class="dropdown-item" onclick="linkManager('2')"
|
||||
role="menuitem">{{ __('user.subscribe.v2ray_only') }}</a>
|
||||
@endif
|
||||
@if(in_array('trojan', $subType, true))
|
||||
<a class="dropdown-item" onclick="linkManager('3')" role="menuitem">只订阅Trojan</a>
|
||||
<a class="dropdown-item" onclick="linkManager('3')"
|
||||
role="menuitem">{{ __('user.subscribe.trojan_only') }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -83,12 +83,12 @@
|
||||
<form action="{{route('profile')}}" method="post" enctype="multipart/form-data" class="form-horizontal" autocomplete="off">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-2 col-form-label">{{trans('auth.password.original')}}</label>
|
||||
<input type="password" class="form-control col-md-5 round" name="password" id="password" autofocus required/>
|
||||
<label for="password" class="col-md-5 col-form-label">{{trans('auth.password.original')}}</label>
|
||||
<input type="password" class="form-control col-md-6 round" name="password" id="password" autofocus required/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="new_password" class="col-md-2 col-form-label">{{trans('auth.password.new')}}</label>
|
||||
<input type="password" class="form-control col-md-5 round" name="new_password" id="new_password" required/>
|
||||
<label for="new_password" class="col-md-5 col-form-label">{{trans('auth.password.new')}}</label>
|
||||
<input type="password" class="form-control col-md-6 round" name="new_password" id="new_password" required/>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-info">{{trans('common.submit')}}</button>
|
||||
@@ -99,16 +99,16 @@
|
||||
<form action="{{route('profile')}}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="nickname" class="col-md-2 col-form-label">{{trans('validation.attributes.nickname')}}</label>
|
||||
<input type="text" class="form-control col-md-5 round" name="nickname" id="nickname" value="{{Auth::getUser()->nickname}}"/>
|
||||
<label for="nickname" class="col-md-5 col-form-label">{{trans('validation.attributes.nickname')}}</label>
|
||||
<input type="text" class="form-control col-md-6 round" name="nickname" id="nickname" value="{{Auth::getUser()->nickname}}"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="wechat" class="col-md-2 col-form-label">{{trans('common.payment.wechat')}}</label>
|
||||
<input type="text" class="form-control col-md-5 round" name="wechat" id="wechat" value="{{Auth::getUser()->wechat}}"/>
|
||||
<label for="wechat" class="col-md-5 col-form-label">{{trans('common.payment.wechat')}}</label>
|
||||
<input type="text" class="form-control col-md-6 round" name="wechat" id="wechat" value="{{Auth::getUser()->wechat}}"/>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="qq" class="col-md-2 col-form-label">QQ</label>
|
||||
<input type="number" class="form-control col-md-5 round" name="qq" id="qq" value="{{Auth::getUser()->qq}}"/>
|
||||
<label for="qq" class="col-md-5 col-form-label">QQ</label>
|
||||
<input type="number" class="form-control col-md-6 round" name="qq" id="qq" value="{{Auth::getUser()->qq}}"/>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-info">{{trans('common.submit')}}</button>
|
||||
@@ -119,7 +119,7 @@
|
||||
<form action="{{route('profile')}}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="passwd" class="col-md-2 col-form-label"> {{trans('user.account.connect_password')}} </label>
|
||||
<label for="passwd" class="col-md-5 col-form-label"> {{trans('user.account.connect_password')}} </label>
|
||||
<input type="text" class="form-control col-md-5 round" name="passwd" id="passwd" value="{{Auth::getUser()->passwd}}" required/>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
|
||||
Reference in New Issue
Block a user