1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 已安装页面增加定时刷新

This commit is contained in:
zhengkunwang223 2022-10-17 17:28:58 +08:00 committed by zhengkunwang223
parent 31990c7735
commit 20a57cc5ab
2 changed files with 15 additions and 4 deletions

View File

@ -32,6 +32,9 @@
<el-tag type="error">{{ row.status }}</el-tag> <el-tag type="error">{{ row.status }}</el-tag>
</template> </template>
</el-popover> </el-popover>
<el-icon v-if="row.status === 'Installing'" class="is-loading">
<Loading />
</el-icon>
<el-tag v-else>{{ row.status }}</el-tag> <el-tag v-else>{{ row.status }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -87,7 +90,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { GetAppInstalled, InstalledOp, SyncInstalledApp, GetAppUpdateVersions } from '@/api/modules/app'; import { GetAppInstalled, InstalledOp, SyncInstalledApp, GetAppUpdateVersions } from '@/api/modules/app';
import { onMounted, reactive, ref } from 'vue'; import { onBeforeMount, onMounted, reactive, ref } from 'vue';
import ComplexTable from '@/components/complex-table/index.vue'; import ComplexTable from '@/components/complex-table/index.vue';
import { dateFromat } from '@/utils/util'; import { dateFromat } from '@/utils/util';
import i18n from '@/lang'; import i18n from '@/lang';
@ -97,6 +100,7 @@ import { App } from '@/api/interface/app';
let data = ref<any>(); let data = ref<any>();
let loading = ref(false); let loading = ref(false);
let timer: NodeJS.Timer | null = null;
const paginationConfig = reactive({ const paginationConfig = reactive({
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -245,6 +249,13 @@ const openBackups = (installId: number) => {
onMounted(() => { onMounted(() => {
search(); search();
timer = setInterval(() => {
search();
}, 1000 * 8);
});
onBeforeMount(() => {
clearInterval(Number(timer));
}); });
</script> </script>

View File

@ -39,9 +39,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
// host: '0.0.0.0', // host: '0.0.0.0',
// https: false, // https: false,
proxy: { proxy: {
'/1panel': { // '/1panel': {
target: 'http://0.0.0.0:4004', // target: 'http://0.0.0.0:4004',
}, // },
'/api/v1': { '/api/v1': {
target: 'http://127.0.0.1:9999', target: 'http://127.0.0.1:9999',
changeOrigin: true, changeOrigin: true,