mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-10 04:16:29 +08:00
feat(system): fix issue with upgrade redirect (#8316)
This commit is contained in:
parent
7364d580d7
commit
fdf95297a5
11 changed files with 58 additions and 77 deletions
|
|
@ -3000,6 +3000,15 @@ func (w WebsiteService) DeleteLoadBalance(req request.WebsiteLBDelete) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
proxies, _ := w.GetProxies(website.ID)
|
||||
if len(proxies) > 0 {
|
||||
for _, proxy := range proxies {
|
||||
if strings.HasSuffix(proxy.ProxyPass, fmt.Sprintf("://%s", req.Name)) {
|
||||
return buserr.New("ErrProxyIsUsed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
includeDir := GetSitePath(website, SiteUpstreamDir)
|
||||
fileOp := files.NewFileOp()
|
||||
filePath := path.Join(includeDir, fmt.Sprintf("%s.conf", req.Name))
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ ErrDefaultAlias: "default 为保留代号,请使用其他代号"
|
|||
ErrParentWebsite: "需要先删除子网站 {{ .name }}"
|
||||
ErrBuildDirNotFound: "构建目录不存在"
|
||||
ErrImageNotExist: "运行环境 {{ .name }} 镜像不存在,请重新编辑运行环境"
|
||||
ErrProxyIsUsed: "负载均衡已被反向代理使用,无法删除"
|
||||
|
||||
#ssl
|
||||
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
class="log-item"
|
||||
:style="{ top: `${(startIndex + index) * logHeight}px` }"
|
||||
>
|
||||
<hightlight :log="log" :type="config.colorMode"></hightlight>
|
||||
<hightlight :log="log" :type="config.colorMode ?? 'nginx'"></hightlight>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -41,7 +41,7 @@ const globalStore = GlobalStore();
|
|||
|
||||
interface LogProps {
|
||||
id?: number;
|
||||
type: string;
|
||||
type?: string;
|
||||
name?: string;
|
||||
tail?: boolean;
|
||||
taskID?: string;
|
||||
|
|
@ -63,6 +63,7 @@ const props = defineProps({
|
|||
taskType: '',
|
||||
taskOperate: '',
|
||||
resourceID: 0,
|
||||
taskID: '',
|
||||
}),
|
||||
},
|
||||
defaultButton: {
|
||||
|
|
|
|||
|
|
@ -93,6 +93,17 @@ const handleMenuClick = async (path) => {
|
|||
tabsStore.activeTabPath = route.path;
|
||||
};
|
||||
|
||||
const toLogin = () => {
|
||||
let baseUrl = window.location.origin;
|
||||
let newUrl = '';
|
||||
if (globalStore.entrance) {
|
||||
newUrl = baseUrl + '/' + globalStore.entrance;
|
||||
} else {
|
||||
newUrl = baseUrl + '/login';
|
||||
}
|
||||
window.open(newUrl, '_self');
|
||||
};
|
||||
|
||||
const loadStatus = async () => {
|
||||
loading.value = globalStore.isLoading;
|
||||
loadingText.value = globalStore.loadingText;
|
||||
|
|
@ -102,6 +113,7 @@ const loadStatus = async () => {
|
|||
.then((res) => {
|
||||
if (res) {
|
||||
location.reload();
|
||||
toLogin();
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,7 +338,6 @@ const login = (formEl: FormInstance | undefined) => {
|
|||
tabsStore.removeAllTabs();
|
||||
globalStore.currentNode = 'local';
|
||||
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
|
||||
console.log('loiin syc');
|
||||
router.push({ name: 'home' });
|
||||
document.onkeydown = null;
|
||||
} catch (res) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
{{ $t('runtime.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="dotnet-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()">
|
||||
<el-table-column
|
||||
|
|
@ -87,7 +91,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
|
||||
import { onMounted, reactive, ref, computed } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -105,7 +109,6 @@ import RuntimeStatus from '@/views/website/runtime/components/runtime-status.vue
|
|||
import PortJump from '@/views/website/runtime/components/port-jump.vue';
|
||||
import { disabledButton } from '@/utils/runtime';
|
||||
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const loading = ref(false);
|
||||
const items = ref<Runtime.RuntimeDTO[]>([]);
|
||||
const operateRef = ref();
|
||||
|
|
@ -250,15 +253,6 @@ const toFolder = (folder: string) => {
|
|||
onMounted(() => {
|
||||
sync();
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
sync();
|
||||
}, 1000 * 10);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
{{ $t('runtime.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="go-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
|
||||
<el-table-column
|
||||
|
|
@ -87,7 +91,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -109,7 +113,6 @@ const mobile = computed(() => {
|
|||
return globalStore.isMobile();
|
||||
});
|
||||
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const loading = ref(false);
|
||||
const items = ref<Runtime.RuntimeDTO[]>([]);
|
||||
const operateRef = ref();
|
||||
|
|
@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
|
|||
onMounted(() => {
|
||||
sync();
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
sync();
|
||||
}, 1000 * 10);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
{{ $t('runtime.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="java-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
|
||||
<el-table-column
|
||||
|
|
@ -87,7 +91,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -109,7 +113,6 @@ const mobile = computed(() => {
|
|||
return globalStore.isMobile();
|
||||
});
|
||||
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const loading = ref(false);
|
||||
const items = ref<Runtime.RuntimeDTO[]>([]);
|
||||
const operateRef = ref();
|
||||
|
|
@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
|
|||
onMounted(() => {
|
||||
sync();
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
sync();
|
||||
}, 1000 * 10);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
{{ $t('runtime.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="node-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
|
||||
<el-table-column
|
||||
|
|
@ -88,7 +92,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -111,7 +115,6 @@ const mobile = computed(() => {
|
|||
return globalStore.isMobile();
|
||||
});
|
||||
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const loading = ref(false);
|
||||
const items = ref<Runtime.RuntimeDTO[]>([]);
|
||||
const operateRef = ref();
|
||||
|
|
@ -265,15 +268,6 @@ const toFolder = (folder: string) => {
|
|||
onMounted(() => {
|
||||
sync();
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
sync();
|
||||
}, 1000 * 10);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,7 @@
|
|||
<div>
|
||||
<RouterMenu />
|
||||
<LayoutContent :title="'PHP'" v-loading="loading">
|
||||
<template #prompt>
|
||||
<el-alert type="info" :closable="false">
|
||||
<template #title>
|
||||
<span>{{ $t('runtime.systemRestartHelper') }}</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
</template>
|
||||
<template #prompt></template>
|
||||
<template #leftToolBar>
|
||||
<el-button type="primary" @click="openCreate">
|
||||
{{ $t('runtime.create') }}
|
||||
|
|
@ -22,6 +16,10 @@
|
|||
{{ $t('container.cleanBuildCache') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="php-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
|
||||
<el-table-column
|
||||
|
|
@ -101,7 +99,7 @@
|
|||
<Log ref="logRef" @close="search" :heightDiff="280" />
|
||||
<Extensions ref="extensionsRef" @close="search" />
|
||||
<AppResources ref="checkRef" @close="search" />
|
||||
<ExtManagement ref="extManagementRef" @close="search" />
|
||||
<ExtManagement ref="extManagementRef" />
|
||||
<ComposeLogs ref="composeLogRef" />
|
||||
<Config ref="configRef" />
|
||||
<Supervisor ref="supervisorRef" />
|
||||
|
|
@ -109,7 +107,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { DeleteRuntime, OperateRuntime, RuntimeDeleteCheck, SearchRuntimes } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -146,7 +144,6 @@ let req = reactive<Runtime.RuntimeReq>({
|
|||
pageSize: 40,
|
||||
type: 'php',
|
||||
});
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const opRef = ref();
|
||||
const logRef = ref();
|
||||
const extensionsRef = ref();
|
||||
|
|
@ -265,7 +262,7 @@ const openLog = (row: Runtime.RuntimeDTO) => {
|
|||
if (row.status == 'Running') {
|
||||
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name });
|
||||
} else {
|
||||
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'building', heightDiff: 220 });
|
||||
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'Building', heightDiff: 220 });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -348,14 +345,6 @@ const onOpenBuildCache = () => {
|
|||
|
||||
onMounted(() => {
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
}, 10000 * 1);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
{{ $t('runtime.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #rightToolBar>
|
||||
<TableRefresh @search="search()" />
|
||||
<TableSetting title="python-runtime-refresh" @search="search()" />
|
||||
</template>
|
||||
<template #main>
|
||||
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
|
||||
<el-table-column
|
||||
|
|
@ -87,7 +91,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
|
|
@ -109,7 +113,6 @@ const mobile = computed(() => {
|
|||
return globalStore.isMobile();
|
||||
});
|
||||
|
||||
let timer: NodeJS.Timer | null = null;
|
||||
const loading = ref(false);
|
||||
const items = ref<Runtime.RuntimeDTO[]>([]);
|
||||
const operateRef = ref();
|
||||
|
|
@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
|
|||
onMounted(() => {
|
||||
sync();
|
||||
search();
|
||||
timer = setInterval(() => {
|
||||
search();
|
||||
sync();
|
||||
}, 1000 * 10);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer));
|
||||
timer = null;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue