From feeb7d14c1402aab2e4f1332ef4e016c24942f47 Mon Sep 17 00:00:00 2001 From: junkfix <165699921+junkfix@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:47:42 +0100 Subject: [PATCH 1/3] Update file_shell.js --- custom_components/file_shell/www/file_shell.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/custom_components/file_shell/www/file_shell.js b/custom_components/file_shell/www/file_shell.js index 88f1971..fc1d166 100644 --- a/custom_components/file_shell/www/file_shell.js +++ b/custom_components/file_shell/www/file_shell.js @@ -1,7 +1,7 @@ (function () { "use strict"; -console.log("File Shell 1.0"); +console.log("File Shell 1.0.3"); const _id = (id) => document.getElementById(id); const _qsa = (q, el) => Array.from((el || document).querySelectorAll(q)); const _qs = (q, el) => (el || document).querySelector(q); @@ -54,7 +54,6 @@ const localTag = 'file_shell'; const localGet = (e) => localStorage.getItem(localTag+e); const localSet = (k, v) => v == null ? localStorage.removeItem(localTag + k) : localStorage.setItem(localTag + k, v); -const getExt = (t)=>{const o=t.split("/").pop().split(".");return o.length>1?o.pop().toLowerCase():"";}; const opt = { multi: 0, @@ -302,11 +301,13 @@ function popup(html='', head='Message', options={}){ } -const isText = (e) => e.type !== "dir" && "txt.md.yaml.yml.jinja.json.xml.csv.log.ini.conf.cfg.py.js.ts.php.htm.html.css.sh".split('.').some(ext => getExt(e.name).endsWith('.' + ext)); +const getExt = (t)=>{const o=t.split("/").pop().split(".");return o.length>1?o.pop().toLowerCase():"";}; +const ext_zip = new Set(["zip", "tar", "gz", "tgz"]); +const ext_text = new Set(["txt", "md", "yaml", "yml", "jinja", "json", "xml", "csv", "log", "ini", "conf", "cfg", "py", "js", "ts", "php", "htm", "html", "css", "sh"]); +const isText = (e) => e.type !== "dir" && ext_text.has(getExt(e.name)); +const isZipFile = (e) => e.type !== "dir" && ext_zip.has(getExt(e.name)); const iconFor = (e) => e.type === "dir" ? "folder" : isZipFile(e) ? "zip" : isText(e) ? "doc" : "file"; -const isZipFile = (e) => e?.type === "file" && [".zip", ".tar", ".gz", ".tgz"].some(ext => getExt(e.name).endsWith(ext)); - const escapeHtml = (s) => String(s).replace(/[&<>]/g, (c) => ({ '&':'&', '<':'<', '>':'>' })[c]); const filesize = (s,t='file') => { @@ -456,13 +457,13 @@ async function validate(){ }else if(['yaml','yml','py'].includes(ext)){ r = await apiPost("valid", { ext, content: c}); if (r.valid) { r = ''; }else{ - r = `${r.error}, line ${r.line}, column ${r.column}`; + r = escapeHtml(r.error)+'

line '+ r.line+', column '+r.column+'

'; } }else{ r = 'Unsupported file: '+ext; } if (r) { - toast('Error: '+r, { theme: 'red', timeout: 15 }); + toast('Error: '+r, { theme: 'red', timeout: 0, close: 1 }); }else{ toast("No Errors"); } @@ -2119,4 +2120,4 @@ async function init() { init(); -})(); \ No newline at end of file +})(); From cc55be629e9078c58a72b1a3c393a88c2ab69015 Mon Sep 17 00:00:00 2001 From: junkfix <165699921+junkfix@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:49:13 +0100 Subject: [PATCH 2/3] Update file_shell.css --- custom_components/file_shell/www/file_shell.css | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/custom_components/file_shell/www/file_shell.css b/custom_components/file_shell/www/file_shell.css index 661d952..2841ef3 100644 --- a/custom_components/file_shell/www/file_shell.css +++ b/custom_components/file_shell/www/file_shell.css @@ -114,23 +114,6 @@ body { overflow: hidden; } -nav { - display: flex; - align-items: center; - gap: 12px; - padding: 0 8px; - background: var(--panel); -} - -nav button, -#files button{ - background-color: var(--panel2); - color: var(--text); - border: 1px solid var(--border); - border-radius: 6px; - padding: 2px 8px; - cursor: pointer; -} button:hover{ border-color: var(--accent); From c28e02170b364f4e6916d6fff876f69ac071f8d7 Mon Sep 17 00:00:00 2001 From: junkfix <165699921+junkfix@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:49:36 +0100 Subject: [PATCH 3/3] Update manifest.json --- custom_components/file_shell/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/file_shell/manifest.json b/custom_components/file_shell/manifest.json index 23575d3..5ead120 100644 --- a/custom_components/file_shell/manifest.json +++ b/custom_components/file_shell/manifest.json @@ -9,5 +9,5 @@ "iot_class": "local_push", "issue_tracker": "https://github.com/junkfix/file-shell/issues", "requirements": [], - "version": "1.0.2" + "version": "1.0.3" }