mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-11 08:00:31 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f475500543 |
@@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue';
|
import { onActivated, ref, watch } from 'vue';
|
||||||
defineOptions({ name: 'TableSearch' });
|
defineOptions({ name: 'TableSearch' });
|
||||||
|
|
||||||
const emit = defineEmits(['search', 'update:searchName']);
|
const emit = defineEmits(['search', 'update:searchName']);
|
||||||
@@ -42,6 +42,10 @@ watch(
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
onActivated(() => {
|
||||||
|
searchInfo.value = props.searchName;
|
||||||
|
});
|
||||||
|
|
||||||
const search = () => {
|
const search = () => {
|
||||||
emit('update:searchName', searchInfo.value);
|
emit('update:searchName', searchInfo.value);
|
||||||
emit('search');
|
emit('search');
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onMounted, ref, useAttrs } from 'vue';
|
import { computed, onDeactivated, onMounted, ref, useAttrs } from 'vue';
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
import { flattenVNodes, type FuTableOperationButton } from '@/components/table/shared';
|
import { flattenVNodes, type FuTableOperationButton } from '@/components/table/shared';
|
||||||
import { useCardColumns } from './useCardColumns';
|
import { useCardColumns } from './useCardColumns';
|
||||||
@@ -459,6 +459,8 @@ watch([currentViewMode, tableData, () => props.syncCardContentHeight], scheduleC
|
|||||||
flush: 'post',
|
flush: 'post',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onDeactivated(clearSelects);
|
||||||
|
|
||||||
watch([() => props.paginationConfig?.currentPage, () => props.paginationConfig?.pageSize], clearSelects, {
|
watch([() => props.paginationConfig?.currentPage, () => props.paginationConfig?.pageSize], clearSelects, {
|
||||||
flush: 'sync',
|
flush: 'sync',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import { reactive, type UnwrapNestedRefs } from 'vue';
|
import { reactive, type UnwrapNestedRefs } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
|
||||||
import { getPageState } from '@/utils/page-state-cache';
|
|
||||||
|
|
||||||
|
/** A new page visit starts from its defaults instead of restoring the previous page number. */
|
||||||
export const usePageState = <T extends object>(factory: () => T): UnwrapNestedRefs<T> => {
|
export const usePageState = <T extends object>(factory: () => T): UnwrapNestedRefs<T> => {
|
||||||
const route = useRoute();
|
return reactive(factory());
|
||||||
const { currentNode } = useGlobalStore();
|
|
||||||
const key = `${currentNode.value}:${String(route.name || route.path)}`;
|
|
||||||
return reactive(getPageState(key, factory));
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
import { storeToRefs } from 'pinia';
|
|
||||||
import { watch, type Ref } from 'vue';
|
|
||||||
import GlobalStore from '@/store/modules/global';
|
|
||||||
|
|
||||||
type SearchValue = string | number | undefined;
|
|
||||||
type SearchFields = Record<string, Ref<SearchValue>>;
|
|
||||||
|
|
||||||
export const useSearchPersistence = (page: string, fields: SearchFields, scope?: () => SearchValue) => {
|
|
||||||
const { currentNode } = storeToRefs(GlobalStore());
|
|
||||||
const defaults = Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, field.value]));
|
|
||||||
let initialized = false;
|
|
||||||
let restoring = false;
|
|
||||||
let activeKey: string | undefined;
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => {
|
|
||||||
const context = scope?.();
|
|
||||||
if (scope && context === undefined) return undefined;
|
|
||||||
return `1panel:search:v1:${JSON.stringify([currentNode.value, page, context ?? ''])}`;
|
|
||||||
},
|
|
||||||
(key) => {
|
|
||||||
activeKey = key;
|
|
||||||
let saved: Record<string, unknown> = {};
|
|
||||||
try {
|
|
||||||
const parsed = activeKey ? JSON.parse(localStorage.getItem(activeKey) || '{}') : {};
|
|
||||||
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) saved = parsed;
|
|
||||||
} catch {}
|
|
||||||
restoring = true;
|
|
||||||
for (const [name, field] of Object.entries(fields)) {
|
|
||||||
const value = saved[name];
|
|
||||||
const initial = defaults[name];
|
|
||||||
let fallback = initial;
|
|
||||||
if (initialized) {
|
|
||||||
fallback = typeof initial === 'string' ? '' : undefined;
|
|
||||||
}
|
|
||||||
const valid =
|
|
||||||
(typeof value === 'string' || (typeof value === 'number' && Number.isFinite(value))) &&
|
|
||||||
(fallback === undefined || typeof value === typeof fallback);
|
|
||||||
if (value === null) {
|
|
||||||
field.value = typeof initial === 'string' ? '' : undefined;
|
|
||||||
} else if (valid) {
|
|
||||||
field.value = value as SearchValue;
|
|
||||||
} else {
|
|
||||||
field.value = fallback;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
restoring = false;
|
|
||||||
initialized = true;
|
|
||||||
},
|
|
||||||
{ immediate: true, flush: 'sync' },
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, field.value ?? null])),
|
|
||||||
(value) => {
|
|
||||||
if (restoring || !activeKey) return;
|
|
||||||
try {
|
|
||||||
localStorage.setItem(activeKey, JSON.stringify(value));
|
|
||||||
} catch {}
|
|
||||||
},
|
|
||||||
{ flush: 'sync' },
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { onActivated, onDeactivated } from 'vue';
|
||||||
|
import GlobalStore from '@/store/modules/global';
|
||||||
|
import { bindSearchReset, type SearchFields } from '@/utils/search-reset';
|
||||||
|
|
||||||
|
interface SearchResetOptions {
|
||||||
|
scope?: () => string | number | undefined;
|
||||||
|
onRevisit: () => unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useSearchReset = (fields: SearchFields, options: SearchResetOptions) => {
|
||||||
|
const { currentNode } = storeToRefs(GlobalStore());
|
||||||
|
const reset = bindSearchReset(options.scope ? [currentNode, options.scope] : [currentNode], fields);
|
||||||
|
let deactivated = false;
|
||||||
|
onDeactivated(() => {
|
||||||
|
deactivated = true;
|
||||||
|
});
|
||||||
|
onActivated(() => {
|
||||||
|
if (!deactivated) return;
|
||||||
|
deactivated = false;
|
||||||
|
reset();
|
||||||
|
return options.onRevisit();
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -4175,9 +4175,6 @@ const message = {
|
|||||||
'Enabling this can avoid certificate leakage, setting a default website will invalidate this setting',
|
'Enabling this can avoid certificate leakage, setting a default website will invalidate this setting',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm:
|
|
||||||
'The following certificates will be deleted. ACME certificates will be automatically revoked. Continue?',
|
|
||||||
deleteAndRevoke: 'Delete and revoke',
|
|
||||||
create: 'Request',
|
create: 'Request',
|
||||||
provider: 'Type',
|
provider: 'Type',
|
||||||
manualCreate: 'Created manually',
|
manualCreate: 'Created manually',
|
||||||
|
|||||||
@@ -4225,9 +4225,6 @@ const message = {
|
|||||||
'Habilitar esto puede evitar la fuga de certificados, establecer un sitio web predeterminado invalidará esta configuración',
|
'Habilitar esto puede evitar la fuga de certificados, establecer un sitio web predeterminado invalidará esta configuración',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm:
|
|
||||||
'Se eliminarán los siguientes certificados. Los certificados ACME se revocarán automáticamente. ¿Desea continuar?',
|
|
||||||
deleteAndRevoke: 'Eliminar y revocar',
|
|
||||||
create: 'Solicitar',
|
create: 'Solicitar',
|
||||||
provider: 'Tipo',
|
provider: 'Tipo',
|
||||||
manualCreate: 'Creado manualmente',
|
manualCreate: 'Creado manualmente',
|
||||||
|
|||||||
@@ -4141,8 +4141,6 @@ const message = {
|
|||||||
'فعالسازی این گزینه میتواند از نشت گواهی جلوگیری کند، تنظیم یک وبسایت پیشفرض این تنظیم را بیاثر میکند',
|
'فعالسازی این گزینه میتواند از نشت گواهی جلوگیری کند، تنظیم یک وبسایت پیشفرض این تنظیم را بیاثر میکند',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: 'گواهیهای زیر حذف خواهند شد. گواهیهای ACME بهطور خودکار باطل خواهند شد. آیا ادامه میدهید؟',
|
|
||||||
deleteAndRevoke: 'حذف و ابطال',
|
|
||||||
create: 'درخواست',
|
create: 'درخواست',
|
||||||
provider: 'نوع',
|
provider: 'نوع',
|
||||||
manualCreate: 'ایجاد دستی',
|
manualCreate: 'ایجاد دستی',
|
||||||
|
|||||||
@@ -4163,8 +4163,6 @@ const message = {
|
|||||||
'有効にすると証明書の漏洩を防げますが、デフォルト Web サイトを設定するとこの設定は無効になります',
|
'有効にすると証明書の漏洩を防げますが、デフォルト Web サイトを設定するとこの設定は無効になります',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: '以下の証明書を削除します。ACME 証明書は自動的に失効されます。続行しますか?',
|
|
||||||
deleteAndRevoke: '削除して失効',
|
|
||||||
create: 'リクエスト',
|
create: 'リクエスト',
|
||||||
provider: 'タイプ',
|
provider: 'タイプ',
|
||||||
manualCreate: '手動で作成されます',
|
manualCreate: '手動で作成されます',
|
||||||
|
|||||||
@@ -4086,8 +4086,6 @@ const message = {
|
|||||||
'활성화하면 인증서 누출을 방지할 수 있지만, 기본 웹사이트를 설정하면 이 설정이 무효화됩니다',
|
'활성화하면 인증서 누출을 방지할 수 있지만, 기본 웹사이트를 설정하면 이 설정이 무효화됩니다',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: '다음 인증서를 삭제합니다. ACME 인증서는 자동으로 폐기됩니다. 계속하시겠습니까?',
|
|
||||||
deleteAndRevoke: '삭제 및 폐기',
|
|
||||||
create: '요청',
|
create: '요청',
|
||||||
provider: '유형',
|
provider: '유형',
|
||||||
manualCreate: '수동 생성됨',
|
manualCreate: '수동 생성됨',
|
||||||
|
|||||||
@@ -4058,8 +4058,6 @@ const message = {
|
|||||||
'ການເປີດໃຊ້ສິ່ງນີ້ສາມາດຫຼີກລ່ຽງການຮົ່ວໄຫຼຂອງໃບຢັ້ງຢືນ, ແຕ່ການຕັ້ງເວັບໄຊເລີ່ມຕົ້ນຈະເຮັດໃຫ້ການຕັ້ງຄ່ານີ້ບໍ່ມີຜົນ',
|
'ການເປີດໃຊ້ສິ່ງນີ້ສາມາດຫຼີກລ່ຽງການຮົ່ວໄຫຼຂອງໃບຢັ້ງຢືນ, ແຕ່ການຕັ້ງເວັບໄຊເລີ່ມຕົ້ນຈະເຮັດໃຫ້ການຕັ້ງຄ່ານີ້ບໍ່ມີຜົນ',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: 'ຈະລຶບໃບຢັ້ງຢືນຕໍ່ໄປນີ້. ໃບຢັ້ງຢືນ ACME ຈະຖືກຖອນໂດຍອັດຕະໂນມັດ. ຕ້ອງການສືບຕໍ່ບໍ?',
|
|
||||||
deleteAndRevoke: 'ລຶບ ແລະ ຖອນ',
|
|
||||||
create: 'ຮ້ອງຂໍ',
|
create: 'ຮ້ອງຂໍ',
|
||||||
provider: 'ປະເພດ',
|
provider: 'ປະເພດ',
|
||||||
manualCreate: 'ສ້າງດ້ວຍຕົນເອງ',
|
manualCreate: 'ສ້າງດ້ວຍຕົນເອງ',
|
||||||
|
|||||||
@@ -4240,8 +4240,6 @@ const message = {
|
|||||||
'Mengaktifkan ini boleh mengelakkan kebocoran sijil, menetapkan laman web lalai akan membatalkan tetapan ini',
|
'Mengaktifkan ini boleh mengelakkan kebocoran sijil, menetapkan laman web lalai akan membatalkan tetapan ini',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: 'Sijil berikut akan dipadamkan. Sijil ACME akan dibatalkan secara automatik. Teruskan?',
|
|
||||||
deleteAndRevoke: 'Padam dan batalkan',
|
|
||||||
create: 'Permintaan',
|
create: 'Permintaan',
|
||||||
provider: 'Jenis',
|
provider: 'Jenis',
|
||||||
manualCreate: 'Dicipta secara manual',
|
manualCreate: 'Dicipta secara manual',
|
||||||
|
|||||||
@@ -4259,9 +4259,6 @@ const message = {
|
|||||||
'Ativar isso pode evitar vazamento de certificados, definir um site padrão invalidará esta configuração',
|
'Ativar isso pode evitar vazamento de certificados, definir um site padrão invalidará esta configuração',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm:
|
|
||||||
'Os certificados a seguir serão excluídos. Os certificados ACME serão revogados automaticamente. Continuar?',
|
|
||||||
deleteAndRevoke: 'Excluir e revogar',
|
|
||||||
create: 'Solicitar',
|
create: 'Solicitar',
|
||||||
provider: 'Tipo',
|
provider: 'Tipo',
|
||||||
manualCreate: 'Criado manualmente',
|
manualCreate: 'Criado manualmente',
|
||||||
|
|||||||
@@ -4226,9 +4226,6 @@ const message = {
|
|||||||
'Включение этого может предотвратить утечку сертификатов, установка веб-сайта по умолчанию сделает эту настройку недействительной',
|
'Включение этого может предотвратить утечку сертификатов, установка веб-сайта по умолчанию сделает эту настройку недействительной',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm:
|
|
||||||
'Следующие сертификаты будут удалены. Сертификаты ACME будут автоматически отозваны. Продолжить?',
|
|
||||||
deleteAndRevoke: 'Удалить и отозвать',
|
|
||||||
create: 'Запросить',
|
create: 'Запросить',
|
||||||
provider: 'Тип',
|
provider: 'Тип',
|
||||||
manualCreate: 'Создан вручную',
|
manualCreate: 'Создан вручную',
|
||||||
|
|||||||
@@ -4244,9 +4244,6 @@ const message = {
|
|||||||
'Etkinleştirilmesi sertifika sızıntısını önleyebilir, varsayılan bir web sitesi ayarlamak bu ayarı geçersiz kılar',
|
'Etkinleştirilmesi sertifika sızıntısını önleyebilir, varsayılan bir web sitesi ayarlamak bu ayarı geçersiz kılar',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm:
|
|
||||||
'Aşağıdaki sertifikalar silinecek. ACME sertifikaları otomatik olarak iptal edilecek. Devam edilsin mi?',
|
|
||||||
deleteAndRevoke: 'Sil ve iptal et',
|
|
||||||
create: 'İstek',
|
create: 'İstek',
|
||||||
provider: 'Tür',
|
provider: 'Tür',
|
||||||
manualCreate: 'Manuel olarak oluşturuldu',
|
manualCreate: 'Manuel olarak oluşturuldu',
|
||||||
|
|||||||
@@ -3898,8 +3898,6 @@ const message = {
|
|||||||
sslRejectHandshakeHelper: '開啟之後可以避免憑證洩露,設置預設網站會讓此設置失效',
|
sslRejectHandshakeHelper: '開啟之後可以避免憑證洩露,設置預設網站會讓此設置失效',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: '將對以下憑證進行 刪除 操作,ACME 類型憑證會被自動撤銷,是否繼續?',
|
|
||||||
deleteAndRevoke: '刪除並撤銷',
|
|
||||||
create: '申請憑證',
|
create: '申請憑證',
|
||||||
provider: '類型',
|
provider: '類型',
|
||||||
manualCreate: '手動建立',
|
manualCreate: '手動建立',
|
||||||
|
|||||||
@@ -3943,8 +3943,6 @@ const message = {
|
|||||||
sslRejectHandshakeHelper: '开启之后可以避免证书泄露,设置默认网站会让此设置失效',
|
sslRejectHandshakeHelper: '开启之后可以避免证书泄露,设置默认网站会让此设置失效',
|
||||||
},
|
},
|
||||||
ssl: {
|
ssl: {
|
||||||
deleteConfirm: '将对以下证书进行 删除 操作,ACME类型证书会被自动吊销,是否继续?',
|
|
||||||
deleteAndRevoke: '删除并吊销',
|
|
||||||
create: '申请证书',
|
create: '申请证书',
|
||||||
provider: '类型',
|
provider: '类型',
|
||||||
manualCreate: '手动创建',
|
manualCreate: '手动创建',
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { bindSearchReset } from '@/utils/search-reset';
|
||||||
|
import router from '@/routers/router';
|
||||||
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { ref, reactive, toRef } from 'vue';
|
import { ref, reactive, toRef } from 'vue';
|
||||||
import { MsgError } from '@/utils/message';
|
import { MsgError } from '@/utils/message';
|
||||||
@@ -47,12 +49,12 @@ export const ProcessStore = defineStore('ProcessStore', () => {
|
|||||||
port: undefined,
|
port: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
useSearchPersistence('host/process/process', {
|
const { currentNode } = useGlobalStore();
|
||||||
|
bindSearchReset([() => router.currentRoute.value.path, currentNode], {
|
||||||
pid: toRef(psSearch, 'pid'),
|
pid: toRef(psSearch, 'pid'),
|
||||||
name: toRef(psSearch, 'name'),
|
name: toRef(psSearch, 'name'),
|
||||||
username: toRef(psSearch, 'username'),
|
username: toRef(psSearch, 'username'),
|
||||||
});
|
|
||||||
useSearchPersistence('host/process/network', {
|
|
||||||
processID: toRef(netSearch, 'processID'),
|
processID: toRef(netSearch, 'processID'),
|
||||||
processName: toRef(netSearch, 'processName'),
|
processName: toRef(netSearch, 'processName'),
|
||||||
port: toRef(netSearch, 'port'),
|
port: toRef(netSearch, 'port'),
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { watch, type Ref, type WatchSource } from 'vue';
|
||||||
|
|
||||||
|
export type SearchFields = Record<string, Ref<string | number | undefined>>;
|
||||||
|
|
||||||
|
export const bindSearchReset = (sources: WatchSource[], fields: SearchFields) => {
|
||||||
|
const defaults = Object.values(fields).map((field) => ({ field, value: field.value }));
|
||||||
|
const reset = () => {
|
||||||
|
for (const { field, value } of defaults) field.value = value;
|
||||||
|
};
|
||||||
|
watch(sources, reset, { flush: 'sync' });
|
||||||
|
return reset;
|
||||||
|
};
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { Refresh, Search } from '@element-plus/icons-vue';
|
import { Refresh, Search } from '@element-plus/icons-vue';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
@@ -193,10 +193,16 @@ const searching = ref(false);
|
|||||||
const operating = ref('');
|
const operating = ref('');
|
||||||
const keyword = ref('');
|
const keyword = ref('');
|
||||||
const marketKeyword = ref('');
|
const marketKeyword = ref('');
|
||||||
useSearchPersistence(
|
useSearchReset(
|
||||||
'ai/agents/agent/config/tabs/plugins',
|
|
||||||
{ keyword, marketKeyword },
|
{ keyword, marketKeyword },
|
||||||
() => agentId.value || undefined,
|
{
|
||||||
|
scope: () => agentId.value || undefined,
|
||||||
|
onRevisit: () => {
|
||||||
|
page.value = 1;
|
||||||
|
marketResults.value = [];
|
||||||
|
marketSearched.value = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
const origin = ref('');
|
const origin = ref('');
|
||||||
const status = ref('');
|
const status = ref('');
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { Refresh, Search } from '@element-plus/icons-vue';
|
import { Refresh, Search } from '@element-plus/icons-vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
@@ -169,10 +169,15 @@ const getDefaultMarketSource = (): HermesSkillMarketSource => {
|
|||||||
const marketSource = ref<HermesSkillMarketSource>(getDefaultMarketSource());
|
const marketSource = ref<HermesSkillMarketSource>(getDefaultMarketSource());
|
||||||
const marketSearched = ref(false);
|
const marketSearched = ref(false);
|
||||||
const agentId = ref(0);
|
const agentId = ref(0);
|
||||||
useSearchPersistence(
|
useSearchReset(
|
||||||
'ai/agents/agent/config/tabs/skills/hermes',
|
|
||||||
{ installedKeyword, marketKeyword },
|
{ installedKeyword, marketKeyword },
|
||||||
() => agentId.value || undefined,
|
{
|
||||||
|
scope: () => agentId.value || undefined,
|
||||||
|
onRevisit: () => {
|
||||||
|
marketResults.value = [];
|
||||||
|
marketSearched.value = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
const installedSkills = ref<AI.AgentSkillItem[]>([]);
|
const installedSkills = ref<AI.AgentSkillItem[]>([]);
|
||||||
const marketResults = ref<AI.AgentSkillSearchItem[]>([]);
|
const marketResults = ref<AI.AgentSkillSearchItem[]>([]);
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { Refresh, Search } from '@element-plus/icons-vue';
|
import { Refresh, Search } from '@element-plus/icons-vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
@@ -181,10 +181,15 @@ const getDefaultMarketSource = (): SkillMarketSource => {
|
|||||||
const marketSource = ref<SkillMarketSource>(getDefaultMarketSource());
|
const marketSource = ref<SkillMarketSource>(getDefaultMarketSource());
|
||||||
const marketSearched = ref(false);
|
const marketSearched = ref(false);
|
||||||
const agentId = ref(0);
|
const agentId = ref(0);
|
||||||
useSearchPersistence(
|
useSearchReset(
|
||||||
'ai/agents/agent/config/tabs/skills/openclaw',
|
|
||||||
{ installedKeyword, marketKeyword },
|
{ installedKeyword, marketKeyword },
|
||||||
() => agentId.value || undefined,
|
{
|
||||||
|
scope: () => agentId.value || undefined,
|
||||||
|
onRevisit: () => {
|
||||||
|
marketResults.value = [];
|
||||||
|
marketSearched.value = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
const skills = ref<AI.AgentSkillItem[]>([]);
|
const skills = ref<AI.AgentSkillItem[]>([]);
|
||||||
const marketResults = ref<AI.AgentSkillSearchItem[]>([]);
|
const marketResults = ref<AI.AgentSkillSearchItem[]>([]);
|
||||||
|
|||||||
@@ -272,8 +272,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { deleteAgentCheck, pageAgents, resetAgentToken, unbindAgentWebsite, updateAgentRemark } from '@/api/modules/ai';
|
import { deleteAgentCheck, pageAgents, resetAgentToken, unbindAgentWebsite, updateAgentRemark } from '@/api/modules/ai';
|
||||||
import { checkAppInstalled, installedOp, searchApp, searchAppInstalled } from '@/api/modules/app';
|
import { checkAppInstalled, installedOp, searchApp, searchAppInstalled } from '@/api/modules/app';
|
||||||
@@ -341,7 +341,6 @@ const isActive = ref(false);
|
|||||||
const isExist = ref(false);
|
const isExist = ref(false);
|
||||||
const noApp = ref(false);
|
const noApp = ref(false);
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('ai/agents/agent/index', { search: searchName });
|
|
||||||
const defaultHttpsPort = ref(443);
|
const defaultHttpsPort = ref(443);
|
||||||
const openrestyPortLoaded = ref(false);
|
const openrestyPortLoaded = ref(false);
|
||||||
const websiteDomainsMap = ref<Record<number, Website.Domain[]>>({});
|
const websiteDomainsMap = ref<Record<number, Website.Domain[]>>({});
|
||||||
@@ -401,6 +400,7 @@ const paginationConfig = reactive({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const checkNoApp = async () => {
|
const checkNoApp = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -69,8 +69,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteAgentAccount, getAgentProviders, pageAgentAccounts } from '@/api/modules/ai';
|
import { deleteAgentAccount, getAgentProviders, pageAgentAccounts } from '@/api/modules/ai';
|
||||||
import { AI } from '@/api/interface/ai';
|
import { AI } from '@/api/interface/ai';
|
||||||
import AddDialog from '@/views/ai/agents/model/add/index.vue';
|
import AddDialog from '@/views/ai/agents/model/add/index.vue';
|
||||||
@@ -86,7 +86,6 @@ const items = ref<AI.AgentAccountItem[]>([]);
|
|||||||
const addRef = ref();
|
const addRef = ref();
|
||||||
const modelPoolRef = ref();
|
const modelPoolRef = ref();
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('ai/agents/model/index', { search: searchName });
|
|
||||||
const apiType = ref('');
|
const apiType = ref('');
|
||||||
const apiTypeOptions = ref<string[]>([]);
|
const apiTypeOptions = ref<string[]>([]);
|
||||||
|
|
||||||
@@ -112,6 +111,7 @@ const paginationConfig = reactive({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
const req: AI.AgentAccountSearch = {
|
const req: AI.AgentAccountSearch = {
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import AppStatus from '@/components/app-status/index.vue';
|
import AppStatus from '@/components/app-status/index.vue';
|
||||||
import AddDialog from '@/views/ai/model/ollama/add/index.vue';
|
import AddDialog from '@/views/ai/model/ollama/add/index.vue';
|
||||||
import Conn from '@/views/ai/model/ollama/conn/index.vue';
|
import Conn from '@/views/ai/model/ollama/conn/index.vue';
|
||||||
@@ -195,7 +195,7 @@ import Terminal from '@/views/ai/model/ollama/terminal/index.vue';
|
|||||||
import Del from '@/views/ai/model/ollama/del/index.vue';
|
import Del from '@/views/ai/model/ollama/del/index.vue';
|
||||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||||
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
|
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import {
|
import {
|
||||||
@@ -237,7 +237,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('ai/model/ollama/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const appInstallID = ref(0);
|
const appInstallID = ref(0);
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { toRef, onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { searchApp, syncApp, syncCutomAppStore, syncLocalApp, getCurrentNodeCustomAppConfig } from '@/api/modules/app';
|
import { searchApp, syncApp, syncCutomAppStore, syncLocalApp, getCurrentNodeCustomAppConfig } from '@/api/modules/app';
|
||||||
@@ -105,7 +105,10 @@ const req = reactive({
|
|||||||
resource: 'all',
|
resource: 'all',
|
||||||
showCurrentArch: false,
|
showCurrentArch: false,
|
||||||
});
|
});
|
||||||
useSearchPersistence('app-store/apps/index', { search: toRef(req, 'name') });
|
useSearchReset(
|
||||||
|
{ search: toRef(req, 'name'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search(req) },
|
||||||
|
);
|
||||||
|
|
||||||
const apps = ref<App.AppItem[]>([]);
|
const apps = ref<App.AppItem[]>([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import AppCard from '@/views/app-store/installed/app/card.vue';
|
import AppCard from '@/views/app-store/installed/app/card.vue';
|
||||||
import Backups from '@/components/backup/index.vue';
|
import Backups from '@/components/backup/index.vue';
|
||||||
import Uploads from '@/components/upload/index.vue';
|
import Uploads from '@/components/upload/index.vue';
|
||||||
@@ -211,7 +211,10 @@ const searchReq = reactive({
|
|||||||
update: false,
|
update: false,
|
||||||
sync: false,
|
sync: false,
|
||||||
});
|
});
|
||||||
useSearchPersistence('app-store/installed/index', { search: toRef(searchReq, 'name') });
|
useSearchReset(
|
||||||
|
{ search: toRef(searchReq, 'name'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const activeName = ref(i18n.global.t('app.installed'));
|
const activeName = ref(i18n.global.t('app.installed'));
|
||||||
const mode = ref('installed');
|
const mode = ref('installed');
|
||||||
|
|||||||
@@ -521,7 +521,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { computed, h, ref } from 'vue';
|
import { computed, h, ref } from 'vue';
|
||||||
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
||||||
import ContainerLog from '@/components/log/container/index.vue';
|
import ContainerLog from '@/components/log/container/index.vue';
|
||||||
@@ -576,7 +576,7 @@ const dialogBackupRef = ref();
|
|||||||
const uploadRef = ref();
|
const uploadRef = ref();
|
||||||
|
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('container/compose/index', { search: searchName });
|
useSearchReset({ search: searchName }, { onRevisit: () => search() });
|
||||||
const includeAppStore = ref(localStorage.getItem('includeAppStore') !== 'false');
|
const includeAppStore = ref(localStorage.getItem('includeAppStore') !== 'false');
|
||||||
const showType = ref('compose');
|
const showType = ref('compose');
|
||||||
const containerStats = ref<any[]>([]);
|
const containerStats = ref<any[]>([]);
|
||||||
|
|||||||
@@ -474,7 +474,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import PruneDialog from '@/views/container/container/prune/index.vue';
|
import PruneDialog from '@/views/container/container/prune/index.vue';
|
||||||
import RenameDialog from '@/views/container/container/rename/index.vue';
|
import RenameDialog from '@/views/container/container/rename/index.vue';
|
||||||
import UpgradeDialog from '@/views/container/container/upgrade/index.vue';
|
import UpgradeDialog from '@/views/container/container/upgrade/index.vue';
|
||||||
@@ -490,7 +490,7 @@ import Uploads from '@/components/upload/index.vue';
|
|||||||
import DockerStatus from '@/views/container/docker-status/index.vue';
|
import DockerStatus from '@/views/container/docker-status/index.vue';
|
||||||
import ContainerLogDialog from '@/components/log/container-drawer/index.vue';
|
import ContainerLogDialog from '@/components/log/container-drawer/index.vue';
|
||||||
import Status from '@/components/status/index.vue';
|
import Status from '@/components/status/index.vue';
|
||||||
import { computed, reactive, ref } from 'vue';
|
import { toRef, computed, reactive, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
containerItemStats,
|
containerItemStats,
|
||||||
containerListStats,
|
containerListStats,
|
||||||
@@ -536,7 +536,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'ascending',
|
order: 'ascending',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('container/container/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const dialogUpgradeRef = ref();
|
const dialogUpgradeRef = ref();
|
||||||
const dialogCommitRef = ref();
|
const dialogCommitRef = ref();
|
||||||
const dialogPortJumpRef = ref();
|
const dialogPortJumpRef = ref();
|
||||||
|
|||||||
@@ -157,7 +157,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { toRef, reactive, ref, computed } from 'vue';
|
import { toRef, reactive, ref, computed } from 'vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { newUUID } from '@/utils/id';
|
import { newUUID } from '@/utils/id';
|
||||||
@@ -200,7 +200,10 @@ const paginationConfig = reactive({
|
|||||||
orderBy: 'createdAt',
|
orderBy: 'createdAt',
|
||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
useSearchPersistence('container/image/index', { search: toRef(paginationConfig, 'name') });
|
useSearchReset(
|
||||||
|
{ search: toRef(paginationConfig, 'name'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
const columns = ref([]);
|
const columns = ref([]);
|
||||||
|
|
||||||
const isActive = ref(false);
|
const isActive = ref(false);
|
||||||
|
|||||||
@@ -95,10 +95,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import CreateDialog from '@/views/container/network/create/index.vue';
|
import CreateDialog from '@/views/container/network/create/index.vue';
|
||||||
import DetailDrawer from '@/views/container/network/detail/index.vue';
|
import DetailDrawer from '@/views/container/network/detail/index.vue';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { newUUID } from '@/utils/id';
|
import { newUUID } from '@/utils/id';
|
||||||
import { deleteNetwork, searchNetwork, inspect, containerPrune } from '@/api/modules/container';
|
import { deleteNetwork, searchNetwork, inspect, containerPrune } from '@/api/modules/container';
|
||||||
@@ -121,7 +121,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('container/network/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
const isActive = ref(false);
|
const isActive = ref(false);
|
||||||
|
|||||||
@@ -59,9 +59,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import OperatorDialog from '@/views/container/repo/operator/index.vue';
|
import OperatorDialog from '@/views/container/repo/operator/index.vue';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { Container } from '@/api/interface/container';
|
import { Container } from '@/api/interface/container';
|
||||||
import { checkRepoStatus, deleteImageRepo, searchImageRepo } from '@/api/modules/container';
|
import { checkRepoStatus, deleteImageRepo, searchImageRepo } from '@/api/modules/container';
|
||||||
@@ -78,7 +78,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('container/repo/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
const confirmDialog = ref();
|
const confirmDialog = ref();
|
||||||
|
|||||||
@@ -81,8 +81,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
|
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
|
||||||
import { downloadWithContent } from '@/utils/file';
|
import { downloadWithContent } from '@/utils/file';
|
||||||
import { Container } from '@/api/interface/container';
|
import { Container } from '@/api/interface/container';
|
||||||
@@ -111,7 +111,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('container/template/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
if (!isActive.value || !isExist.value) {
|
if (!isActive.value || !isExist.value) {
|
||||||
|
|||||||
@@ -124,11 +124,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import CreateDialog from '@/views/container/volume/create/index.vue';
|
import CreateDialog from '@/views/container/volume/create/index.vue';
|
||||||
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
|
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
|
||||||
import DockerStatus from '@/views/container/docker-status/index.vue';
|
import DockerStatus from '@/views/container/docker-status/index.vue';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { newUUID } from '@/utils/id';
|
import { newUUID } from '@/utils/id';
|
||||||
import { deleteVolume, searchVolume, inspect, containerPrune } from '@/api/modules/container';
|
import { deleteVolume, searchVolume, inspect, containerPrune } from '@/api/modules/container';
|
||||||
@@ -158,7 +158,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('container/volume/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const isActive = ref(false);
|
const isActive = ref(false);
|
||||||
const isExist = ref(false);
|
const isExist = ref(false);
|
||||||
|
|
||||||
|
|||||||
@@ -272,11 +272,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import Records from '@/views/cronjob/cronjob/record/index.vue';
|
import Records from '@/views/cronjob/cronjob/record/index.vue';
|
||||||
import Backups from '@/views/cronjob/cronjob/backup/index.vue';
|
import Backups from '@/views/cronjob/cronjob/backup/index.vue';
|
||||||
import Import from '@/views/cronjob/cronjob/import/index.vue';
|
import Import from '@/views/cronjob/cronjob/import/index.vue';
|
||||||
import { onMounted, ref, toRefs } from 'vue';
|
import { toRef, onMounted, ref, toRefs } from 'vue';
|
||||||
import {
|
import {
|
||||||
deleteCronjob,
|
deleteCronjob,
|
||||||
editCronjobGroup,
|
editCronjobGroup,
|
||||||
@@ -332,7 +332,7 @@ const pageState = usePageState(() => ({
|
|||||||
}));
|
}));
|
||||||
const paginationConfig = pageState.paginationConfig;
|
const paginationConfig = pageState.paginationConfig;
|
||||||
const { defaultGroupID, searchName, searchGroupID } = toRefs(pageState);
|
const { defaultGroupID, searchName, searchGroupID } = toRefs(pageState);
|
||||||
useSearchPersistence('cronjob/cronjob/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async (column?: any) => {
|
const search = async (column?: any) => {
|
||||||
if (column) {
|
if (column) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
|
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
|
||||||
import { deepCopy } from '@/utils/misc';
|
import { deepCopy } from '@/utils/misc';
|
||||||
import { newUUID } from '@/utils/id';
|
import { newUUID } from '@/utils/id';
|
||||||
@@ -141,7 +141,7 @@ import TaskLog from '@/components/log/task/index.vue';
|
|||||||
import OperateDialog from '@/views/cronjob/library/operate/index.vue';
|
import OperateDialog from '@/views/cronjob/library/operate/index.vue';
|
||||||
import TerminalDialog from '@/views/cronjob/library/run/index.vue';
|
import TerminalDialog from '@/views/cronjob/library/run/index.vue';
|
||||||
import { deleteScript, searchScript, syncScript } from '@/api/modules/cronjob';
|
import { deleteScript, searchScript, syncScript } from '@/api/modules/cronjob';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { Cronjob } from '@/api/interface/cronjob';
|
import { Cronjob } from '@/api/interface/cronjob';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
@@ -170,7 +170,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchInfo = ref<string>('');
|
const searchInfo = ref<string>('');
|
||||||
useSearchPersistence('cronjob/library/index', { search: searchInfo });
|
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const group = ref<string>('');
|
const group = ref<string>('');
|
||||||
const groupOptions = ref();
|
const groupOptions = ref();
|
||||||
|
|
||||||
|
|||||||
@@ -323,8 +323,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
import { toRef, nextTick, onMounted, reactive, ref } from 'vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { getRandomStr } from '@/utils/id';
|
import { getRandomStr } from '@/utils/id';
|
||||||
import { Position } from '@element-plus/icons-vue';
|
import { Position } from '@element-plus/icons-vue';
|
||||||
@@ -366,7 +366,6 @@ const loading = ref(false);
|
|||||||
const maskShow = ref(true);
|
const maskShow = ref(true);
|
||||||
const submitLoading = ref(false);
|
const submitLoading = ref(false);
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('database/mongodb/index', { search: searchName });
|
|
||||||
const createVisible = ref(false);
|
const createVisible = ref(false);
|
||||||
const appStatusRef = ref();
|
const appStatusRef = ref();
|
||||||
const bindRef = ref();
|
const bindRef = ref();
|
||||||
@@ -400,6 +399,7 @@ const paginationConfig = reactive({
|
|||||||
orderBy: 'createdAt',
|
orderBy: 'createdAt',
|
||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
type FormInstance = InstanceType<typeof ElForm>;
|
type FormInstance = InstanceType<typeof ElForm>;
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
|
|||||||
@@ -75,9 +75,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
||||||
import AppResources from '@/views/database/postgresql/check/index.vue';
|
import AppResources from '@/views/database/postgresql/check/index.vue';
|
||||||
import OperateDialog from '@/views/database/mongodb/remote/operate/index.vue';
|
import OperateDialog from '@/views/database/mongodb/remote/operate/index.vue';
|
||||||
@@ -101,7 +101,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/mongodb/remote/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async (column?: any) => {
|
const search = async (column?: any) => {
|
||||||
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import BindDialog from '@/views/database/mysql/bind/index.vue';
|
import BindDialog from '@/views/database/mysql/bind/index.vue';
|
||||||
import UserDialog from '@/views/database/mysql/user/index.vue';
|
import UserDialog from '@/views/database/mysql/user/index.vue';
|
||||||
import OperateDialog from '@/views/database/mysql/create/index.vue';
|
import OperateDialog from '@/views/database/mysql/create/index.vue';
|
||||||
@@ -241,7 +241,7 @@ import PortJumpDialog from '@/components/port-jump/index.vue';
|
|||||||
import Tooltip from '@/components/tooltip/index.vue';
|
import Tooltip from '@/components/tooltip/index.vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
deleteCheckMysqlDB,
|
deleteCheckMysqlDB,
|
||||||
listDatabases,
|
listDatabases,
|
||||||
@@ -301,7 +301,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/mysql/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const mysqlContainer = ref();
|
const mysqlContainer = ref();
|
||||||
const mysqlStatus = ref();
|
const mysqlStatus = ref();
|
||||||
|
|||||||
@@ -74,9 +74,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
||||||
import AppResources from '@/views/database/mysql/check/index.vue';
|
import AppResources from '@/views/database/mysql/check/index.vue';
|
||||||
import OperateDialog from '@/views/database/mysql/remote/operate/index.vue';
|
import OperateDialog from '@/views/database/mysql/remote/operate/index.vue';
|
||||||
@@ -100,7 +100,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/mysql/remote/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async (column?: any) => {
|
const search = async (column?: any) => {
|
||||||
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
||||||
|
|||||||
@@ -241,7 +241,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import BindDialog from '@/views/database/postgresql/bind/index.vue';
|
import BindDialog from '@/views/database/postgresql/bind/index.vue';
|
||||||
import OperateDialog from '@/views/database/postgresql/create/index.vue';
|
import OperateDialog from '@/views/database/postgresql/create/index.vue';
|
||||||
import DeleteDialog from '@/views/database/postgresql/delete/index.vue';
|
import DeleteDialog from '@/views/database/postgresql/delete/index.vue';
|
||||||
@@ -256,7 +256,7 @@ import UploadDialog from '@/components/upload/index.vue';
|
|||||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||||
import Tooltip from '@/components/tooltip/index.vue';
|
import Tooltip from '@/components/tooltip/index.vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
deleteCheckPostgresqlDB,
|
deleteCheckPostgresqlDB,
|
||||||
listDatabases,
|
listDatabases,
|
||||||
@@ -313,7 +313,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/postgresql/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const postgresqlContainer = ref();
|
const postgresqlContainer = ref();
|
||||||
const postgresqlStatus = ref();
|
const postgresqlStatus = ref();
|
||||||
|
|||||||
@@ -74,9 +74,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
||||||
import AppResources from '@/views/database/postgresql/check/index.vue';
|
import AppResources from '@/views/database/postgresql/check/index.vue';
|
||||||
import OperateDialog from '@/views/database/postgresql/remote/operate/index.vue';
|
import OperateDialog from '@/views/database/postgresql/remote/operate/index.vue';
|
||||||
@@ -100,7 +100,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/postgresql/remote/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async (column?: any) => {
|
const search = async (column?: any) => {
|
||||||
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
||||||
|
|||||||
@@ -73,9 +73,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
|
||||||
import AppResources from '@/views/database/redis/check/index.vue';
|
import AppResources from '@/views/database/redis/check/index.vue';
|
||||||
import OperateDialog from '@/views/database/redis/remote/operate/index.vue';
|
import OperateDialog from '@/views/database/redis/remote/operate/index.vue';
|
||||||
@@ -99,7 +99,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('database/redis/remote/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async (column?: any) => {
|
const search = async (column?: any) => {
|
||||||
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
||||||
|
|||||||
@@ -739,7 +739,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { toRef, computed, nextTick, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
import { toRef, computed, nextTick, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
addFavorite,
|
addFavorite,
|
||||||
@@ -853,7 +853,6 @@ const initData = () => ({
|
|||||||
sortOrder: 'ascending',
|
sortOrder: 'ascending',
|
||||||
});
|
});
|
||||||
let req = reactive(initData());
|
let req = reactive(initData());
|
||||||
useSearchPersistence('host/file-management/index', { search: toRef(req, 'search') });
|
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
const paths = ref<FilePaths[]>([]);
|
const paths = ref<FilePaths[]>([]);
|
||||||
const breadcrumbVisiblePaths = ref<FilePaths[]>([]);
|
const breadcrumbVisiblePaths = ref<FilePaths[]>([]);
|
||||||
@@ -986,6 +985,10 @@ const paginationConfig = reactive({
|
|||||||
pageSize: Number(localStorage.getItem('file-page-size')) || 100,
|
pageSize: Number(localStorage.getItem('file-page-size')) || 100,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset(
|
||||||
|
{ search: toRef(req, 'search'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
|
|
||||||
const btnWrapperRefs = ref<Record<string, any>>({});
|
const btnWrapperRefs = ref<Record<string, any>>({});
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { computed, reactive, ref, watch } from 'vue';
|
import { computed, reactive, ref, watch } from 'vue';
|
||||||
import FireRouter from '@/views/host/firewall/index.vue';
|
import FireRouter from '@/views/host/firewall/index.vue';
|
||||||
import DockerGuardStatus from '@/views/host/firewall/docker/status/index.vue';
|
import DockerGuardStatus from '@/views/host/firewall/docker/status/index.vue';
|
||||||
@@ -263,7 +263,14 @@ const openRuleTask = (taskID: string) => taskLogRef.value?.openWithTaskID(taskID
|
|||||||
const orphanDrawerVisible = ref(false);
|
const orphanDrawerVisible = ref(false);
|
||||||
const orphanSearchName = ref('');
|
const orphanSearchName = ref('');
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('host/firewall/docker/index', { search: searchName });
|
useSearchReset(
|
||||||
|
{ search: searchName },
|
||||||
|
{
|
||||||
|
onRevisit: () => {
|
||||||
|
paginationConfig.currentPage = 1;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
const selects = ref<Firewall.DockerGuardContainer[]>([]);
|
const selects = ref<Firewall.DockerGuardContainer[]>([]);
|
||||||
const orphanSelects = ref<Firewall.DockerGuardEndpoint[]>([]);
|
const orphanSelects = ref<Firewall.DockerGuardEndpoint[]>([]);
|
||||||
const data = reactive<Firewall.DockerGuardList>({
|
const data = reactive<Firewall.DockerGuardList>({
|
||||||
|
|||||||
@@ -117,14 +117,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import OperateDialog from './operate/index.vue';
|
import OperateDialog from './operate/index.vue';
|
||||||
import ImportDialog from './import/index.vue';
|
import ImportDialog from './import/index.vue';
|
||||||
import FireRouter from '@/views/host/firewall/index.vue';
|
import FireRouter from '@/views/host/firewall/index.vue';
|
||||||
import FireStatus from '@/views/host/firewall/status/index.vue';
|
import FireStatus from '@/views/host/firewall/status/index.vue';
|
||||||
import RuleReset from '@/views/host/firewall/components/rule-reset.vue';
|
import RuleReset from '@/views/host/firewall/components/rule-reset.vue';
|
||||||
import TaskLog from '@/components/log/task/index.vue';
|
import TaskLog from '@/components/log/task/index.vue';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { resetFirewallRules, operateForwardRule, searchForwardRule } from '@/api/modules/firewall';
|
import { resetFirewallRules, operateForwardRule, searchForwardRule } from '@/api/modules/firewall';
|
||||||
import { Firewall } from '@/api/interface/firewall';
|
import { Firewall } from '@/api/interface/firewall';
|
||||||
import { buildForwardRuleExport } from './transfer';
|
import { buildForwardRuleExport } from './transfer';
|
||||||
@@ -138,7 +138,6 @@ import { ElMessageBox } from 'element-plus';
|
|||||||
const loading = ref();
|
const loading = ref();
|
||||||
const selects = ref<any>([]);
|
const selects = ref<any>([]);
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('host/firewall/forward/index', { search: searchName });
|
|
||||||
|
|
||||||
const isInit = ref(false);
|
const isInit = ref(false);
|
||||||
const isBind = ref(false);
|
const isBind = ref(false);
|
||||||
@@ -189,6 +188,7 @@ const paginationConfig = reactive({
|
|||||||
pageSize: Number(localStorage.getItem('firewall-forward-page-size')) || 20,
|
pageSize: Number(localStorage.getItem('firewall-forward-page-size')) || 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
if (!isInit.value || !isBind.value || fireName.value === '-') {
|
if (!isInit.value || !isBind.value || fireName.value === '-') {
|
||||||
|
|||||||
@@ -302,7 +302,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { Firewall } from '@/api/interface/firewall';
|
import { Firewall } from '@/api/interface/firewall';
|
||||||
import type { FuTableOperationButton } from '@/components/table/shared';
|
import type { FuTableOperationButton } from '@/components/table/shared';
|
||||||
import { buildHostRuleExport } from './transfer';
|
import { buildHostRuleExport } from './transfer';
|
||||||
@@ -330,7 +330,7 @@ import RuleReset from '@/views/host/firewall/components/rule-reset.vue';
|
|||||||
import TaskLog from '@/components/log/task/index.vue';
|
import TaskLog from '@/components/log/task/index.vue';
|
||||||
import DockerRestart from '@/components/docker-proxy/docker-restart.vue';
|
import DockerRestart from '@/components/docker-proxy/docker-restart.vue';
|
||||||
import { loadDockerStatus } from '@/api/modules/container';
|
import { loadDockerStatus } from '@/api/modules/container';
|
||||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
import { toRef, computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { Expand, Loading, Lock, Refresh } from '@element-plus/icons-vue';
|
import { Expand, Loading, Lock, Refresh } from '@element-plus/icons-vue';
|
||||||
@@ -405,7 +405,6 @@ const showFirewallUnavailablePrompt = computed(
|
|||||||
const firewallVersion = ref('');
|
const firewallVersion = ref('');
|
||||||
const selectedRuleFilters = ref<RuleFilter[]>(loadCachedFilterValues(ruleFilterStorageKey, ruleFilterOptions, []));
|
const selectedRuleFilters = ref<RuleFilter[]>(loadCachedFilterValues(ruleFilterStorageKey, ruleFilterOptions, []));
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('host/firewall/rule/index', { search: searchName });
|
|
||||||
const inventoryItems = ref<Firewall.InventoryItem[]>([]);
|
const inventoryItems = ref<Firewall.InventoryItem[]>([]);
|
||||||
const positionRanges = ref<Partial<Record<Firewall.Family, Firewall.PositionRange>>>({});
|
const positionRanges = ref<Partial<Record<Firewall.Family, Firewall.PositionRange>>>({});
|
||||||
const inventoryTotal = ref(0);
|
const inventoryTotal = ref(0);
|
||||||
@@ -433,6 +432,7 @@ const paginationConfig = reactive({
|
|||||||
pageSize: Number(localStorage.getItem('firewall-rule-page-size')) || 20,
|
pageSize: Number(localStorage.getItem('firewall-rule-page-size')) || 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const providerScopes = (): Firewall.Scope[] => {
|
const providerScopes = (): Firewall.Scope[] => {
|
||||||
if (provider.value === 'iptables' || provider.value === 'nftables') {
|
if (provider.value === 'iptables' || provider.value === 'nftables') {
|
||||||
|
|||||||
@@ -93,11 +93,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||||
import { dateFormatServerTimezone } from '@/utils/date';
|
import { dateFormatServerTimezone } from '@/utils/date';
|
||||||
import { downloadFile } from '@/utils/file';
|
import { downloadFile } from '@/utils/file';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { cleanSSHLogs, exportSSHLogs, loadSSHLogs } from '@/api/modules/host';
|
import { cleanSSHLogs, exportSSHLogs, loadSSHLogs } from '@/api/modules/host';
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
@@ -120,7 +120,7 @@ const exportConfig = reactive({
|
|||||||
status: 'All',
|
status: 'All',
|
||||||
});
|
});
|
||||||
const searchInfo = ref();
|
const searchInfo = ref();
|
||||||
useSearchPersistence('host/ssh/log/log', { search: searchInfo });
|
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const searchStatus = ref('All');
|
const searchStatus = ref('All');
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import FireRouter from '@/views/host/ssh/index.vue';
|
import FireRouter from '@/views/host/ssh/index.vue';
|
||||||
import { toRef, ref, onMounted, onUnmounted, reactive } from 'vue';
|
import { toRef, ref, onMounted, onUnmounted, reactive } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
@@ -38,7 +38,7 @@ const sshSearch = reactive({
|
|||||||
type: 'ssh',
|
type: 'ssh',
|
||||||
loginUser: '',
|
loginUser: '',
|
||||||
});
|
});
|
||||||
useSearchPersistence('host/ssh/session/index', { search: toRef(sshSearch, 'loginUser') });
|
useSearchReset({ search: toRef(sshSearch, 'loginUser') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
||||||
import { Log } from '@/api/interface/log';
|
import { Log } from '@/api/interface/log';
|
||||||
import { getSystemLogStatus, listRunningServices, readSystemLogs } from '@/api/modules/log';
|
import { getSystemLogStatus, listRunningServices, readSystemLogs } from '@/api/modules/log';
|
||||||
@@ -114,7 +114,7 @@ const logs = ref<Log.SystemLogItem[]>([]);
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const watching = ref(false);
|
const watching = ref(false);
|
||||||
const keyword = ref('');
|
const keyword = ref('');
|
||||||
useSearchPersistence('log/host-system/index', { keyword });
|
useSearchReset({ keyword }, { onRevisit: () => scheduleFilterSearch() });
|
||||||
const priority = ref('');
|
const priority = ref('');
|
||||||
const service = ref('');
|
const service = ref('');
|
||||||
const services = ref<string[]>([]);
|
const services = ref<string[]>([]);
|
||||||
@@ -274,11 +274,13 @@ onUnmounted(() => {
|
|||||||
if (filterTimer) clearTimeout(filterTimer);
|
if (filterTimer) clearTimeout(filterTimer);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch([keyword, priority, service], () => {
|
const scheduleFilterSearch = () => {
|
||||||
requestID++;
|
requestID++;
|
||||||
if (filterTimer) clearTimeout(filterTimer);
|
if (filterTimer) clearTimeout(filterTimer);
|
||||||
filterTimer = setTimeout(resetAndLoadLogs, 300);
|
filterTimer = setTimeout(resetAndLoadLogs, 300);
|
||||||
});
|
};
|
||||||
|
|
||||||
|
watch([keyword, priority, service], scheduleFilterSearch);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -45,12 +45,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||||
import LogRouter from '@/views/log/router/index.vue';
|
import LogRouter from '@/views/log/router/index.vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { cleanLogs, getLoginLogs } from '@/api/modules/log';
|
import { cleanLogs, getLoginLogs } from '@/api/modules/log';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
@@ -67,7 +67,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchInfo = ref<string>('');
|
const searchInfo = ref<string>('');
|
||||||
useSearchPersistence('log/login/index', { search: searchInfo });
|
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const searchStatus = ref<string>('');
|
const searchStatus = ref<string>('');
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
|
|||||||
@@ -125,12 +125,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||||
import LogRouter from '@/views/log/router/index.vue';
|
import LogRouter from '@/views/log/router/index.vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { cleanLogs, getOperationLogs } from '@/api/modules/log';
|
import { cleanLogs, getOperationLogs } from '@/api/modules/log';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useGlobalStore } from '@/composables/useGlobalStore';
|
import { useGlobalStore } from '@/composables/useGlobalStore';
|
||||||
@@ -146,7 +146,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const searchName = ref<string>('');
|
const searchName = ref<string>('');
|
||||||
useSearchPersistence('log/operation/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const searchGroup = ref<string>('');
|
const searchGroup = ref<string>('');
|
||||||
const searchStatus = ref<string>('');
|
const searchStatus = ref<string>('');
|
||||||
const searchNode = ref<string>('');
|
const searchNode = ref<string>('');
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { toRef, onMounted, ref } from 'vue';
|
import { toRef, onMounted, ref } from 'vue';
|
||||||
import { searchBackup, deleteBackup, refreshToken } from '@/api/modules/backup';
|
import { searchBackup, deleteBackup, refreshToken } from '@/api/modules/backup';
|
||||||
@@ -143,7 +143,10 @@ const paginationConfig = reactive({
|
|||||||
type: '',
|
type: '',
|
||||||
name: '',
|
name: '',
|
||||||
});
|
});
|
||||||
useSearchPersistence('setting/backup-account/index', { search: toRef(paginationConfig, 'name') });
|
useSearchReset(
|
||||||
|
{ search: toRef(paginationConfig, 'name'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
const dialogRef = ref();
|
const dialogRef = ref();
|
||||||
const detailRef = ref();
|
const detailRef = ref();
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import {
|
import {
|
||||||
searchSnapshotPage,
|
searchSnapshotPage,
|
||||||
snapshotDelete,
|
snapshotDelete,
|
||||||
@@ -233,7 +233,7 @@ import {
|
|||||||
snapshotRollback,
|
snapshotRollback,
|
||||||
updateSnapshotDescription,
|
updateSnapshotDescription,
|
||||||
} from '@/api/modules/setting';
|
} from '@/api/modules/setting';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import { computeSize } from '@/utils/size';
|
import { computeSize } from '@/utils/size';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import { newUUID } from '@/utils/id';
|
import { newUUID } from '@/utils/id';
|
||||||
@@ -261,7 +261,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('setting/snapshot/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
|
|
||||||
|
|||||||
@@ -100,13 +100,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { Command } from '@/api/interface/command';
|
import { Command } from '@/api/interface/command';
|
||||||
import GroupDialog from '@/components/group/index.vue';
|
import GroupDialog from '@/components/group/index.vue';
|
||||||
import OperateDialog from '@/views/terminal/command/operate/index.vue';
|
import OperateDialog from '@/views/terminal/command/operate/index.vue';
|
||||||
import ImportDialog from '@/views/terminal/command/import/index.vue';
|
import ImportDialog from '@/views/terminal/command/import/index.vue';
|
||||||
import { editCommand, deleteCommand, getCommandPage, exportCommands } from '@/api/modules/command';
|
import { editCommand, deleteCommand, getCommandPage, exportCommands } from '@/api/modules/command';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { getGroupList } from '@/api/modules/group';
|
import { getGroupList } from '@/api/modules/group';
|
||||||
@@ -124,7 +124,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'ascending',
|
order: 'ascending',
|
||||||
});
|
});
|
||||||
const info = ref();
|
const info = ref();
|
||||||
useSearchPersistence('terminal/command/index', { search: info });
|
useSearchReset({ search: info, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const group = ref<string>('');
|
const group = ref<string>('');
|
||||||
const dialogRef = ref();
|
const dialogRef = ref();
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
|
|||||||
@@ -79,12 +79,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import GroupDialog from '@/components/agent-group/index.vue';
|
import GroupDialog from '@/components/agent-group/index.vue';
|
||||||
import OperateDialog from '@/views/terminal/host/operate/index.vue';
|
import OperateDialog from '@/views/terminal/host/operate/index.vue';
|
||||||
import { deleteHost, editHostGroup, searchHosts } from '@/api/modules/terminal';
|
import { deleteHost, editHostGroup, searchHosts } from '@/api/modules/terminal';
|
||||||
import { getAgentGroupList } from '@/api/modules/group';
|
import { getAgentGroupList } from '@/api/modules/group';
|
||||||
import { reactive, ref } from 'vue';
|
import { toRef, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { Host } from '@/api/interface/host';
|
import { Host } from '@/api/interface/host';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
@@ -100,7 +100,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const info = ref();
|
const info = ref();
|
||||||
useSearchPersistence('terminal/host/index', { search: info });
|
useSearchReset({ search: info, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
const group = ref<string>('');
|
const group = ref<string>('');
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
|
|||||||
@@ -190,8 +190,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { deleteClam, handleClamScan, searchClam, updateClam, updateClamStatus } from '@/api/modules/toolbox';
|
import { deleteClam, handleClamScan, searchClam, updateClam, updateClamStatus } from '@/api/modules/toolbox';
|
||||||
@@ -218,7 +218,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('toolbox/clam/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
const dialogRef = ref();
|
const dialogRef = ref();
|
||||||
|
|||||||
@@ -174,8 +174,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { toRef, onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||||
import { deleteFtp, searchFtp, updateFtp, syncFtp, operateFtp, getFtpBase } from '@/api/modules/toolbox';
|
import { deleteFtp, searchFtp, updateFtp, syncFtp, operateFtp, getFtpBase } from '@/api/modules/toolbox';
|
||||||
@@ -201,7 +201,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
useSearchPersistence('toolbox/ftp/index', { search: searchName });
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { Runtime } from '@/api/interface/runtime';
|
import { Runtime } from '@/api/interface/runtime';
|
||||||
import { GetPHPExtensions, InstallPHPExtension, UnInstallPHPExtension } from '@/api/modules/runtime';
|
import { GetPHPExtensions, InstallPHPExtension, UnInstallPHPExtension } from '@/api/modules/runtime';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
@@ -49,7 +49,7 @@ const supportExtensions = ref([]);
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const taskLogRef = ref();
|
const taskLogRef = ref();
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('website/runtime/php/extension-management/index', { search: searchName });
|
useSearchReset({ search: searchName }, { onRevisit: () => searchByName() });
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
|
|||||||
@@ -221,7 +221,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
||||||
import { deleteSSL, downloadFile, pushSSLToNode, searchSSL, updateSSL } from '@/api/modules/website';
|
import { deleteSSL, downloadFile, pushSSLToNode, searchSSL, updateSSL } from '@/api/modules/website';
|
||||||
import DnsAccount from './dns-account/index.vue';
|
import DnsAccount from './dns-account/index.vue';
|
||||||
@@ -287,7 +287,10 @@ const req = reactive({
|
|||||||
orderBy: 'updated_at',
|
orderBy: 'updated_at',
|
||||||
order: 'descending',
|
order: 'descending',
|
||||||
});
|
});
|
||||||
useSearchPersistence('website/ssl/index', { search: toRef(req, 'domain') });
|
useSearchReset(
|
||||||
|
{ search: toRef(req, 'domain'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
const pushForm = ref({
|
const pushForm = ref({
|
||||||
id: 0,
|
id: 0,
|
||||||
pushNode: true,
|
pushNode: true,
|
||||||
@@ -304,8 +307,6 @@ const routerButton = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const shouldRevokeSSL = (row: Website.SSLDTO) => ['dnsAccount', 'dnsManual', 'http'].includes(row.provider);
|
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
label: i18n.global.t('ssl.detail'),
|
label: i18n.global.t('ssl.detail'),
|
||||||
@@ -381,15 +382,6 @@ const buttons = [
|
|||||||
click: function (row: Website.SSLDTO) {
|
click: function (row: Website.SSLDTO) {
|
||||||
deletessl(row);
|
deletessl(row);
|
||||||
},
|
},
|
||||||
show: (row: Website.SSLDTO) => !shouldRevokeSSL(row),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: i18n.global.t('ssl.deleteAndRevoke'),
|
|
||||||
permission: true,
|
|
||||||
click: function (row: Website.SSLDTO) {
|
|
||||||
deletessl(row);
|
|
||||||
},
|
|
||||||
show: shouldRevokeSSL,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -543,13 +535,9 @@ const applySSL = (row: Website.SSLDTO) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deletessl = async (row: any) => {
|
const deletessl = async (row: any) => {
|
||||||
const isBatch = row == null;
|
|
||||||
const deleteLabel = i18n.global.t(
|
|
||||||
!isBatch && shouldRevokeSSL(row) ? 'ssl.deleteAndRevoke' : 'commons.button.delete',
|
|
||||||
);
|
|
||||||
let names = [];
|
let names = [];
|
||||||
let params = {};
|
let params = {};
|
||||||
if (isBatch) {
|
if (row == null) {
|
||||||
names = selects.value.map((item: Website.SSLDTO) => item.primaryDomain);
|
names = selects.value.map((item: Website.SSLDTO) => item.primaryDomain);
|
||||||
params = { ids: selects.value.map((item: Website.SSLDTO) => item.id) };
|
params = { ids: selects.value.map((item: Website.SSLDTO) => item.id) };
|
||||||
} else {
|
} else {
|
||||||
@@ -558,11 +546,12 @@ const deletessl = async (row: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
opRef.value.acceptParams({
|
opRef.value.acceptParams({
|
||||||
title: deleteLabel,
|
title: i18n.global.t('commons.button.delete'),
|
||||||
names: names,
|
names: names,
|
||||||
msg: isBatch
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
? i18n.global.t('ssl.deleteConfirm')
|
i18n.global.t('website.ssl'),
|
||||||
: i18n.global.t('commons.msg.operatorHelper', [i18n.global.t('website.ssl'), deleteLabel]),
|
i18n.global.t('commons.button.delete'),
|
||||||
|
]),
|
||||||
api: deleteSSL,
|
api: deleteSSL,
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
import { deleteTemplate, searchTemplates } from '@/api/modules/website';
|
import { deleteTemplate, searchTemplates } from '@/api/modules/website';
|
||||||
import TemplateOperate from '@/views/website/template/operate/index.vue';
|
import TemplateOperate from '@/views/website/template/operate/index.vue';
|
||||||
@@ -67,12 +67,11 @@ import OutputCreate from '@/views/website/template/output/create.vue';
|
|||||||
import OutputList from '@/views/website/template/output/index.vue';
|
import OutputList from '@/views/website/template/output/index.vue';
|
||||||
import { dateFormat } from '@/utils/date';
|
import { dateFormat } from '@/utils/date';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { reactive, ref, onMounted } from 'vue';
|
import { toRef, reactive, ref, onMounted } from 'vue';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const data = ref<Website.Template[]>([]);
|
const data = ref<Website.Template[]>([]);
|
||||||
const searchName = ref('');
|
const searchName = ref('');
|
||||||
useSearchPersistence('website/template/index', { search: searchName });
|
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
const operateRef = ref();
|
const operateRef = ref();
|
||||||
const outputCreateRef = ref();
|
const outputCreateRef = ref();
|
||||||
@@ -91,6 +90,7 @@ const paginationConfig = reactive({
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -346,7 +346,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useSearchPersistence } from '@/composables/useSearchPersistence';
|
import { useSearchReset } from '@/composables/useSearchReset';
|
||||||
import Backups from '@/components/backup/index.vue';
|
import Backups from '@/components/backup/index.vue';
|
||||||
import UploadDialog from '@/components/upload/index.vue';
|
import UploadDialog from '@/components/upload/index.vue';
|
||||||
import DefaultServer from '@/views/website/website/default/index.vue';
|
import DefaultServer from '@/views/website/website/default/index.vue';
|
||||||
@@ -451,7 +451,10 @@ const pageState = usePageState(() => ({
|
|||||||
}));
|
}));
|
||||||
const paginationConfig = pageState.paginationConfig;
|
const paginationConfig = pageState.paginationConfig;
|
||||||
const req = pageState.req;
|
const req = pageState.req;
|
||||||
useSearchPersistence('website/website/index', { search: toRef(req, 'name') });
|
useSearchReset(
|
||||||
|
{ search: toRef(req, 'name'), page: toRef(paginationConfig, 'currentPage') },
|
||||||
|
{ onRevisit: () => search() },
|
||||||
|
);
|
||||||
const tableSort = pageState.tableSort;
|
const tableSort = pageState.tableSort;
|
||||||
|
|
||||||
const goRouter = async (key: string) => {
|
const goRouter = async (key: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user