Skip to content

Commit

Permalink
admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 27, 2023
1 parent 20454cd commit de49c05
Show file tree
Hide file tree
Showing 216 changed files with 4,175 additions and 51 deletions.
4 changes: 2 additions & 2 deletions cmd/haoadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/sevlyar/go-daemon"

"github.com/urfave/cli/v2"
"github.com/yzimhao/trading_engine/cmd/haoadm/www"
"github.com/yzimhao/trading_engine/cmd/haoadm/view"
"github.com/yzimhao/trading_engine/utils/app"
"github.com/yzimhao/trading_engine/utils/app/config"
)
Expand Down Expand Up @@ -56,7 +56,7 @@ func main() {
}(context)

}
www.Run()
view.Run()
return nil
},
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/haoadm/models/system_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ func (m *SystemMenu) GetSystemInit() SystemInit {

// 首页
systemInit.HomeInfo.Title = "首页"
systemInit.HomeInfo.Href = "/admin"
systemInit.HomeInfo.Href = "/admin/"

// logo
systemInit.LogoInfo.Title = "HaoTrader"
systemInit.LogoInfo.Image = "/images/logo.png"
systemInit.LogoInfo.Image = "/admin/images/logo.png"

// 菜单
systemInit.MenuInfo = m.GetMenuList()
Expand All @@ -108,11 +108,11 @@ func (m *SystemMenu) GetMenuList() []*MenuTreeList {
SystemMenu{Id: 3, Pid: 0, Title: "用户", Icon: "fa fa-user", Href: "", Target: "_self"},
SystemMenu{Id: 4, Pid: 0, Title: "统计", Icon: "fa fa-bar-chart", Href: "", Target: "_self"},

SystemMenu{Id: 10, Pid: 1, Title: "系统设置", Icon: "fa fa-wrench", Href: "", Target: "_self"},
SystemMenu{Id: 10, Pid: 1, Title: "系统设置", Icon: "fa fa-wrench", Href: "/admin/system/settings", Target: "_self"},

SystemMenu{Id: 20, Pid: 2, Title: "资产列表", Icon: "fa fa-btc", Href: "", Target: "_self"},
SystemMenu{Id: 21, Pid: 2, Title: "板块分类", Icon: "fa fa-file-text-o", Href: "", Target: "_self"},
SystemMenu{Id: 22, Pid: 2, Title: "交易列表", Icon: "fa fa-retweet", Href: "", Target: "_self"},
SystemMenu{Id: 20, Pid: 2, Title: "资产列表", Icon: "fa fa-btc", Href: "/admin/assets/list", Target: "_self"},
SystemMenu{Id: 21, Pid: 2, Title: "板块分类", Icon: "fa fa-file-text-o", Href: "/admin/symbols/category", Target: "_self"},
SystemMenu{Id: 22, Pid: 2, Title: "交易列表", Icon: "fa fa-retweet", Href: "/admin/trade/list", Target: "_self"},

SystemMenu{Id: 30, Pid: 3, Title: "用户资产", Icon: "fa fa-user", Href: "", Target: "_self"},
SystemMenu{Id: 31, Pid: 3, Title: "用户订单", Icon: "fa fa-reorder", Href: "", Target: "_self"},
Expand Down
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ window.rootPath = (function (src) {

layui.config({
base: rootPath + "lay-module/",
version: true
version: false
}).extend({
miniAdmin: "layuimini/miniAdmin", // layuimini后台扩展
miniMenu: "layuimini/miniMenu", // layuimini菜单扩展
Expand Down
110 changes: 110 additions & 0 deletions cmd/haoadm/template/default/admin/page/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>404</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
<style>
.error .clip .shadow {height:180px;}
.error .clip:nth-of-type(2) .shadow {width:130px;}
.error .clip:nth-of-type(1) .shadow,.error .clip:nth-of-type(3) .shadow {width:250px;}
.error .digit {width:150px;height:150px;line-height:150px;font-size:120px;font-weight:bold;}
.error h2 {font-size:32px;}
.error .msg {top:-190px;left:30%;width:80px;height:80px;line-height:80px;font-size:32px;}
.error span.triangle {top:70%;right:0%;border-left:20px solid #535353;border-top:15px solid transparent;border-bottom:15px solid transparent;}
.error .container-error-404 {top: 50%;margin-top: 250px;position:relative;height:250px;padding-top:40px;}
.error .container-error-404 .clip {display:inline-block;transform:skew(-45deg);}
.error .clip .shadow {overflow:hidden;}
.error .clip:nth-of-type(2) .shadow {overflow:hidden;position:relative;box-shadow:inset 20px 0px 20px -15px rgba(150,150,150,0.8),20px 0px 20px -15px rgba(150,150,150,0.8);}
.error .clip:nth-of-type(3) .shadow:after,.error .clip:nth-of-type(1) .shadow:after {content:"";position:absolute;right:-8px;bottom:0px;z-index:9999;height:100%;width:10px;background:linear-gradient(90deg,transparent,rgba(173,173,173,0.8),transparent);border-radius:50%;}
.error .clip:nth-of-type(3) .shadow:after {left:-8px;}
.error .digit {position:relative;top:8%;color:white;background:#1E9FFF;border-radius:50%;display:inline-block;transform:skew(45deg);}
.error .clip:nth-of-type(2) .digit {left:-10%;}
.error .clip:nth-of-type(1) .digit {right:-20%;}
.error .clip:nth-of-type(3) .digit {left:-20%;}
.error h2 {font-size:24px;color:#A2A2A2;font-weight:bold;padding-bottom:20px;}
.error .tohome {font-size:16px;color:#07B3F9;}
.error .msg {position:relative;z-index:9999;display:block;background:#535353;color:#A2A2A2;border-radius:50%;font-style:italic;}
.error .triangle {position:absolute;z-index:999;transform:rotate(45deg);content:"";width:0;height:0;}
@media(max-width:767px) {.error .clip .shadow {height:100px;}
.error .clip:nth-of-type(2) .shadow {width:80px;}
.error .clip:nth-of-type(1) .shadow,.error .clip:nth-of-type(3) .shadow {width:100px;}
.error .digit {width:80px;height:80px;line-height:80px;font-size:52px;}
.error h2 {font-size:18px;}
.error .msg {top:-110px;left:15%;width:40px;height:40px;line-height:40px;font-size:18px;}
.error span.triangle {top:70%;right:-3%;border-left:10px solid #535353;border-top:8px solid transparent;border-bottom:8px solid transparent;}
.error .container-error-404 {height:150px;}
}
</style>
</head>
<body>
<div class="error">
<div class="container-floud">
<div style="text-align: center">
<div class="container-error-404">
<div class="clip">
<div class="shadow">
<span class="digit thirdDigit"></span>
</div>
</div>
<div class="clip">
<div class="shadow">
<span class="digit secondDigit"></span>
</div>
</div>
<div class="clip">
<div class="shadow">
<span class="digit firstDigit"></span>
</div>
</div>
<div class="msg">OH!
<span class="triangle"></span>
</div>
</div>
<h2 class="h1">很抱歉,你访问的页面找不到了</h2>
</div>
</div>
</div>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
function randomNum() {
return Math.floor(Math.random() * 9) + 1;
}

var loop1, loop2, loop3, time = 30, i = 0, number;
loop3 = setInterval(function () {
if (i > 40) {
clearInterval(loop3);
document.querySelector('.thirdDigit').textContent = 4;
} else {
document.querySelector('.thirdDigit').textContent = randomNum();
i++;
}
}, time);
loop2 = setInterval(function () {
if (i > 80) {
clearInterval(loop2);
document.querySelector('.secondDigit').textContent = 0;
} else {
document.querySelector('.secondDigit').textContent = randomNum();
i++;
}
}, time);
loop1 = setInterval(function () {
if (i > 100) {
clearInterval(loop1);
document.querySelector('.firstDigit').textContent = 4;
} else {
document.querySelector('.firstDigit').textContent = randomNum();
i++;
}
}, time);
</script>
</body>
</html>
70 changes: 70 additions & 0 deletions cmd/haoadm/template/default/admin/page/area.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<div class="layuimini-container layuimini-page-anim">
<div class="layuimini-main">
<blockquote class="layui-elem-quote">
省市县区三级联动下拉选择器使用开源项目:layarea<br>
<a href="https://github.com/fesiong/layarea" target="_blank" class="layui-btn layui-btn-danger">layarea</a>
</blockquote>
<form class="layui-form" action="" style="padding:20px;">
<div class="layui-form-item" id="area-picker">
<div class="layui-form-label">网点地址</div>
<div class="layui-input-inline" style="width: 200px;">
<select name="province" class="province-selector" data-value="广东省" lay-filter="province-1">
<option value="">请选择省</option>
</select>
</div>
<div class="layui-input-inline" style="width: 200px;">
<select name="city" class="city-selector" data-value="深圳市" lay-filter="city-1">
<option value="">请选择市</option>
</select>
</div>
<div class="layui-input-inline" style="width: 200px;">
<select name="county" class="county-selector" data-value="龙岗区" lay-filter="county-1">
<option value="">请选择区</option>
</select>
</div>
</div>
</form>
<pre class="layui-code">
layui.use(['layer', 'form', 'layarea'], function () {
var layer = layui.layer
, form = layui.form
, layarea = layui.layarea;

layarea.render({
elem: '#area-picker',
// data: {
// province: '广东省',
// city: '深圳市',
// county: '龙岗区',
// },
change: function (res) {
//选择结果
console.log(res);
}
});
});
</pre>
</div>
</div>
<script src="lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="lib/jq-module/paigusu.min.js" charset="utf-8"></script>
<script>
layui.use(['layer', 'form', 'layarea'], function () {
var layer = layui.layer
, form = layui.form
, layarea = layui.layarea;

layarea.render({
elem: '#area-picker',
// data: {
// province: '广东省',
// city: '深圳市',
// county: '龙岗区',
// },
change: function (res) {
//选择结果
console.log(res);
}
});
});
</script>
131 changes: 131 additions & 0 deletions cmd/haoadm/template/default/admin/page/button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<style>
.site-demo-button {margin:10px 0 10px 0}
</style>
<div class="layuimini-container layuimini-page-anim">
<div class="layuimini-main">
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;">
<legend>按钮主题</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary">原始按钮</button>
<button type="button" class="layui-btn">默认按钮</button>
<button type="button" class="layui-btn layui-btn-normal">百搭按钮</button>
<button type="button" class="layui-btn layui-btn-warm">暖色按钮</button>
<button type="button" class="layui-btn layui-btn-danger">警告按钮</button>
<button type="button" class="layui-btn layui-btn-disabled">禁用按钮</button>
</div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button">
<legend>按钮尺寸</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-lg">大型按钮</button>
<button type="button" class="layui-btn layui-btn-primary">默认按钮</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">小型按钮</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs">迷你按钮</button>

<br>

<button type="button" class="layui-btn layui-btn-lg">大型按钮</button>
<button type="button" class="layui-btn">默认按钮</button>
<button type="button" class="layui-btn layui-btn-sm">小型按钮</button>
<button type="button" class="layui-btn layui-btn-xs">迷你按钮</button>

<br>

<button type="button" class="layui-btn layui-btn-lg layui-btn-normal">大型按钮</button>
<button type="button" class="layui-btn layui-btn-normal">默认按钮</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal">小型按钮</button>
<button type="button" class="layui-btn layui-btn-xs layui-btn-normal">迷你按钮</button>

<br>

<div style="width: 216px; margin: 0;">
<button type="button" class="layui-btn layui-btn-fluid">流体按钮</button>
</div>
</div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button">
<legend>灵活的图标按钮(更多图标请阅览:文档-图标)</legend>
<div>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn"><i class="layui-icon"></i></button>

<br>

<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>

<br>

<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>

<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>

<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i></button>
</div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button">
<legend>还可以是圆角按钮</legend>
<div>
<button type="button" class="layui-btn layui-btn-primary layui-btn-radius">原始按钮</button>
<button type="button" class="layui-btn layui-btn-radius">默认按钮</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius">百搭按钮</button>
<button type="button" class="layui-btn layui-btn-warm layui-btn-radius">暖色按钮</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-radius">警告按钮</button>
<button type="button" class="layui-btn layui-btn-disabled layui-btn-radius">禁用按钮</button>
</div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button">
<legend>风格混搭的按钮</legend>
<div>
<button type="button" class="layui-btn layui-btn-lg layui-btn-primary layui-btn-radius">大型加圆角</button>
<a href="http://www.layui.com/doc/element/button.html" class="layui-btn" target="_blank">跳转的按钮</a>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon"></i> 删除</button>
<button type="button" class="layui-btn layui-btn-xs layui-btn-disabled"><i class="layui-icon"></i> 分享</button>
</div>
</fieldset>

<fieldset class="layui-elem-field site-demo-button">
<legend>按钮组</legend>
<div class="layui-btn-group">
<button type="button" class="layui-btn">增加</button>
<button type="button" class="layui-btn ">编辑</button>
<button type="button" class="layui-btn">删除</button>
</div>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-sm"><i class="layui-icon"></i></button>
</div>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">文字</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
</div>
</fieldset>
</div>
</div>
Loading

0 comments on commit de49c05

Please sign in to comment.