openc3-tool-base 5.0.11 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bba7ddde2bbc1a362a5cd76785a30d8439ddfa94fa8fd23290c96ad941c85552
4
- data.tar.gz: 1a6a50f6da051cb452ffd9ec5acbb94fd57ae18516eb8fa6ec98c3a3350ae6d4
3
+ metadata.gz: 2dbf00f559e08d1765d691f93315924dfee87c88b77f43a3ce9c8a59a3366a98
4
+ data.tar.gz: bc618b805e2d80c365935a34cf74a911209891eb24e456bb918b9ffc6f2eefef
5
5
  SHA512:
6
- metadata.gz: c139cb215920a433494aa05a79218d6a0842b3183f2235d478abd125e42d5b974ce55a5b90904cba3e89f8a001221dc019a97859701b9c1da9fa1b4a3bb298c4
7
- data.tar.gz: 6ac7ccf9efd9d0f730ffcf07ddaf004f8f32b5be4d66b6b509f6b8832cf7d96569c43b50a711a25df4f487239ccdcf21fcc32ab14af0a8edb3a30c70e2aa44c1
6
+ metadata.gz: 664c2c519d953e7233a3a06f725b273fc00c79f004e8ff4e36477c845e83b46aeb9d3381b84934eafae697a989690d9012aeefce92278fba8b93e51b811fa698
7
+ data.tar.gz: e0cc078d25cbad0fa9a9e2afa8b4345c5528b22a51b2c569c6d77ae755e5270c503a3323d16be729b164a964018177d3faec7bd3240a1f65b61f916d7398e05c
data/LICENSE.txt CHANGED
@@ -1,19 +1,21 @@
1
- The OpenC3 software program is a derived work based on the
1
+ The OpenC3 COSMOS software program is a derived work based on the
2
2
  Ball Aerospace COSMOS software licensed under the
3
3
  GNU Affero General Public License, version 3 with the Addendums listed below.
4
4
 
5
+ Commercial licensing is also available for purchase from OpenC3, Inc.
6
+
5
7
  Please note that the verbiage of the AGPL below are copyrighted
6
8
  by the Free Software Foundation, but the instance of code to which the
7
- licenses refer (the OpenC3 software) is copyrighted by
9
+ licenses refer (the OpenC3 COSMOS software) is copyrighted by
8
10
  OpenC3 Inc. and/or Ball Aerospace and Technologies Corp as marked in each file.
9
11
 
10
12
  Also please note that the only valid versions of the AGPL
11
- that pertain to OpenC3 are the particular versions of
13
+ that pertain to OpenC3 COSMOS are the particular versions of
12
14
  the license reproduced below (i.e., versions 3, rather than any other
13
15
  versions of the AGPL), unless explicitly otherwise stated.
14
16
 
15
17
  OpenC3 AGPL, version 3 LICENSE ADDENDUMS
16
- OpenC3 Version 5, 16 July 2022
18
+ OpenC3 COSMOS Version 5, 16 July 2022
17
19
 
18
20
  The following addendums are made under section 7 of the GNU Affero General
19
21
  Public License, version 3.
@@ -24,7 +26,7 @@ Public License, version 3.
24
26
  2. Modified applications and source files must be clearly marked as
25
27
  "modified" with the modification author and company indicated
26
28
  immediately following the copyright and legal notices.
27
- 3. OpenC3 is trademark of OpenC3, Inc. and may be used for publicity purposes
29
+ 3. OpenC3, and OpenC3 COSMOS are trademarks of OpenC3, Inc. and may be used for publicity purposes
28
30
  only in a manner that constitutes "fair use" under applicable trademark
29
31
  law, except with the express, written permission of OpenC3 Inc.
30
32
 
data/Rakefile CHANGED
@@ -16,6 +16,9 @@
16
16
  # Modified by OpenC3, Inc.
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
+ #
20
+ # This file may also be used under the terms of a commercial license
21
+ # if purchased from OpenC3, Inc.
19
22
 
20
23
  PLUGIN_NAME = Dir['*.gemspec'][0].split('.')[0..-2].join('.')
21
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"543.openc3-tool-base.js","mappings":"wJAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,SACA,CACEA,EAAG,eAAgB,CAACJ,EAAIM,GAAG,aAC3BN,EAAIM,GAAG,KACPF,EAAG,kBAAmB,CACpBJ,EAAIM,GACF,SACEN,EAAIO,GAAGP,EAAIQ,MAAQ,YAAc,YACjC,8CAGNR,EAAIM,GAAG,KACPF,E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AA,CACAN,KAAAA,CACAc,UAAAA,KAAAA,YACAH,MAAAA,KAAAA,WAEA,eACAC,KAAA,eEpKIG,GAAY,E,QAAA,GACd,EACA5D,EHqJoB,IGnJpB,EACA,KACA,KACA,MAuBF4D,EAAUb,QAAQc,OAAS,kEAC3B,MAAeD,EAAiB","sources":["webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function () {\n localStorage.openc3Token = this.password\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect'\n )\n window.location = decodeURI(redirect || '/')\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login()\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n }).then(this.login)\n },\n },\n}\n</script>\n","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","created","Api","methods","login","localStorage","window","token","then","catch","old_token","component","__file"],"sourceRoot":""}
1
+ {"version":3,"file":"543.openc3-tool-base.js","mappings":"wJAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,SACA,CACEA,EAAG,eAAgB,CAACJ,EAAIM,GAAG,aAC3BN,EAAIM,GAAG,KACPF,EAAG,kBAAmB,CACpBJ,EAAIM,GACF,SACEN,EAAIO,GAAGP,EAAIQ,MAAQ,YAAc,YACjC,8CAGNR,EAAIM,GAAG,KACPF,EACE,cACA,CACEA,EACE,SACA,CACEJ,EAAIQ,OAASR,EAAIS,MACbL,EAAG,eAAgB,CACjBM,MAAO,CAAEC,KAAM,WAAYC,MAAO,gBAClCC,MAAO,CACLC,MAAOd,EAAIe,YACXC,SAAU,SAAUC,GAClBjB,EAAIe,YAAcE,CACpB,EACAC,WAAY,iBAGhBlB,EAAImB,KACRnB,EAAIM,GAAG,KACPF,EAAG,eAAgB,CACjBM,MAAO,CACLC,KA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AAiB,O","sources":["webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license \n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function () {\n localStorage.openc3Token = this.password\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect'\n )\n window.location = decodeURI(redirect || '/')\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login()\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n }).then(this.login)\n },\n },\n}\n</script>\n","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","created","Api","methods","login","localStorage","window","token","then","catch","old_token","component","__file"],"sourceRoot":""}