mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 15:43:02 +00:00
post-pve-install mobile nag fix (#7567)
This commit is contained in:
parent
d06ad37a22
commit
5385382a88
@ -530,14 +530,26 @@ if [ -f "$MOBILE_TPL" ] && ! grep -q "$MARKER" "$MOBILE_TPL"; then
|
|||||||
printf "%s\n" \
|
printf "%s\n" \
|
||||||
"$MARKER" \
|
"$MARKER" \
|
||||||
"<script>" \
|
"<script>" \
|
||||||
" function watchAndRemoveDialog() {" \
|
" function removeSubscriptionElements() {" \
|
||||||
" const observer = new MutationObserver(() => {" \
|
" const dialogs = document.querySelectorAll('dialog.pwt-outer-dialog');" \
|
||||||
" const dialog = document.querySelector('dialog[aria-label=\"No valid subscription\"]');" \
|
" dialogs.forEach(dialog => {" \
|
||||||
" if (dialog) { dialog.remove(); console.log('Removed dialog: No valid subscription'); observer.disconnect(); }" \
|
" const closeButton = dialog.querySelector('.fa-close');" \
|
||||||
|
" const exclamationIcon = dialog.querySelector('.fa-exclamation-triangle');" \
|
||||||
|
" const continueButton = dialog.querySelector('button');" \
|
||||||
|
" if (closeButton && exclamationIcon && continueButton) { dialog.remove(); console.log('Removed subscription dialog'); }" \
|
||||||
|
" });" \
|
||||||
|
" const cards = document.querySelectorAll('.pwt-card.pwt-p-2.pwt-d-flex.pwt-interactive.pwt-justify-content-center');" \
|
||||||
|
" cards.forEach(card => {" \
|
||||||
|
" const hasInteractiveElements = card.querySelector('button, input, a');" \
|
||||||
|
" const hasComplexStructure = card.querySelector('.pwt-grid, .pwt-flex, .pwt-button');" \
|
||||||
|
" if (!hasInteractiveElements && !hasComplexStructure) { card.remove(); console.log('Removed subscription card'); }" \
|
||||||
" });" \
|
" });" \
|
||||||
" observer.observe(document.body, { childList: true, subtree: true });" \
|
|
||||||
" }" \
|
" }" \
|
||||||
" setTimeout(watchAndRemoveDialog, 100);" \
|
" const observer = new MutationObserver(removeSubscriptionElements);" \
|
||||||
|
" observer.observe(document.body, { childList: true, subtree: true });" \
|
||||||
|
" removeSubscriptionElements();" \
|
||||||
|
" setInterval(removeSubscriptionElements, 300);" \
|
||||||
|
" setTimeout(() => {observer.disconnect();}, 10000);" \
|
||||||
"</script>" \
|
"</script>" \
|
||||||
"" >> "$MOBILE_TPL"
|
"" >> "$MOBILE_TPL"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user