summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorkirankumarb07 <kirankumarb@ami.com>2023-03-29 08:49:31 +0300
committerSivaprabu Ganesan <sivaprabug@ami.com>2023-05-10 23:50:31 +0300
commit2dabfc1bb488f84ec00f19a51aba144b7f71e45d (patch)
tree726107029941fcb61c0d204c33945aa3c2e44ef2 /src/views
parent0f6147ca2518bd7401e94e5551322a7892e27d77 (diff)
downloadwebui-vue-2dabfc1bb488f84ec00f19a51aba144b7f71e45d.tar.xz
Add session timeout in Policies page
This patchset will provide the option to configure the session timeout for the WebUI. The functionality will provide the below timeout options to configure. 1. 30 minutes 2. 1 hour 3. 2 hours 4. 4 hours 5. 8 hours 6. 1 Day For the API, redfish is having the following resource. URL - /redfish/v1/SessionService Method - GET (to get the configured timeout) - PATCH (to configure the timeout value) Property - { "SessionTimeout": 1800 } When the user idles up until the configured session timeout, after that any API call from this session will get 401 status and the web UI will gets logged out. Change-Id: Ic7c6b4817e560ca4ceb983dc5e2af51f3ae08cf5 Signed-off-by: Kirankumar Ballapalli <kirankumarb@ami.com>
Diffstat (limited to 'src/views')
-rw-r--r--src/views/SecurityAndAccess/Policies/Policies.vue50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/views/SecurityAndAccess/Policies/Policies.vue b/src/views/SecurityAndAccess/Policies/Policies.vue
index 1dc197c7..3ebfee4e 100644
--- a/src/views/SecurityAndAccess/Policies/Policies.vue
+++ b/src/views/SecurityAndAccess/Policies/Policies.vue
@@ -103,6 +103,30 @@
</b-form-checkbox>
</b-col>
</b-row>
+ <b-row class="setting-section">
+ <b-col class="d-flex align-items-center justify-content-between">
+ <dl class="mt-3 mr-3 w-75">
+ <dt>{{ $t('pagePolicies.webSessionTimeOut') }}</dt>
+ <dd>
+ {{ $t('pagePolicies.webSessionTimeOutDescription') }}
+ </dd>
+ </dl>
+ </b-col>
+ <b-col lg="3" class="session-timeout">
+ <b-form-select
+ id="session-timeout-options"
+ v-model="sessionTimeoutState"
+ :options="sessionTimeOutOptions"
+ @change="saveSessionTimeoutValue"
+ >
+ <template #first>
+ <b-form-select-option :value="null" disabled>
+ {{ $t('global.form.selectAnOption') }}
+ </b-form-select-option>
+ </template>
+ </b-form-select>
+ </b-col>
+ </b-row>
</b-col>
</b-row>
</b-container>
@@ -126,6 +150,14 @@ export default {
return {
modifySSHPolicyDisabled:
process.env.VUE_APP_MODIFY_SSH_POLICY_DISABLED === 'true',
+ sessionTimeOutOptions: [
+ { value: 1800, text: this.$t('pagePolicies.options.30minutes') },
+ { value: 3600, text: this.$t('pagePolicies.options.1hour') },
+ { value: 7200, text: this.$t('pagePolicies.options.2hours') },
+ { value: 14400, text: this.$t('pagePolicies.options.4hours') },
+ { value: 28800, text: this.$t('pagePolicies.options.8hours') },
+ { value: 86400, text: this.$t('pagePolicies.options.1day') },
+ ],
};
},
computed: {
@@ -169,12 +201,21 @@ export default {
return newValue;
},
},
+ sessionTimeoutState: {
+ get() {
+ return this.$store.getters['policies/getSessionTimeoutValue'];
+ },
+ set(newValue) {
+ return newValue;
+ },
+ },
},
created() {
this.startLoader();
Promise.all([
this.$store.dispatch('policies/getBiosStatus'),
this.$store.dispatch('policies/getNetworkProtocolStatus'),
+ this.$store.dispatch('policies/getSessionTimeout'),
]).finally(() => this.endLoader());
},
methods: {
@@ -202,6 +243,12 @@ export default {
.then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
+ saveSessionTimeoutValue(sessionTimeoutState) {
+ this.$store
+ .dispatch('policies/saveSessionTimeoutValue', sessionTimeoutState)
+ .then((message) => this.successToast(message))
+ .catch(({ message }) => this.errorToast(message));
+ },
},
};
</script>
@@ -210,4 +257,7 @@ export default {
.setting-section {
border-bottom: 1px solid gray('300');
}
+.session-timeout {
+ align-self: center;
+}
</style>