pinokiod 3.312.0 → 3.314.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.312.0",
3
+ "version": "3.314.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1648,6 +1648,7 @@ class Server {
1648
1648
  if (this.kernel.homedir) {
1649
1649
  system_env = await Environment.get(this.kernel.homedir, this.kernel)
1650
1650
  }
1651
+ const hasHome = !!this.kernel.homedir
1651
1652
  let configArray = [{
1652
1653
  key: "home",
1653
1654
  val: this.kernel.homedir,
@@ -1693,6 +1694,7 @@ class Server {
1693
1694
  res.render("settings", {
1694
1695
  list,
1695
1696
  current_host: this.kernel.peer.host,
1697
+ hasHome,
1696
1698
  ...peerAccess,
1697
1699
  platform,
1698
1700
  version: this.version,
@@ -5114,6 +5116,7 @@ class Server {
5114
5116
  if (this.kernel.homedir) {
5115
5117
  system_env = await Environment.get(this.kernel.homedir, this.kernel)
5116
5118
  }
5119
+ const hasHome = !!this.kernel.homedir
5117
5120
  let configArray = [{
5118
5121
  key: "home",
5119
5122
  val: this.kernel.homedir ? this.kernel.homedir : _home,
@@ -5160,6 +5163,7 @@ class Server {
5160
5163
  let list = this.getPeers()
5161
5164
  res.render("settings", {
5162
5165
  current_host: this.kernel.peer.host,
5166
+ hasHome,
5163
5167
  ...peerAccess,
5164
5168
  list,
5165
5169
  platform,
@@ -512,9 +512,9 @@ document.addEventListener('DOMContentLoaded', function() {
512
512
  </select>
513
513
  <% } else { %>
514
514
  <% if (c.val) { %>
515
- <input class='homepath' name="<%=c.key%>" type='text' value="<%=c.val%>" placeholder="<%=c.placeholder ? c.placeholder : ''%>">
515
+ <input class='homepath' name="<%=c.key%>" type='text' value="<%=c.val%>" placeholder="<%=c.placeholder ? c.placeholder : ''%>" <%= c.key === 'home' && !hasHome ? `data-first-home=\"true\"` : "" %>>
516
516
  <% } else { %>
517
- <input class='homepath' name="<%=c.key%>" type='text' placeholder="<%=c.placeholder ? c.placeholder : ''%>">
517
+ <input class='homepath' name="<%=c.key%>" type='text' placeholder="<%=c.placeholder ? c.placeholder : ''%>" <%= c.key === 'home' && !hasHome ? `data-first-home=\"true\"` : "" %>>
518
518
  <% } %>
519
519
  <% } %>
520
520
  <% if (c.description) { %>
@@ -653,6 +653,7 @@ document.addEventListener("DOMContentLoaded", async () => {
653
653
  const homeInput = document.querySelector('input.homepath[name="home"]')
654
654
  let showHomeWarning = () => {}
655
655
  const originalHome = homeInput ? (homeInput.defaultValue || '') : ''
656
+ const isFirstHome = homeInput ? homeInput.dataset.firstHome === 'true' : false
656
657
  if (homeInput) {
657
658
  const warning = document.createElement('div')
658
659
  warning.className = 'home-warning hidden'
@@ -829,7 +830,7 @@ document.addEventListener("DOMContentLoaded", async () => {
829
830
  return
830
831
  }
831
832
  const isChanged = val !== originalHome
832
- if (homeInput && isChanged) {
833
+ if (homeInput && (isFirstHome || isChanged)) {
833
834
  const confirmResult = await Swal.fire({
834
835
  title: 'Reminder',
835
836
  html: 'exFAT drives often break permissions/metadata.<br>Please double-check the path isn\u2019t on exFAT. If it looks good, click \u201cSelect\u201d to continue.',