openc3-tool-tablemanager 5.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ ## OpenC3 Tool Packet Viewer Plugin
2
+
3
+ [Documentation](https://openc3.com)
4
+
5
+ This plugin provides the Table Manager user interface
6
+
7
+ ## Getting Started
8
+
9
+ 1. At the OpenC3 Admin - Plugins, upload the openc3-tool-tablemanager.gem file
10
+
11
+ ## Contributing
12
+
13
+ We encourage you to contribute to OpenC3!
14
+
15
+ Contributing is easy.
16
+
17
+ 1. Fork the project
18
+ 2. Create a feature branch
19
+ 3. Make your changes
20
+ 4. Submit a pull request
21
+
22
+ Before any contributions can be incorporated we do require all contributors to agree to a Contributor License Agreement
23
+
24
+ This protects both you and us and you retain full rights to any code you write.
25
+
26
+ ## License
27
+
28
+ This OpenC3 plugin is released under the AGPLv3.0 with a few addendums. See [LICENSE.txt](LICENSE.txt)
data/Rakefile ADDED
@@ -0,0 +1,40 @@
1
+ # encoding: ascii-8bit
2
+
3
+ # Copyright 2021 Ball Aerospace & Technologies Corp.
4
+ # All Rights Reserved.
5
+ #
6
+ # This program is free software; you can modify and/or redistribute it
7
+ # under the terms of the GNU Affero General Public License
8
+ # as published by the Free Software Foundation; version 3 with
9
+ # attribution addendums as found in the LICENSE.txt
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Affero General Public License for more details.
15
+
16
+ # Modified by OpenC3, Inc.
17
+ # All changes Copyright 2022, OpenC3, Inc.
18
+ # All Rights Reserved
19
+
20
+ PLUGIN_NAME = Dir['*.gemspec'][0].split('.')[0..-2].join('.')
21
+
22
+ task :require_version do
23
+ if ENV['VERSION']
24
+ if ENV['VERSION'] =~ /-/
25
+ # Add Timestamp to prerelease versions
26
+ ENV['VERSION'] = ENV['VERSION'] + "." + Time.now.utc.strftime("%Y%m%d%H%M%S")
27
+ end
28
+ else
29
+ puts "VERSION is required: rake <task> VERSION=X.X.X"
30
+ exit 1
31
+ end
32
+ end
33
+
34
+ task :build => [:require_version] do
35
+ _, platform, *_ = RUBY_PLATFORM.split("-")
36
+ if platform == 'mswin32' or platform == 'mingw32'
37
+ puts "Warning: Building gem on Windows will lose file permissions"
38
+ end
39
+ system("gem build #{PLUGIN_NAME}")
40
+ end
data/plugin.txt ADDED
@@ -0,0 +1,3 @@
1
+ TOOL tablemanager "Table Manager"
2
+ INLINE_URL js/app.js
3
+ ICON mdi-table-furniture
@@ -0,0 +1,4 @@
1
+ <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><main><h1>Your Microfrontend is not here</h1><p>The @openc3/tool-tablemanager microfrontend is running in "integrated" mode, since standalone-single-spa-webpack-plugin is disabled. This means that it does not work as a standalone application without changing configuration.</p><h2>How do I develop this microfrontend?</h2><p>To develop this microfrontend, try the following steps:</p><ol><li>Copy the following URL to your clipboard: <a target="_blank" rel="noopener" id="mf-url"></a></li><li>In a new browser tab, go to the your single-spa web app. This is where your "root config" is running. You do not have to run the root config locally if it is already running on a deployed environment - go to the deployed environment directly.</li><li>In the browser console, run <code>localStorage.setItem('devtools', true);</code> Refresh the page.</li><li>A yellowish rectangle should appear at the bottom right of your screen. Click on it. Find the name @openc3/tool-tablemanager and click on it. If it is not present, click on Add New Module.</li><li>Paste the URL above into the input that appears. Refresh the page.</li><li>Congrats, your local code is now being used!</li></ol><p></p><p>For further information about "integrated" mode, see the following links:</p><ul><li><a target="_blank" rel="noopener" href="https://single-spa.js.org/docs/recommended-setup#local-development">Local Development Overview</a></li><li><a target="_blank" rel="noopener" href="https://github.com/joeldenning/import-map-overrides">Import Map Overrides Documentation</a></li></ul><p></p><h2>If you prefer Standalone mode</h2><p>To run this microfrontend in "standalone" mode, the standalone-single-spa-webpack-plugin must not be disabled. In some cases, this is done by running <code>npm run start:standalone</code>. Alternatively, you can add <code>--env standalone</code> to your package.json start script if you are using webpack-config-single-spa.</p>If neither of those work for you, see more details about enabling standalone mode at <a target="_blank" rel="noopener" href="https://github.com/single-spa/standalone-single-spa-webpack-plugin">Standalone Plugin Documentation</a>.<p></p><script>const mfLink = document.getElementById('mf-url');
2
+ const fullSrc = new URL('/tools/tablemanager//tools/tablemanager/js/app.js', window.location.href);
3
+ mfLink.href = fullSrc;
4
+ mfLink.textContent = fullSrc;</script></main></head><body><div id="app"></div></body></html>
@@ -0,0 +1,2 @@
1
+ (self["webpackChunk_openc3_tool_tablemanager"]=self["webpackChunk_openc3_tool_tablemanager"]||[]).push([[628],{628:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return un}});var l=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("top-bar",{attrs:{menus:n.menus,title:n.title}}),t("v-snackbar",{attrs:{top:"",timeout:-1,color:"orange"},scopedSlots:n._u([{key:"action",fn:function(e){var l=e.attrs;return[t("v-btn",n._b({attrs:{text:"",color:"danger","data-test":"unlock-button"},on:{click:n.confirmLocalUnlock}},"v-btn",l,!1),[n._v(" Unlock ")]),t("v-btn",n._b({attrs:{text:""},on:{click:function(){n.showReadOnlyToast=!1}}},"v-btn",l,!1),[n._v(" dismiss ")])]}}]),model:{value:n.showReadOnlyToast,callback:function(e){n.showReadOnlyToast=e},expression:"showReadOnlyToast"}},[t("v-icon",[n._v(" mdi-pencil-off ")]),n._v(" "+n._s(n.lockedBy)+" is editing this script. Editor is in read-only mode ")],1),t("v-file-input",{ref:"fileInput",staticStyle:{position:"fixed",top:"-100%"},attrs:{"show-size":"",accept:".bin","data-test":"file-input"},model:{value:n.fileInput,callback:function(e){n.fileInput=e},expression:"fileInput"}}),t("v-row",{attrs:{dense:""}},[t("v-col",{attrs:{cols:"6"}},[t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Filename",id:"filename","data-test":"filename"},model:{value:n.fullFilename,callback:function(e){n.fullFilename=e},expression:"fullFilename"}})],1),t("v-col",{attrs:{cols:"6"}},[t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Definition",id:"definition-filename","data-test":"definition-filename"},model:{value:n.definitionFilename,callback:function(e){n.definitionFilename=e},expression:"definitionFilename"}})],1)],1),t("v-row",{staticClass:"mb-1",attrs:{dense:""}},[t("v-col",{staticClass:"mr-auto",attrs:{cols:"auto"}},[t("span",{staticClass:"text-body-1 ma-2"},[n._v("File Download:")]),t("v-btn",{staticClass:"mr-3",attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-file-binary"},on:{click:function(e){return n.downloadBinary(null)}}},[n._v(" Binary "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-code ")])],1),t("v-btn",{staticClass:"mr-3",attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-file-definition"},on:{click:function(e){return n.downloadDefinition(null)}}},[n._v(" Definition "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-document-edit ")])],1),t("v-btn",{attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-file-report"},on:{click:function(e){return n.downloadReport(null)}}},[n._v(" Report "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-document ")])],1)],1),t("v-col",{attrs:{cols:"auto"}},[t("v-btn",{attrs:{dense:"",color:"primary",disabled:!n.uploadScript,"data-test":"upload-file"},on:{click:function(e){return n.upload()}}},[n._v(" Upload "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-upload ")])],1)],1),t("v-col",{attrs:{cols:"auto"}},[t("v-btn",{attrs:{dense:"",color:"primary",disabled:!n.downloadScript,"data-test":"download-file"},on:{click:function(e){return n.download()}}},[n._v(" Download "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-download ")])],1)],1),t("v-col",{attrs:{cols:"auto"}},[t("v-tooltip",{attrs:{bottom:""},scopedSlots:n._u([{key:"activator",fn:function(e){var l=e.on,i=e.attrs;return[t("span",n._g(n._b({},"span",i,!1),l),[t("v-checkbox",{staticClass:"shrink mt-0",attrs:{label:"B/G","data-test":"upload-background"},model:{value:n.scriptBackground,callback:function(e){n.scriptBackground=e},expression:"scriptBackground"}})],1)]}}])},[t("span",[n._v("Run upload download scripts in the background")])])],1)],1),t("v-card",[t("v-card-title",[n._v(" Items "),t("v-spacer"),t("v-text-field",{attrs:{"append-icon":"mdi-magnify",label:"Search","single-line":"","hide-details":""},model:{value:n.search,callback:function(e){n.search=e},expression:"search"}})],1),t("v-tabs",{model:{value:n.curTab,callback:function(e){n.curTab=e},expression:"curTab"}},n._l(n.tables,(function(e,l){return t("v-tab",{key:l},[n._v(" "+n._s(e.name)+" ")])})),1),t("v-tabs-items",{model:{value:n.curTab,callback:function(e){n.curTab=e},expression:"curTab"}},n._l(n.tables,(function(e,l){return t("v-tab-item",{key:""+n.filename+l},[t("v-data-table",{attrs:{headers:e.headers,items:e.rows,search:n.search,"items-per-page":20,"footer-props":{itemsPerPageOptions:[10,20,50,100,-1]},"calculate-widths":"","multi-sort":"",dense:"","data-test":e.name},scopedSlots:n._u([{key:"item",fn:function(e){var l=e.item;return[t("table-row",{key:l[0].name,attrs:{items:l},on:{change:function(e){return n.onChange(l,e)}}})]}},n.tables.length>1?{key:"footer",fn:function(){return[t("div",{staticClass:"ma-3",staticStyle:{position:"absolute"}},[t("span",{staticClass:"text-body-1 mr-3"},[n._v("Table Download:")]),t("v-btn",{staticClass:"mr-3",attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-table-binary"},on:{click:function(t){return n.downloadBinary(e.name)}}},[n._v(" Binary "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-code ")])],1),t("v-btn",{staticClass:"mr-3",attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-table-definition"},on:{click:function(t){return n.downloadDefinition(e.name)}}},[n._v(" Definition "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-document-edit ")])],1),t("v-btn",{attrs:{dense:"",color:"primary",disabled:""==n.filename,"data-test":"download-table-report"},on:{click:function(t){return n.downloadReport(e.name)}}},[n._v(" Report "),t("v-icon",{attrs:{right:"",dark:""}},[n._v(" mdi-file-document ")])],1)],1)]},proxy:!0}:null],null,!0)})],1)})),1)],1),n.fileOpen?t("file-open-save-dialog",{attrs:{type:"open","api-url":"/openc3-api/tables"},on:{file:function(e){return n.setFile(e)},error:function(e){return n.setError(e)}},model:{value:n.fileOpen,callback:function(e){n.fileOpen=e},expression:"fileOpen"}}):n._e(),n.showSaveAs?t("file-open-save-dialog",{attrs:{type:"save","require-target-parent-dir":"","api-url":"/openc3-api/tables","input-filename":n.filename},on:{filename:function(e){return n.saveAsFilename(e)},error:function(e){return n.setError(e)}},model:{value:n.showSaveAs,callback:function(e){n.showSaveAs=e},expression:"showSaveAs"}}):n._e(),t("simple-text-dialog",{attrs:{title:n.errorTitle,text:n.errorText},model:{value:n.showError,callback:function(e){n.showError=e},expression:"showError"}})],1)},i=[],o=t(8378),a=(t(5794),t(8178),t(2501),t(7950),t(8319),t(9529),t(1235),t(6710),t(4707),t(1497),t(5640),t(1871),t(8188),t(3675),t(4898),t(5825),t(7170),t(8857),t(8329),t(6279),t(427),t(1159),t(2516),t(4349),t(5273),t(6729),t(1801),t(574),t(5787),t(9271),t(3160),t(5688),t(3157),t(1700),t(315),t(556),t(9224),t(6297),t(8882),t(8673),t(6886),t(4121),t(523),t(5940),t(3450),t(6625)),s=t(5627),c=(t(8233),t(9644)),r=t.n(c),u=t(4091),d=new u["default"],A=r().create({baseURL:location.origin,timeout:6e4,params:{}});A.interceptors.response.use((function(n){return n}),(function(n){if(n.response){if(401===n.response.status)delete localStorage.openc3Token,OpenC3Auth.login(location.href);else{var e,t,l,i,o,a,s,c,r,u;if(localStorage.axiosIgnoreResponse===n.response.status.toString())return Promise.reject(n);var A="HTTP ".concat(n.response.status," - ");if(null!==(e=n.response)&&void 0!==e&&e.statusText&&(A+="".concat(n.response.statusText," ")),null!==(t=n.response)&&void 0!==t&&null!==(l=t.config)&&void 0!==l&&l.data&&(A+="".concat(n.response.config.data," ")),null!==(i=n.response)&&void 0!==i&&null!==(o=i.data)&&void 0!==o&&o.message)A+="".concat(n.response.data.message);else if(null!==(a=n.response)&&void 0!==a&&null!==(s=a.data)&&void 0!==s&&s.exception)A+="".concat(n.response.data.exception);else if(null!==(c=n.response)&&void 0!==c&&null!==(r=c.data)&&void 0!==r&&null!==(u=r.error)&&void 0!==u&&u.message)n.response.data.error.class&&(A+="".concat(n.response.data.error.class," ")),A+="".concat(n.response.data.error.message);else{var m;A+="".concat(null===(m=n.response)||void 0===m?void 0:m.data)}d.$notify.serious({title:"Network error",body:A})}throw n}throw n}));var m=A,f=function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e,t){var l,i,o,s,c,r,u,d,A,f=arguments;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(l=f.length>2&&void 0!==f[2]?f[2]:{},i=l.data,o=l.params,s=void 0===o?{}:o,c=l.headers,r=l.noAuth,u=void 0!==r&&r,d=l.noScope,A=void 0!==d&&d,u){n.next=11;break}return n.prev=2,n.next=5,OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity);case 5:n.next=10;break;case 7:n.prev=7,n.t0=n["catch"](2),OpenC3Auth.login();case 10:c["Authorization"]=localStorage.openc3Token;case 11:return A||s["scope"]||(s["scope"]=localStorage.scope),n.abrupt("return",m({method:e,url:t,data:i,params:s,headers:c}));case 13:case"end":return n.stop()}}),n,null,[[2,7]])})));return function(e,t){return n.apply(this,arguments)}}(),p={Accept:"application/json"},h=(0,o.Z)((0,o.Z)({},p),{},{"Content-Type":"application/json"}),v={get:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.params,l=e.headers,i=void 0===l?p:l,o=e.noScope,a=e.noAuth;return f("get",n,{params:t,headers:i,noScope:o,noAuth:a})},put:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.data,l=e.params,i=e.headers,o=void 0===i?h:i,a=e.noScope,s=e.noAuth;return f("put",n,{data:t,params:l,headers:o,noScope:a,noAuth:s})},post:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.data,l=e.params,i=e.headers,o=void 0===i?h:i,a=e.noScope,s=e.noAuth;return f("post",n,{data:t,params:l,headers:o,noScope:a,noAuth:s})},delete:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.params,l=e.headers,i=void 0===l?p:l,o=e.noScope,a=e.noAuth;return f("delete",n,{params:t,headers:i,noScope:o,noAuth:a})}},C=t(8816),b=t(578),_=t(7105),g=t(6455),y=t(1901),k=(t(1372),t(1245),t(7233),t(5734),function(){function n(){(0,_.Z)(this,n),(0,y.Z)(this,"id",1)}return(0,g.Z)(n,[{key:"exec",value:function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e,t){var l,i,o,s=arguments;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return l=s.length>2&&void 0!==s[2]?s[2]:{},n.prev=1,n.next=4,OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n["catch"](1),OpenC3Auth.login();case 9:return this.id=this.id+1,n.prev=10,l["scope"]=localStorage.scope,n.next=14,m.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:t,id:this.id,keyword_params:l},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc"}});case 14:return i=n.sent,n.abrupt("return",i.data.result);case 18:throw n.prev=18,n.t1=n["catch"](10),o=new Error,n.t1.response?(o.name=n.t1.response.data.error.data.class,o.message=n.t1.response.data.error.data.message):n.t1.request?(o.name="Request error",o.message="Request error, no response received"):o.name="Unknown error",o;case 23:case"end":return n.stop()}}),n,this,[[1,6],[10,18]])})));function e(e,t){return n.apply(this,arguments)}return e}()},{key:"decode_openc3_type",value:function(n){if(null!==n&&"object"===(0,b.Z)(n)&&"Float"==n.json_class&&n.raw){if("NaN"==n.raw)return NaN;if("Infinity"==n.raw)return 1/0;if("-Infinity"==n.raw)return-1/0}return null}},{key:"encode_openc3_type",value:function(n){return Number.isNaN(n)?{json_class:"Float",raw:"NaN"}:n==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:n==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}},{key:"get_all_interface_info",value:function(){return this.exec("get_all_interface_info",[])}},{key:"connect_interface",value:function(n){return this.exec("connect_interface",[n])}},{key:"disconnect_interface",value:function(n){return this.exec("disconnect_interface",[n])}},{key:"get_all_router_info",value:function(){return this.exec("get_all_router_info",[])}},{key:"connect_router",value:function(n){return this.exec("connect_router",[n])}},{key:"disconnect_router",value:function(n){return this.exec("disconnect_router",[n])}},{key:"get_all_target_info",value:function(){return this.exec("get_all_target_info",[])}},{key:"get_tlm_cnts",value:function(n){return this.exec("get_tlm_cnts",[n])}},{key:"get_item",value:function(n,e,t){return this.exec("get_item",[n,e,t])}},{key:"get_parameter",value:function(n,e,t){return this.exec("get_parameter",[n,e,t])}},{key:"get_all_packet_logger_info",value:function(){return this.exec("get_all_packet_logger_info",[])}},{key:"start_logging",value:function(){return this.exec("start_logging",[])}},{key:"stop_logging",value:function(){return this.exec("stop_logging",[])}},{key:"start_cmd_log",value:function(n){return this.exec("start_cmd_log",[n])}},{key:"start_tlm_log",value:function(n){return this.exec("start_tlm_log",[n])}},{key:"stop_cmd_log",value:function(n){return this.exec("stop_cmd_log",[n])}},{key:"stop_tlm_log",value:function(n){return this.exec("stop_tlm_log",[n])}},{key:"get_server_status",value:function(){return this.exec("get_server_status",[])}},{key:"get_limits_sets",value:function(){return this.exec("get_limits_sets",[])}},{key:"get_limits_set",value:function(){return this.exec("get_limits_set",[])}},{key:"set_limits_set",value:function(n){return this.exec("set_limits_set",[n])}},{key:"get_background_tasks",value:function(){return this.exec("get_background_tasks",[])}},{key:"start_background_task",value:function(n){return this.exec("start_background_task",[n])}},{key:"stop_background_task",value:function(n){return this.exec("stop_background_task",[n])}},{key:"get_oldest_logfile",value:function(){return this.exec("get_oldest_logfile",[])}},{key:"get_target",value:function(n){return this.exec("get_target",[n])}},{key:"get_target_list",value:function(){return this.exec("get_target_list",[])}},{key:"get_telemetry",value:function(n,e){return this.exec("get_telemetry",[n,e])}},{key:"get_all_telemetry",value:function(n){return this.exec("get_all_telemetry",[n])}},{key:"get_all_telemetry_names",value:function(n){return this.exec("get_all_telemetry_names",[n])}},{key:"get_tlm_packet",value:function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e,t,l){var i,o,s,c;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,this.exec("get_tlm_packet",[e,t],{type:l});case 2:if(i=n.sent,null!=i)for(o=i.length,s=null,c=0;c<o;c++)s=this.decode_openc3_type(i[c][1]),null!==s&&(i[c][1]=s);return n.abrupt("return",i);case 5:case"end":return n.stop()}}),n,this)})));function e(e,t,l){return n.apply(this,arguments)}return e}()},{key:"get_packet_derived_items",value:function(n,e){return this.exec("get_packet_derived_items",[n,e])}},{key:"get_tlm_buffer",value:function(n,e){return this.exec("get_tlm_buffer",[n,e])}},{key:"get_tlm_values",value:function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e){var t,l,i,o;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,this.exec("get_tlm_values",[e]);case 2:for(t=n.sent,l=t[0].length,i=null,o=0;o<l;o++)i=this.decode_openc3_type(t[0][o]),null!==i&&(t[0][o]=i);return n.abrupt("return",t);case 7:case"end":return n.stop()}}),n,this)})));function e(e){return n.apply(this,arguments)}return e}()},{key:"get_limits",value:function(n,e,t){return this.exec("get_limits",[n,e,t])}},{key:"tlm",value:function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e,t,l){var i,o;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,this.exec("tlm",[e,t,l]);case 2:return i=n.sent,o=this.decode_openc3_type(i),null!==o&&(0,C.Z)("data"),n.abrupt("return",i);case 6:case"end":return n.stop()}}),n,this)})));function e(e,t,l){return n.apply(this,arguments)}return e}()},{key:"get_all_commands",value:function(n){return this.exec("get_all_commands",[n])}},{key:"get_all_command_names",value:function(n){return this.exec("get_all_command_names",[n])}},{key:"get_command",value:function(n,e){return this.exec("get_command",[n,e])}},{key:"get_cmd_cnts",value:function(n){return this.exec("get_cmd_cnts",[n])}},{key:"get_cmd_value",value:function(n,e,t){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"CONVERTED";return this.exec("get_cmd_value",[n,e,t,l])}},{key:"get_cmd_buffer",value:function(n,e){return this.exec("get_cmd_buffer",[n,e])}},{key:"_cmd",value:function(n,e,t,l){var i=null;for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i=this.encode_openc3_type(l[o]),null!==i&&(l[o]=i));return this.exec(n,[e,t,l])}},{key:"get_cmd_hazardous",value:function(n,e,t){return void 0===e?this.exec("get_cmd_hazardous",n):this._cmd("get_cmd_hazardous",n,e,t)}},{key:"cmd",value:function(n,e,t){return void 0===e?this.exec("cmd",n):this._cmd("cmd",n,e,t)}},{key:"cmd_no_range_check",value:function(n,e,t){return void 0===e?this.exec("cmd_no_range_check",n):this._cmd("cmd_no_range_check",n,e,t)}},{key:"cmd_raw",value:function(n,e,t){return void 0===e?this.exec("cmd_raw",n):this._cmd("cmd_raw",n,e,t)}},{key:"cmd_raw_no_range_check",value:function(n,e,t){return void 0===e?this.exec("cmd_raw_no_range_check",n):this._cmd("cmd_raw_no_range_check",n,e,t)}},{key:"cmd_no_hazardous_check",value:function(n,e,t){return void 0===e?this.exec("cmd_no_hazardous_check",n):this._cmd("cmd_no_hazardous_check",n,e,t)}},{key:"cmd_no_checks",value:function(n,e,t){return void 0===e?this.exec("cmd_no_checks",n):this._cmd("cmd_no_checks",n,e,t)}},{key:"cmd_raw_no_hazardous_check",value:function(n,e,t){return void 0===e?this.exec("cmd_raw_no_hazardous_check",n):this._cmd("cmd_raw_no_hazardous_check",n,e,t)}},{key:"cmd_raw_no_checks",value:function(n,e,t){return void 0===e?this.exec("cmd_raw_no_checks",n):this._cmd("cmd_raw_no_checks",n,e,t)}},{key:"get_interface_names",value:function(){return this.exec("get_interface_names",[])}},{key:"send_raw",value:function(n,e){return this.exec("send_raw",[n,e])}},{key:"list_configs",value:function(n){return this.exec("list_configs",[n])}},{key:"load_config",value:function(n,e){return this.exec("load_config",[n,e])}},{key:"save_config",value:function(n,e,t){return this.exec("save_config",[n,e,t])}},{key:"delete_config",value:function(n,e){return this.exec("delete_config",[n,e])}},{key:"get_out_of_limits",value:function(){return this.exec("get_out_of_limits",[])}},{key:"get_overall_limits_state",value:function(n){return this.exec("get_overall_limits_state",[n])}},{key:"list_settings",value:function(){return this.exec("list_settings",[])}},{key:"get_all_settings",value:function(){return this.exec("get_all_settings",[])}},{key:"get_setting",value:function(n){return this.exec("get_setting",[n])}},{key:"get_settings",value:function(n){return this.exec("get_settings",n)}},{key:"save_setting",value:function(n,e){return this.exec("save_setting",[n,e])}},{key:"hashString",value:function(){var n=(0,s.Z)((0,a.Z)().mark((function n(e){var t,l,i;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!window.isSecureContext){n.next=7;break}return t=(new TextEncoder).encode(e),n.next=4,crypto.subtle.digest("SHA-256",t);case 4:return l=n.sent,i=new Uint8Array(l),n.abrupt("return",Array.from(i).map((function(n){return n.toString(16).padStart(2,"0")})).join(""));case 7:case"end":return n.stop()}}),n)})));function e(e){return n.apply(this,arguments)}return e}()}]),n}()),w=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("mounting-portal",{attrs:{"mount-to":"#openc3-menu",append:""}},[t("div",{staticClass:"v-toolbar__content"},[n._l(n.menus,(function(e,l){return t("v-menu",{key:l,attrs:{"offset-y":""},scopedSlots:n._u([{key:"activator",fn:function(l){var i=l.on,o=l.attrs;return[t("v-btn",n._g(n._b({staticClass:"mx-1",attrs:{outlined:"","data-test":n.formatDT(n.title+" "+e.label)}},"v-btn",o,!1),i),[t("span",{domProps:{textContent:n._s(e.label)}}),t("v-icon",{attrs:{right:""}},[n._v(" mdi-menu-down ")])],1)]}}],null,!0)},[t("v-list",[t("v-radio-group",{staticClass:"ma-0 pa-0",attrs:{value:e.radioGroup,"hide-details":"",dense:""}},[n._l(e.items,(function(l,i){return[l.divider?t("v-divider"):t("v-list-item",{key:i,attrs:{disabled:l.disabled,"data-test":n.formatDT(n.title+" "+e.label+" "+l.label)},on:{click:l.command}},[l.radio?t("v-list-item-action",[t("v-radio",{attrs:{color:"secondary",label:l.label,value:l.label}})],1):n._e(),l.checkbox?t("v-list-item-action",[t("v-checkbox",{attrs:{color:"secondary",label:l.label,value:l.label},model:{value:n.checked,callback:function(e){n.checked=e},expression:"checked"}})],1):n._e(),l.icon?t("v-list-item-icon",[t("v-icon",{attrs:{disabled:l.disabled}},[n._v(n._s(l.icon))])],1):n._e(),l.radio||l.checkbox?n._e():t("v-list-item-title",{style:"cursor: pointer;"+(l.disabled?"opacity: 0.2":"")},[n._v(n._s(l.label))])],1)]}))],2)],1)],1)})),t("v-spacer"),t("v-toolbar-title",[n._v(n._s(n.title))]),t("v-spacer")],2)])},x=[],F=(t(1639),{props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(n){return n.replaceAll(" ","-").toLowerCase()}}}),T=F,S=(t(5741),t(3287)),I=(0,S.Z)(T,w,x,!1,null,"3237297b",null),D=I.exports,E=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("tr",[t("td",{staticClass:"text-start"},[n._v(n._s(n.dataItems[0].index))]),n.oneDimensional?t("td",{staticClass:"text-start"},[n._v(n._s(n.dataItems[0].name))]):n._e(),n._l(n.dataItems,(function(e,l){return t("table-item",{key:e.name,attrs:{item:e},on:{change:function(t){return n.onChange(e,l,t)}}})}))],2)},O=[],R=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("td",[n.isCheckbox?t("v-checkbox",{attrs:{dense:"","hide-details":"",disabled:!n.dataItem.editable,"data-test":"table-item-checkbox"},on:{change:n.checkboxChange},model:{value:n.checkValue,callback:function(e){n.checkValue=e},expression:"checkValue"}}):n.dataItem.states?t("v-select",{attrs:{dense:"","hide-details":"",items:n.itemStates,disabled:!n.dataItem.editable,"data-test":"table-item-select"},on:{change:n.stateChange},model:{value:n.stateValue,callback:function(e){n.stateValue=e},expression:"stateValue"}}):t("v-text-field",{attrs:{solo:"",dense:"","single-line":"","hide-no-data":"","hide-details":"",disabled:!n.dataItem.editable,"data-test":"table-item-text-field"},on:{change:n.textChange},model:{value:n.dataItem.value,callback:function(e){n.$set(n.dataItem,"value",e)},expression:"dataItem.value"}})],1)},N=[],$=t(6533);t(4769),t(5883),t(9228);function B(){var n="/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableItem.vue",e="0d1e00a675ff6c9a34964ce80107dc1f37c151e9",t=new Function("return this")(),l="__coverage__",i={path:"/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableItem.vue",statementMap:{0:{start:{line:65,column:4},end:{line:69,column:5}},1:{start:{line:72,column:4},end:{line:74,column:5}},2:{start:{line:73,column:6},end:{line:73,column:65}},3:{start:{line:75,column:4},end:{line:77,column:5}},4:{start:{line:76,column:6},end:{line:76,column:45}},5:{start:{line:81,column:19},end:{line:81,column:23}},6:{start:{line:82,column:6},end:{line:90,column:7}},7:{start:{line:83,column:8},end:{line:87,column:9}},8:{start:{line:84,column:10},end:{line:86,column:11}},9:{start:{line:85,column:12},end:{line:85,column:26}},10:{start:{line:89,column:8},end:{line:89,column:22}},11:{start:{line:91,column:6},end:{line:91,column:19}},12:{start:{line:94,column:19},end:{line:94,column:21}},13:{start:{line:95,column:6},end:{line:97,column:7}},14:{start:{line:96,column:8},end:{line:96,column:49}},15:{start:{line:98,column:6},end:{line:98,column:19}},16:{start:{line:103,column:6},end:{line:107,column:7}},17:{start:{line:104,column:8},end:{line:104,column:39}},18:{start:{line:106,column:8},end:{line:106,column:41}},19:{start:{line:111,column:18},end:{line:113,column:7}},20:{start:{line:112,column:17},end:{line:112,column:62}},21:{start:{line:114,column:6},end:{line:114,column:33}},22:{start:{line:117,column:6},end:{line:117,column:47}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:64,column:2},end:{line:64,column:3}},loc:{start:{line:64,column:9},end:{line:70,column:3}},line:64},1:{name:"(anonymous_1)",decl:{start:{line:71,column:2},end:{line:71,column:3}},loc:{start:{line:71,column:12},end:{line:78,column:3}},line:71},2:{name:"(anonymous_2)",decl:{start:{line:80,column:16},end:{line:80,column:17}},loc:{start:{line:80,column:28},end:{line:92,column:5}},line:80},3:{name:"(anonymous_3)",decl:{start:{line:93,column:16},end:{line:93,column:17}},loc:{start:{line:93,column:28},end:{line:99,column:5}},line:93},4:{name:"(anonymous_4)",decl:{start:{line:102,column:20},end:{line:102,column:21}},loc:{start:{line:102,column:32},end:{line:108,column:5}},line:102},5:{name:"(anonymous_5)",decl:{start:{line:109,column:17},end:{line:109,column:18}},loc:{start:{line:109,column:29},end:{line:115,column:5}},line:109},6:{name:"(anonymous_6)",decl:{start:{line:112,column:8},end:{line:112,column:9}},loc:{start:{line:112,column:17},end:{line:112,column:62}},line:112},7:{name:"(anonymous_7)",decl:{start:{line:116,column:16},end:{line:116,column:17}},loc:{start:{line:116,column:28},end:{line:118,column:5}},line:116}},branchMap:{0:{loc:{start:{line:72,column:4},end:{line:74,column:5}},type:"if",locations:[{start:{line:72,column:4},end:{line:74,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:72},1:{loc:{start:{line:75,column:4},end:{line:77,column:5}},type:"if",locations:[{start:{line:75,column:4},end:{line:77,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:75},2:{loc:{start:{line:82,column:6},end:{line:90,column:7}},type:"if",locations:[{start:{line:82,column:6},end:{line:90,column:7}},{start:{line:88,column:13},end:{line:90,column:7}}],line:82},3:{loc:{start:{line:84,column:10},end:{line:86,column:11}},type:"if",locations:[{start:{line:84,column:10},end:{line:86,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:84},4:{loc:{start:{line:84,column:14},end:{line:84,column:58}},type:"binary-expr",locations:[{start:{line:84,column:14},end:{line:84,column:33}},{start:{line:84,column:37},end:{line:84,column:58}}],line:84},5:{loc:{start:{line:103,column:6},end:{line:107,column:7}},type:"if",locations:[{start:{line:103,column:6},end:{line:107,column:7}},{start:{line:105,column:13},end:{line:107,column:7}}],line:103}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0]},inputSourceMap:{version:3,sources:["TableItem.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableItem.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\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--\x3e\n\n<template>\n <td>\n <v-checkbox\n v-if="isCheckbox"\n dense\n hide-details\n v-model="checkValue"\n @change="checkboxChange"\n :disabled="!dataItem.editable"\n data-test="table-item-checkbox"\n />\n <v-select\n v-else-if="dataItem.states"\n dense\n hide-details\n v-model="stateValue"\n :items="itemStates"\n @change="stateChange"\n :disabled="!dataItem.editable"\n data-test="table-item-select"\n />\n <v-text-field\n v-else\n solo\n dense\n single-line\n hide-no-data\n hide-details\n v-model="dataItem.value"\n @change="textChange"\n :disabled="!dataItem.editable"\n data-test="table-item-text-field"\n />\n </td>\n</template>\n\n<script>\nexport default {\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItem: this.item,\n stateValue: null,\n checkValue: false,\n }\n },\n created() {\n if (this.dataItem.states) {\n this.stateValue = this.dataItem.states[this.dataItem.value]\n }\n if (this.isCheckbox) {\n this.checkValue = this.stateValue === 1\n }\n },\n computed: {\n isCheckbox: function () {\n let result = true\n if (this.dataItem.states) {\n for (const state of Object.keys(this.dataItem.states)) {\n if (state !== \'CHECKED\' && state !== \'UNCHECKED\') {\n result = false\n }\n }\n } else {\n result = false\n }\n return result\n },\n itemStates: function () {\n let result = []\n for (const [text, value] of Object.entries(this.dataItem.states)) {\n result.push({ text: text, value: value })\n }\n return result\n },\n },\n methods: {\n checkboxChange: function () {\n if (this.checkValue) {\n this.$emit(\'change\', \'CHECKED\')\n } else {\n this.$emit(\'change\', \'UNCHECKED\')\n }\n },\n stateChange: function () {\n // Lookup the state key that corresponds to the value\n let state = Object.keys(this.dataItem.states).find(\n (key) => this.dataItem.states[key] === this.stateValue\n )\n this.$emit(\'change\', state)\n },\n textChange: function () {\n this.$emit(\'change\', this.dataItem.value)\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"0d1e00a675ff6c9a34964ce80107dc1f37c151e9"},o=t[l]||(t[l]={});o[n]&&o[n].hash===e||(o[n]=i);var a=o[n];return B=function(){return a},a}B();var M={props:{item:{type:Object,required:!0}},data:function(){return B().f[0]++,B().s[0]++,{dataItem:this.item,stateValue:null,checkValue:!1}},created:function(){B().f[1]++,B().s[1]++,this.dataItem.states?(B().b[0][0]++,B().s[2]++,this.stateValue=this.dataItem.states[this.dataItem.value]):B().b[0][1]++,B().s[3]++,this.isCheckbox?(B().b[1][0]++,B().s[4]++,this.checkValue=1===this.stateValue):B().b[1][1]++},computed:{isCheckbox:function(){B().f[2]++;var n=(B().s[5]++,!0);if(B().s[6]++,this.dataItem.states){B().b[2][0]++,B().s[7]++;for(var e=0,t=Object.keys(this.dataItem.states);e<t.length;e++){var l=t[e];B().s[8]++,B().b[4][0]++,"CHECKED"!==l&&(B().b[4][1]++,"UNCHECKED"!==l)?(B().b[3][0]++,B().s[9]++,n=!1):B().b[3][1]++}}else B().b[2][1]++,B().s[10]++,n=!1;return B().s[11]++,n},itemStates:function(){B().f[3]++;var n=(B().s[12]++,[]);B().s[13]++;for(var e=0,t=Object.entries(this.dataItem.states);e<t.length;e++){var l=(0,$.Z)(t[e],2),i=l[0],o=l[1];B().s[14]++,n.push({text:i,value:o})}return B().s[15]++,n}},methods:{checkboxChange:function(){B().f[4]++,B().s[16]++,this.checkValue?(B().b[5][0]++,B().s[17]++,this.$emit("change","CHECKED")):(B().b[5][1]++,B().s[18]++,this.$emit("change","UNCHECKED"))},stateChange:function(){var n=this;B().f[5]++;var e=(B().s[19]++,Object.keys(this.dataItem.states).find((function(e){return B().f[6]++,B().s[20]++,n.dataItem.states[e]===n.stateValue})));B().s[21]++,this.$emit("change",e)},textChange:function(){B().f[7]++,B().s[22]++,this.$emit("change",this.dataItem.value)}}},U=M,L=(0,S.Z)(U,R,N,!1,null,null,null),j=L.exports;function Z(){var n="/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableRow.vue",e="2210e7e51917df2e160226554193b46328654b95",t=new Function("return this")(),l="__coverage__",i={path:"/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableRow.vue",statementMap:{0:{start:{line:47,column:4},end:{line:49,column:5}},1:{start:{line:53,column:6},end:{line:57,column:7}},2:{start:{line:54,column:8},end:{line:54,column:19}},3:{start:{line:56,column:8},end:{line:56,column:20}},4:{start:{line:62,column:6},end:{line:62,column:58}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:46,column:2},end:{line:46,column:3}},loc:{start:{line:46,column:9},end:{line:50,column:3}},line:46},1:{name:"(anonymous_1)",decl:{start:{line:52,column:4},end:{line:52,column:5}},loc:{start:{line:52,column:21},end:{line:58,column:5}},line:52},2:{name:"(anonymous_2)",decl:{start:{line:61,column:14},end:{line:61,column:15}},loc:{start:{line:61,column:44},end:{line:63,column:5}},line:61}},branchMap:{0:{loc:{start:{line:53,column:6},end:{line:57,column:7}},type:"if",locations:[{start:{line:53,column:6},end:{line:57,column:7}},{start:{line:55,column:13},end:{line:57,column:7}}],line:53}},s:{0:0,1:0,2:0,3:0,4:0},f:{0:0,1:0,2:0},b:{0:[0,0]},inputSourceMap:{version:3,sources:["TableRow.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableRow.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\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--\x3e\n\n<template>\n <tr>\n <td class="text-start">{{ dataItems[0].index }}</td>\n <td class="text-start" v-if="oneDimensional">{{ dataItems[0].name }}</td>\n <table-item\n v-for="(item, index) in dataItems"\n :key="item.name"\n :item="item"\n @change="onChange(item, index, $event)"\n />\n </tr>\n</template>\n\n<script>\nimport TableItem from \'@/tools/TableManager/TableItem\'\n\nexport default {\n components: {\n TableItem,\n },\n props: {\n items: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItems: this.items,\n }\n },\n computed: {\n oneDimensional() {\n if (this.dataItems.length === 1) {\n return true\n } else {\n return false\n }\n },\n },\n methods: {\n onChange: function (item, index, event) {\n this.$emit(\'change\', { index: index, event: event })\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"2210e7e51917df2e160226554193b46328654b95"},o=t[l]||(t[l]={});o[n]&&o[n].hash===e||(o[n]=i);var a=o[n];return Z=function(){return a},a}Z();var P={components:{TableItem:j},props:{items:{type:Object,required:!0}},data:function(){return Z().f[0]++,Z().s[0]++,{dataItems:this.items}},computed:{oneDimensional:function(){return Z().f[1]++,Z().s[1]++,1===this.dataItems.length?(Z().b[0][0]++,Z().s[2]++,!0):(Z().b[0][1]++,Z().s[3]++,!1)}},methods:{onChange:function(n,e,t){Z().f[2]++,Z().s[4]++,this.$emit("change",{index:e,event:t})}}},V=P,G=(0,S.Z)(V,E,O,!1,null,null,null),H=G.exports,z=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("v-dialog",{attrs:{width:"600"},model:{value:n.show,callback:function(e){n.show=e},expression:"show"}},[t("v-card",[t("form",{on:{submit:function(e){return e.preventDefault(),n.success.apply(null,arguments)}}},[t("v-system-bar",[t("v-spacer"),t("span",[n._v(" "+n._s(n.title)+" ")]),t("v-spacer")],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("v-row",{attrs:{dense:""}},[t("v-text-field",{attrs:{flat:"",autofocus:"","solo-inverted":"","hide-details":"",clearable:"",label:"Search","data-test":"file-open-save-search"},on:{input:n.handleSearch},model:{value:n.search,callback:function(e){n.search=e},expression:"search"}})],1),t("v-row",{staticClass:"mt-2",attrs:{dense:""}},[t("v-treeview",{ref:"tree",staticStyle:{width:"100%"},attrs:{dense:"",activatable:"","return-object":"",items:n.items,search:n.search,"open-on-click":"open"===n.type},on:{"update:active":n.activeFile},scopedSlots:n._u([{key:"prepend",fn:function(e){var l=e.item,i=e.open;return[l.file?t("v-icon",[n._v(" "+n._s("mdi-language-ruby")+" ")]):t("v-icon",[n._v(" "+n._s(i?"mdi-folder-open":"mdi-folder")+" ")])]}}]),model:{value:n.tree,callback:function(e){n.tree=e},expression:"tree"}})],1),t("v-row",{staticClass:"my-2"},[t("v-text-field",{attrs:{"hide-details":"",label:"Filename","data-test":"file-open-save-filename",disabled:"open"===n.type},model:{value:n.selectedFile,callback:function(e){n.selectedFile=e},expression:"selectedFile"}})],1),t("v-row",{attrs:{dense:""}},[t("span",{directives:[{name:"show",rawName:"v-show",value:n.error,expression:"error"}],staticClass:"my-2 red--text",domProps:{textContent:n._s(n.error)}})]),t("v-row",{staticClass:"mt-2"},[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{outlined:"","data-test":"file-open-save-cancel-btn",disabled:n.disableButtons},on:{click:function(e){n.show=!1}}},[n._v(" Cancel ")]),t("v-btn",{staticClass:"mx-2",attrs:{type:"submit",color:"primary","data-test":"file-open-save-submit-btn",disabled:n.disableButtons||!!n.error},on:{click:function(e){return e.preventDefault(),n.success.apply(null,arguments)}}},[n._v(" "+n._s(n.submit)+" ")])],1)],1)])],1)])],1)},q=[],Y=t(1150),W=(t(4083),t(4069),t(7368),t(4471),t(1172),t(9949),{props:{type:{type:String,required:!0,validator:function(n){return-1!==["open","save"].indexOf(n)}},apiUrl:String,requireTargetParentDir:Boolean,inputFilename:String,value:Boolean},data:function(){return{tree:[],items:[],id:1,search:null,selectedFile:null,disableButtons:!1,targets:[]}},computed:{show:{get:function(){return this.value},set:function(n){this.$emit("input",n)}},title:function(){return"open"===this.type?"File Open":"File Save As..."},submit:function(){return"open"===this.type?"OPEN":"SAVE"},error:function(){if(""===this.selectedFile||null===this.selectedFile)return"No file selected must select a file";if(!this.selectedFile.match(this.validFilenameRegex)||this.selectedFile.match(/\.\.|\/\/|\.\/|\/\./)){var n="".concat(this.selectedFile," is not a valid filename. Must ");return this.requireTargetParentDir&&(n+="be in a target directory and "),n+="only contain alphanumeric characters and / ! - _ . * ' ( )",n}return null},validFilenameRegex:function(){var n="0-9a-zA-Z",e="".concat(n,"\\/\\!\\-\\_\\.\\*\\'\\(\\)"),t="[".concat(e,"]+\\.[").concat(n,"]+");if(this.requireTargetParentDir){var l="(".concat(this.targets.join("|"),")");t="\\/?".concat(l,"\\/").concat(t)}return new RegExp(t)}},created:function(){var n=this;v.get(this.apiUrl).then((function(e){n.items=[],n.id=1;var t,l=(0,Y.Z)(e.data);try{for(l.s();!(t=l.n()).done;){var i=t.value;n.filepath=i,n.insertFile(n.items,1,i),n.id++}}catch(o){l.e(o)}finally{l.f()}n.inputFilename&&(n.selectedFile=n.inputFilename)})).catch((function(e){n.$emit("error","Failed to connect to OpenC3. ".concat(e))})),this.requireTargetParentDir&&v.get("/openc3-api/targets").then((function(e){n.targets=e.data}))},methods:{clear:function(){this.show=!1,this.overwrite=!1,this.disableButtons=!1},handleSearch:function(n){n?this.$refs.tree.updateAll(!0):this.$refs.tree.updateAll(!1)},activeFile:function(n){0===n.length?this.selectedFile=null:this.selectedFile=n[0].path},exists:function(n,e){var t,l=!1,i=(0,Y.Z)(n);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o.path===e)return!0;o.children&&(l=l||this.exists(o.children,e))}}catch(a){i.e(a)}finally{i.f()}return l},success:function(){"open"===this.type?this.openSuccess():this.saveSuccess()},openSuccess:function(){var n=this;this.disableButtons=!0,v.get("".concat(this.apiUrl,"/").concat(this.selectedFile)).then((function(e){var t={name:n.selectedFile,contents:e.data.contents};e.data.suites&&(t["suites"]=JSON.parse(e.data.suites)),e.data.error&&(t["error"]=e.data.error),e.data.success&&(t["success"]=e.data.success);var l=e.data.locked,i=e.data.breakpoints;n.$emit("file",{file:t,locked:l,breakpoints:i}),n.clear()})).catch((function(e){n.$emit("error","Failed to open ".concat(n.selectedFile,". ").concat(e)),n.clear()}))},saveSuccess:function(){var n=this,e=this.exists(this.items,this.selectedFile);e?this.$dialog.confirm("Are you sure you want to overwrite: ".concat(this.selectedFile),{okText:"Overwrite",cancelText:"Cancel"}).then((function(e){n.$emit("filename",n.selectedFile),n.clear()})):(this.$emit("filename",this.selectedFile),this.clear())},insertFile:function(n,e,t){var l=t.split("/");if(1===l.length)return n.push({id:this.id,name:l[0],file:"ruby",path:this.filepath}),void this.id++;var i=n.findIndex((function(n){return n.name===l[0]}));-1===i?(n.push({id:this.id,name:l[0],children:[],path:this.filepath.split("/").slice(0,e).join("/")}),this.id++,this.insertFile(n[n.length-1].children,e+1,l.slice(1).join("/"))):this.insertFile(n[i].children,e+1,l.slice(1).join("/"))}}}),K=W,J=(0,S.Z)(K,z,q,!1,null,null,null),X=J.exports,Q=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("v-dialog",{attrs:{width:n.width},model:{value:n.show,callback:function(e){n.show=e},expression:"show"}},[t("v-card",[t("v-system-bar",[t("v-spacer"),t("span",[n._v(" "+n._s(n.title)+" ")]),t("v-spacer"),t("div",{staticClass:"mx-2"},[t("v-tooltip",{attrs:{top:""},scopedSlots:n._u([{key:"activator",fn:function(e){var l=e.on,i=e.attrs;return[t("div",n._g(n._b({},"div",i,!1),l),[t("v-icon",{attrs:{"data-test":"downloadIcon"},on:{click:n.download}},[n._v(" mdi-download ")])],1)]}}])},[t("span",[n._v(" Download ")])])],1)],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("span",{staticStyle:{"white-space":"pre-wrap"}},[n._v(n._s(n.text))])])]),t("v-card-actions",[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{color:"primary"},on:{click:function(e){n.show=!n.show}}},[n._v(" Ok ")])],1)],1)],1)},nn=[],en={props:{value:Boolean,text:String,title:String,width:800},computed:{show:{get:function(){return this.value},set:function(n){this.$emit("input",n)}}},methods:{download:function(){var n=new Blob([this.text],{type:"text/plain"}),e=document.createElement("a");e.href=URL.createObjectURL(n),e.setAttribute("download","".concat(this.title,".txt")),e.click()}}},tn=en,ln=(0,S.Z)(tn,Q,nn,!1,null,null,null),on=ln.exports;function an(){var n="/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableManager.vue",e="5acfbb42c115a391aa43d67785a96bbeda64ba42",t=new Function("return this")(),l="__coverage__",i={path:"/openc3/plugins/packages/openc3-tool-tablemanager/src/tools/TableManager/TableManager.vue",statementMap:{0:{start:{line:284,column:4},end:{line:306,column:5}},1:{start:{line:310,column:6},end:{line:310,column:28}},2:{start:{line:313,column:6},end:{line:313,column:59}},3:{start:{line:316,column:6},end:{line:373,column:7}},4:{start:{line:324,column:16},end:{line:324,column:30}},5:{start:{line:331,column:16},end:{line:331,column:31}},6:{start:{line:341,column:16},end:{line:341,column:31}},7:{start:{line:348,column:16},end:{line:348,column:29}},8:{start:{line:368,column:16},end:{line:368,column:29}},9:{start:{line:380,column:8},end:{line:380,column:80}},10:{start:{line:382,column:8},end:{line:383,column:33}},11:{start:{line:386,column:6},end:{line:386,column:46}},12:{start:{line:387,column:6},end:{line:393,column:10}},13:{start:{line:389,column:10},end:{line:389,column:34}},14:{start:{line:392,column:10},end:{line:392,column:35}},15:{start:{line:394,column:6},end:{line:402,column:10}},16:{start:{line:396,column:10},end:{line:396,column:36}},17:{start:{line:397,column:10},end:{line:397,column:49}},18:{start:{line:400,column:10},end:{line:400,column:37}},19:{start:{line:401,column:10},end:{line:401,column:49}},20:{start:{line:406,column:4},end:{line:406,column:30}},21:{start:{line:411,column:6},end:{line:411,column:28}},22:{start:{line:412,column:6},end:{line:412,column:25}},23:{start:{line:413,column:6},end:{line:413,column:26}},24:{start:{line:416,column:6},end:{line:416,column:26}},25:{start:{line:421,column:6},end:{line:435,column:7}},26:{start:{line:422,column:8},end:{line:427,column:9}},27:{start:{line:423,column:10},end:{line:423,column:40}},28:{start:{line:424,column:10},end:{line:424,column:30}},29:{start:{line:426,column:10},end:{line:426,column:39}},30:{start:{line:429,column:8},end:{line:429,column:25}},31:{start:{line:431,column:8},end:{line:431,column:47}},32:{start:{line:432,column:8},end:{line:432,column:30}},33:{start:{line:433,column:8},end:{line:433,column:30}},34:{start:{line:434,column:8},end:{line:434,column:28}},35:{start:{line:439,column:6},end:{line:439,column:31}},36:{start:{line:440,column:6},end:{line:440,column:40}},37:{start:{line:441,column:6},end:{line:441,column:44}},38:{start:{line:442,column:6},end:{line:442,column:27}},39:{start:{line:446,column:6},end:{line:446,column:26}},40:{start:{line:448,column:23},end:{line:448,column:37}},41:{start:{line:449,column:6},end:{line:449,column:46}},42:{start:{line:450,column:6},end:{line:450,column:60}},43:{start:{line:451,column:6},end:{line:451,column:60}},44:{start:{line:452,column:6},end:{line:466,column:10}},45:{start:{line:456,column:10},end:{line:456,column:32}},46:{start:{line:457,column:10},end:{line:459,column:18}},47:{start:{line:458,column:12},end:{line:458,column:33}},48:{start:{line:462,column:10},end:{line:462,column:31}},49:{start:{line:463,column:10},end:{line:463,column:40}},50:{start:{line:464,column:10},end:{line:464,column:48}},51:{start:{line:465,column:10},end:{line:465,column:31}},52:{start:{line:467,column:6},end:{line:467,column:21}},53:{start:{line:470,column:6},end:{line:470,column:28}},54:{start:{line:473,column:6},end:{line:473,column:72}},55:{start:{line:474,column:6},end:{line:474,column:30}},56:{start:{line:475,column:6},end:{line:475,column:49}},57:{start:{line:478,column:6},end:{line:500,column:7}},58:{start:{line:479,column:8},end:{line:499,column:12}},59:{start:{line:485,column:12},end:{line:487,column:14}},60:{start:{line:490,column:12},end:{line:490,column:26}},61:{start:{line:493,column:12},end:{line:498,column:13}},62:{start:{line:494,column:14},end:{line:497,column:16}},63:{start:{line:503,column:23},end:{line:503,column:37}},64:{start:{line:504,column:6},end:{line:504,column:46}},65:{start:{line:505,column:6},end:{line:505,column:60}},66:{start:{line:506,column:6},end:{line:508,column:7}},67:{start:{line:507,column:8},end:{line:507,column:43}},68:{start:{line:509,column:6},end:{line:529,column:8}},69:{start:{line:513,column:28},end:{line:513,column:63}},70:{start:{line:515,column:27},end:{line:515,column:61}},71:{start:{line:517,column:8},end:{line:519,column:9}},72:{start:{line:517,column:21},end:{line:517,column:22}},73:{start:{line:518,column:10},end:{line:518,column:51}},74:{start:{line:521,column:21},end:{line:523,column:10}},75:{start:{line:525,column:21},end:{line:525,column:48}},76:{start:{line:526,column:8},end:{line:526,column:45}},77:{start:{line:527,column:8},end:{line:527,column:61}},78:{start:{line:528,column:8},end:{line:528,column:20}},79:{start:{line:532,column:23},end:{line:532,column:37}},80:{start:{line:533,column:6},end:{line:533,column:60}},81:{start:{line:534,column:6},end:{line:536,column:7}},82:{start:{line:535,column:8},end:{line:535,column:43}},83:{start:{line:537,column:6},end:{line:548,column:8}},84:{start:{line:540,column:21},end:{line:542,column:10}},85:{start:{line:544,column:21},end:{line:544,column:48}},86:{start:{line:545,column:8},end:{line:545,column:45}},87:{start:{line:546,column:8},end:{line:546,column:61}},88:{start:{line:547,column:8},end:{line:547,column:20}},89:{start:{line:551,column:23},end:{line:551,column:37}},90:{start:{line:552,column:6},end:{line:552,column:46}},91:{start:{line:553,column:6},end:{line:553,column:60}},92:{start:{line:554,column:6},end:{line:556,column:7}},93:{start:{line:555,column:8},end:{line:555,column:43}},94:{start:{line:557,column:6},end:{line:571,column:8}},95:{start:{line:561,column:10},end:{line:562,column:54}},96:{start:{line:563,column:21},end:{line:565,column:10}},97:{start:{line:567,column:21},end:{line:567,column:48}},98:{start:{line:568,column:8},end:{line:568,column:45}},99:{start:{line:569,column:8},end:{line:569,column:61}},100:{start:{line:570,column:8},end:{line:570,column:20}},101:{start:{line:575,column:8},end:{line:575,column:80}},102:{start:{line:576,column:6},end:{line:584,column:8}},103:{start:{line:581,column:8},end:{line:583,column:9}},104:{start:{line:582,column:10},end:{line:582,column:71}},105:{start:{line:587,column:6},end:{line:611,column:29}},106:{start:{line:599,column:12},end:{line:600,column:37}},107:{start:{line:601,column:10},end:{line:609,column:12}},108:{start:{line:606,column:12},end:{line:608,column:13}},109:{start:{line:607,column:14},end:{line:607,column:75}},110:{start:{line:625,column:6},end:{line:637,column:10}},111:{start:{line:635,column:10},end:{line:635,column:30}},112:{start:{line:636,column:10},end:{line:636,column:32}},113:{start:{line:640,column:6},end:{line:640,column:65}},114:{start:{line:643,column:6},end:{line:645,column:7}},115:{start:{line:644,column:8},end:{line:644,column:62}},116:{start:{line:648,column:6},end:{line:652,column:7}},117:{start:{line:649,column:8},end:{line:651,column:38}},118:{start:{line:653,column:6},end:{line:653,column:22}},119:{start:{line:654,column:23},end:{line:654,column:37}},120:{start:{line:655,column:6},end:{line:655,column:46}},121:{start:{line:656,column:6},end:{line:656,column:55}},122:{start:{line:657,column:6},end:{line:710,column:10}},123:{start:{line:661,column:10},end:{line:661,column:54}},124:{start:{line:662,column:10},end:{line:688,column:12}},125:{start:{line:663,column:12},end:{line:687,column:13}},126:{start:{line:667,column:31},end:{line:670,column:17}},127:{start:{line:671,column:16},end:{line:685,column:17}},128:{start:{line:674,column:18},end:{line:677,column:19}},129:{start:{line:681,column:18},end:{line:684,column:19}},130:{start:{line:690,column:10},end:{line:695,column:11}},131:{start:{line:691,column:12},end:{line:694,column:14}},132:{start:{line:698,column:10},end:{line:709,column:11}},133:{start:{line:699,column:12},end:{line:702,column:14}},134:{start:{line:703,column:12},end:{line:703,column:32}},135:{start:{line:705,column:12},end:{line:708,column:14}},136:{start:{line:713,column:23},end:{line:713,column:37}},137:{start:{line:714,column:6},end:{line:714,column:45}},138:{start:{line:715,column:6},end:{line:720,column:8}},139:{start:{line:718,column:8},end:{line:718,column:46}},140:{start:{line:719,column:8},end:{line:719,column:36}},141:{start:{line:723,column:6},end:{line:723,column:29}},142:{start:{line:724,column:6},end:{line:724,column:31}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:283,column:2},end:{line:283,column:3}},loc:{start:{line:283,column:9},end:{line:307,column:3}},line:283},1:{name:"(anonymous_1)",decl:{start:{line:309,column:14},end:{line:309,column:15}},loc:{start:{line:309,column:26},end:{line:311,column:5}},line:309},2:{name:"(anonymous_2)",decl:{start:{line:312,column:4},end:{line:312,column:5}},loc:{start:{line:312,column:19},end:{line:314,column:5}},line:312},3:{name:"(anonymous_3)",decl:{start:{line:315,column:11},end:{line:315,column:12}},loc:{start:{line:315,column:23},end:{line:374,column:5}},line:315},4:{name:"(anonymous_4)",decl:{start:{line:323,column:23},end:{line:323,column:24}},loc:{start:{line:323,column:29},end:{line:325,column:15}},line:323},5:{name:"(anonymous_5)",decl:{start:{line:330,column:23},end:{line:330,column:24}},loc:{start:{line:330,column:29},end:{line:332,column:15}},line:330},6:{name:"(anonymous_6)",decl:{start:{line:340,column:23},end:{line:340,column:24}},loc:{start:{line:340,column:29},end:{line:342,column:15}},line:340},7:{name:"(anonymous_7)",decl:{start:{line:347,column:23},end:{line:347,column:24}},loc:{start:{line:347,column:29},end:{line:349,column:15}},line:347},8:{name:"(anonymous_8)",decl:{start:{line:367,column:23},end:{line:367,column:24}},loc:{start:{line:367,column:29},end:{line:369,column:15}},line:367},9:{name:"(anonymous_9)",decl:{start:{line:378,column:14},end:{line:378,column:15}},loc:{start:{line:378,column:29},end:{line:403,column:5}},line:378},10:{name:"(anonymous_10)",decl:{start:{line:388,column:14},end:{line:388,column:15}},loc:{start:{line:388,column:28},end:{line:390,column:9}},line:388},11:{name:"(anonymous_11)",decl:{start:{line:391,column:15},end:{line:391,column:16}},loc:{start:{line:391,column:26},end:{line:393,column:9}},line:391},12:{name:"(anonymous_12)",decl:{start:{line:395,column:14},end:{line:395,column:15}},loc:{start:{line:395,column:28},end:{line:398,column:9}},line:395},13:{name:"(anonymous_13)",decl:{start:{line:399,column:15},end:{line:399,column:16}},loc:{start:{line:399,column:26},end:{line:402,column:9}},line:399},14:{name:"(anonymous_14)",decl:{start:{line:405,column:2},end:{line:405,column:3}},loc:{start:{line:405,column:12},end:{line:407,column:3}},line:405},15:{name:"(anonymous_15)",decl:{start:{line:410,column:13},end:{line:410,column:14}},loc:{start:{line:410,column:25},end:{line:414,column:5}},line:410},16:{name:"(anonymous_16)",decl:{start:{line:415,column:14},end:{line:415,column:15}},loc:{start:{line:415,column:26},end:{line:417,column:5}},line:415},17:{name:"(anonymous_17)",decl:{start:{line:419,column:13},end:{line:419,column:14}},loc:{start:{line:419,column:41},end:{line:436,column:5}},line:419},18:{name:"(anonymous_18)",decl:{start:{line:438,column:4},end:{line:438,column:5}},loc:{start:{line:438,column:20},end:{line:443,column:5}},line:438},19:{name:"(anonymous_19)",decl:{start:{line:444,column:14},end:{line:444,column:15}},loc:{start:{line:444,column:26},end:{line:468,column:5}},line:444},20:{name:"(anonymous_20)",decl:{start:{line:455,column:14},end:{line:455,column:15}},loc:{start:{line:455,column:28},end:{line:460,column:9}},line:455},21:{name:"(anonymous_21)",decl:{start:{line:457,column:21},end:{line:457,column:22}},loc:{start:{line:457,column:27},end:{line:459,column:11}},line:457},22:{name:"(anonymous_22)",decl:{start:{line:461,column:15},end:{line:461,column:16}},loc:{start:{line:461,column:33},end:{line:466,column:9}},line:461},23:{name:"(anonymous_23)",decl:{start:{line:469,column:12},end:{line:469,column:13}},loc:{start:{line:469,column:24},end:{line:471,column:5}},line:469},24:{name:"(anonymous_24)",decl:{start:{line:472,column:20},end:{line:472,column:21}},loc:{start:{line:472,column:40},end:{line:476,column:5}},line:472},25:{name:"(anonymous_25)",decl:{start:{line:477,column:12},end:{line:477,column:13}},loc:{start:{line:477,column:24},end:{line:501,column:5}},line:477},26:{name:"(anonymous_26)",decl:{start:{line:484,column:16},end:{line:484,column:17}},loc:{start:{line:484,column:28},end:{line:488,column:11}},line:484},27:{name:"(anonymous_27)",decl:{start:{line:489,column:16},end:{line:489,column:17}},loc:{start:{line:489,column:30},end:{line:491,column:11}},line:489},28:{name:"(anonymous_28)",decl:{start:{line:492,column:17},end:{line:492,column:18}},loc:{start:{line:492,column:28},end:{line:499,column:11}},line:492},29:{name:"(anonymous_29)",decl:{start:{line:502,column:20},end:{line:502,column:21}},loc:{start:{line:502,column:48},end:{line:530,column:5}},line:502},30:{name:"(anonymous_30)",decl:{start:{line:511,column:14},end:{line:511,column:15}},loc:{start:{line:511,column:28},end:{line:529,column:7}},line:511},31:{name:"(anonymous_31)",decl:{start:{line:531,column:24},end:{line:531,column:25}},loc:{start:{line:531,column:52},end:{line:549,column:5}},line:531},32:{name:"(anonymous_32)",decl:{start:{line:539,column:14},end:{line:539,column:15}},loc:{start:{line:539,column:28},end:{line:548,column:7}},line:539},33:{name:"(anonymous_33)",decl:{start:{line:550,column:20},end:{line:550,column:21}},loc:{start:{line:550,column:48},end:{line:572,column:5}},line:550},34:{name:"(anonymous_34)",decl:{start:{line:559,column:14},end:{line:559,column:15}},loc:{start:{line:559,column:28},end:{line:571,column:7}},line:559},35:{name:"(anonymous_35)",decl:{start:{line:573,column:4},end:{line:573,column:5}},loc:{start:{line:573,column:13},end:{line:585,column:5}},line:573},36:{name:"(anonymous_36)",decl:{start:{line:580,column:14},end:{line:580,column:15}},loc:{start:{line:580,column:28},end:{line:584,column:7}},line:580},37:{name:"(anonymous_37)",decl:{start:{line:586,column:4},end:{line:586,column:5}},loc:{start:{line:586,column:15},end:{line:612,column:5}},line:586},38:{name:"(anonymous_38)",decl:{start:{line:597,column:14},end:{line:597,column:15}},loc:{start:{line:597,column:20},end:{line:610,column:9}},line:597},39:{name:"(anonymous_39)",decl:{start:{line:605,column:18},end:{line:605,column:19}},loc:{start:{line:605,column:32},end:{line:609,column:11}},line:605},40:{name:"(anonymous_40)",decl:{start:{line:611,column:15},end:{line:611,column:16}},loc:{start:{line:611,column:26},end:{line:611,column:28}},line:611},41:{name:"(anonymous_41)",decl:{start:{line:624,column:24},end:{line:624,column:25}},loc:{start:{line:624,column:36},end:{line:638,column:5}},line:624},42:{name:"(anonymous_42)",decl:{start:{line:634,column:14},end:{line:634,column:15}},loc:{start:{line:634,column:20},end:{line:637,column:9}},line:634},43:{name:"(anonymous_43)",decl:{start:{line:639,column:14},end:{line:639,column:15}},loc:{start:{line:639,column:26},end:{line:641,column:5}},line:639},44:{name:"(anonymous_44)",decl:{start:{line:642,column:16},end:{line:642,column:17}},loc:{start:{line:642,column:28},end:{line:646,column:5}},line:642},45:{name:"(anonymous_45)",decl:{start:{line:647,column:19},end:{line:647,column:20}},loc:{start:{line:647,column:56},end:{line:711,column:5}},line:647},46:{name:"(anonymous_46)",decl:{start:{line:660,column:14},end:{line:660,column:15}},loc:{start:{line:660,column:28},end:{line:696,column:9}},line:660},47:{name:"(anonymous_47)",decl:{start:{line:662,column:49},end:{line:662,column:50}},loc:{start:{line:662,column:60},end:{line:688,column:11}},line:662},48:{name:"(anonymous_48)",decl:{start:{line:666,column:41},end:{line:666,column:42}},loc:{start:{line:666,column:54},end:{line:686,column:15}},line:666},49:{name:"(anonymous_49)",decl:{start:{line:697,column:15},end:{line:697,column:16}},loc:{start:{line:697,column:26},end:{line:710,column:9}},line:697},50:{name:"(anonymous_50)",decl:{start:{line:712,column:20},end:{line:712,column:21}},loc:{start:{line:712,column:40},end:{line:721,column:5}},line:712},51:{name:"(anonymous_51)",decl:{start:{line:717,column:14},end:{line:717,column:15}},loc:{start:{line:717,column:28},end:{line:720,column:7}},line:717},52:{name:"(anonymous_52)",decl:{start:{line:722,column:14},end:{line:722,column:15}},loc:{start:{line:722,column:48},end:{line:725,column:5}},line:722}},branchMap:{0:{loc:{start:{line:421,column:6},end:{line:435,column:7}},type:"if",locations:[{start:{line:421,column:6},end:{line:435,column:7}},{start:{line:428,column:13},end:{line:435,column:7}}],line:421},1:{loc:{start:{line:422,column:8},end:{line:427,column:9}},type:"if",locations:[{start:{line:422,column:8},end:{line:427,column:9}},{start:{line:425,column:15},end:{line:427,column:9}}],line:422},2:{loc:{start:{line:478,column:6},end:{line:500,column:7}},type:"if",locations:[{start:{line:478,column:6},end:{line:500,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:478},3:{loc:{start:{line:493,column:12},end:{line:498,column:13}},type:"if",locations:[{start:{line:493,column:12},end:{line:498,column:13}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:493},4:{loc:{start:{line:502,column:30},end:{line:502,column:46}},type:"default-arg",locations:[{start:{line:502,column:42},end:{line:502,column:46}}],line:502},5:{loc:{start:{line:506,column:6},end:{line:508,column:7}},type:"if",locations:[{start:{line:506,column:6},end:{line:508,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:506},6:{loc:{start:{line:531,column:34},end:{line:531,column:50}},type:"default-arg",locations:[{start:{line:531,column:46},end:{line:531,column:50}}],line:531},7:{loc:{start:{line:534,column:6},end:{line:536,column:7}},type:"if",locations:[{start:{line:534,column:6},end:{line:536,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:534},8:{loc:{start:{line:550,column:30},end:{line:550,column:46}},type:"default-arg",locations:[{start:{line:550,column:42},end:{line:550,column:46}}],line:550},9:{loc:{start:{line:554,column:6},end:{line:556,column:7}},type:"if",locations:[{start:{line:554,column:6},end:{line:556,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:554},10:{loc:{start:{line:581,column:8},end:{line:583,column:9}},type:"if",locations:[{start:{line:581,column:8},end:{line:583,column:9}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:581},11:{loc:{start:{line:606,column:12},end:{line:608,column:13}},type:"if",locations:[{start:{line:606,column:12},end:{line:608,column:13}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:606},12:{loc:{start:{line:643,column:6},end:{line:645,column:7}},type:"if",locations:[{start:{line:643,column:6},end:{line:645,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:643},13:{loc:{start:{line:643,column:10},end:{line:643,column:48}},type:"binary-expr",locations:[{start:{line:643,column:10},end:{line:643,column:30}},{start:{line:643,column:34},end:{line:643,column:48}}],line:643},14:{loc:{start:{line:647,column:29},end:{line:647,column:54}},type:"default-arg",locations:[{start:{line:647,column:50},end:{line:647,column:54}}],line:647},15:{loc:{start:{line:648,column:6},end:{line:652,column:7}},type:"if",locations:[{start:{line:648,column:6},end:{line:652,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:648},16:{loc:{start:{line:671,column:16},end:{line:685,column:17}},type:"if",locations:[{start:{line:671,column:16},end:{line:685,column:17}},{start:{line:678,column:23},end:{line:685,column:17}}],line:671},17:{loc:{start:{line:690,column:10},end:{line:695,column:11}},type:"if",locations:[{start:{line:690,column:10},end:{line:695,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:690},18:{loc:{start:{line:698,column:10},end:{line:709,column:11}},type:"if",locations:[{start:{line:698,column:10},end:{line:709,column:11}},{start:{line:704,column:17},end:{line:709,column:11}}],line:698}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0,53:0,54:0,55:0,56:0,57:0,58:0,59:0,60:0,61:0,62:0,63:0,64:0,65:0,66:0,67:0,68:0,69:0,70:0,71:0,72:0,73:0,74:0,75:0,76:0,77:0,78:0,79:0,80:0,81:0,82:0,83:0,84:0,85:0,86:0,87:0,88:0,89:0,90:0,91:0,92:0,93:0,94:0,95:0,96:0,97:0,98:0,99:0,100:0,101:0,102:0,103:0,104:0,105:0,106:0,107:0,108:0,109:0,110:0,111:0,112:0,113:0,114:0,115:0,116:0,117:0,118:0,119:0,120:0,121:0,122:0,123:0,124:0,125:0,126:0,127:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:0,136:0,137:0,138:0,139:0,140:0,141:0,142:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0],5:[0,0],6:[0],7:[0,0],8:[0],9:[0,0],10:[0,0],11:[0,0],12:[0,0],13:[0,0],14:[0],15:[0,0],16:[0,0],17:[0,0],18:[0,0]},inputSourceMap:{version:3,sources:["TableManager.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4QA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableManager.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\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--\x3e\n\n<template>\n <div>\n <top-bar :menus="menus" :title="title" />\n <v-snackbar v-model="showReadOnlyToast" top :timeout="-1" color="orange">\n <v-icon> mdi-pencil-off </v-icon>\n {{ lockedBy }} is editing this script. Editor is in read-only mode\n <template v-slot:action="{ attrs }">\n <v-btn\n text\n v-bind="attrs"\n color="danger"\n @click="confirmLocalUnlock"\n data-test="unlock-button"\n >\n Unlock\n </v-btn>\n <v-btn\n text\n v-bind="attrs"\n @click="\n () => {\n showReadOnlyToast = false\n }\n "\n >\n dismiss\n </v-btn>\n </template>\n </v-snackbar>\n <v-file-input\n show-size\n v-model="fileInput"\n ref="fileInput"\n accept=".bin"\n data-test="file-input"\n style="position: fixed; top: -100%"\n />\n <v-row dense>\n <v-col cols="6">\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label="Filename"\n v-model="fullFilename"\n id="filename"\n data-test="filename"\n />\n </v-col>\n <v-col cols="6">\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label="Definition"\n v-model="definitionFilename"\n id="definition-filename"\n data-test="definition-filename"\n />\n </v-col>\n </v-row>\n <v-row dense class="mb-1">\n <v-col cols="auto" class="mr-auto">\n <span class="text-body-1 ma-2">File Download:</span>\n <v-btn\n dense\n color="primary"\n class="mr-3"\n @click="downloadBinary(null)"\n :disabled="filename == \'\'"\n data-test="download-file-binary"\n >\n Binary\n <v-icon right dark> mdi-file-code </v-icon>\n </v-btn>\n <v-btn\n dense\n color="primary"\n class="mr-3"\n @click="downloadDefinition(null)"\n :disabled="filename == \'\'"\n data-test="download-file-definition"\n >\n Definition\n <v-icon right dark> mdi-file-document-edit </v-icon>\n </v-btn>\n <v-btn\n dense\n color="primary"\n @click="downloadReport(null)"\n :disabled="filename == \'\'"\n data-test="download-file-report"\n >\n Report\n <v-icon right dark> mdi-file-document </v-icon>\n </v-btn>\n </v-col>\n <v-col cols="auto">\n <v-btn\n dense\n color="primary"\n @click="upload()"\n :disabled="!uploadScript"\n data-test="upload-file"\n >\n Upload\n <v-icon right dark> mdi-file-upload </v-icon>\n </v-btn>\n </v-col>\n <v-col cols="auto">\n <v-btn\n dense\n color="primary"\n @click="download()"\n :disabled="!downloadScript"\n data-test="download-file"\n >\n Download\n <v-icon right dark> mdi-file-download </v-icon>\n </v-btn>\n </v-col>\n <v-col cols="auto">\n <v-tooltip bottom>\n <template v-slot:activator="{ on, attrs }">\n <span v-bind="attrs" v-on="on">\n <v-checkbox\n v-model="scriptBackground"\n label="B/G"\n class="shrink mt-0"\n data-test="upload-background"\n />\n </span>\n </template>\n <span>Run upload download scripts in the background</span>\n </v-tooltip>\n </v-col>\n </v-row>\n <v-card>\n <v-card-title>\n Items\n <v-spacer />\n <v-text-field\n v-model="search"\n append-icon="mdi-magnify"\n label="Search"\n single-line\n hide-details\n />\n </v-card-title>\n <v-tabs v-model="curTab">\n <v-tab v-for="(table, index) in tables" :key="index">\n {{ table.name }}\n </v-tab>\n </v-tabs>\n <v-tabs-items v-model="curTab">\n <v-tab-item\n v-for="(table, index) in tables"\n :key="`${filename}${index}`"\n >\n <v-data-table\n :headers="table.headers"\n :items="table.rows"\n :search="search"\n :items-per-page="20"\n :footer-props="{\n itemsPerPageOptions: [10, 20, 50, 100, -1],\n }"\n calculate-widths\n multi-sort\n dense\n :data-test="table.name"\n >\n <template v-slot:item="{ item }">\n <table-row\n :items="item"\n :key="item[0].name"\n @change="onChange(item, $event)"\n />\n </template>\n <template v-slot:footer v-if="tables.length > 1">\n <div style="position: absolute" class="ma-3">\n <span class="text-body-1 mr-3">Table Download:</span>\n <v-btn\n dense\n color="primary"\n class="mr-3"\n @click="downloadBinary(table.name)"\n :disabled="filename == \'\'"\n data-test="download-table-binary"\n >\n Binary\n <v-icon right dark> mdi-file-code </v-icon>\n </v-btn>\n <v-btn\n dense\n color="primary"\n class="mr-3"\n @click="downloadDefinition(table.name)"\n :disabled="filename == \'\'"\n data-test="download-table-definition"\n >\n Definition\n <v-icon right dark> mdi-file-document-edit </v-icon>\n </v-btn>\n <v-btn\n dense\n color="primary"\n @click="downloadReport(table.name)"\n :disabled="filename == \'\'"\n data-test="download-table-report"\n >\n Report\n <v-icon right dark> mdi-file-document </v-icon>\n </v-btn>\n </div>\n </template>\n </v-data-table>\n </v-tab-item>\n </v-tabs-items>\n </v-card>\n <file-open-save-dialog\n v-if="fileOpen"\n v-model="fileOpen"\n type="open"\n api-url="/openc3-api/tables"\n @file="setFile($event)"\n @error="setError($event)"\n />\n <file-open-save-dialog\n v-if="showSaveAs"\n v-model="showSaveAs"\n type="save"\n require-target-parent-dir\n api-url="/openc3-api/tables"\n :input-filename="filename"\n @filename="saveAsFilename($event)"\n @error="setError($event)"\n />\n <simple-text-dialog\n v-model="showError"\n :title="errorTitle"\n :text="errorText"\n />\n </div>\n</template>\n\n<script>\nimport Api from \'@openc3/tool-common/src/services/api\'\nimport { OpenC3Api } from \'@openc3/tool-common/src/services/openc3-api\'\nimport TopBar from \'@openc3/tool-common/src/components/TopBar\'\nimport TableRow from \'@/tools/TableManager/TableRow\'\nimport FileOpenSaveDialog from \'@openc3/tool-common/src/components/FileOpenSaveDialog\'\nimport SimpleTextDialog from \'@openc3/tool-common/src/components/SimpleTextDialog\'\n\nexport default {\n components: {\n TopBar,\n TableRow,\n FileOpenSaveDialog,\n SimpleTextDialog,\n },\n data() {\n return {\n title: \'Table Manager\',\n search: \'\',\n curTab: null,\n tables: [],\n api: null,\n definition: null,\n fileInput: \'\',\n definitionFilename: \'\',\n fileNew: false,\n filename: \'\',\n fileModified: \'\',\n lockedBy: null,\n fileOpen: false,\n showSave: false,\n showSaveAs: false,\n showError: false,\n errorTitle: \'\',\n errorText: \'\',\n uploadScript: false,\n downloadScript: false,\n scriptBackground: true,\n }\n },\n computed: {\n readOnly: function () {\n return !!this.lockedBy\n },\n fullFilename() {\n return `${this.filename} ${this.fileModified}`.trim()\n },\n menus: function () {\n return [\n {\n label: \'File\',\n items: [\n {\n label: \'New File\',\n icon: \'mdi-file-plus\',\n command: () => {\n this.newFile()\n },\n },\n {\n label: \'Open File\',\n icon: \'mdi-folder-open\',\n command: () => {\n this.openFile()\n },\n },\n {\n divider: true,\n },\n {\n label: \'Save File\',\n icon: \'mdi-content-save\',\n command: () => {\n this.saveFile()\n },\n },\n {\n label: \'Save As...\',\n icon: \'mdi-content-save\',\n command: () => {\n this.saveAs()\n },\n },\n {\n divider: true,\n },\n // {\n // label: \'Load Binary\',\n // icon: \'mdi-cloud-upload\',\n // command: () => {\n // this.loadBinary()\n // },\n // },\n // {\n // divider: true,\n // },\n {\n label: \'Delete File\',\n icon: \'mdi-delete\',\n command: () => {\n this.delete()\n },\n },\n ],\n },\n ]\n },\n },\n watch: {\n // Everytime the filename changes we figure out if there is an associated upload & download script\n filename: function (val) {\n let upload =\n this.filename.split(\'/\').slice(0, 2).join(\'/\') + \'/procedures/upload.rb\'\n let download =\n this.filename.split(\'/\').slice(0, 2).join(\'/\') +\n \'/procedures/download.rb\'\n // Temporarily ignore any 404 errors since it\'s ok that we get one\n // The whole point of this is to check if the file exists or not\n localStorage.axiosIgnoreResponse = \'404\' // localStorage only supports strings\n Api.get(`/openc3-api/tables/${upload}`)\n .then((response) => {\n this.uploadScript = true\n })\n .catch((error) => {\n this.uploadScript = false\n })\n Api.get(`/openc3-api/tables/${download}`)\n .then((response) => {\n this.downloadScript = true\n delete localStorage.axiosIgnoreResponse\n })\n .catch((error) => {\n this.downloadScript = false\n delete localStorage.axiosIgnoreResponse\n })\n },\n },\n created() {\n this.api = new OpenC3Api()\n },\n methods: {\n // File menu actions\n newFile: function () {\n this.fileModified = \'\'\n this.fileNew = true\n this.fileOpen = true\n },\n openFile: function () {\n this.fileOpen = true\n },\n // Called by the FileOpenDialog to set the file contents\n setFile: function ({ file, locked }) {\n // They opened a definition file so create a new binary\n if (file.name.includes(\'.txt\')) {\n if (this.fileNew) {\n this.buildNewBinary(file.name)\n this.fileNew = false\n } else {\n this.getDefinition(file.name)\n }\n } else {\n this.unlockFile() // first unlock what was just being edited\n // Split off the \' *\' which indicates a file is modified on the server\n this.filename = file.name.split(\'*\')[0]\n this.fileModified = \'\'\n this.lockedBy = locked\n this.getDefinition()\n }\n },\n // Called by the FileOpenSaveDialog on error\n setError(event) {\n this.errorTitle = \'Error\'\n this.errorText = `Error: ${event}`\n this.errorText = response.data.message\n this.showError = true\n },\n saveFile: function () {\n // Save a file by posting the new contents\n this.showSave = true\n\n const formData = new FormData()\n formData.append(\'binary\', this.filename)\n formData.append(\'definition\', this.definitionFilename)\n formData.append(\'tables\', JSON.stringify(this.tables))\n Api.post(`/openc3-api/tables/${this.filename}`, {\n data: formData,\n })\n .then((response) => {\n this.fileModified = \'\'\n setTimeout(() => {\n this.showSave = false\n }, 2000)\n })\n .catch(({ response }) => {\n this.showSave = false\n this.errorTitle = \'Save Error\'\n this.errorText = response.data.message\n this.showError = true\n })\n this.lockFile() // Ensure this file is locked for editing\n },\n saveAs: function () {\n this.showSaveAs = true\n },\n saveAsFilename: function (filename) {\n Api.put(`/openc3-api/tables/${this.filename}/save-as/${filename}`)\n this.filename = filename\n this.getDefinition(this.definitionFilename)\n },\n delete: function () {\n if (this.filename !== \'\') {\n this.$dialog\n .confirm(`Permanently delete file: ${this.filename}`, {\n okText: \'Delete\',\n cancelText: \'Cancel\',\n })\n .then((dialog) => {\n return Api.delete(`/openc3-api/tables/${this.filename}`, {\n data: {},\n })\n })\n .then((response) => {\n this.newFile()\n })\n .catch((error) => {\n if (error) {\n this.$notify.caution({\n title: \'Error\',\n body: `Error deleting file: ${error}`,\n })\n }\n })\n }\n },\n downloadBinary: function (tableName = null) {\n const formData = new FormData()\n formData.append(\'binary\', this.filename)\n formData.append(\'definition\', this.definitionFilename)\n if (tableName !== null) {\n formData.append(\'table\', tableName)\n }\n Api.post(`/openc3-api/tables/binary`, {\n data: formData,\n }).then((response) => {\n // Decode Base64 string\n const decodedData = window.atob(response.data.contents)\n // Create UNIT8ARRAY of size same as row data length\n const uInt8Array = new Uint8Array(decodedData.length)\n // Insert all character code into uInt8Array\n for (let i = 0; i < decodedData.length; ++i) {\n uInt8Array[i] = decodedData.charCodeAt(i)\n }\n // Return BLOB image after conversion\n const blob = new Blob([uInt8Array], {\n type: \'application/octet-stream\',\n })\n // Make a link and then \'click\' on it to start the download\n const link = document.createElement(\'a\')\n link.href = URL.createObjectURL(blob)\n link.setAttribute(\'download\', response.data.filename)\n link.click()\n })\n },\n downloadDefinition: function (tableName = null) {\n const formData = new FormData()\n formData.append(\'definition\', this.definitionFilename)\n if (tableName !== null) {\n formData.append(\'table\', tableName)\n }\n Api.post(`/openc3-api/tables/definition`, {\n data: formData,\n }).then((response) => {\n const blob = new Blob([response.data.contents], {\n type: \'text/plain\',\n })\n // Make a link and then \'click\' on it to start the download\n const link = document.createElement(\'a\')\n link.href = URL.createObjectURL(blob)\n link.setAttribute(\'download\', response.data.filename)\n link.click()\n })\n },\n downloadReport: function (tableName = null) {\n const formData = new FormData()\n formData.append(\'binary\', this.filename)\n formData.append(\'definition\', this.definitionFilename)\n if (tableName !== null) {\n formData.append(\'table\', tableName)\n }\n Api.post(`/openc3-api/tables/report`, {\n data: formData,\n }).then((response) => {\n const header =\n `Binary: ${this.filename}\\n` +\n `Definition: ${this.definitionFilename}\\n\\n`\n const blob = new Blob([header, response.data.contents], {\n type: \'text/plain\',\n })\n // Make a link and then \'click\' on it to start the download\n const link = document.createElement(\'a\')\n link.href = URL.createObjectURL(blob)\n link.setAttribute(\'download\', response.data.filename)\n link.click()\n })\n },\n upload() {\n let upload =\n this.filename.split(\'/\').slice(0, 2).join(\'/\') + \'/procedures/upload.rb\'\n Api.post(`/script-api/scripts/${upload}/run`, {\n data: {\n environment: [{ key: \'TBL_FILENAME\', value: this.filename }],\n },\n }).then((response) => {\n if (this.scriptBackground !== true) {\n window.open(`/tools/scriptrunner/${response.data}`, \'_blank\')\n }\n })\n },\n download() {\n this.$dialog\n .confirm(\n `Are you sure you want to overwrite ${this.filename}? ` +\n \'You can Save As to create a new file and then Download to preserve the existing file. \' +\n \'Note: Once the download completes you will need to re-open the file to see changes.\',\n {\n okText: \'Download (Overwrite!)\',\n cancelText: \'Cancel\',\n }\n )\n .then(() => {\n let download =\n this.filename.split(\'/\').slice(0, 2).join(\'/\') +\n \'/procedures/download.rb\'\n Api.post(`/script-api/scripts/${download}/run`, {\n data: {\n environment: [{ key: \'TBL_FILENAME\', value: this.filename }],\n },\n }).then((response) => {\n if (this.scriptBackground !== true) {\n window.open(`/tools/scriptrunner/${response.data}`, \'_blank\')\n }\n })\n })\n .catch((error) => {}) // Cancel, do nothing\n },\n // TODO: Need to load to tmp dir or something before we can saveAs to rename\n // async loadBinary() {\n // this.fileInput = \'\'\n // this.$refs.fileInput.$refs.input.click()\n // // Wait for the file to be set by the dialog so upload works\n // while (this.fileInput === \'\') {\n // await new Promise((resolve) => setTimeout(resolve, 500))\n // }\n // this.filename = this.fileInput.name\n // this.saveAs()\n // },\n confirmLocalUnlock: function () {\n this.$dialog\n .confirm(\n \'Are you sure you want to unlock this file for editing? \' +\n \'If another user is editing this file, your changes might conflict with each other.\',\n {\n okText: \'Force Unlock\',\n cancelText: \'Cancel\',\n }\n )\n .then(() => {\n this.lockedBy = null\n return this.lockFile() // Re-lock it as this user so it\'s locked for anyone else who opens it\n })\n },\n lockFile: function () {\n return Api.post(`/openc3-api/tables/${this.filename}/lock`)\n },\n unlockFile: function () {\n if (this.filename !== \'\' && !this.readOnly) {\n Api.post(`/openc3-api/tables/${this.filename}/unlock`)\n }\n },\n getDefinition: function (definitionFilename = null) {\n if (!definitionFilename) {\n definitionFilename = this.filename\n .replace(\'/bin/\', \'/config/\')\n .replace(\'.bin\', \'_def.txt\')\n }\n this.tables = [] // Clear so table is re-rendered\n const formData = new FormData()\n formData.append(\'binary\', this.filename)\n formData.append(\'definition\', definitionFilename)\n Api.post(`/openc3-api/tables/load`, {\n data: formData,\n })\n .then((response) => {\n this.definitionFilename = definitionFilename\n this.tables = response.data.tables.map((table) => {\n return {\n ...table,\n // Build up the headers for proper searching\n headers: table.headers.map((text, i) => {\n const header = {\n text,\n filterable: text !== \'INDEX\',\n }\n if (table.numColumns === 1) {\n // In the 1D table the searchable value is the first value in the row\n // Note the names in 1D are INDEX, NAME, VALUE\n return {\n ...header,\n value: `[0].${text.toLowerCase()}`,\n }\n } else {\n // In the 2D table the searchable value is always in the value attribute\n // of the current column item\n return {\n ...header,\n value: `[${i}].value`,\n }\n }\n }),\n }\n })\n\n if (response.data[\'errors\']) {\n this.$notify.caution({\n title: \'Warning\',\n body: response.data[\'errors\'],\n })\n }\n })\n .catch((error) => {\n if (error.response.status == 404) {\n this.$notify.normal({\n title: \'Definition File Not Found\',\n body: `Definition file ${definitionFilename} not found. Please select definition file.`,\n })\n this.fileOpen = true\n } else {\n this.$notify.serious({\n title: \'Error\',\n body: `Error loading due to ${error.response.statusText}. Status: ${error.response.status}`,\n })\n }\n })\n },\n buildNewBinary: function (filename) {\n const formData = new FormData()\n formData.append(\'definition\', filename)\n Api.post(`/openc3-api/tables/generate`, {\n data: formData,\n }).then((response) => {\n this.filename = response.data.filename\n this.getDefinition(filename)\n })\n },\n onChange: function (item, { index, event }) {\n this.fileModified = \'*\'\n item[index].value = event\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"5acfbb42c115a391aa43d67785a96bbeda64ba42"},o=t[l]||(t[l]={});o[n]&&o[n].hash===e||(o[n]=i);var a=o[n];return an=function(){return a},a}an();var sn={components:{TopBar:D,TableRow:H,FileOpenSaveDialog:X,SimpleTextDialog:on},data:function(){return an().f[0]++,an().s[0]++,{title:"Table Manager",search:"",curTab:null,tables:[],api:null,definition:null,fileInput:"",definitionFilename:"",fileNew:!1,filename:"",fileModified:"",lockedBy:null,fileOpen:!1,showSave:!1,showSaveAs:!1,showError:!1,errorTitle:"",errorText:"",uploadScript:!1,downloadScript:!1,scriptBackground:!0}},computed:{readOnly:function(){return an().f[1]++,an().s[1]++,!!this.lockedBy},fullFilename:function(){return an().f[2]++,an().s[2]++,"".concat(this.filename," ").concat(this.fileModified).trim()},menus:function(){var n=this;return an().f[3]++,an().s[3]++,[{label:"File",items:[{label:"New File",icon:"mdi-file-plus",command:function(){an().f[4]++,an().s[4]++,n.newFile()}},{label:"Open File",icon:"mdi-folder-open",command:function(){an().f[5]++,an().s[5]++,n.openFile()}},{divider:!0},{label:"Save File",icon:"mdi-content-save",command:function(){an().f[6]++,an().s[6]++,n.saveFile()}},{label:"Save As...",icon:"mdi-content-save",command:function(){an().f[7]++,an().s[7]++,n.saveAs()}},{divider:!0},{label:"Delete File",icon:"mdi-delete",command:function(){an().f[8]++,an().s[8]++,n.delete()}}]}]}},watch:{filename:function(n){var e=this;an().f[9]++;var t=(an().s[9]++,this.filename.split("/").slice(0,2).join("/")+"/procedures/upload.rb"),l=(an().s[10]++,this.filename.split("/").slice(0,2).join("/")+"/procedures/download.rb");an().s[11]++,localStorage.axiosIgnoreResponse="404",an().s[12]++,v.get("/openc3-api/tables/".concat(t)).then((function(n){an().f[10]++,an().s[13]++,e.uploadScript=!0})).catch((function(n){an().f[11]++,an().s[14]++,e.uploadScript=!1})),an().s[15]++,v.get("/openc3-api/tables/".concat(l)).then((function(n){an().f[12]++,an().s[16]++,e.downloadScript=!0,an().s[17]++,delete localStorage.axiosIgnoreResponse})).catch((function(n){an().f[13]++,an().s[18]++,e.downloadScript=!1,an().s[19]++,delete localStorage.axiosIgnoreResponse}))}},created:function(){an().f[14]++,an().s[20]++,this.api=new k},methods:{newFile:function(){an().f[15]++,an().s[21]++,this.fileModified="",an().s[22]++,this.fileNew=!0,an().s[23]++,this.fileOpen=!0},openFile:function(){an().f[16]++,an().s[24]++,this.fileOpen=!0},setFile:function(n){var e=n.file,t=n.locked;an().f[17]++,an().s[25]++,e.name.includes(".txt")?(an().b[0][0]++,an().s[26]++,this.fileNew?(an().b[1][0]++,an().s[27]++,this.buildNewBinary(e.name),an().s[28]++,this.fileNew=!1):(an().b[1][1]++,an().s[29]++,this.getDefinition(e.name))):(an().b[0][1]++,an().s[30]++,this.unlockFile(),an().s[31]++,this.filename=e.name.split("*")[0],an().s[32]++,this.fileModified="",an().s[33]++,this.lockedBy=t,an().s[34]++,this.getDefinition())},setError:function(n){an().f[18]++,an().s[35]++,this.errorTitle="Error",an().s[36]++,this.errorText="Error: ".concat(n),an().s[37]++,this.errorText=response.data.message,an().s[38]++,this.showError=!0},saveFile:function(){var n=this;an().f[19]++,an().s[39]++,this.showSave=!0;var e=(an().s[40]++,new FormData);an().s[41]++,e.append("binary",this.filename),an().s[42]++,e.append("definition",this.definitionFilename),an().s[43]++,e.append("tables",JSON.stringify(this.tables)),an().s[44]++,v.post("/openc3-api/tables/".concat(this.filename),{data:e}).then((function(e){an().f[20]++,an().s[45]++,n.fileModified="",an().s[46]++,setTimeout((function(){an().f[21]++,an().s[47]++,n.showSave=!1}),2e3)})).catch((function(e){var t=e.response;an().f[22]++,an().s[48]++,n.showSave=!1,an().s[49]++,n.errorTitle="Save Error",an().s[50]++,n.errorText=t.data.message,an().s[51]++,n.showError=!0})),an().s[52]++,this.lockFile()},saveAs:function(){an().f[23]++,an().s[53]++,this.showSaveAs=!0},saveAsFilename:function(n){an().f[24]++,an().s[54]++,v.put("/openc3-api/tables/".concat(this.filename,"/save-as/").concat(n)),an().s[55]++,this.filename=n,an().s[56]++,this.getDefinition(this.definitionFilename)},delete:function(){var n=this;an().f[25]++,an().s[57]++,""!==this.filename?(an().b[2][0]++,an().s[58]++,this.$dialog.confirm("Permanently delete file: ".concat(this.filename),{okText:"Delete",cancelText:"Cancel"}).then((function(e){return an().f[26]++,an().s[59]++,v["delete"]("/openc3-api/tables/".concat(n.filename),{data:{}})})).then((function(e){an().f[27]++,an().s[60]++,n.newFile()})).catch((function(e){an().f[28]++,an().s[61]++,e?(an().b[3][0]++,an().s[62]++,n.$notify.caution({title:"Error",body:"Error deleting file: ".concat(e)})):an().b[3][1]++}))):an().b[2][1]++},downloadBinary:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(an().b[4][0]++,null);an().f[29]++;var e=(an().s[63]++,new FormData);an().s[64]++,e.append("binary",this.filename),an().s[65]++,e.append("definition",this.definitionFilename),an().s[66]++,null!==n?(an().b[5][0]++,an().s[67]++,e.append("table",n)):an().b[5][1]++,an().s[68]++,v.post("/openc3-api/tables/binary",{data:e}).then((function(n){an().f[30]++;var e=(an().s[69]++,window.atob(n.data.contents)),t=(an().s[70]++,new Uint8Array(e.length));an().s[71]++;for(var l=(an().s[72]++,0);l<e.length;++l)an().s[73]++,t[l]=e.charCodeAt(l);var i=(an().s[74]++,new Blob([t],{type:"application/octet-stream"})),o=(an().s[75]++,document.createElement("a"));an().s[76]++,o.href=URL.createObjectURL(i),an().s[77]++,o.setAttribute("download",n.data.filename),an().s[78]++,o.click()}))},downloadDefinition:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(an().b[6][0]++,null);an().f[31]++;var e=(an().s[79]++,new FormData);an().s[80]++,e.append("definition",this.definitionFilename),an().s[81]++,null!==n?(an().b[7][0]++,an().s[82]++,e.append("table",n)):an().b[7][1]++,an().s[83]++,v.post("/openc3-api/tables/definition",{data:e}).then((function(n){an().f[32]++;var e=(an().s[84]++,new Blob([n.data.contents],{type:"text/plain"})),t=(an().s[85]++,document.createElement("a"));an().s[86]++,t.href=URL.createObjectURL(e),an().s[87]++,t.setAttribute("download",n.data.filename),an().s[88]++,t.click()}))},downloadReport:function(){var n=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(an().b[8][0]++,null);an().f[33]++;var t=(an().s[89]++,new FormData);an().s[90]++,t.append("binary",this.filename),an().s[91]++,t.append("definition",this.definitionFilename),an().s[92]++,null!==e?(an().b[9][0]++,an().s[93]++,t.append("table",e)):an().b[9][1]++,an().s[94]++,v.post("/openc3-api/tables/report",{data:t}).then((function(e){an().f[34]++;var t=(an().s[95]++,"Binary: ".concat(n.filename,"\n")+"Definition: ".concat(n.definitionFilename,"\n\n")),l=(an().s[96]++,new Blob([t,e.data.contents],{type:"text/plain"})),i=(an().s[97]++,document.createElement("a"));an().s[98]++,i.href=URL.createObjectURL(l),an().s[99]++,i.setAttribute("download",e.data.filename),an().s[100]++,i.click()}))},upload:function(){var n=this;an().f[35]++;var e=(an().s[101]++,this.filename.split("/").slice(0,2).join("/")+"/procedures/upload.rb");an().s[102]++,v.post("/script-api/scripts/".concat(e,"/run"),{data:{environment:[{key:"TBL_FILENAME",value:this.filename}]}}).then((function(e){an().f[36]++,an().s[103]++,!0!==n.scriptBackground?(an().b[10][0]++,an().s[104]++,window.open("/tools/scriptrunner/".concat(e.data),"_blank")):an().b[10][1]++}))},download:function(){var n=this;an().f[37]++,an().s[105]++,this.$dialog.confirm("Are you sure you want to overwrite ".concat(this.filename,"? ")+"You can Save As to create a new file and then Download to preserve the existing file. Note: Once the download completes you will need to re-open the file to see changes.",{okText:"Download (Overwrite!)",cancelText:"Cancel"}).then((function(){an().f[38]++;var e=(an().s[106]++,n.filename.split("/").slice(0,2).join("/")+"/procedures/download.rb");an().s[107]++,v.post("/script-api/scripts/".concat(e,"/run"),{data:{environment:[{key:"TBL_FILENAME",value:n.filename}]}}).then((function(e){an().f[39]++,an().s[108]++,!0!==n.scriptBackground?(an().b[11][0]++,an().s[109]++,window.open("/tools/scriptrunner/".concat(e.data),"_blank")):an().b[11][1]++}))})).catch((function(n){an().f[40]++}))},confirmLocalUnlock:function(){var n=this;an().f[41]++,an().s[110]++,this.$dialog.confirm("Are you sure you want to unlock this file for editing? If another user is editing this file, your changes might conflict with each other.",{okText:"Force Unlock",cancelText:"Cancel"}).then((function(){return an().f[42]++,an().s[111]++,n.lockedBy=null,an().s[112]++,n.lockFile()}))},lockFile:function(){return an().f[43]++,an().s[113]++,v.post("/openc3-api/tables/".concat(this.filename,"/lock"))},unlockFile:function(){an().f[44]++,an().s[114]++,an().b[13][0]++,""===this.filename||(an().b[13][1]++,this.readOnly)?an().b[12][1]++:(an().b[12][0]++,an().s[115]++,v.post("/openc3-api/tables/".concat(this.filename,"/unlock")))},getDefinition:function(){var n=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(an().b[14][0]++,null);an().f[45]++,an().s[116]++,e?an().b[15][1]++:(an().b[15][0]++,an().s[117]++,e=this.filename.replace("/bin/","/config/").replace(".bin","_def.txt")),an().s[118]++,this.tables=[];var t=(an().s[119]++,new FormData);an().s[120]++,t.append("binary",this.filename),an().s[121]++,t.append("definition",e),an().s[122]++,v.post("/openc3-api/tables/load",{data:t}).then((function(t){an().f[46]++,an().s[123]++,n.definitionFilename=e,an().s[124]++,n.tables=t.data.tables.map((function(n){return an().f[47]++,an().s[125]++,(0,o.Z)((0,o.Z)({},n),{},{headers:n.headers.map((function(e,t){an().f[48]++;var l=(an().s[126]++,{text:e,filterable:"INDEX"!==e});return an().s[127]++,1===n.numColumns?(an().b[16][0]++,an().s[128]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[0].".concat(e.toLowerCase())})):(an().b[16][1]++,an().s[129]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[".concat(t,"].value")}))}))})})),an().s[130]++,t.data["errors"]?(an().b[17][0]++,an().s[131]++,n.$notify.caution({title:"Warning",body:t.data["errors"]})):an().b[17][1]++})).catch((function(t){an().f[49]++,an().s[132]++,404==t.response.status?(an().b[18][0]++,an().s[133]++,n.$notify.normal({title:"Definition File Not Found",body:"Definition file ".concat(e," not found. Please select definition file.")}),an().s[134]++,n.fileOpen=!0):(an().b[18][1]++,an().s[135]++,n.$notify.serious({title:"Error",body:"Error loading due to ".concat(t.response.statusText,". Status: ").concat(t.response.status)}))}))},buildNewBinary:function(n){var e=this;an().f[50]++;var t=(an().s[136]++,new FormData);an().s[137]++,t.append("definition",n),an().s[138]++,v.post("/openc3-api/tables/generate",{data:t}).then((function(t){an().f[51]++,an().s[139]++,e.filename=t.data.filename,an().s[140]++,e.getDefinition(n)}))},onChange:function(n,e){var t=e.index,l=e.event;an().f[52]++,an().s[141]++,this.fileModified="*",an().s[142]++,n[t].value=l}}},cn=sn,rn=(0,S.Z)(cn,l,i,!1,null,null,null),un=rn.exports},7764:function(n,e,t){"use strict";t.r(e);var l=t(3467),i=t.n(l),o=t(8715),a=t.n(o),s=a()(i());s.push([n.id,".v-list[data-v-3237297b] .v-label{margin-left:5px}.v-list-item__icon[data-v-3237297b]{margin-right:15px!important}.v-list-item__title[data-v-3237297b]{color:#fff}",""]),e["default"]=s},5741:function(n,e,t){var l=t(7764);l.__esModule&&(l=l.default),"string"===typeof l&&(l=[[n.id,l,""]]),l.locals&&(n.exports=l.locals);var i=t(3514).Z;i("9f637652",l,!0,{sourceMap:!1,shadowMode:!1})}}]);
2
+ //# sourceMappingURL=628.js.map