feat: menric

This commit is contained in:
hashbro
2026-09-06 03:55:24 +08:00
parent f94def7c1f
commit d4c096ed4a
50 changed files with 1698 additions and 148 deletions
+19 -3
View File
@@ -165,6 +165,16 @@
@if ($tab === 'photos')
<form class="layui-form" lay-filter="LAY-photo-filter" style="margin-bottom: 12px;">
<div class="layui-form-item" style="margin-bottom: 0;">
<div class="layui-inline">
<label class="layui-form-label" style="width: auto;">已读</label>
<div class="layui-input-inline" style="width: 140px;">
<select name="read">
<option value="">全部</option>
<option value="0">未读</option>
<option value="1">已读</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: auto;">敏感词</label>
<div class="layui-input-inline" style="width: 180px;">
@@ -245,7 +255,7 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
var revealMnemonic = window.CorunaMnemonicReveal({
token: token,
google_bound: @json(!empty($google_bound)),
security_url: @json(auth('admin')->check() ? route('admin.security.google2fa') : '')
security_url: @json($google2fa_url ?? '')
});
var dash = function (v) { return v ? v : '—'; };
var esc = function (v) {
@@ -315,14 +325,15 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
});
if (tab === 'photos') {
var photoState = { page: 1, limit: 20, sensitive: '' };
var photoState = { page: 1, limit: 20, sensitive: '', read: '' };
var renderPhotos = function () {
$.getJSON(tabDataUrl, {
tab: 'photos',
page: photoState.page,
limit: photoState.limit,
sensitive: photoState.sensitive
sensitive: photoState.sensitive,
read: photoState.read
}, function (res) {
var $grid = $('#LAY-photo-grid').empty();
var list = (res && res.data) ? res.data : [];
@@ -334,6 +345,7 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
var hit = (p.x_hit == null || p.x_hit === '') ? '—' : p.x_hit;
var card = $(
'<a class="photo-card" href="javascript:;">' +
(Number(p.read) === 1 ? '' : '<i class="photo-unread-dot" title="未读"></i>') +
'<img alt="">' +
'<div></div>' +
'<div class="muted" style="font-size:12px;color:#888;"></div>' +
@@ -349,6 +361,8 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
);
card.on('click', function (e) {
e.preventDefault();
card.find('.photo-unread-dot').remove();
p.read = 1;
layer.open({
type: 1,
title: '相册预览',
@@ -383,6 +397,7 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
form.on('submit(LAY-photo-search)', function (data) {
photoState.sensitive = data.field.sensitive || '';
photoState.read = data.field.read || '';
photoState.page = 1;
renderPhotos();
return false;
@@ -391,6 +406,7 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
$('#LAY-photo-reset').on('click', function () {
setTimeout(function () {
photoState.sensitive = '';
photoState.read = '';
photoState.page = 1;
renderPhotos();
}, 0);