diff --git a/lib/extensions/admin/account.html b/lib/extensions/admin/account.html index 4792923..b9f8f14 100644 --- a/lib/extensions/admin/account.html +++ b/lib/extensions/admin/account.html @@ -51,9 +51,12 @@
  1. {{ device.id }} {{ device.socketId }} -
      +
        +
      • + +
      • {{ name }}
      • -
    +
diff --git a/lib/extensions/admin/js/account.js b/lib/extensions/admin/js/account.js index 85b1fe1..7ea8734 100644 --- a/lib/extensions/admin/js/account.js +++ b/lib/extensions/admin/js/account.js @@ -67,6 +67,24 @@ , challengeEmail: function () { console.log("A new (Email) challenger!", vueData); } + , pushDomain: function (dev) { + // TODO do some local validation too + console.log('pushDomain', dev); + vueData.spinner = true; + return oauth3.request({ + url: 'https://api.' + location.hostname + '/api/telebit.cloud/devices/:dev/:name' + .replace(/:dev/g, dev.socketId) + .replace(/:name/g, dev.newDomain) + , method: 'POST' + , session: session + }).catch(function (err) { + console.error(err); + window.alert(err.toString()); + }).then(function () { + dev.newDomain = ''; + vueData.spinner = false; + }); + } , login: function () { var email = vueData.newEmail; vueMethods.logout();