diff --git a/ui/src/api/sessions.js b/ui/src/api/sessions.js
index 2aa6fb8717c..17bbc190d41 100644
--- a/ui/src/api/sessions.js
+++ b/ui/src/api/sessions.js
@@ -3,4 +3,8 @@ import http from '@/helpers/http'
export const
fetchSessions = async () => {
return http().get('/sessions')
- }
\ No newline at end of file
+ },
+ getSession = async (uid) => {
+ return http().get(`/session/${uid}`)
+ }
+
diff --git a/ui/src/components/AddDevice.vue b/ui/src/components/device/AddDevice.vue
similarity index 100%
rename from ui/src/components/AddDevice.vue
rename to ui/src/components/device/AddDevice.vue
diff --git a/ui/src/components/DeviceFeature.vue b/ui/src/components/device/DetailsDevice.vue
similarity index 95%
rename from ui/src/components/DeviceFeature.vue
rename to ui/src/components/device/DetailsDevice.vue
index c0c80ff116b..16f2406ec8e 100644
--- a/ui/src/components/DeviceFeature.vue
+++ b/ui/src/components/device/DetailsDevice.vue
@@ -84,7 +84,7 @@ import TerminalDialog from "@/components/TerminalDialog.vue";
import moment from 'moment'
export default {
- name: "DeviceFeature",
+ name: "DetailsDevice",
components: {
TerminalDialog,
@@ -97,12 +97,6 @@ export default {
},
computed: {
- // format_date(value){
- // if (value) {
- // return moment(String(value)).format('YYYYMMDD')
- // }
- // },
-
},
methods: {
@@ -160,14 +154,12 @@ export default {
.item-description {
font-size: 14px;
/* display:inline; */
-
}
.item-title{
margin-bottom: -4px;
margin-left: 15px;
width: 350%;
-
}
.item-title-name{
@@ -196,11 +188,4 @@ export default {
float: right;
}
-
-
-/* .mt-2{
- padding: 32px;
-} */
-
-
\ No newline at end of file
diff --git a/ui/src/components/DeviceList.vue b/ui/src/components/device/ListDevice.vue
similarity index 96%
rename from ui/src/components/DeviceList.vue
rename to ui/src/components/device/ListDevice.vue
index 6a36b25099b..ef04c89f37c 100644
--- a/ui/src/components/DeviceList.vue
+++ b/ui/src/components/device/ListDevice.vue
@@ -56,7 +56,7 @@
-
+
info
@@ -75,7 +75,7 @@
+
\ No newline at end of file
diff --git a/ui/src/components/session/ListSession.vue b/ui/src/components/session/ListSession.vue
new file mode 100644
index 00000000000..d6e0602e492
--- /dev/null
+++ b/ui/src/components/session/ListSession.vue
@@ -0,0 +1,128 @@
+
+
+ Sessions
+
+
+
+
+
+
+
+
+
+ check_circle
+
+
+ check_circle
+
+ active {{ item.last_seen | moment("from", "now") }}
+
+
+
+
+
+ {{item.device}}
+ mdi-content-copy
+
+
+
+
+ {{ item.ip_address }}
+
+
+
+ {{ item.started_at | moment("ddd, MMM Do YYY, h:mm:ss a")}}
+
+
+
+ {{ item.last_seen | moment("ddd, MMM Do YYY, h:mm:ss a")}}
+
+
+
+
+ info
+
+
+
+
+
+
+ Device UID copied to clipboard
+
+
+
+
+
+
diff --git a/ui/src/modules/sessions.js b/ui/src/modules/sessions.js
index 729d26db174..209f3cfb9e9 100644
--- a/ui/src/modules/sessions.js
+++ b/ui/src/modules/sessions.js
@@ -1,20 +1,26 @@
import Vue from 'vue'
-import { fetchSessions } from '@/api/sessions'
+import { fetchSessions, getSession } from '@/api/sessions'
export default {
namespaced: true,
state: {
- sessions: []
+ sessions: [],
+ session: []
+
},
getters: {
- list: state => state.sessions
+ list: state => state.sessions,
+ get: state => state.session
},
mutations: {
setSessions: (state, data) => {
Vue.set(state, 'sessions', data)
+ },
+ setSession: (state, data) => {
+ Vue.set(state, 'session', data)
}
},
@@ -23,6 +29,11 @@ export default {
let res = await fetchSessions()
context.commit('setSessions', res.data)
+ },
+ get: async (context,uid) => {
+ let res = await getSession(uid)
+ context.commit('setSession', res.data)
}
+
}
}
\ No newline at end of file
diff --git a/ui/src/router.js b/ui/src/router.js
index 8b1b0a6d578..eb01e170396 100644
--- a/ui/src/router.js
+++ b/ui/src/router.js
@@ -22,10 +22,10 @@ const router = new Router({
import(/* webpackChunkName: "devices" */ "./views/Devices.vue")
},
{
- path: "/devices/:id",
- name: "featureDevice",
+ path: "/device/:id",
+ name: "detailsDevice",
component: () =>
- import("./views/FeatureDevice.vue")
+ import(/* webpackChunkName: "details-device" */ "./views/DetailsDevice.vue")
},
{
path: "/sessions",
@@ -33,6 +33,12 @@ const router = new Router({
component: () =>
import("./views/Sessions.vue")
},
+ {
+ path: "/session/:id",
+ name: "detailsSession",
+ component: () =>
+ import(/* webpackChunkName: "details-session" */ "./views/DetailsSession.vue")
+ },
{
path: "/login",
name: "login",
diff --git a/ui/src/views/Dashboard.vue b/ui/src/views/Dashboard.vue
index dd98a5a4bbb..e03a110bb9d 100644
--- a/ui/src/views/Dashboard.vue
+++ b/ui/src/views/Dashboard.vue
@@ -60,7 +60,7 @@
\ No newline at end of file
diff --git a/ui/src/views/DetailsSession.vue b/ui/src/views/DetailsSession.vue
new file mode 100644
index 00000000000..b367e50e022
--- /dev/null
+++ b/ui/src/views/DetailsSession.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/src/views/Devices.vue b/ui/src/views/Devices.vue
index 7615bf4de65..ae9d17f5a1a 100644
--- a/ui/src/views/Devices.vue
+++ b/ui/src/views/Devices.vue
@@ -1,16 +1,16 @@
-
+
\ No newline at end of file
diff --git a/ui/src/views/FeatureDevice.vue b/ui/src/views/FeatureDevice.vue
deleted file mode 100644
index 876519739b8..00000000000
--- a/ui/src/views/FeatureDevice.vue
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ui/src/views/Sessions.vue b/ui/src/views/Sessions.vue
index f549e926f4c..19842f95a74 100644
--- a/ui/src/views/Sessions.vue
+++ b/ui/src/views/Sessions.vue
@@ -1,105 +1,16 @@
-
-
- Sessions
-
-
-
-
-
-
-
-
-
-
- {{item.device}}
- mdi-content-copy
-
-
-
-
- {{ item.ip_address }}
-
-
-
- {{ item.started_at | moment("ddd, MMM Do YYY, h:mm:ss a")}}
-
-
-
- {{ item.last_seen | moment("ddd, MMM Do YYY, h:mm:ss a")}}
-
-
- check_circle
-
-
- check_circle
-
- active {{ item.last_seen | moment("from", "now") }}
-
-
-
-
-
-
- Device UID copied to clipboard
-
+
+
+
+
-
-
+
\ No newline at end of file