⚡ 修改终端提示.
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
try {
|
||||
// 加载组内数据
|
||||
const { data } = await getHostGroupRelList(groupId as number);
|
||||
const hosts = await cacheStore.loadHosts('');
|
||||
const hosts = await cacheStore.loadHosts();
|
||||
selectedGroupHosts.value = data.map(s => hosts.find(h => h.id === s) as HostQueryResponse)
|
||||
.filter(Boolean);
|
||||
} catch (e) {
|
||||
@@ -138,6 +138,8 @@
|
||||
idList: checkedGroups.value
|
||||
});
|
||||
Message.success('授权成功');
|
||||
// 清空缓存
|
||||
cacheStore.reset('authorizedHost_ALL', 'authorizedHost_SSH');
|
||||
} catch (e) {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -96,6 +96,8 @@
|
||||
idList: selectedKeys.value
|
||||
});
|
||||
Message.success('授权成功');
|
||||
// 清空缓存
|
||||
cacheStore.reset('authorizedHostIdentities');
|
||||
} catch (e) {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
idList: selectedKeys.value
|
||||
});
|
||||
Message.success('授权成功');
|
||||
// 清空缓存
|
||||
cacheStore.reset('authorizedHostKeys');
|
||||
} catch (e) {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
// 加载主机列表
|
||||
const loadHosts = () => {
|
||||
cacheStore.loadHosts('').then(hosts => {
|
||||
cacheStore.loadHosts().then(hosts => {
|
||||
data.value = hosts.map(s => {
|
||||
return {
|
||||
value: String(s.id),
|
||||
|
||||
@@ -339,7 +339,8 @@
|
||||
// 重新加载数据
|
||||
fetchCardData();
|
||||
// 清空缓存
|
||||
cacheStore.reset('host_', 'host_SSH');
|
||||
cacheStore.reset('host_ALL', 'host_SSH',
|
||||
'authorizedHost_ALL', 'authorizedHost_SSH');
|
||||
};
|
||||
|
||||
defineExpose({ reload });
|
||||
|
||||
@@ -373,7 +373,8 @@
|
||||
// 重新加载数据
|
||||
fetchTableData();
|
||||
// 清空缓存
|
||||
cacheStore.reset('host_', 'host_SSH');
|
||||
cacheStore.reset('host_ALL', 'host_SSH',
|
||||
'authorizedHost_ALL', 'authorizedHost_SSH');
|
||||
};
|
||||
|
||||
defineExpose({ reload });
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
const {
|
||||
fetchPreference, getCurrentSession, openSession,
|
||||
layoutState, preference, loadHosts, hosts, tabManager, sessionManager
|
||||
layoutState, preference, loadHostList, hosts, tabManager, sessionManager
|
||||
} = useTerminalStore();
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { enter: enterFull, exit: exitFull } = useFullscreen();
|
||||
@@ -165,7 +165,7 @@
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 加载主机
|
||||
await loadHosts();
|
||||
await loadHostList();
|
||||
// 默认连接主机
|
||||
const connect = route.query.connect as string;
|
||||
if (connect) {
|
||||
|
||||
Reference in New Issue
Block a user