parent
774f567511
commit
44c81c72a9
@ -0,0 +1,103 @@
|
||||
<html lang="cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="陶士涵">
|
||||
<title>GO-IMAP网页版邮箱imap工具</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.el-container{
|
||||
margin-top:10px;
|
||||
height: 100%;
|
||||
}
|
||||
.el-aside{
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border: solid 1px #e6e6e6;
|
||||
}
|
||||
.el-aside .el-menu{
|
||||
border-right: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body class="text-center">
|
||||
<div id="app" style="width:100%">
|
||||
<template>
|
||||
<el-menu
|
||||
default-active="2"
|
||||
mode="horizontal">
|
||||
<el-menu-item index="1" class="mainLogo">GO-IMAP</el-menu-item>
|
||||
<el-menu-item index="2">收信</el-menu-item>
|
||||
<el-menu-item index="3">写信</el-menu-item>
|
||||
<el-header style="text-align: right; font-size: 12px" class="logout">
|
||||
<a href="/logout">退出</a>
|
||||
</el-header>
|
||||
</el-menu>
|
||||
<el-container v-loading.fullscreen.lock="fullscreenLoading">
|
||||
<el-aside>
|
||||
<el-menu
|
||||
default-active="1">
|
||||
<el-menu-item index="1" v-on:click="" v-for="(f,v) in folderlist.folders" v-bind:key="v">
|
||||
<i class="el-icon-menu"></i>
|
||||
<span slot="title"><{v}></span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
|
||||
<el-main class="mainMain">
|
||||
<div class="block">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="item in folderlist.mails" v-bind:key="item.Id" timestamp="2018/4/12" placement="top">
|
||||
<el-card>
|
||||
<h4><{item.Subject}></h4>
|
||||
<p>王小虎 提交于 2018/4/12 20:46</p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
delimiters:["<{","}>"],
|
||||
data: {
|
||||
fullscreenLoading:true,
|
||||
folderlist:[],
|
||||
},
|
||||
methods: {
|
||||
//提交表单
|
||||
getFolders: function () {
|
||||
let _this = this;
|
||||
$.get('/folders', function (rs) {
|
||||
_this.folderlist=rs.result;
|
||||
}).then(()=>{
|
||||
_this.fullscreenLoading=false;
|
||||
});
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
this.getFolders();
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
</html>
|
@ -1,71 +1,13 @@
|
||||
package tmpl
|
||||
|
||||
import (
|
||||
"github.com/taoshihan1991/imaptool/tools"
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RenderList(w http.ResponseWriter, render interface{}) {
|
||||
const html = `
|
||||
<!doctype html>
|
||||
<html lang="cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Jekyll v3.8.6">
|
||||
<title>邮箱IMAP-首页</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
|
||||
<style>
|
||||
body{
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item active">邮件夹</li>
|
||||
{{ range $key, $value := .Folders}}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<a href="/list?fid={{$key}}">{{$key}}</a>
|
||||
{{if ne $value 0 }}<span class="badge badge-primary badge-pill">{{$value}}</span>{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item active">[{{.Fid}}]邮件列表</li>
|
||||
{{ range .MailPagelist}}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<a href="/view?fid={{.Fid}}&id={{.Id}}">
|
||||
{{.Subject}}{{if eq .Subject "" }}无标题{{end}}
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
<nav aria-label="..." style="margin:20px 0;">
|
||||
<ul class="pagination">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{.PrePage}}">Previous</a>
|
||||
</li>
|
||||
{{.NumPages}}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{.NextPage}}">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
html:=tools.FileGetContent("html/list.html")
|
||||
t, _ := template.New("list").Parse(html)
|
||||
t.Execute(w, render)
|
||||
t.Execute(w,nil)
|
||||
}
|
||||
|
Loading…
Reference in new issue