mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-17 08:06:30 +00:00
Merge pull request #14379 from 1Panel-dev/pr@dev-v2@fix-cache
fix: revise cache index
This commit is contained in:
@@ -28,6 +28,7 @@ const hostRouter = {
|
||||
component: () => import('@/views/host/monitor/monitor/index.vue'),
|
||||
meta: {
|
||||
icon: 'p-system-monitor-menu',
|
||||
activeMenu: '/hosts/monitor/monitor',
|
||||
title: 'menu.monitor',
|
||||
permission: 'host_monitor_view',
|
||||
},
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { computed, reactive, ref, watch, toRef } from 'vue';
|
||||
import FireRouter from '@/views/host/firewall/index.vue';
|
||||
import DockerGuardStatus from '@/views/host/firewall/docker/status/index.vue';
|
||||
import DockerGuardDetail from '@/views/host/firewall/docker/detail/index.vue';
|
||||
@@ -371,6 +371,9 @@ const orphanPaginationConfig = reactive({
|
||||
pageSize: 20,
|
||||
total: computed(() => orphanRows.value.length),
|
||||
});
|
||||
useSearchState('host/firewall/docker/pagination', { pageSize: toRef(paginationConfig, 'pageSize') });
|
||||
useSearchState('host/firewall/docker/orphan-pagination', { pageSize: toRef(orphanPaginationConfig, 'pageSize') });
|
||||
|
||||
const containerPageRows = computed(() => {
|
||||
const start = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
|
||||
return containerRows.value.slice(start, start + paginationConfig.pageSize);
|
||||
|
||||
@@ -100,6 +100,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { VM } from '@/api/interface/vm';
|
||||
@@ -132,6 +134,10 @@ const props = defineProps<{
|
||||
const vmUnavailable = computed(() => props.vmUnavailable);
|
||||
const loading = ref(false);
|
||||
const searchName = ref('');
|
||||
|
||||
useSearchState('1Panel/vm/iso/iso', {
|
||||
searchName: searchName,
|
||||
});
|
||||
const items = ref<VM.IsoItem[]>([]);
|
||||
const operateRef = ref();
|
||||
const deleteRef = ref();
|
||||
|
||||
@@ -478,6 +478,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
|
||||
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
@@ -524,6 +526,10 @@ const getStoredViewMode = (): VMListViewMode => {
|
||||
const loading = ref(false);
|
||||
const fullPageLoading = ref(false);
|
||||
const searchName = ref('');
|
||||
|
||||
useSearchState('1Panel/vm/list/index', {
|
||||
searchName: searchName,
|
||||
});
|
||||
const viewMode = ref<VMListViewMode>(getStoredViewMode());
|
||||
const items = ref<VM.Item[]>([]);
|
||||
const resourceItems = ref<VM.Item[]>([]);
|
||||
@@ -554,7 +560,7 @@ const getQueryName = () => {
|
||||
return Array.isArray(name) ? name[0] || '' : String(name || '');
|
||||
};
|
||||
|
||||
searchName.value = getQueryName();
|
||||
if (typeof route.query.name === 'string') searchName.value = getQueryName();
|
||||
|
||||
const paginationConfig = reactive({
|
||||
currentPage: 1,
|
||||
@@ -963,7 +969,7 @@ watch(
|
||||
watch(
|
||||
() => route.query.name,
|
||||
() => {
|
||||
searchName.value = getQueryName();
|
||||
if (typeof route.query.name === 'string') searchName.value = getQueryName();
|
||||
paginationConfig.currentPage = 1;
|
||||
if (props.vmEnvironmentLoaded && !vmUnavailable.value) {
|
||||
search();
|
||||
|
||||
@@ -172,6 +172,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
@@ -188,6 +190,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
const loading = ref(false);
|
||||
const searchName = ref('');
|
||||
|
||||
useSearchState('1Panel/vm/network/index', {
|
||||
searchName: searchName,
|
||||
});
|
||||
const items = ref<VM.NetworkItem[]>([]);
|
||||
const switchingIds = ref<number[]>([]);
|
||||
const statusSwitchingIds = ref<number[]>([]);
|
||||
|
||||
@@ -125,6 +125,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
@@ -142,6 +144,10 @@ const props = defineProps<{
|
||||
}>();
|
||||
const loading = ref(false);
|
||||
const searchName = ref('');
|
||||
|
||||
useSearchState('1Panel/vm/storage/index', {
|
||||
searchName: searchName,
|
||||
});
|
||||
const items = ref<VM.StorageItem[]>([]);
|
||||
const switchingIds = ref<number[]>([]);
|
||||
const statusSwitchingIds = ref<number[]>([]);
|
||||
|
||||
@@ -86,6 +86,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSearchState } from '@/utils/search-reset';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
@@ -105,6 +107,10 @@ const vmUnavailable = computed(() => props.vmUnavailable);
|
||||
const loading = ref(false);
|
||||
const deleteLoading = ref(false);
|
||||
const searchName = ref('');
|
||||
|
||||
useSearchState('1Panel/vm/template/index', {
|
||||
searchName: searchName,
|
||||
});
|
||||
const items = ref<VM.TemplateItem[]>([]);
|
||||
const taskLogRef = ref();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user