summaryrefslogtreecommitdiff
path: root/src/views/Control
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/Control')
-rw-r--r--src/views/Control/Kvm/Kvm.vue2
-rw-r--r--src/views/Control/Kvm/KvmConsole.vue12
-rw-r--r--src/views/Control/ManagePowerUsage/ManagePowerUsage.vue30
-rw-r--r--src/views/Control/RebootBmc/RebootBmc.vue20
-rw-r--r--src/views/Control/SerialOverLan/SerialOverLan.vue4
-rw-r--r--src/views/Control/SerialOverLan/SerialOverLanConsole.vue22
-rw-r--r--src/views/Control/ServerLed/ServerLed.vue18
-rw-r--r--src/views/Control/ServerPowerOperations/BootSettings.vue28
-rw-r--r--src/views/Control/ServerPowerOperations/ServerPowerOperations.vue34
-rw-r--r--src/views/Control/VirtualMedia/ModalConfigureConnection.vue28
-rw-r--r--src/views/Control/VirtualMedia/VirtualMedia.vue14
11 files changed, 107 insertions, 105 deletions
diff --git a/src/views/Control/Kvm/Kvm.vue b/src/views/Control/Kvm/Kvm.vue
index 66b2e5f7..10322bde 100644
--- a/src/views/Control/Kvm/Kvm.vue
+++ b/src/views/Control/Kvm/Kvm.vue
@@ -13,7 +13,7 @@ import KvmConsole from './KvmConsole';
export default {
name: 'Kvm',
- components: { PageTitle, KvmConsole }
+ components: { PageTitle, KvmConsole },
};
</script>
diff --git a/src/views/Control/Kvm/KvmConsole.vue b/src/views/Control/Kvm/KvmConsole.vue
index 8438b35c..43dc7271 100644
--- a/src/views/Control/Kvm/KvmConsole.vue
+++ b/src/views/Control/Kvm/KvmConsole.vue
@@ -60,8 +60,8 @@ export default {
props: {
isFullWindow: {
type: Boolean,
- default: true
- }
+ default: true,
+ },
},
data() {
return {
@@ -70,7 +70,7 @@ export default {
terminalClass: this.isFullWindow ? 'full-window' : '',
marginClass: this.isFullWindow ? 'margin-left-full-window' : '',
status: Connecting,
- convasRef: null
+ convasRef: null,
};
},
computed: {
@@ -89,7 +89,7 @@ export default {
return this.$t('pageKvm.disconnected');
}
return this.$t('pageKvm.connecting');
- }
+ },
},
mounted() {
this.openTerminal();
@@ -141,8 +141,8 @@ export default {
'_blank',
'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=700,height=550'
);
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/ManagePowerUsage/ManagePowerUsage.vue b/src/views/Control/ManagePowerUsage/ManagePowerUsage.vue
index 5a7eed08..5fcf938b 100644
--- a/src/views/Control/ManagePowerUsage/ManagePowerUsage.vue
+++ b/src/views/Control/ManagePowerUsage/ManagePowerUsage.vue
@@ -46,7 +46,7 @@
{{
$t('pageManagePowerUsage.powerCapLabelTextInfo', {
min: 1,
- max: 10000
+ max: 10000,
})
}}
</b-form-text>
@@ -97,9 +97,13 @@ export default {
name: 'ManagePowerUsage',
components: { PageTitle },
mixins: [VuelidateMixin, BVToastMixin, LoadingBarMixin],
+ beforeRouteLeave(to, from, next) {
+ this.hideLoader();
+ next();
+ },
computed: {
...mapGetters({
- powerConsumptionValue: 'powerControl/powerConsumptionValue'
+ powerConsumptionValue: 'powerControl/powerConsumptionValue',
}),
/**
@@ -114,7 +118,7 @@ export default {
let newValue = value ? '' : null;
this.$v.$reset();
this.$store.dispatch('powerControl/setPowerCapUpdatedValue', newValue);
- }
+ },
},
powerCapValue: {
get() {
@@ -123,8 +127,8 @@ export default {
set(value) {
this.$v.$touch();
this.$store.dispatch('powerControl/setPowerCapUpdatedValue', value);
- }
- }
+ },
+ },
},
created() {
this.startLoader();
@@ -132,17 +136,13 @@ export default {
.dispatch('powerControl/getPowerControl')
.finally(() => this.endLoader());
},
- beforeRouteLeave(to, from, next) {
- this.hideLoader();
- next();
- },
validations: {
powerCapValue: {
between: between(1, 10000),
- required: requiredIf(function() {
+ required: requiredIf(function () {
return this.isPowerCapFieldEnabled;
- })
- }
+ }),
+ },
},
methods: {
submitForm() {
@@ -151,10 +151,10 @@ export default {
this.startLoader();
this.$store
.dispatch('powerControl/setPowerControl', this.powerCapValue)
- .then(message => this.successToast(message))
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message))
.finally(() => this.endLoader());
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/RebootBmc/RebootBmc.vue b/src/views/Control/RebootBmc/RebootBmc.vue
index 29932535..03880b38 100644
--- a/src/views/Control/RebootBmc/RebootBmc.vue
+++ b/src/views/Control/RebootBmc/RebootBmc.vue
@@ -43,10 +43,14 @@ export default {
name: 'RebootBmc',
components: { PageTitle, PageSection },
mixins: [BVToastMixin, LoadingBarMixin],
+ beforeRouteLeave(to, from, next) {
+ this.hideLoader();
+ next();
+ },
computed: {
lastBmcRebootTime() {
return this.$store.getters['controls/lastBmcRebootTime'];
- }
+ },
},
created() {
this.startLoader();
@@ -54,28 +58,24 @@ export default {
.dispatch('controls/getLastBmcRebootTime')
.finally(() => this.endLoader());
},
- beforeRouteLeave(to, from, next) {
- this.hideLoader();
- next();
- },
methods: {
onClick() {
this.$bvModal
.msgBoxConfirm(this.$t('pageRebootBmc.modal.confirmMessage'), {
title: this.$t('pageRebootBmc.modal.confirmTitle'),
- okTitle: this.$t('global.action.confirm')
+ okTitle: this.$t('global.action.confirm'),
})
- .then(confirmed => {
+ .then((confirmed) => {
if (confirmed) this.rebootBmc();
});
},
rebootBmc() {
this.$store
.dispatch('controls/rebootBmc')
- .then(message => this.successToast(message))
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/SerialOverLan/SerialOverLan.vue b/src/views/Control/SerialOverLan/SerialOverLan.vue
index 037a4963..48a68345 100644
--- a/src/views/Control/SerialOverLan/SerialOverLan.vue
+++ b/src/views/Control/SerialOverLan/SerialOverLan.vue
@@ -18,7 +18,7 @@ export default {
components: {
PageSection,
PageTitle,
- SerialOverLanConsole
- }
+ SerialOverLanConsole,
+ },
};
</script>
diff --git a/src/views/Control/SerialOverLan/SerialOverLanConsole.vue b/src/views/Control/SerialOverLan/SerialOverLanConsole.vue
index d5e9b214..b734bb13 100644
--- a/src/views/Control/SerialOverLan/SerialOverLanConsole.vue
+++ b/src/views/Control/SerialOverLan/SerialOverLanConsole.vue
@@ -42,13 +42,13 @@ export default {
name: 'SerialOverLanConsole',
components: {
IconLaunch,
- StatusIcon
+ StatusIcon,
},
props: {
isFullWindow: {
type: Boolean,
- default: true
- }
+ default: true,
+ },
},
computed: {
hostStatus() {
@@ -61,7 +61,7 @@ export default {
return this.hostStatus === 'on'
? this.$t('pageSerialOverLan.connected')
: this.$t('pageSerialOverLan.disconnected');
- }
+ },
},
created() {
this.$store.dispatch('global/getHostStatus');
@@ -74,7 +74,7 @@ export default {
const token = this.$store.getters['authentication/token'];
const ws = new WebSocket(`wss://${window.location.host}/console0`, [
- token
+ token,
]);
// Refer https://github.com/xtermjs/xterm.js/ for xterm implementation and addons.
@@ -82,7 +82,7 @@ export default {
const term = new Terminal({
fontSize: 15,
fontFamily:
- 'SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace'
+ 'SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace',
});
const attachAddon = new AttachAddon(ws);
@@ -94,7 +94,7 @@ export default {
const SOL_THEME = {
background: '#19273c',
cursor: 'rgba(83, 146, 255, .5)',
- scrollbar: 'rgba(83, 146, 255, .5)'
+ scrollbar: 'rgba(83, 146, 255, .5)',
};
term.setOption('theme', SOL_THEME);
@@ -102,10 +102,10 @@ export default {
fitAddon.fit();
try {
- ws.onopen = function() {
+ ws.onopen = function () {
console.log('websocket console0/ opened');
};
- ws.onclose = function(event) {
+ ws.onclose = function (event) {
console.log(
'websocket console0/ closed. code: ' +
event.code +
@@ -123,8 +123,8 @@ export default {
'_blank',
'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=550'
);
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/ServerLed/ServerLed.vue b/src/views/Control/ServerLed/ServerLed.vue
index b2eab0e6..73ec704f 100644
--- a/src/views/Control/ServerLed/ServerLed.vue
+++ b/src/views/Control/ServerLed/ServerLed.vue
@@ -38,6 +38,10 @@ export default {
name: 'ServerLed',
components: { PageTitle, PageSection },
mixins: [LoadingBarMixin, BVToastMixin],
+ beforeRouteLeave(to, from, next) {
+ this.hideLoader();
+ next();
+ },
computed: {
indicatorLed: {
get() {
@@ -45,8 +49,8 @@ export default {
},
set(newValue) {
return newValue;
- }
- }
+ },
+ },
},
created() {
this.startLoader();
@@ -54,15 +58,11 @@ export default {
.dispatch('serverLed/getIndicatorValue')
.finally(() => this.endLoader());
},
- beforeRouteLeave(to, from, next) {
- this.hideLoader();
- next();
- },
methods: {
changeLedValue(indicatorLed) {
this.$store
.dispatch('serverLed/saveIndicatorLedValue', indicatorLed)
- .then(message => this.successToast(message))
+ .then((message) => this.successToast(message))
.catch(({ message }) => {
this.errorToast(message);
if (indicatorLed === 'Off') {
@@ -71,7 +71,7 @@ export default {
this.indicatorLed === 'Off';
}
});
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/ServerPowerOperations/BootSettings.vue b/src/views/Control/ServerPowerOperations/BootSettings.vue
index 3435f1c6..a94da0c3 100644
--- a/src/views/Control/ServerPowerOperations/BootSettings.vue
+++ b/src/views/Control/ServerPowerOperations/BootSettings.vue
@@ -62,8 +62,8 @@ export default {
form: {
bootOption: this.$store.getters['hostBootSettings/bootSource'],
oneTimeBoot: this.$store.getters['hostBootSettings/overrideEnabled'],
- tpmPolicyOn: this.$store.getters['hostBootSettings/tpmEnabled']
- }
+ tpmPolicyOn: this.$store.getters['hostBootSettings/tpmEnabled'],
+ },
};
},
computed: {
@@ -71,19 +71,19 @@ export default {
'bootSourceOptions',
'bootSource',
'overrideEnabled',
- 'tpmEnabled'
- ])
+ 'tpmEnabled',
+ ]),
},
watch: {
- bootSource: function(value) {
+ bootSource: function (value) {
this.form.bootOption = value;
},
- overrideEnabled: function(value) {
+ overrideEnabled: function (value) {
this.form.oneTimeBoot = value;
},
- tpmEnabled: function(value) {
+ tpmEnabled: function (value) {
this.form.tpmPolicyOn = value;
- }
+ },
},
validations: {
// Empty validations to leverage vuelidate form states
@@ -91,13 +91,13 @@ export default {
form: {
bootOption: {},
oneTimeBoot: {},
- tpmPolicyOn: {}
- }
+ tpmPolicyOn: {},
+ },
},
created() {
Promise.all([
this.$store.dispatch('hostBootSettings/getBootSettings'),
- this.$store.dispatch('hostBootSettings/getTpmPolicy')
+ this.$store.dispatch('hostBootSettings/getTpmPolicy'),
]).finally(() =>
this.$root.$emit('serverPowerOperations::bootSettings::complete')
);
@@ -124,7 +124,7 @@ export default {
this.$store
.dispatch('hostBootSettings/saveSettings', settings)
- .then(message => this.successToast(message))
+ .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message))
.finally(() => {
this.$v.form.$reset();
@@ -135,7 +135,7 @@ export default {
this.$v.form.bootOption.$touch();
// Disable one time boot if selected boot option is 'None'
if (selectedOption === 'None') this.form.oneTimeBoot = false;
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue b/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
index 32b2ea86..9bc259f8 100644
--- a/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
+++ b/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
@@ -148,12 +148,16 @@ export default {
name: 'ServerPowerOperations',
components: { PageTitle, PageSection, BootSettings, Alert },
mixins: [BVToastMixin, LoadingBarMixin],
+ beforeRouteLeave(to, from, next) {
+ this.hideLoader();
+ next();
+ },
data() {
return {
form: {
rebootOption: 'orderly',
- shutdownOption: 'orderly'
- }
+ shutdownOption: 'orderly',
+ },
};
},
computed: {
@@ -168,24 +172,20 @@ export default {
},
oneTimeBootEnabled() {
return this.$store.getters['hostBootSettings/overrideEnabled'];
- }
+ },
},
created() {
this.startLoader();
- const bootSettingsPromise = new Promise(resolve => {
+ const bootSettingsPromise = new Promise((resolve) => {
this.$root.$on('serverPowerOperations::bootSettings::complete', () =>
resolve()
);
});
Promise.all([
this.$store.dispatch('controls/getLastPowerOperationTime'),
- bootSettingsPromise
+ bootSettingsPromise,
]).finally(() => this.endLoader());
},
- beforeRouteLeave(to, from, next) {
- this.hideLoader();
- next();
- },
methods: {
powerOn() {
this.$store.dispatch('controls/hostPowerOn');
@@ -196,19 +196,19 @@ export default {
);
const modalOptions = {
title: this.$t('pageServerPowerOperations.modal.confirmRebootTitle'),
- okTitle: this.$t('global.action.confirm')
+ okTitle: this.$t('global.action.confirm'),
};
if (this.form.rebootOption === 'orderly') {
this.$bvModal
.msgBoxConfirm(modalMessage, modalOptions)
- .then(confirmed => {
+ .then((confirmed) => {
if (confirmed) this.$store.dispatch('controls/hostSoftReboot');
});
} else if (this.form.rebootOption === 'immediate') {
this.$bvModal
.msgBoxConfirm(modalMessage, modalOptions)
- .then(confirmed => {
+ .then((confirmed) => {
if (confirmed) this.$store.dispatch('controls/hostHardReboot');
});
}
@@ -219,24 +219,24 @@ export default {
);
const modalOptions = {
title: this.$t('pageServerPowerOperations.modal.confirmShutdownTitle'),
- okTitle: this.$t('global.action.confirm')
+ okTitle: this.$t('global.action.confirm'),
};
if (this.form.shutdownOption === 'orderly') {
this.$bvModal
.msgBoxConfirm(modalMessage, modalOptions)
- .then(confirmed => {
+ .then((confirmed) => {
if (confirmed) this.$store.dispatch('controls/hostSoftPowerOff');
});
}
if (this.form.shutdownOption === 'immediate') {
this.$bvModal
.msgBoxConfirm(modalMessage, modalOptions)
- .then(confirmed => {
+ .then((confirmed) => {
if (confirmed) this.$store.dispatch('controls/hostHardPowerOff');
});
}
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/VirtualMedia/ModalConfigureConnection.vue b/src/views/Control/VirtualMedia/ModalConfigureConnection.vue
index 2c75ae2a..21907734 100644
--- a/src/views/Control/VirtualMedia/ModalConfigureConnection.vue
+++ b/src/views/Control/VirtualMedia/ModalConfigureConnection.vue
@@ -6,7 +6,7 @@
@hidden="resetForm"
@show="initModal"
>
- <template v-slot:modal-title>
+ <template #modal-title>
{{ $t('pageVirtualMedia.modal.title') }}
</template>
<b-form>
@@ -60,7 +60,7 @@
</b-form-checkbox>
</b-form-group>
</b-form>
- <template v-slot:modal-ok>
+ <template #modal-ok>
{{ $t('global.action.save') }}
</template>
</b-modal>
@@ -76,11 +76,11 @@ export default {
connection: {
type: Object,
default: null,
- validator: prop => {
+ validator: (prop) => {
console.log(prop);
return true;
- }
- }
+ },
+ },
},
data() {
return {
@@ -88,23 +88,23 @@ export default {
serverUri: null,
username: null,
password: null,
- isRW: false
- }
+ isRW: false,
+ },
};
},
watch: {
- connection: function(value) {
+ connection: function (value) {
if (value === null) return;
Object.assign(this.form, value);
- }
+ },
},
validations() {
return {
form: {
serverUri: {
- required
- }
- }
+ required,
+ },
+ },
};
},
methods: {
@@ -136,7 +136,7 @@ export default {
onOk(bvModalEvt) {
bvModalEvt.preventDefault();
this.handleSubmit();
- }
- }
+ },
+ },
};
</script>
diff --git a/src/views/Control/VirtualMedia/VirtualMedia.vue b/src/views/Control/VirtualMedia/VirtualMedia.vue
index 5460eb46..a15f2cd9 100644
--- a/src/views/Control/VirtualMedia/VirtualMedia.vue
+++ b/src/views/Control/VirtualMedia/VirtualMedia.vue
@@ -111,7 +111,9 @@ export default {
return {
modalConfigureConnection: null,
loadImageFromExternalServer:
- process.env.VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED === 'true' ? true : false
+ process.env.VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED === 'true'
+ ? true
+ : false,
};
},
computed: {
@@ -120,7 +122,7 @@ export default {
},
legacyDevices() {
return this.$store.getters['virtualMedia/legacyDevices'];
- }
+ },
},
created() {
if (this.proxyDevices.length > 0 || this.legacyDevices.length > 0) return;
@@ -142,7 +144,7 @@ export default {
this.successToast(this.$t('pageVirtualMedia.toast.serverRunning'));
device.nbd.errorReadingFile = () =>
this.errorToast(this.$t('pageVirtualMedia.toast.errorReadingFile'));
- device.nbd.socketClosed = code => {
+ device.nbd.socketClosed = (code) => {
if (code === 1000)
this.successToast(
this.$t('pageVirtualMedia.toast.serverClosedSuccessfully')
@@ -171,7 +173,7 @@ export default {
this.$store
.dispatch('virtualMedia/mountImage', {
id: connectionData.id,
- data: data
+ data: data,
})
.then(() => {
this.successToast(
@@ -208,7 +210,7 @@ export default {
configureConnection(connectionData) {
this.modalConfigureConnection = connectionData;
this.$bvModal.show('configure-connection');
- }
- }
+ },
+ },
};
</script>