Skip to content

Commit

Permalink
[#] 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Dec 31, 2020
1 parent 3b766e7 commit f8ea9e9
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 56 deletions.
12 changes: 12 additions & 0 deletions app/Http/Controllers/UrlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,16 @@ public function delete(Request $request, $id)
}
return $this->fail('删除失败');
}

/**
* 清空
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
*/
public function empty(Request $request)
{
ShortUrl::truncate();
return $this->success();
}
}
6 changes: 4 additions & 2 deletions docs/apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

- 获取id


![id](https://i.loli.net/2018/10/27/5bd470721f1a3.png)


Expand All @@ -43,6 +42,9 @@

## 错误处理

如果填写过程出现错误,可以执行命令,重置数据文件,重新安装。 `composer run uninstall-app` 此操作会重置配置文件未初始化状态;
如果填写过程出现错误,可以执行命令,重置数据文件,重新安装。

`composer run uninstall-app` 此操作会重置配置文件未初始化状态;

也可以通过页面的返回修改重置数据,并进行再一次绑定。

8 changes: 1 addition & 7 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
- PHP BCMath 扩展
- PHP Fileinfo 扩展 *


**Laravel 文件系统模块要求,为保证成功安装,建议安装 `PHP Fileinfo 扩展` **


推荐使用 oneinstack 安装php环境 [https://oneinstack.com/auto](https://oneinstack.com/auto)

可以根据需要安装扩展,具体扩展安装请参考官方文档。
Expand All @@ -37,7 +35,7 @@ wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-fu

**注意:**

OLAINDEX 基于 `Laravel` 安装需要开启禁用的两个方法,步骤如下:
OLAINDEX 基于 `Laravel` 安装需要开启禁用的几个函数方法,步骤如下:

oneinstack php安装路径 `/usr/local/php/etc/php.ini`

Expand All @@ -48,10 +46,6 @@ oneinstack php安装路径 `/usr/local/php/etc/php.ini`
4、sudo service php-fpm restart # 重启 php 进程
```

**3.0更新了命令行操作,另外需要开启禁用的两个方法**

分别是 `exec``shell_exec` 步骤参考上面。

另外使用composer包管理器, 需要下载 composer 并且全局处理,步骤如下:

```
Expand Down
4 changes: 4 additions & 0 deletions docs/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ chown -R www:www * # 此处 www 根据服务器具体用户组而定
4. 执行数据库迁移 `php artisan migrate --seed`
5. 访问网站,设置其它数据

**Q: 如何重置应用**

A: 删除 `storage/install` 文件夹下的 `install.lock` 文件 以及 `data` 目录的 `sqlite` 文件

51 changes: 51 additions & 0 deletions resources/views/admin/url-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@
短链管理
</h2>
</div>
<!-- Page title actions -->
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<span class="d-none d-sm-inline">
<a href="javascript:void(0);" class="btn btn-danger delete-all">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24"
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z"
fill="none"/><line x1="4" y1="7"
x2="20"
y2="7"/><line
x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/><path
d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"/><path
d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"/></svg>
清空
</a>
</span>
</div>
</div>
</div>
</div>
<div class="row row-cards">
Expand Down Expand Up @@ -103,6 +122,38 @@
})
})
$('.delete-all').on('click', function(e) {
Swal.fire({
title: '确定清空吗?',
text: '清空后无法恢复!',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then((result) => {
if (result.value) {
axios.post('/admin/url/empty')
.then(function(response) {
let data = response.data
if (data.error === '') {
Swal.fire({
title: '操作成功',
text: '清空成功',
icon: 'success',
}).then(() => {
window.location.reload()
})
}
})
.catch(function(error) {
console.log(error)
})
}
})
})
})
</script>
@endpush
18 changes: 0 additions & 18 deletions resources/views/default/components/admin-nav.blade.php

This file was deleted.

53 changes: 24 additions & 29 deletions resources/views/default/one.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
@extends('default.layouts.main')
@section('title', setting('site_name','OLAINDEX'))
@section('content')
<div class="row mb-3">
@if(count($accounts) > 1)
<div class="col">
<div class="dropdown">
@includeWhen(!blank($path),'default.components.breadcrumb',['hash' => $hash, 'path' => $path])
@if (!blank($doc['head']))
<div class="card border-light mb-3 shadow">
<div class="card-header"><i class="ri-send-plane-fill"></i> HEAD</div>
<div class="card-body markdown-body" id="head">
{!! marked($doc['head']) !!}
</div>
</div>
@endif
<div class="card border-light mb-3 shadow">
<div class="card-header d-flex align-items-center">
@if(count($accounts) > 1)
<div class="dropdown mb-0 mr-2 my-1">
<button class="btn btn-primary btn-sm dropdown-toggle" type="button" id="btnChoiceAccount"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
选择盘符:
Expand All @@ -16,19 +25,15 @@
@endforeach
</div>
</div>
</div>
@endif
</div>
@includeWhen(!blank($path),'default.components.breadcrumb',['hash' => $hash, 'path' => $path])
@if (!blank($doc['head']))
<div class="card border-light mb-3 shadow">
<div class="card-header"><i class="ri-send-plane-fill"></i> HEAD</div>
<div class="card-body markdown-body" id="head">
{!! marked($doc['head']) !!}
</div>
@endif
<form class="form-inline mb-0 mr-2 my-1">
<label class="mb-0 mr-2 my-1">
<input class="form-control form-control-sm" type="text" name="keywords"
placeholder="搜索" value="{{ $keywords }}">
</label>
<button class="btn btn-primary btn-sm mr-2 my-1" type="submit">搜索</button>
</form>
</div>
@endif
<div class="card border-light mb-3 shadow">
<div class="card-body table-responsive">
<table class="table table-sm table-hover table-borderless">
<caption>
Expand Down Expand Up @@ -72,17 +77,6 @@ class="text-decoration-none"><i class="ri-arrow-up-s-line"></i> </a>
</tr>
</thead>
<tbody class="w-100">
<tr class="row mx-0">
<td colspan="4">
<form class="form-inline">
<label class="mb-0 mr-2 my-1">
<input class="form-control form-control-sm mr-sm-2" type="text" name="keywords"
placeholder="搜索" value="{{ $keywords }}">
</label>
<button class="btn btn-primary btn-sm mr-2 my-1" type="submit">搜索</button>
</form>
</td>
</tr>
@if(!blank($path))
<tr class="row mx-0">
<td colspan="4">
Expand All @@ -94,7 +88,7 @@ class="text-decoration-none"><i class="ri-arrow-up-s-line"></i> </a>
</tr>
@endif
@if(blank($list))
<tr class="row mx-0 text-center" >
<tr class="row mx-0 text-center">
<td colspan="4">
Ops! 暂无资源
</td>
Expand All @@ -105,7 +99,8 @@ class="text-decoration-none"><i class="ri-arrow-up-s-line"></i> </a>
data-route="{{ route('drive.query', ['hash' => $hash, 'query' => url_encode(implode('/', array_add($path, key(array_slice($path, -1, 1, true)) + 1, $data['name']) ))]) }}">
<td class="col-5"
style="text-overflow:ellipsis;overflow:hidden;white-space:nowrap;">
<a title="{{ $data['name'] }}" href="{{ route('drive.query', ['hash' => $hash, 'query' => url_encode(implode('/', array_add($path, key(array_slice($path, -1, 1, true)) + 1, $data['name'])))]) }}"
<a title="{{ $data['name'] }}"
href="{{ route('drive.query', ['hash' => $hash, 'query' => url_encode(implode('/', array_add($path, key(array_slice($path, -1, 1, true)) + 1, $data['name'])))]) }}"
class="text-decoration-none stretched-link">
<i class="ri-{{ \App\Helpers\Tool::fetchExtIco($data['ext'] ?? 'file') }}-fill"></i>
{{ $data['name'] }}
Expand Down
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

Route::get('url/list', 'UrlController@list')->name('admin.url.list');
Route::post('url/delete/{id}', 'UrlController@delete')->name('admin.url.delete');
Route::post('url/empty', 'UrlController@empty')->name('admin.url.empty');


Route::post('manage/refresh', 'ManageController@refresh')->name('manage.refresh');
Expand Down

0 comments on commit f8ea9e9

Please sign in to comment.