diff --git a/app/Filament/Resources/User/UserResource/Pages/UserProfile.php b/app/Filament/Resources/User/UserResource/Pages/UserProfile.php
index c230df3b..7071dbc8 100644
--- a/app/Filament/Resources/User/UserResource/Pages/UserProfile.php
+++ b/app/Filament/Resources/User/UserResource/Pages/UserProfile.php
@@ -82,13 +82,16 @@ class UserProfile extends Page
private function buildEnableDisableAction(): Actions\Action
{
- return Actions\Action::make($this->record->enabled == 'yes' ? __('admin.resources.user.actions.disable_modal_btn') : __('admin.resources.user.actions.enable_modal_btn'))
+ return Actions\Action::make('enable_disable')
+ ->label($this->record->enabled == 'yes' ? __('admin.resources.user.actions.disable_modal_btn') : __('admin.resources.user.actions.enable_modal_btn'))
->modalHeading($this->record->enabled == 'yes' ? __('admin.resources.user.actions.disable_modal_title') : __('admin.resources.user.actions.enable_modal_title'))
->form([
Forms\Components\TextInput::make('reason')->label(__('admin.resources.user.actions.enable_disable_reason'))->placeholder(__('admin.resources.user.actions.enable_disable_reason_placeholder')),
Forms\Components\Hidden::make('action')->default($this->record->enabled == 'yes' ? 'disable' : 'enable'),
Forms\Components\Hidden::make('uid')->default($this->record->id),
])
+// ->visible(false)
+// ->hidden(true)
->action(function ($data) {
$userRep = $this->getRep();
try {
diff --git a/app/Models/Torrent.php b/app/Models/Torrent.php
index 88e1dc22..aa7b762f 100644
--- a/app/Models/Torrent.php
+++ b/app/Models/Torrent.php
@@ -216,7 +216,7 @@ class Torrent extends NexusModel
public static function getFieldsForList($appendTableName = false): array|bool
{
- $fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr, approval_status';
+ $fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr, approval_status, cover';
$fields = preg_split('/[,\s]+/', $fields);
if ($appendTableName) {
foreach ($fields as &$value) {
diff --git a/include/constants.php b/include/constants.php
index 5d781857..7d47fff0 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -1,6 +1,6 @@
listLeechingSeedingStatus($CURUSER['id'], $torrentIdArr);
$tagRep = new \App\Repositories\TagRepository();
@@ -3487,7 +3488,20 @@ foreach ($rows as $row)
$sp_torrent = get_torrent_promotion_append($row['sp_state'],"",true,$row["added"], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);
$hrImg = get_hr_img($row);
- print("
| ".$stickyicon."".htmlspecialchars($dispname)."");
+ //cover
+ $coverSrc = '';
+ if ($imdb_id = parse_imdb_id($row["url"])) {
+ try {
+ $coverSrc = $imdb->getMovie($imdb_id)->photo(false);
+ } catch (\Exception $exception) {
+ do_log("torrent: {$row['id']} get cover from imdb error: ".$exception->getMessage() . "\n[stacktrace]\n" . $exception->getTraceAsString(), 'error');
+ }
+ }
+ if (empty($coverSrc) && !empty($row['cover'])) {
+ $coverSrc = $row['cover'];
+ }
+ $tdCover = sprintf(' |  | ', $coverSrc);
+ print(" | ");
if ($wait)
diff --git a/nexus/Install/Update.php b/nexus/Install/Update.php
index 54bd9569..497faaad 100644
--- a/nexus/Install/Update.php
+++ b/nexus/Install/Update.php
@@ -91,7 +91,7 @@ class Update extends Install
*/
foreach (['adminpanel', 'modpanel', 'sysoppanel'] as $table) {
$columnInfo = NexusDB::getMysqlColumnInfo($table, 'id');
- if ($columnInfo['DATA_TYPE'] == 'tinyint') {
+ if ($columnInfo['DATA_TYPE'] == 'tinyint' || empty($columnInfo['EXTRA']) || $columnInfo['EXTRA'] != 'auto_increment') {
sql_query("alter table $table modify id int(11) unsigned not null AUTO_INCREMENT");
}
}
diff --git a/public/js/nexus.js b/public/js/nexus.js
index bd0ea98f..bca0eea3 100644
--- a/public/js/nexus.js
+++ b/public/js/nexus.js
@@ -8,9 +8,21 @@ jQuery(document).ready(function () {
}
})
+ // preview
function getPosition(e, imgEle) {
let imgWidth = imgEle.prop('naturalWidth')
let imgHeight = imgEle.prop("naturalHeight")
+ console.log(`imgWidth: ${imgWidth}, imgHeight: ${imgHeight}`)
+ let ratio = imgWidth / imgHeight;
+ if (imgWidth > window.innerWidth) {
+ imgWidth = window.innerWidth;
+ imgHeight = imgWidth / ratio;
+ }
+ if (imgHeight > window.innerHeight) {
+ imgHeight = window.innerHeight;
+ imgWidth = imgHeight * ratio;
+ }
+ let width = imgWidth, height= imgHeight;
let left = e.pageX + 10;
if (left + imgWidth > window.innerWidth) {
left = e.pageX - 10 - imgWidth
@@ -19,7 +31,9 @@ jQuery(document).ready(function () {
if (top + imgHeight > window.innerHeight) {
top = e.pageY - imgHeight / 2
}
- return {left, top}
+ let result = {left, top, width, height}
+ console.log(result)
+ return result
}
var previewEle = jQuery('#nexus-preview')
var imgEle, selector = '.preview'
@@ -37,4 +51,25 @@ jQuery(document).ready(function () {
previewEle.css(position)
})
+ // lazy load
+ if ("IntersectionObserver" in window) {
+ const imgList = [...document.querySelectorAll('.nexus-lazy-load')]
+ var io = new IntersectionObserver((entries) =>{
+ entries.forEach(item => {
+ // isIntersecting是一个Boolean值,判断目标元素当前是否可见
+ if (item.isIntersecting) {
+ item.target.src = item.target.dataset.src
+ item.target.classList.add('preview')
+ // 图片加载后即停止监听该元素
+ io.unobserve(item.target)
+ }
+ })
+ }, {
+ root: document.querySelector('body')
+ })
+
+ // observe遍历监听所有img节点
+ imgList.forEach(img => io.observe(img))
+ }
+
})
diff --git a/public/pic/misc/spinner.svg b/public/pic/misc/spinner.svg
new file mode 100644
index 00000000..73eddcc9
--- /dev/null
+++ b/public/pic/misc/spinner.svg
@@ -0,0 +1,41 @@
+
\ No newline at end of file
|