修改系统 reload 分支

This commit is contained in:
whyour 2024-03-16 13:25:42 +08:00
parent 7a8a8ab9b3
commit 47d2fc24bc
4 changed files with 42 additions and 16 deletions

View File

@ -235,14 +235,14 @@ reload_qinglong() {
local reload_target="${1}" local reload_target="${1}"
local primary_branch="master" local primary_branch="master"
if [[ "${QL_BRANCH}" == "develop" ]]; then if [[ "${QL_BRANCH}" == "develop" ]] || [[ "${QL_BRANCH}" == "debian" ]] || [[ "${QL_BRANCH}" == "debian-dev" ]]; then
primary_branch="develop" primary_branch="${QL_BRANCH}"
fi fi
if [[ "$reload_target" == 'system' ]]; then if [[ "$reload_target" == 'system' ]]; then
cp -rf ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/ mv -f ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/
rm -rf $dir_static/* rm -rf $dir_static/*
cp -rf ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}/ mv -f ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}/
cp -f $file_config_sample $dir_config/config.sample.sh cp -f $file_config_sample $dir_config/config.sample.sh
fi fi
@ -314,9 +314,9 @@ check_update_dep() {
if [[ "$needRestart" == 'true' ]]; then if [[ "$needRestart" == 'true' ]]; then
delete_pm2 delete_pm2
cp -rf ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/ mv -f ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/
rm -rf $dir_static/* rm -rf $dir_static/*
cp -rf ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}/ mv -f ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}/
cp -f $file_config_sample $dir_config/config.sample.sh cp -f $file_config_sample $dir_config/config.sample.sh
reload_pm2 reload_pm2

View File

@ -1,3 +1,4 @@
import { disableBody } from '@/utils';
import config from '@/utils/config'; import config from '@/utils/config';
import { request } from '@/utils/http'; import { request } from '@/utils/http';
import WebSocketManager from '@/utils/websocket'; import WebSocketManager from '@/utils/websocket';
@ -132,6 +133,7 @@ const CheckUpdate = ({ systemInfo }: any) => {
), ),
duration: 30, duration: 30,
}); });
disableBody();
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 30000); }, 30000);

View File

@ -22,6 +22,7 @@ import { UploadOutlined } from '@ant-design/icons';
import Countdown from 'antd/lib/statistic/Countdown'; import Countdown from 'antd/lib/statistic/Countdown';
import useProgress from './progress'; import useProgress from './progress';
import pick from 'lodash/pick'; import pick from 'lodash/pick';
import { disableBody } from '@/utils';
const dataMap = { const dataMap = {
'log-remove-frequency': 'logRemoveFrequency', 'log-remove-frequency': 'logRemoveFrequency',
@ -157,6 +158,7 @@ const Other = ({
), ),
duration: 30, duration: 30,
}); });
disableBody();
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 30000); }, 30000);

View File

@ -154,9 +154,9 @@ export default function browserType() {
shell === 'none' shell === 'none'
? {} ? {}
: { : {
shell, // wechat qq uc 360 2345 sougou liebao maxthon shell, // wechat qq uc 360 2345 sougou liebao maxthon
shellVs, shellVs,
}, },
); );
console.log( console.log(
@ -335,20 +335,23 @@ export function parseCrontab(schedule: string): Date | null {
if (time) { if (time) {
return time.next().toDate(); return time.next().toDate();
} }
} catch (error) { } } catch (error) {}
return null; return null;
} }
export function getCrontabsNextDate(schedule: string, extra_schedules: string[]): Date | null { export function getCrontabsNextDate(
let date = parseCrontab(schedule) schedule: string,
extra_schedules: string[],
): Date | null {
let date = parseCrontab(schedule);
if (extra_schedules?.length) { if (extra_schedules?.length) {
extra_schedules.forEach(x => { extra_schedules.forEach((x) => {
const _date = parseCrontab(x) const _date = parseCrontab(x);
if (_date && (!date || _date < date)) { if (_date && (!date || _date < date)) {
date = _date; date = _date;
} }
}) });
} }
return date; return date;
} }
@ -362,4 +365,23 @@ export function getExtension(filename: string) {
export function getEditorMode(filename: string) { export function getEditorMode(filename: string) {
const extension = getExtension(filename) as keyof typeof LANG_MAP; const extension = getExtension(filename) as keyof typeof LANG_MAP;
return LANG_MAP[extension]; return LANG_MAP[extension];
} }
export function disableBody() {
const overlay = document.createElement('div');
overlay.style.position = 'fixed';
overlay.style.top = '0px';
overlay.style.left = '0px';
overlay.style.width = '100%';
overlay.style.height = '100%';
overlay.style.backgroundColor = 'transparent';
overlay.style.zIndex = '9999';
document.body.appendChild(overlay);
overlay.addEventListener('click', function (event) {
event.stopPropagation();
event.preventDefault();
});
document.body.style.overflow = 'hidden';
}