Browse Source

Merge pull request #9 from helloxz/dev

v0.9.9
pull/16/head
xiaoz 3 years ago committed by GitHub
parent
commit
2ad9f52f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      README.md
  2. 2
      config.simple.php
  3. 4
      controller/index.php
  4. 1
      data/index.html
  5. 11
      index.php
  6. 2
      templates/admin/footer.php
  7. 18
      templates/default/index.php
  8. 2
      version.txt

19
README.md

@ -21,13 +21,28 @@ @@ -21,13 +21,28 @@
* 支持链接信息自动识别
* 支持API
## 快速开始
## 安装
**常规安装:**
1. 需安装PHP环境,并确保支持SQLite3
2. 下载源码解压到站点根目录
3. 将`config.simple.php`修改为`config.php`并填写自己的站点信息
3. 将`config.simple.php`复制为`data/config.php`并填写自己的站点信息
5. 访问后台:`http://IP/index.php?c=login`
**Docker部署:**
```bash
docker run -itd --name="onenav" -p 80:80 \
-e USER='xiaoz' -e PASSWORD='xiaoz.me' \
-v /data/onenav:/data/wwwroot/default/data \
helloz/onenav
```
* `USER`:设置用户名,上述设置为`xiaoz`
* `PASSWORD`:设置密码,上述设置为`xiaoz.me`
* `/data/onenav`:本机挂载目录,用于持久存储Onenav数据
> 更多说明,请参考帮助文档:https://www.yuque.com/helloz/onenav
## 联系我

2
config.simple.php

@ -4,7 +4,7 @@ require 'class/Medoo.php'; @@ -4,7 +4,7 @@ require 'class/Medoo.php';
use Medoo\Medoo;
$db = new medoo([
'database_type' => 'sqlite',
'database_file' => 'db/onenav.db3'
'database_file' => 'data/onenav.db3'
]);
//用户名

4
controller/index.php

@ -109,8 +109,8 @@ function base64($url){ @@ -109,8 +109,8 @@ function base64($url){
//获取版本号
$version = get_version();
//载入js扩展
if( file_exists('templates/admin/static/extend.js') ) {
$onenav['extend'] = '<script src = "templates/admin/static/extend.js"></script>';
if( file_exists('data/extend.js') ) {
$onenav['extend'] = '<script src = "data/extend.js"></script>';
}
else{
$onenav['extend'] = '';

1
data/index.html

@ -0,0 +1 @@ @@ -0,0 +1 @@

11
index.php

@ -11,16 +11,17 @@ $c = strip_tags($c); @@ -11,16 +11,17 @@ $c = strip_tags($c);
//读取版本号
//$version = @file_get_contents("./functions/version.txt");
//载入配置文件
if( !file_exists('./config.php') ) {
exit('<h3>配置文件不存在,请将config.simple.php复制一份并命名为config.php</h3>');
if( !file_exists('./data/config.php') ) {
exit('<h3>配置文件不存在,请将站点目录下的config.simple.php复制为data/config.php</h3>');
}
//检查数据库是否存在,不存在则复制数据库
if( !file_exists('./db/onenav.db3') ) {
copy('db/onenav.simple.db3','db/onenav.db3');
if( !file_exists('./data/onenav.db3') ) {
copy('db/onenav.simple.db3','data/onenav.db3');
// copy('db/.htaccess','data/.htaccess');
}
//载入配置文件
require("./config.php");
require("./data/config.php");
//根据不同的请求载入不同的方法
//如果没有请求控制器

2
templates/admin/footer.php

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<div class="layui-footer">
<!-- 底部固定区域 -->
© Copyright 2020.Powered by <a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">OneNav</a>.
© Copyright 2021.Powered by <a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">OneNav</a>.
</div>
</div>
<script src = 'https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js'></script>

18
templates/default/index.php

@ -34,7 +34,15 @@ @@ -34,7 +34,15 @@
</div>
</div> -->
<!-- 搜索框END -->
<a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-tooltip="{content: '查看 Github'}">
<!-- 新版搜索框 -->
<div class="mdui-col-md-4 mdui-col-xs-6">
<div class="mdui-textfield mdui-textfield-floating-label">
<!-- <label class="mdui-textfield-label">输入书签关键词进行搜索</label> -->
<input class="mdui-textfield-input search" style = "color:#FFFFFF;" placeholder="输入书签关键词进行搜索" type="text" />
</div>
</div>
<!-- 新版搜索框END -->
<a class = "mdui-hidden-xs" href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-tooltip="{content: '查看 Github'}">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" xml:space="preserve" class="mdui-icon" style="width: 24px;height:24px;">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#ffffff" d="M18,1.4C9,1.4,1.7,8.7,1.7,17.7c0,7.2,4.7,13.3,11.1,15.5
c0.8,0.1,1.1-0.4,1.1-0.8c0-0.4,0-1.4,0-2.8c-4.5,1-5.5-2.2-5.5-2.2c-0.7-1.9-1.8-2.4-1.8-2.4c-1.5-1,0.1-1,0.1-1
@ -43,7 +51,7 @@ @@ -43,7 +51,7 @@
c0.9,2.2,0.3,3.9,0.2,4.3c1,1.1,1.7,2.6,1.7,4.4c0,6.3-3.8,7.6-7.4,8c0.6,0.5,1.1,1.5,1.1,3c0,2.2,0,3.9,0,4.5
c0,0.4,0.3,0.9,1.1,0.8c6.5-2.2,11.1-8.3,11.1-15.5C34.3,8.7,27,1.4,18,1.4z"></path>
</svg>
<a href="/index.php?c=login" title = "登录OneNav" target="_blank" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">account_circle</i></a>
<a class = "mdui-hidden-xs" href="/index.php?c=login" title = "登录OneNav" target="_blank" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">account_circle</i></a>
</a>
</div>
</header>
@ -81,14 +89,14 @@ @@ -81,14 +89,14 @@
<!--正文内容部分-->
<div class="mdui-container">
<!-- 搜索框 -->
<div class="mdui-row">
<!-- <div class="mdui-row">
<div class="mdui-col-xs-12">
<div class="mdui-textfield mdui-textfield-floating-label">
<label class="mdui-textfield-label">输入书签关键词进行搜索</label>
<input class="mdui-textfield-input search" type="text" />
</div>
</div>
</div>
</div> -->
<!-- 搜索框END -->
<div class="mdui-row">
<!-- 遍历分类目录 -->
@ -153,7 +161,7 @@ @@ -153,7 +161,7 @@
<!--正文内容部分END-->
<!-- footer部分 -->
<footer>
© 2020 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a>
© 2021 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a>
</footer>
<!-- footerend -->
</body>

2
version.txt

@ -1 +1 @@ @@ -1 +1 @@
v0.9.8-20201224
v0.9.9-20210322
Loading…
Cancel
Save