mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: redesign user host defaults system
This commit is contained in:
1 parent
3028ab1176
commit
a4a4d4f27b
144 files changed
+24609
-2555
No files matched your search
@@ -826,8 +826,16 @@ export function createFakeContext(
|
||||
|
||||
getHost: async (hostId, key) =>
|
||||
settings.get(settingsKey("host", String(hostId), key)) as never,
|
||||
setHost: async (hostId, key, value) =>
|
||||
writeSetting("host", String(hostId), key, value),
|
||||
getHostFor: async (hostId, _userId, key) =>
|
||||
settings.get(settingsKey("host", String(hostId), key)) as never,
|
||||
// Host defaults live in core; the mock stands in the user's own
|
||||
// setting of the same key, so a test can set one with setUser.
|
||||
getHostDefault: async (userId, key) =>
|
||||
settings.get(settingsKey("user", userId, key)) as never,
|
||||
setHost: async (hostId, key, value, options) =>
|
||||
options?.inherit
|
||||
? void settings.delete(settingsKey("host", String(hostId), key))
|
||||
: writeSetting("host", String(hostId), key, value),
|
||||
|
||||
listHostValues: async (key) => {
|
||||
const found: Array<{ hostId: number; userId: string; value: never }> =
|
||||
|
||||
Reference in new issue
Block a user