mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 13:40:06 +00:00
Web 服务
This commit is contained in:
BIN
resource/static/logo.png
Normal file
BIN
resource/static/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
57
resource/static/main.css
Normal file
57
resource/static/main.css
Normal file
@@ -0,0 +1,57 @@
|
||||
@media only screen and (min-width: 1200px) {
|
||||
.ui.container {
|
||||
width: 77%;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.login-form .column {
|
||||
max-width: 450px;
|
||||
}
|
||||
|
||||
.login-form .grid {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.nb-container {
|
||||
margin-top: 75px;
|
||||
}
|
||||
|
||||
.avatar-list img {
|
||||
width: 2.6rem !important;
|
||||
height: 2.6rem !important;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.card-list {
|
||||
width: 100% !important;
|
||||
padding-right: unset !important;
|
||||
}
|
||||
|
||||
.card-list .card {
|
||||
width: calc(33.33333333% - 1.1em) !important;
|
||||
margin-right: unset !important;
|
||||
margin-top: unset !important;
|
||||
|
||||
}
|
||||
|
||||
.card-list .card:nth-child(1) {
|
||||
margin-top: 0.875em !important;
|
||||
}
|
||||
|
||||
.card-list .card:nth-child(2) {
|
||||
margin-top: 0.875em !important;
|
||||
}
|
||||
|
||||
.card-list .card:nth-child(3) {
|
||||
margin-top: 0.875em !important;
|
||||
}
|
||||
|
||||
.grid-list>.grid>.row {
|
||||
border-bottom: solid gainsboro 2px;
|
||||
padding-bottom: .6em;
|
||||
margin-bottom: .6em;
|
||||
}
|
||||
79
resource/static/main.js
Normal file
79
resource/static/main.js
Normal file
@@ -0,0 +1,79 @@
|
||||
$('.ui.checkbox').checkbox();
|
||||
$('.ui.dropdown').dropdown();
|
||||
|
||||
const confirmBtn = $('.mini.confirm.modal .positive.button')
|
||||
function showConfirm(title, content, callFn, extData) {
|
||||
const modal = $('.mini.confirm.modal')
|
||||
modal.children('.header').text(title)
|
||||
modal.children('.content').text(content)
|
||||
if (confirmBtn.hasClass('loading')) {
|
||||
return false
|
||||
}
|
||||
modal.modal({
|
||||
closable: true,
|
||||
onApprove: function () {
|
||||
confirmBtn.toggleClass('loading')
|
||||
callFn(extData)
|
||||
return false
|
||||
}
|
||||
}).modal('show')
|
||||
}
|
||||
|
||||
function showFormModal(modelSelector, formID, URL, getData) {
|
||||
$(modelSelector).modal({
|
||||
closable: true,
|
||||
onApprove: function () {
|
||||
let success = false
|
||||
const btn = $(modelSelector + ' .positive.button')
|
||||
const form = $(modelSelector + ' form')
|
||||
if (btn.hasClass('loading')) {
|
||||
return success
|
||||
}
|
||||
form.children('.message').remove()
|
||||
btn.toggleClass('loading')
|
||||
const data = getData ? getData() : $(formID).serializeArray().reduce(function (obj, item) {
|
||||
obj[item.name] = (item.name.endsWith('_id') || item.name === 'id' || item.name === 'permission') ? parseInt(item.value) : item.value;
|
||||
return obj;
|
||||
}, {});
|
||||
$.post(URL, JSON.stringify(data)).done(function (resp) {
|
||||
if (resp.code == 200) {
|
||||
if (resp.message) {
|
||||
alert(resp.message)
|
||||
}
|
||||
window.location.reload()
|
||||
} else {
|
||||
form.append(`<div class="ui negative message"><div class="header">操作失败</div><p>` + resp.message + `</p></div>`)
|
||||
}
|
||||
}).fail(function (err) {
|
||||
form.append(`<div class="ui negative message"><div class="header">网络错误</div><p>` + err.responseText + `</p></div>`)
|
||||
}).always(function () {
|
||||
btn.toggleClass('loading')
|
||||
});
|
||||
return success
|
||||
}
|
||||
}).modal('show')
|
||||
}
|
||||
|
||||
function logout(id) {
|
||||
$.post('/api/logout', JSON.stringify({ id: id })).done(function (resp) {
|
||||
if (resp.code == 200) {
|
||||
$.suiAlert({
|
||||
title: '注销成功',
|
||||
type: 'success',
|
||||
time: '3',
|
||||
position: 'top-center',
|
||||
});
|
||||
window.location.reload()
|
||||
} else {
|
||||
$.suiAlert({
|
||||
title: '注销失败',
|
||||
description: resp.code + ':' + resp.message,
|
||||
type: 'error',
|
||||
time: '3',
|
||||
position: 'top-center',
|
||||
});
|
||||
}
|
||||
}).fail(function (err) {
|
||||
alert('网络错误:' + err.responseText)
|
||||
})
|
||||
}
|
||||
1
resource/static/semantic-ui-alerts.min.css
vendored
Normal file
1
resource/static/semantic-ui-alerts.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.ui-alerts{position:fixed;z-index:2060;padding:23px}.ui-alerts.center{top:50%;left:50%;margin-top:-100px;margin-left:-222px}.ui-alerts.top-right{top:20px;right:20px}.ui-alerts.top-center{top:20px;margin-left:-222px;left:50%}.ui-alerts.top-left{top:20px;left:20px}.ui-alerts.bottom-right{bottom:0;right:20px}.ui-alerts.bottom-center{bottom:0;margin-left:-222px;left:50%}.ui-alerts.bottom-left{bottom:0;left:20px}.ui-alerts.ui-alerts>.message>.content>.header{padding-right:13px}@media (min-width:320px){.ui-alerts.top-center{margin-left:-163px}}
|
||||
1
resource/static/semantic-ui-alerts.min.js
vendored
Normal file
1
resource/static/semantic-ui-alerts.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
$.suiAlert=function(i){function t(){l=setTimeout(function(){c.transition({animation:e,duration:"2s",onComplete:function(){c.remove()}})},1e3*o.time)}var o=$.extend({title:"Semantic UI Alerts",description:"semantic ui alerts library",type:"error",time:5,position:"top-right",icon:!1},i);o.icon===!1&&("info"==o.type?o.icon="announcement":"success"==o.type?o.icon="checkmark":"error"==o.type?o.icon="remove":"warning"==o.type&&(o.icon="warning circle"));var e="drop";"top-right"==o.position?e="fly left":"top-center"==o.position?e="fly down":"top-left"==o.position?e="fly right":"bottom-right"==o.position?e="fly left":"bottom-center"==o.position?e="fly up":"bottom-left"==o.position&&(e="fly right");var n="",r=$(window).width();r<425&&(n="mini");var s="ui-alerts."+o.position;$("body > ."+s).length||$("body").append('<div class="ui-alerts '+o.position+'"></div>');var c=$('<div class="ui icon floating '+n+" message "+o.type+'" id="alert"> <i class="'+o.icon+' icon"></i> <i class="close icon" id="alertclose"></i> <div class="content"> <div class="header">'+o.title+"</div> <p>"+o.description+"</p> </div> </div>");$("."+s).prepend(c),c.transition("pulse"),$("#alertclose").on("click",function(){$(this).closest("#alert").transition({animation:e,onComplete:function(){c.remove()}})});var l=0;$(c).mouseenter(function(){clearTimeout(l)}).mouseleave(function(){t()}),t()};
|
||||
Reference in New Issue
Block a user