-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67c1a07
commit 10c1665
Showing
4 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {toggleElem} from '../../utils/dom.js'; | ||
import {POST} from '../../modules/fetch.js'; | ||
|
||
const {appSubUrl} = window.config; | ||
|
||
export async function initAdminSelfCheck() { | ||
const elAdminSelfCheckFrontend = document.querySelector('.page-content.admin .self-check-by-frontend'); | ||
if (!elAdminSelfCheckFrontend) return; | ||
|
||
const resp = await POST(`${appSubUrl}/admin/selfcheck/with-frontend`, { | ||
data: new URLSearchParams({ | ||
locationOrigin: window.location.origin, | ||
now: Date.now(), | ||
}), | ||
}); | ||
|
||
const json = await resp.json(); | ||
console.log(json); | ||
|
||
// only show the "no problem" if there is no visible "self-check-problem" | ||
const elContent = document.querySelector('.page-content.admin .admin-setting-content:not(.tw-hidden)'); | ||
const hasProblem = Boolean(elContent.querySelectorAll('.self-check-problem').length); | ||
toggleElem(elContent.querySelector('.self-check-no-problem'), !hasProblem); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters