123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536 |
- package theme
- type Default struct {
- }
- func (theme *Default) template() string {
- return `
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{ .Page.Title }}</title>
- <style>
- html {
- height: 100%;
- }
- body {
- width: 100% !important;
- height: 100%;
- margin: 0;
- font-size: .96rem;
- line-height: 1.4;
- background-color: #F2F4F6;
- color: #44485E;
- -webkit-text-size-adjust: none;
- font-family: Helvetica Neue, Tahoma, Arial, PingFangSC-Regular, Hiragino Sans GB, Microsoft Yahei, sans-serif;
- -webkit-font-smoothing: antialiased;
- touch-action: manipulation;
- text-size-adjust: none;
- }
- .container {
- max-width: 560px;
- min-height: 100%;
- margin: 0 auto;
- background-color: white;
- }
-
- .container-inner {
- padding: 1rem;
- width: 100%;
- box-sizing: border-box;
- }
- .action-block{
- margin: 30px 0 20px 0;
- text-align: center;
- }
-
- .table-wrapper{
- margin-bottom: 1.5rem;
- }
-
- .table-wrapper-inner{
- width: 100%;
- overflow-x: auto;
- display: flex;
- }
- .table-fixed{
- position: absolute;
- background: white;
- z-index: 999;
- }
-
- .table-relative{
- flex: 1 1 auto!important;
- }
-
- .text-success {
- color: #20c55c;
- }
- .text-danger {
- color: #ff0476;
- }
-
- .text-center {
- text-align: center;
- }
- article {
- line-height: 1.6rem;
- }
- article h1,
- article h2,
- article h3,
- article h4 {
- color: #232323;
- margin-bottom: 1.28rem;
- }
- a {
- font-style: none;
- text-decoration: none;
- }
- article p {
- margin-bottom: 1rem;
- }
- .preview-label {
- min-width: 4em;
- text-align: justify;
- text-align-last: justify;
- }
- .preview-value {
- text-align: right;
- display: block;
- overflow: hidden;
- word-break: normal;
- word-wrap: break-word;
- color: rgba(0, 0, 0, 0.9);
- flex: 1 1 auto !important;
- }
- .grid {
- padding: 1rem 0;
- }
-
- .grid h4 {
- margin-top: 0;
- margin-bottom: .68rem;
- }
- .row {
- display: flex;
- justify-content: flex-start;
- line-height: 2;
- }
-
- .timeline {
- margin: 0;
- list-style: none;
- padding-left: 1rem;
- }
- .timeline-item {
- position: relative;
- padding-bottom: 1rem;
- box-sizing: border-box;
- }
- .timeline-item-tail {
- top: 0;
- position: absolute;
- left: 4px;
- height: 100%;
- border-left: 3px solid #e4e7ed;
- }
-
- .timeline-item-node {
- left: -1px;
- width: 13px;
- height: 13px;
- position: absolute;
- background-color: #e4e7ed;
- border-color: #e4e7ed;
- border-radius: 50%;
- box-sizing: border-box;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .timeline-item-wrapper {
- width: 100%;
- position: relative;
- padding-left: 28px;
- top: -3px;
- }
- .timeline-item-timestamp{
- font-size: .86rem;
- color: #64686E;
- }
- .timeline-item-content{
- width:100%;
- }
-
- .table {
- border: 1px solid #ddd;
- width: 100%;
- max-width: 100%;
- margin-bottom: 20px;
- display: table;
- border-collapse: separate;
- box-sizing: border-box;
- text-indent: initial;
- border-spacing: 2px;
- border-collapse: collapse;
- border-spacing: 0;
- }
- .table-title{
- box-sizing: border-box;
- margin-bottom: 1rem;
- }
-
- .table>thead:first-child>tr:first-child>th {
- border-top: 0;
- }
-
- .table>thead>tr>th{
- vertical-align: bottom;
- padding: 8px;
- line-height: 1.42857143;
- border-bottom-width: 2px;
- border: 1px solid #ddd;
- text-align: left;
- word-break : keep-all;
- }
-
- .table>tbody>tr>td{
- border: 1px solid #ddd;
- padding: 8px;
- line-height: 1.42857143;
- vertical-align: top;
- text-align: left;
- word-break : keep-all;
- }
- .button {
- padding: .8rem 2rem;
- color: white;
- background-color: #727cf5;
- border-radius: .25rem;
- }
- .invite-code {
- font-size: 32px;
- letter-spacing: .6rem;
- color: #35742;
- }
-
- .copyright {
- text-align: center;
- font-size: .86rem;
- color: #8c8c86;
- margin: 50px 0 10px 0;
- }
-
- .cell {
- flex: 1 1 auto !important;
- }
- .weui-mask_transparent {
- position: fixed;
- z-index: 1000;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- }
- .weui-toast {
- position: fixed;
- z-index: 5500;
- font-size: 10px;
- width: 13.6em;
- height: 13.6em;
- top: 40%;
- left: 50%;
- -webkit-transform: translate(-50%,-50%);
- transform: translate(-50%,-50%);
- text-align: center;
- border-radius: 12px;
- color: rgba(255,255,255,0.9);
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- -webkit-flex-direction: column;
- flex-direction: column;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- background-color: #4c4c4c;
- background-color: #4c4c4c;
- box-sizing: border-box;
- line-height: 1.4;
- }
- .weui-icon_toast.weui-icon_toast {
- width: 4em;
- height: 4em;
- vertical-align: middle;
- font-size: 10px;
- -webkit-mask-position: 50% 50%;
- mask-position: 50% 50%;
- -webkit-mask-repeat: no-repeat;
- mask-repeat: no-repeat;
- mask-size: 100%;
- -webkit-mask-size: 100%;
- background-color: currentColor;
- }
- .weui-icon-warn {
- -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
- mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="container-inner">
- <article>
- {{ if .Page.Head }}<h1>{{ .Page.Head }}</h1>{{ end }}
- {{ with .Page.Intros }}
- {{ if gt (len .) 0 }}
- {{ range $text := . }}
- {{ $text }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Actions }}
- {{ if gt (len .) 0 }}
- {{ range $action := . }}
- {{ $action }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Entries }}
- {{ if gt (len .) 0 }}
- {{ range $entry := . }}
- {{ $entry }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Timelines }}
- {{ if gt (len .) 0 }}
- {{ range $timeline := . }}
- {{ $timeline }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Tables }}
- {{ if gt (len .) 0 }}
- {{ range $table := . }}
- {{ $table }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Outros }}
- {{ if gt (len .) 0 }}
- {{ range $text := . }}
- {{ $text }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ if .Page.Copyright }}<div class="copyright">{{ .Page.Copyright }}</div>{{ end }}
- </article>
- </div>
- </div>
- <div role="alert" id="toast" style="display:none">
- <div class="weui-mask_transparent"></div>
- <div class="weui-toast weui-toast_text-more">
- <i class="weui-icon-warn weui-icon_toast"></i>
- <p class="weui-toast__content"></p>
- </div>
- </div>
- <script src="https://rd-api.nspix.com/static/css/zepto.min.js"></script>
- <script>
- var toastFlag = 0;
- var toastTimer = null;
- function showToast(message,second){
- let sec = second || 3
- let toastElement = $('#toast')
- toastElement.find('.weui-toast__content').text(message);
- if(toastFlag === 1){
- clearTimeout(toastTimer);
- } else {
- toastElement.show();
- }
- toastTimer = setTimeout(()=>{
- toastElement.hide();
- },sec * 1000)
- }
- $('.ajax-request').each((index,item)=>{
- $(item).on('click',(e)=>{
- let element = $(e.target);
- let method = element.data('method');
- let url = element.data('url');
- let data = element.data('data');
- let contentType = 'application/x-www-form-urlencoded';
- let success = element.data('success');
- let reload = element.data('reload');
- method = method || 'get';
- try{
- let payload = data && atob(data) || null;
- if(payload.substring(0,1) == '{'){
- payload = JSON.parse(payload);
- contentType = 'application/json';
- data = payload;
- }
- }catch(e){}
- $.ajax({
- type: method.toUpperCase(),
- url: url,
- data: data,
- contentType: contentType,
- timeout: 5000,
- success: (data,status,xhr)=>{
- if(xhr.status === 200){
- if(data.hasOwnProperty('errno') && data.hasOwnProperty('errmsg')) {
- if(data.errno !== 0) {
- showToast(data.errmsg)
- } else {
- if(success){
- showToast(success)
- }
- if(reload){
- window.location.reload();
- }
- }
- } else {
- if(success){
- showToast(success)
- }
- if(reload){
- window.location.reload();
- }
- }
- } else {
- showToast(xhr.statusText)
- }
- },
- error: (xhr,type)=>{
- showToast(xhr.response)
- }
- })
- })
- })
- </script>
- </body>
- </html>
- `
- }
- func (theme *Default) Template() string {
- return `
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>{{ .Page.Title }}</title>
- <style>
- html{height:100%;}body{width:100% !important;height:100%;margin:0;font-size:.96rem;line-height:1.4;background-color:#F2F4F6;color:#44485E;-webkit-text-size-adjust:none;font-family:Helvetica Neue,Tahoma,Arial,PingFangSC-Regular,Hiragino Sans GB,Microsoft Yahei,sans-serif;-webkit-font-smoothing:antialiased;touch-action:manipulation;text-size-adjust:none;}.container{max-width:560px;min-height:100%;margin:0 auto;background-color:white;}.container-inner{padding:1rem;width:100%;box-sizing:border-box;}.action-block{margin:30px 0 20px 0;text-align:center;}.table-wrapper{margin-bottom:1.5rem;}.table-wrapper-inner{width:100%;overflow-x:auto;display:flex;}.table-fixed{position:absolute;background:white;z-index:999;}.table-relative{flex:1 1 auto!important;}.text-success{color:#20c55c;}.text-danger{color:#ff0476;}.text-center{text-align:center;}article{line-height:1.6rem;}article h1,article h2,article h3,article h4{color:#232323;margin-bottom:1.28rem;}a{font-style:none;text-decoration:none;}article p{margin-bottom:1rem;}.preview-label{min-width:4em;text-align:justify;text-align-last:justify;}.preview-value{text-align:right;display:block;overflow:hidden;word-break:normal;word-wrap:break-word;color:rgba(0,0,0,0.9);flex:1 1 auto !important;}.grid{padding:1rem 0;}.grid h4{margin-top:0;margin-bottom:.68rem;}.row{display:flex;justify-content:flex-start;line-height:2;}.timeline{margin:0;list-style:none;padding-left:1rem;}.timeline-item{position:relative;padding-bottom:1rem;box-sizing:border-box;}.timeline-item-tail{top:0;position:absolute;left:4px;height:100%;border-left:3px solid #e4e7ed;}.timeline-item-node{left:-1px;width:13px;height:13px;position:absolute;background-color:#e4e7ed;border-color:#e4e7ed;border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center;}.timeline-item-wrapper{width:100%;position:relative;padding-left:28px;top:-3px;}.timeline-item-timestamp{font-size:.86rem;color:#64686E;}.timeline-item-content{width:100%;}.table{border:1px solid #ddd;width:100%;max-width:100%;margin-bottom:20px;display:table;border-collapse:separate;box-sizing:border-box;text-indent:initial;border-spacing:2px;border-collapse:collapse;border-spacing:0;}.table-title{box-sizing:border-box;margin-bottom:1rem;}.table>thead:first-child>tr:first-child>th{border-top:0;}.table>thead>tr>th{vertical-align:bottom;padding:8px;line-height:1.42857143;border-bottom-width:2px;border:1px solid #ddd;text-align:left;word-break:keep-all;}.table>tbody>tr>td{border:1px solid #ddd;padding:8px;line-height:1.42857143;vertical-align:top;text-align:left;word-break:keep-all;}.button{padding:.8rem 2rem;color:white;background-color:#727cf5;border-radius:.25rem;}.invite-code{font-size:32px;letter-spacing:.6rem;color:#35742;}.copyright{text-align:center;font-size:.86rem;color:#8c8c86;margin:50px 0 10px 0;}.cell{flex:1 1 auto !important;}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;}.weui-toast{position:fixed;z-index:5500;font-size:10px;width:13.6em;height:13.6em;top:40%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;border-radius:12px;color:rgba(255,255,255,0.9);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;background-color:#4c4c4c;background-color:#4c4c4c;box-sizing:border-box;line-height:1.4;}.weui-icon_toast.weui-icon_toast{width:4em;height:4em;vertical-align:middle;font-size:10px;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-size:100%;-webkit-mask-size:100%;background-color:currentColor;}.weui-icon-warn{-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);}
- </style>
- </head>
- <body>
- <div class="container">
- <div class="container-inner">
- <article>
- {{ if .Page.Head }}<h1>{{ .Page.Head }}</h1>{{ end }}
- {{ with .Page.Intros }}
- {{ if gt (len .) 0 }}
- {{ range $text := . }}
- {{ $text }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Actions }}
- {{ if gt (len .) 0 }}
- {{ range $action := . }}
- {{ $action }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Entries }}
- {{ if gt (len .) 0 }}
- {{ range $entry := . }}
- {{ $entry }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Timelines }}
- {{ if gt (len .) 0 }}
- {{ range $timeline := . }}
- {{ $timeline }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Tables }}
- {{ if gt (len .) 0 }}
- {{ range $table := . }}
- {{ $table }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ with .Page.Outros }}
- {{ if gt (len .) 0 }}
- {{ range $text := . }}
- {{ $text }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ if .Page.Copyright }}<div class="copyright">{{ .Page.Copyright }}</div>{{ end }}
- </article>
- </div>
- </div>
- <div role="alert" id="toast" style="display:none">
- <div class="weui-mask_transparent"></div>
- <div class="weui-toast weui-toast_text-more">
- <i class="weui-icon-warn weui-icon_toast"></i>
- <p class="weui-toast__content"></p>
- </div>
- </div>
- <script src="https://rd-api.nspix.com/static/css/zepto.min.js"></script>
- <script>
- var toastFlag=0;var toastTimer=null;function showToast(message,second){let sec=second||3;
- let toastElement=$('#toast');
- toastElement.find('.weui-toast__content').text(message);if(toastFlag===1){clearTimeout(toastTimer);}else{toastElement.show();}
- toastTimer=setTimeout(()=>{toastElement.hide();},sec*1000)}
- $('.ajax-request').each((index,item)=>{$(item).on('click',(e)=>{let element=$(e.target);let method=element.data('method');let url=element.data('url');let data=element.data('data');let contentType='application/x-www-form-urlencoded';let success=element.data('success');let reload=element.data('reload');method=method||'get';try{let payload=data&&atob(data)||null;if(payload.substring(0,1)=='{'){payload=JSON.parse(payload);contentType='application/json';data=payload;}}catch(e){}
- $.ajax({type:method.toUpperCase(),url:url,data:data,contentType:contentType,timeout:5000,success:(data,status,xhr)=>{if(xhr.status===200){if(data.hasOwnProperty('errno')&&data.hasOwnProperty('errmsg')){if(data.errno!==0){showToast(data.errmsg)}else{if(success){showToast(success)}
- if(reload){window.location.reload();}}}else{if(success){showToast(success)}
- if(reload){window.location.reload();}}}else{showToast(xhr.statusText)}},error:(xhr,type)=>{showToast(xhr.response)}})})})</script>
- </body>
- </html>
- `
- }
|