diff options
-rw-r--r-- | .eslintrc.js | 8 | ||||
-rw-r--r-- | .prettierrc.js | 10 | ||||
-rw-r--r-- | src/App.vue | 6 | ||||
-rw-r--r-- | src/components/AppHeader/AppHeader.vue | 28 | ||||
-rw-r--r-- | src/components/AppNavigation/AppNavigation.vue | 12 | ||||
-rw-r--r-- | src/components/Global/StatusIcon.vue | 10 | ||||
-rw-r--r-- | src/layouts/AppLayout.vue | 12 | ||||
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue | 44 | ||||
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/ModalSettings.vue | 2 | ||||
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/ModalUser.vue | 12 | ||||
-rw-r--r-- | src/views/AccessControl/LocalUserManagement/TableRoles.vue | 30 | ||||
-rw-r--r-- | src/views/Login/Login.vue | 16 | ||||
-rw-r--r-- | src/views/Overview/Overview.vue | 24 | ||||
-rw-r--r-- | src/views/Overview/OverviewEvents.vue | 12 | ||||
-rw-r--r-- | src/views/Overview/OverviewQuickLinks.vue | 10 |
15 files changed, 116 insertions, 120 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 2e8a358a..4de4c1fd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,13 @@ module.exports = { extends: ['plugin:vue/essential', '@vue/prettier'], rules: { 'no-console': 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'prettier/prettier': [ + 'error', + { + singleQuote: true + } + ] }, parserOptions: { parser: 'babel-eslint' diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 948879ba..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - overrides: [ - { - files: '*.js', - options: { - singleQuote: true - } - } - ] -}; diff --git a/src/App.vue b/src/App.vue index d5b49329..a5a768a5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,15 +5,15 @@ </template> <style lang="scss"> -@import "@/assets/styles/_obmc-custom"; +@import '@/assets/styles/_obmc-custom'; </style> <script> export default { - name: "App", + name: 'App', watch: { $route: function(to) { - document.title = to.meta.title || "Page is Missing Title"; + document.title = to.meta.title || 'Page is Missing Title'; } } }; diff --git a/src/components/AppHeader/AppHeader.vue b/src/components/AppHeader/AppHeader.vue index 244eeb32..5c2c333c 100644 --- a/src/components/AppHeader/AppHeader.vue +++ b/src/components/AppHeader/AppHeader.vue @@ -36,38 +36,38 @@ </template> <script> -import IconAvatar from "@carbon/icons-vue/es/user--avatar/20"; -import IconRenew from "@carbon/icons-vue/es/renew/20"; -import StatusIcon from "../Global/StatusIcon"; +import IconAvatar from '@carbon/icons-vue/es/user--avatar/20'; +import IconRenew from '@carbon/icons-vue/es/renew/20'; +import StatusIcon from '../Global/StatusIcon'; export default { - name: "AppHeader", + name: 'AppHeader', components: { IconAvatar, IconRenew, StatusIcon }, created() { this.getHostInfo(); }, computed: { hostStatus() { - return this.$store.getters["global/hostStatus"]; + return this.$store.getters['global/hostStatus']; }, hostStatusIcon() { switch (this.hostStatus) { - case "on": - return "success"; - case "error": - return "danger"; - case "off": + case 'on': + return 'success'; + case 'error': + return 'danger'; + case 'off': default: - return "secondary"; + return 'secondary'; } } }, methods: { getHostInfo() { - this.$store.dispatch("global/getHostStatus"); + this.$store.dispatch('global/getHostStatus'); }, logout() { - this.$store.dispatch("authentication/logout").then(() => { - this.$router.push("/login"); + this.$store.dispatch('authentication/logout').then(() => { + this.$router.push('/login'); }); } } diff --git a/src/components/AppNavigation/AppNavigation.vue b/src/components/AppNavigation/AppNavigation.vue index 06e9efec..6871b88d 100644 --- a/src/components/AppNavigation/AppNavigation.vue +++ b/src/components/AppNavigation/AppNavigation.vue @@ -56,14 +56,14 @@ </template> <script> -import Analytics16 from "@carbon/icons-vue/es/analytics/16"; -import DataCheck16 from "@carbon/icons-vue/es/data--check/16"; -import SettingsAdjust16 from "@carbon/icons-vue/es/settings--adjust/16"; -import Settings16 from "@carbon/icons-vue/es/settings/16"; -import Password16 from "@carbon/icons-vue/es/password/16"; +import Analytics16 from '@carbon/icons-vue/es/analytics/16'; +import DataCheck16 from '@carbon/icons-vue/es/data--check/16'; +import SettingsAdjust16 from '@carbon/icons-vue/es/settings--adjust/16'; +import Settings16 from '@carbon/icons-vue/es/settings/16'; +import Password16 from '@carbon/icons-vue/es/password/16'; export default { - name: "AppNavigation", + name: 'AppNavigation', components: { Analytics16, DataCheck16, diff --git a/src/components/Global/StatusIcon.vue b/src/components/Global/StatusIcon.vue index bb208409..63155c9a 100644 --- a/src/components/Global/StatusIcon.vue +++ b/src/components/Global/StatusIcon.vue @@ -7,13 +7,13 @@ </template> <script> -import IconCheckmark from "@carbon/icons-vue/es/checkmark--filled/20"; -import IconWarning from "@carbon/icons-vue/es/warning--filled/20"; -import IconError from "@carbon/icons-vue/es/error--filled/20"; +import IconCheckmark from '@carbon/icons-vue/es/checkmark--filled/20'; +import IconWarning from '@carbon/icons-vue/es/warning--filled/20'; +import IconError from '@carbon/icons-vue/es/error--filled/20'; export default { - name: "StatusIcon", - props: ["status"], + name: 'StatusIcon', + props: ['status'], components: { iconSuccess: IconCheckmark, iconDanger: IconWarning, diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index 49d61c14..e5a55018 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -17,11 +17,11 @@ </template> <script> -import AppHeader from "@/components/AppHeader"; -import AppNavigation from "@/components/AppNavigation"; -import PageContainer from "../components/Global/PageContainer"; +import AppHeader from '@/components/AppHeader'; +import AppNavigation from '@/components/AppNavigation'; +import PageContainer from '../components/Global/PageContainer'; export default { - name: "App", + name: 'App', components: { AppHeader, AppNavigation, @@ -35,14 +35,14 @@ export default { let focusTarget = this.$refs.focusTarget.$el; // Make focustarget programmatically focussable - focusTarget.setAttribute("tabindex", "-1"); + focusTarget.setAttribute('tabindex', '-1'); // Focus element focusTarget.focus(); // Remove tabindex from focustarget // Reason: https://axesslab.com/skip-links/#update-3-a-comment-from-gov-uk - focusTarget.removeAttribute("tabindex"); + focusTarget.removeAttribute('tabindex'); }); } } diff --git a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue index 6a8300b7..bc2200e6 100644 --- a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue +++ b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue @@ -59,18 +59,18 @@ </template> <script> -import IconTrashcan from "@carbon/icons-vue/es/trash-can/20"; -import IconEdit from "@carbon/icons-vue/es/edit/20"; -import IconAdd from "@carbon/icons-vue/es/add--alt/20"; -import IconSettings from "@carbon/icons-vue/es/settings/20"; +import IconTrashcan from '@carbon/icons-vue/es/trash-can/20'; +import IconEdit from '@carbon/icons-vue/es/edit/20'; +import IconAdd from '@carbon/icons-vue/es/add--alt/20'; +import IconSettings from '@carbon/icons-vue/es/settings/20'; -import TableRoles from "./TableRoles"; -import ModalUser from "./ModalUser"; -import ModalSettings from "./ModalSettings"; -import PageTitle from "../../../components/Global/PageTitle"; +import TableRoles from './TableRoles'; +import ModalUser from './ModalUser'; +import ModalSettings from './ModalSettings'; +import PageTitle from '../../../components/Global/PageTitle'; export default { - name: "local-users", + name: 'local-users', components: { IconAdd, IconEdit, @@ -92,7 +92,7 @@ export default { }, computed: { allUsers() { - return this.$store.getters["localUsers/allUsers"]; + return this.$store.getters['localUsers/allUsers']; }, tableItems() { // transform user data to table data @@ -101,13 +101,13 @@ export default { username: user.UserName, privilege: user.RoleId, status: user.Locked - ? "Locked" + ? 'Locked' : user.Enabled - ? "Enabled" - : "Disabled", + ? 'Enabled' + : 'Disabled', actions: { edit: true, - delete: user.UserName === "root" ? false : true + delete: user.UserName === 'root' ? false : true } }; }); @@ -115,19 +115,19 @@ export default { }, methods: { getUsers() { - this.$store.dispatch("localUsers/getUsers"); + this.$store.dispatch('localUsers/getUsers'); }, initModalUser(user) { this.activeUser = user; - this.$bvModal.show("modal-user"); + this.$bvModal.show('modal-user'); }, initModalDelete(user) { this.$bvModal .msgBoxConfirm( `Are you sure you want to delete user '${user.username}'? This action cannot be undone.`, { - title: "Delete user", - okTitle: "Delete user" + title: 'Delete user', + okTitle: 'Delete user' } ) .then(deleteConfirmed => { @@ -138,20 +138,20 @@ export default { }, initModalSettings() { if (this.settings) { - this.$bvModal.show("modal-settings"); + this.$bvModal.show('modal-settings'); } else { // fetch settings then show modal } }, saveUser({ newUser, form }) { if (newUser) { - this.$store.dispatch("localUsers/createUser", form); + this.$store.dispatch('localUsers/createUser', form); } else { - this.$store.dispatch("localUsers/updateUser", form); + this.$store.dispatch('localUsers/updateUser', form); } }, deleteUser({ username }) { - this.$store.dispatch("localUsers/deleteUser", username); + this.$store.dispatch('localUsers/deleteUser', username); }, clearActiveUser() { this.activeUser = null; diff --git a/src/views/AccessControl/LocalUserManagement/ModalSettings.vue b/src/views/AccessControl/LocalUserManagement/ModalSettings.vue index 3d985ac2..dae4d908 100644 --- a/src/views/AccessControl/LocalUserManagement/ModalSettings.vue +++ b/src/views/AccessControl/LocalUserManagement/ModalSettings.vue @@ -4,6 +4,6 @@ <script> export default { - props: ["settings"] + props: ['settings'] }; </script> diff --git a/src/views/AccessControl/LocalUserManagement/ModalUser.vue b/src/views/AccessControl/LocalUserManagement/ModalUser.vue index 70cd6141..73aa164c 100644 --- a/src/views/AccessControl/LocalUserManagement/ModalUser.vue +++ b/src/views/AccessControl/LocalUserManagement/ModalUser.vue @@ -47,10 +47,10 @@ <script> export default { - props: ["user"], + props: ['user'], data() { return { - privilegeTypes: ["Administrator", "Operator", "ReadOnly", "NoAccess"] + privilegeTypes: ['Administrator', 'Operator', 'ReadOnly', 'NoAccess'] }; }, computed: { @@ -62,12 +62,12 @@ export default { originalUsername: this.newUser ? null : this.user.username, status: this.newUser ? true - : this.user.status === "Enabled" + : this.user.status === 'Enabled' ? true : false, - username: this.newUser ? "" : this.user.username, - privilege: this.newUser ? "" : this.user.privilege, - password: "" + username: this.newUser ? '' : this.user.username, + privilege: this.newUser ? '' : this.user.privilege, + password: '' }; } } diff --git a/src/views/AccessControl/LocalUserManagement/TableRoles.vue b/src/views/AccessControl/LocalUserManagement/TableRoles.vue index 7aa1dc8e..b4019664 100644 --- a/src/views/AccessControl/LocalUserManagement/TableRoles.vue +++ b/src/views/AccessControl/LocalUserManagement/TableRoles.vue @@ -24,7 +24,7 @@ </template> <script> -import Checkmark20 from "@carbon/icons-vue/es/checkmark/20"; +import Checkmark20 from '@carbon/icons-vue/es/checkmark/20'; export default { components: { @@ -34,63 +34,63 @@ export default { return { items: [ { - description: "Configure components managed by this service", + description: 'Configure components managed by this service', administrator: true, operator: false, readonly: false, noaccess: false }, { - description: "Configure manager resources", + description: 'Configure manager resources', administrator: true, operator: false, readonly: false, noaccess: false }, { - description: "Update password for current user account", + description: 'Update password for current user account', administrator: true, operator: false, // TODO Set to true when profile page added readonly: false, // TODO Set to true when profile page added noaccess: false }, { - description: "Configure users and their accounts", + description: 'Configure users and their accounts', administrator: true, operator: false, readonly: false, noaccess: false }, { - description: "Log in to the service and read resources", + description: 'Log in to the service and read resources', administrator: true, operator: true, readonly: true, noaccess: false }, { - description: "IPMI access point", + description: 'IPMI access point', administrator: true, operator: true, readonly: true, noaccess: false }, { - description: "Redfish access point", + description: 'Redfish access point', administrator: true, operator: true, readonly: true, noaccess: false }, { - description: "SSH access point", + description: 'SSH access point', administrator: true, operator: false, readonly: false, noaccess: false }, { - description: "WebUI access point", + description: 'WebUI access point', administrator: true, operator: true, readonly: true, @@ -98,11 +98,11 @@ export default { } ], fields: [ - { key: "description", label: "" }, - { key: "administrator", label: "Administrator", class: "text-center" }, - { key: "operator", label: "Operator", class: "text-center" }, - { key: "readonly", label: "ReadOnly", class: "text-center" }, - { key: "noaccess", label: "NoAccess", class: "text-center" } + { key: 'description', label: '' }, + { key: 'administrator', label: 'Administrator', class: 'text-center' }, + { key: 'operator', label: 'Operator', class: 'text-center' }, + { key: 'readonly', label: 'ReadOnly', class: 'text-center' }, + { key: 'noaccess', label: 'NoAccess', class: 'text-center' } ] }; } diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index 7914ea62..b6adf9eb 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -47,11 +47,11 @@ <script> export default { - name: "Login", + name: 'Login', data() { return { - username: "", - password: "" + username: '', + password: '' }; }, methods: { @@ -59,8 +59,8 @@ export default { const username = this.username; const password = this.password; this.$store - .dispatch("authentication/login", [username, password]) - .then(() => this.$router.push("/")) + .dispatch('authentication/login', [username, password]) + .then(() => this.$router.push('/')) .catch(error => console.log(error)); } } @@ -68,9 +68,9 @@ export default { </script> <style lang="scss" scoped> -@import "~bootstrap/scss/functions"; -@import "~bootstrap/scss/variables"; -@import "~bootstrap/scss/mixins"; +@import '~bootstrap/scss/functions'; +@import '~bootstrap/scss/variables'; +@import '~bootstrap/scss/mixins'; .login-container { @include media-breakpoint-up(md) { diff --git a/src/views/Overview/Overview.vue b/src/views/Overview/Overview.vue index 570f8494..2672af7e 100644 --- a/src/views/Overview/Overview.vue +++ b/src/views/Overview/Overview.vue @@ -87,13 +87,13 @@ </template> <script> -import OverviewQuickLinks from "./OverviewQuickLinks"; -import OverviewEvents from "./OverviewEvents"; -import PageTitle from "../../components/Global/PageTitle"; -import PageSection from "../../components/Global/PageSection"; -import { mapState } from "vuex"; +import OverviewQuickLinks from './OverviewQuickLinks'; +import OverviewEvents from './OverviewEvents'; +import PageTitle from '../../components/Global/PageTitle'; +import PageSection from '../../components/Global/PageSection'; +import { mapState } from 'vuex'; export default { - name: "Overview", + name: 'Overview', components: { OverviewQuickLinks, OverviewEvents, @@ -117,12 +117,12 @@ export default { }), methods: { getOverviewInfo() { - this.$store.dispatch("overview/getServerInfo"); - this.$store.dispatch("global/getHostName"); - this.$store.dispatch("firmware/getFirmwareInfo"); - this.$store.dispatch("powerConsumption/getPowerData"); - this.$store.dispatch("powerCap/getPowerCapData"); - this.$store.dispatch("networkSettings/getNetworkData"); + this.$store.dispatch('overview/getServerInfo'); + this.$store.dispatch('global/getHostName'); + this.$store.dispatch('firmware/getFirmwareInfo'); + this.$store.dispatch('powerConsumption/getPowerData'); + this.$store.dispatch('powerCap/getPowerCapData'); + this.$store.dispatch('networkSettings/getNetworkData'); } } }; diff --git a/src/views/Overview/OverviewEvents.vue b/src/views/Overview/OverviewEvents.vue index 05106067..07aab1d5 100644 --- a/src/views/Overview/OverviewEvents.vue +++ b/src/views/Overview/OverviewEvents.vue @@ -2,11 +2,11 @@ <div> <b-list-group v-for="logData in eventLogData" :key="logData.id"> <b-list-group-item href="#" class="flex-column align-items-start"> - {{ "#" + logData.logId }} + {{ '#' + logData.logId }} <b-badge variant="danger">{{ logData.priority }}</b-badge> <div class="d-flex w-100 justify-content-between"> <small>{{ - logData.Timestamp | date("MMM DD YYYY HH:MM:SS A ZZ") + logData.Timestamp | date('MMM DD YYYY HH:MM:SS A ZZ') }}</small> <ChevronRight16 /> </div> @@ -20,9 +20,9 @@ </template> <script> -import ChevronRight16 from "@carbon/icons-vue/es/chevron--right/16"; +import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16'; export default { - name: "events", + name: 'events', components: { ChevronRight16 }, @@ -31,12 +31,12 @@ export default { }, computed: { eventLogData() { - return this.$store.getters["eventLog/eventLogData"]; + return this.$store.getters['eventLog/eventLogData']; } }, methods: { getEventLogData() { - this.$store.dispatch("eventLog/getEventLogData"); + this.$store.dispatch('eventLog/getEventLogData'); } } }; diff --git a/src/views/Overview/OverviewQuickLinks.vue b/src/views/Overview/OverviewQuickLinks.vue index 577ea5ff..726eaf7d 100644 --- a/src/views/Overview/OverviewQuickLinks.vue +++ b/src/views/Overview/OverviewQuickLinks.vue @@ -4,7 +4,7 @@ <b-list-group-item> <dl> <dt>BMC time</dt> - <dd>{{ bmcTime | date("MMM, DD YYYY HH:MM:SS A ZZ") }}</dd> + <dd>{{ bmcTime | date('MMM, DD YYYY HH:MM:SS A ZZ') }}</dd> </dl> </b-list-group-item> <b-list-group-item> @@ -35,9 +35,9 @@ </template> <script> -import ChevronRight16 from "@carbon/icons-vue/es/chevron--right/16"; +import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16'; export default { - name: "quickLinks", + name: 'quickLinks', components: { ChevronRight16 }, @@ -46,12 +46,12 @@ export default { }, computed: { bmcTime() { - return this.$store.getters["global/bmcTime"]; + return this.$store.getters['global/bmcTime']; } }, methods: { getBmcTime() { - this.$store.dispatch("global/getBmcTime"); + this.$store.dispatch('global/getBmcTime'); } }, data() { |