Merge pull request #17 from htmltiger/htmltiger-patch-1

fix new file ext
This commit is contained in:
htmltiger 2022-01-18 12:21:26 +00:00 committed by GitHub
commit 72268fa735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
console.info("Config Editor 3.0");
console.info("Config Editor 3.1");
const LitElement = window.LitElement || Object.getPrototypeOf(customElements.get("hui-masonry-view") );
const html = LitElement.prototype.html;
@ -145,9 +145,9 @@ async Save() {
return;
}
if(!this.openedFile && this.code){
this.openedFile=prompt("type abc.yaml or folder/abc.yaml");
this.openedFile=prompt("type abc."+this.edit.ext+" or folder/abc."+this.edit.ext);
}
if(this.openedFile && this.openedFile.endsWith(".yaml")){
if(this.openedFile && this.openedFile.endsWith("."+this.edit.ext)){
if(!this.code){this.infoLine='';this.infoLine = 'Text is empty!'; return;}
this.infoLine = 'Saving: '+this.openedFile;
const e=(await this._hass.callWS({type: "config_editor/ws", action: 'save', data: this.code, file: this.openedFile, ext: this.edit.ext}));