Skip to content

Commit

Permalink
Update SettingsSubscription.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Jan 18, 2024
1 parent e45fdba commit 253c24e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions core/ui/src/views/settings/SettingsSubscription.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<NsInlineNotification
v-if="error.cluster_subscription"
kind="error"
:title="$t('action.cluster-subscription')"
:title="$t('action.get-subscription')"
:description="error.cluster_subscription"
:showCloseButton="false"
/>
Expand Down Expand Up @@ -229,6 +229,8 @@ import {
IconService,
PageTitleService,
} from "@nethserver/ns8-ui-lib";
import { mapActions } from "vuex";

import NotificationService from "@/mixins/notification";
import Play20 from "@carbon/icons-vue/es/play/20";
import Stop20 from "@carbon/icons-vue/es/stop/20";
Expand Down Expand Up @@ -265,7 +267,7 @@ export default {
status: "inactive",
active: false,
session_id: "",
with_remote_support: false,
with_remote_support: true,
loading: {
getSubscription: false,
get_support: false,
Expand Down Expand Up @@ -300,6 +302,7 @@ export default {
next();
},
methods: {
...mapActions(["setSubscriptionInStore"]),
async getSubscription() {
this.clearErrors();
this.loading.getSubscription = true;
Expand All @@ -312,14 +315,15 @@ export default {
);

const res = await to(
this.createNodeTask(this.nodeId, {
this.createClusterTask({
action: taskAction,
extra: {
title: this.$t("action." + taskAction),
isNotificationHidden: true,
},
})
);

const err = res[0];

if (err) {
Expand All @@ -331,6 +335,7 @@ export default {
},
getSubscriptionCompleted(taskContext, taskResult) {
const output = taskResult.output;
console.log(taskResult);
this.auth_token = output.subscription.auth_token;
this.system_id = output.subscription.system_id;
this.vpn_cert_cn = output.subscription.vpn_cert_cn;
Expand Down Expand Up @@ -363,7 +368,7 @@ export default {
this.$root.$once(taskAction + "-aborted", this.setSubscriptionFailed);

const res = await to(
this.createNodeTask(this.nodeId, {
this.createClusterTask({
action: taskAction,
data: {
subscription: {
Expand Down Expand Up @@ -425,7 +430,7 @@ export default {
);

const res = await to(
this.createNodeTask(this.nodeId, {
this.createNodeTask(1, {
action: taskAction,
extra: {
title: this.$t("action." + taskAction),
Expand Down Expand Up @@ -464,7 +469,7 @@ export default {
this.$root.$once(taskAction + "-aborted", this.startSessionSupportFailed);

const res = await to(
this.createNodeTask(this.nodeId, {
this.createNodeTask(1, {
action: taskAction,
data: {
session_id: this.session_id,
Expand Down Expand Up @@ -528,7 +533,7 @@ export default {
this.$root.$once(taskAction + "-aborted", this.stopSessionSupportFailed);

const res = await to(
this.createNodeTask(this.nodeId, {
this.createNodeTask(1, {
action: taskAction,
extra: {
title: this.$t("action." + taskAction),
Expand Down

0 comments on commit 253c24e

Please sign in to comment.