diff --git a/src/api/sessions.js b/src/api/sessions.js index 60bd03b39..1ef2db725 100644 --- a/src/api/sessions.js +++ b/src/api/sessions.js @@ -57,6 +57,26 @@ export function TestReplayStorage(id) { }) } +function SetToDefaultStorage(url) { + return request({ + url: url, + method: 'patch', + data: { 'is_default': true } + }) +} + +export function SetToDefaultCommandStorage(id) { + return SetToDefaultStorage( + `/api/v1/terminal/command-storages/${id}/`, + ) +} + +export function SetToDefaultReplayStorage(id) { + return SetToDefaultStorage( + `/api/v1/terminal/replay-storages/${id}/`, + ) +} + export function getReplayStorage(id) { return request({ url: `/api/v1/terminal/replay-storages/${id}/`, diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 69e94e4d1..8da00db5f 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -663,6 +663,9 @@ "SiteMessageList": "站内信" }, "sessions": { + "SetToDefault": "设为默认", + "SetSuccess": "设置成功", + "SetFailed": "设置失败", "StorageConfiguration": "存储配置", "accountKey": "账户密钥", "accountName": "账户名称", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 9627bf5a9..08d99f821 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -661,6 +661,9 @@ "SiteMessageList": "Site message" }, "sessions": { + "SetToDefault": "Set to default", + "SetSuccess": "Set success", + "SetFailed": "Set failed", "StorageConfiguration": "Storage configuration", "accountKey": "Account key", "accountName": "Account name", diff --git a/src/views/sessions/Storage/CommandStorage.vue b/src/views/sessions/Storage/CommandStorage.vue index af7f88ee1..ebc31d14b 100644 --- a/src/views/sessions/Storage/CommandStorage.vue +++ b/src/views/sessions/Storage/CommandStorage.vue @@ -1,10 +1,11 @@