Add GlobalStore module

Create a GlobalStore to store global variables,
including data in app header.

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: Id498dec3925feec9a7e31ede91328f89ae591a0b
diff --git a/src/store/index.js b/src/store/index.js
index 3b86bfe..af06a47 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -2,6 +2,7 @@
 import Vuex from "vuex";
 
 import LocalUserManagementStore from "./modules/AccessControl/LocalUserMangementStore";
+import GlobalStore from "./modules/GlobalStore";
 
 Vue.use(Vuex);
 
@@ -10,6 +11,7 @@
   mutations: {},
   actions: {},
   modules: {
+    global: GlobalStore,
     localUsers: LocalUserManagementStore
   }
 });
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
new file mode 100644
index 0000000..332c801
--- /dev/null
+++ b/src/store/modules/GlobalStore.js
@@ -0,0 +1,35 @@
+import api from "../api";
+
+const GlobalStore = {
+  namespaced: true,
+  state: {
+    hostName: "--",
+    hostStatus: null
+  },
+  getters: {
+    hostName(state) {
+      return state.hostName;
+    },
+    hostStatus(state) {
+      return state.hostStatus;
+    }
+  },
+  mutations: {
+    setHostName(state, hostName) {
+      state.hostName = hostName;
+    }
+  },
+  actions: {
+    getHostName({ commit }) {
+      api
+        .get("/xyz/openbmc_project/network/config/attr/HostName")
+        .then(response => {
+          const hostName = response.data.data;
+          commit("setHostName", hostName);
+        })
+        .catch(error => console.log(error));
+    }
+  }
+};
+
+export default GlobalStore;