Skip to content

Commit f974a64

Browse files
feat(system): fix issue with upgrade redirect
1 parent c93d229 commit f974a64

File tree

11 files changed

+60
-76
lines changed

11 files changed

+60
-76
lines changed

agent/app/service/website.go

+9
Original file line numberDiff line numberDiff line change
@@ -3000,6 +3000,15 @@ func (w WebsiteService) DeleteLoadBalance(req request.WebsiteLBDelete) error {
30003000
if err != nil {
30013001
return err
30023002
}
3003+
proxies, _ := w.GetProxies(website.ID)
3004+
if len(proxies) > 0 {
3005+
for _, proxy := range proxies {
3006+
if strings.HasSuffix(proxy.ProxyPass, fmt.Sprintf("://%s", req.Name)) {
3007+
return buserr.New("ErrProxyIsUsed")
3008+
}
3009+
}
3010+
}
3011+
30033012
includeDir := GetSitePath(website, SiteUpstreamDir)
30043013
fileOp := files.NewFileOp()
30053014
filePath := path.Join(includeDir, fmt.Sprintf("%s.conf", req.Name))

agent/i18n/lang/zh.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ ErrDefaultAlias: "default 为保留代号,请使用其他代号"
128128
ErrParentWebsite: "需要先删除子网站 {{ .name }}"
129129
ErrBuildDirNotFound: "构建目录不存在"
130130
ErrImageNotExist: "运行环境 {{ .name }} 镜像不存在,请重新编辑运行环境"
131+
ErrProxyIsUsed: "负载均衡已被反向代理使用,无法删除"
131132

132133
#ssl
133134
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"

frontend/src/components/log/drawer/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ watch(open, (val) => {
6868
6969
const acceptParams = (logProps: LogProps) => {
7070
config.value = logProps;
71+
console.log(config.value);
7172
open.value = true;
7273
};
7374

frontend/src/components/log/file/index.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class="log-item"
2626
:style="{ top: `${(startIndex + index) * logHeight}px` }"
2727
>
28-
<hightlight :log="log" :type="config.colorMode"></hightlight>
28+
<hightlight :log="log" :type="config.colorMode ?? 'nginx'"></hightlight>
2929
</div>
3030
</div>
3131
</div>
@@ -41,7 +41,7 @@ const globalStore = GlobalStore();
4141
4242
interface LogProps {
4343
id?: number;
44-
type: string;
44+
type?: string;
4545
name?: string;
4646
tail?: boolean;
4747
taskID?: string;
@@ -63,6 +63,7 @@ const props = defineProps({
6363
taskType: '',
6464
taskOperate: '',
6565
resourceID: 0,
66+
taskID: '',
6667
}),
6768
},
6869
defaultButton: {

frontend/src/layout/index.vue

+13
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ const handleMenuClick = async (path) => {
100100
tabsStore.activeTabPath = route.path;
101101
};
102102
103+
const toLogin = () => {
104+
let baseUrl = window.location.origin;
105+
let newUrl = '';
106+
if (globalStore.entrance) {
107+
newUrl = baseUrl + '/' + globalStore.entrance;
108+
} else {
109+
newUrl = baseUrl + '/login';
110+
}
111+
console.log(newUrl);
112+
window.open(newUrl, '_self');
113+
};
114+
103115
const loadStatus = async () => {
104116
loading.value = globalStore.isLoading;
105117
loadingText.value = globalStore.loadingText;
@@ -109,6 +121,7 @@ const loadStatus = async () => {
109121
.then((res) => {
110122
if (res) {
111123
location.reload();
124+
toLogin();
112125
clearInterval(Number(timer));
113126
timer = null;
114127
}

frontend/src/views/website/runtime/dotnet/index.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
{{ $t('runtime.create') }}
1717
</el-button>
1818
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="dotnet-runtime-refresh" @search="search()" />
22+
</template>
1923
<template #main>
2024
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()">
2125
<el-table-column
@@ -87,7 +91,7 @@
8791
</template>
8892

8993
<script setup lang="ts">
90-
import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
94+
import { onMounted, reactive, ref, computed } from 'vue';
9195
import { Runtime } from '@/api/interface/runtime';
9296
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
9397
import { dateFormat } from '@/utils/util';
@@ -105,7 +109,6 @@ import RuntimeStatus from '@/views/website/runtime/components/runtime-status.vue
105109
import PortJump from '@/views/website/runtime/components/port-jump.vue';
106110
import { disabledButton } from '@/utils/runtime';
107111
108-
let timer: NodeJS.Timer | null = null;
109112
const loading = ref(false);
110113
const items = ref<Runtime.RuntimeDTO[]>([]);
111114
const operateRef = ref();
@@ -250,15 +253,6 @@ const toFolder = (folder: string) => {
250253
onMounted(() => {
251254
sync();
252255
search();
253-
timer = setInterval(() => {
254-
search();
255-
sync();
256-
}, 1000 * 10);
257-
});
258-
259-
onUnmounted(() => {
260-
clearInterval(Number(timer));
261-
timer = null;
262256
});
263257
</script>
264258

frontend/src/views/website/runtime/go/index.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
{{ $t('runtime.create') }}
1717
</el-button>
1818
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="go-runtime-refresh" @search="search()" />
22+
</template>
1923
<template #main>
2024
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
2125
<el-table-column
@@ -87,7 +91,7 @@
8791
</template>
8892

8993
<script setup lang="ts">
90-
import { onMounted, onUnmounted, reactive, ref } from 'vue';
94+
import { onMounted, reactive, ref } from 'vue';
9195
import { Runtime } from '@/api/interface/runtime';
9296
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
9397
import { dateFormat } from '@/utils/util';
@@ -109,7 +113,6 @@ const mobile = computed(() => {
109113
return globalStore.isMobile();
110114
});
111115
112-
let timer: NodeJS.Timer | null = null;
113116
const loading = ref(false);
114117
const items = ref<Runtime.RuntimeDTO[]>([]);
115118
const operateRef = ref();
@@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
249252
onMounted(() => {
250253
sync();
251254
search();
252-
timer = setInterval(() => {
253-
search();
254-
sync();
255-
}, 1000 * 10);
256-
});
257-
258-
onUnmounted(() => {
259-
clearInterval(Number(timer));
260-
timer = null;
261255
});
262256
</script>
263257

frontend/src/views/website/runtime/java/index.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
{{ $t('runtime.create') }}
1717
</el-button>
1818
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="java-runtime-refresh" @search="search()" />
22+
</template>
1923
<template #main>
2024
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
2125
<el-table-column
@@ -87,7 +91,7 @@
8791
</template>
8892

8993
<script setup lang="ts">
90-
import { onMounted, onUnmounted, reactive, ref } from 'vue';
94+
import { onMounted, reactive, ref } from 'vue';
9195
import { Runtime } from '@/api/interface/runtime';
9296
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
9397
import { dateFormat } from '@/utils/util';
@@ -109,7 +113,6 @@ const mobile = computed(() => {
109113
return globalStore.isMobile();
110114
});
111115
112-
let timer: NodeJS.Timer | null = null;
113116
const loading = ref(false);
114117
const items = ref<Runtime.RuntimeDTO[]>([]);
115118
const operateRef = ref();
@@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
249252
onMounted(() => {
250253
sync();
251254
search();
252-
timer = setInterval(() => {
253-
search();
254-
sync();
255-
}, 1000 * 10);
256-
});
257-
258-
onUnmounted(() => {
259-
clearInterval(Number(timer));
260-
timer = null;
261255
});
262256
</script>
263257

frontend/src/views/website/runtime/node/index.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
{{ $t('runtime.create') }}
1717
</el-button>
1818
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="node-runtime-refresh" @search="search()" />
22+
</template>
1923
<template #main>
2024
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
2125
<el-table-column
@@ -88,7 +92,7 @@
8892
</template>
8993

9094
<script setup lang="ts">
91-
import { onMounted, onUnmounted, reactive, ref } from 'vue';
95+
import { onMounted, reactive, ref } from 'vue';
9296
import { Runtime } from '@/api/interface/runtime';
9397
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
9498
import { dateFormat } from '@/utils/util';
@@ -111,7 +115,6 @@ const mobile = computed(() => {
111115
return globalStore.isMobile();
112116
});
113117
114-
let timer: NodeJS.Timer | null = null;
115118
const loading = ref(false);
116119
const items = ref<Runtime.RuntimeDTO[]>([]);
117120
const operateRef = ref();
@@ -265,15 +268,6 @@ const toFolder = (folder: string) => {
265268
onMounted(() => {
266269
sync();
267270
search();
268-
timer = setInterval(() => {
269-
search();
270-
sync();
271-
}, 1000 * 10);
272-
});
273-
274-
onUnmounted(() => {
275-
clearInterval(Number(timer));
276-
timer = null;
277271
});
278272
</script>
279273

frontend/src/views/website/runtime/php/index.vue

+8-19
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
<div>
33
<RouterMenu />
44
<LayoutContent :title="'PHP'" v-loading="loading">
5-
<template #prompt>
6-
<el-alert type="info" :closable="false">
7-
<template #title>
8-
<span>{{ $t('runtime.systemRestartHelper') }}</span>
9-
</template>
10-
</el-alert>
11-
</template>
5+
<template #prompt></template>
126
<template #leftToolBar>
137
<el-button type="primary" @click="openCreate">
148
{{ $t('runtime.create') }}
@@ -22,6 +16,10 @@
2216
{{ $t('container.cleanBuildCache') }}
2317
</el-button>
2418
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="php-runtime-refresh" @search="search()" />
22+
</template>
2523
<template #main>
2624
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
2725
<el-table-column
@@ -101,15 +99,15 @@
10199
<Log ref="logRef" @close="search" :heightDiff="280" />
102100
<Extensions ref="extensionsRef" @close="search" />
103101
<AppResources ref="checkRef" @close="search" />
104-
<ExtManagement ref="extManagementRef" @close="search" />
102+
<ExtManagement ref="extManagementRef" />
105103
<ComposeLogs ref="composeLogRef" />
106104
<Config ref="configRef" />
107105
<Supervisor ref="supervisorRef" />
108106
</div>
109107
</template>
110108

111109
<script setup lang="ts">
112-
import { onMounted, onUnmounted, reactive, ref } from 'vue';
110+
import { onMounted, reactive, ref } from 'vue';
113111
import { Runtime } from '@/api/interface/runtime';
114112
import { DeleteRuntime, OperateRuntime, RuntimeDeleteCheck, SearchRuntimes } from '@/api/modules/runtime';
115113
import { dateFormat } from '@/utils/util';
@@ -146,7 +144,6 @@ let req = reactive<Runtime.RuntimeReq>({
146144
pageSize: 40,
147145
type: 'php',
148146
});
149-
let timer: NodeJS.Timer | null = null;
150147
const opRef = ref();
151148
const logRef = ref();
152149
const extensionsRef = ref();
@@ -265,7 +262,7 @@ const openLog = (row: Runtime.RuntimeDTO) => {
265262
if (row.status == 'Running') {
266263
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name });
267264
} else {
268-
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'building', heightDiff: 220 });
265+
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'Building', heightDiff: 220 });
269266
}
270267
};
271268
@@ -348,14 +345,6 @@ const onOpenBuildCache = () => {
348345
349346
onMounted(() => {
350347
search();
351-
timer = setInterval(() => {
352-
search();
353-
}, 10000 * 1);
354-
});
355-
356-
onUnmounted(() => {
357-
clearInterval(Number(timer));
358-
timer = null;
359348
});
360349
</script>
361350

frontend/src/views/website/runtime/python/index.vue

+5-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
{{ $t('runtime.create') }}
1717
</el-button>
1818
</template>
19+
<template #rightToolBar>
20+
<TableRefresh @search="search()" />
21+
<TableSetting title="python-runtime-refresh" @search="search()" />
22+
</template>
1923
<template #main>
2024
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
2125
<el-table-column
@@ -87,7 +91,7 @@
8791
</template>
8892

8993
<script setup lang="ts">
90-
import { onMounted, onUnmounted, reactive, ref } from 'vue';
94+
import { onMounted, reactive, ref } from 'vue';
9195
import { Runtime } from '@/api/interface/runtime';
9296
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
9397
import { dateFormat } from '@/utils/util';
@@ -109,7 +113,6 @@ const mobile = computed(() => {
109113
return globalStore.isMobile();
110114
});
111115
112-
let timer: NodeJS.Timer | null = null;
113116
const loading = ref(false);
114117
const items = ref<Runtime.RuntimeDTO[]>([]);
115118
const operateRef = ref();
@@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
249252
onMounted(() => {
250253
sync();
251254
search();
252-
timer = setInterval(() => {
253-
search();
254-
sync();
255-
}, 1000 * 10);
256-
});
257-
258-
onUnmounted(() => {
259-
clearInterval(Number(timer));
260-
timer = null;
261255
});
262256
</script>
263257

0 commit comments

Comments
 (0)