@tomorrowos/sdk 0.6.3 → 0.6.4
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": "@tomorrowos/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "TomorrowOS CMS server SDK - WebSocket transport, pairing, device commands, optional static CMS UI. Includes CLI (tomorrowos init / build) and starter templates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-cms",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "CMS server on @tomorrowos/sdk. Add your UI (React, static files, etc.) alongside this server.",
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build-player": "tomorrowos build --platform tizen"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@tomorrowos/sdk": "^0.6.
|
|
13
|
+
"@tomorrowos/sdk": "^0.6.4",
|
|
14
14
|
"dotenv": "^17.2.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
@@ -664,6 +664,8 @@ function renderDeviceCards() {
|
|
|
664
664
|
|
|
665
665
|
const header = document.createElement("div");
|
|
666
666
|
header.className = "device-card-header";
|
|
667
|
+
const headerMain = document.createElement("div");
|
|
668
|
+
headerMain.className = "device-card-header-main";
|
|
667
669
|
const led = document.createElement("span");
|
|
668
670
|
led.className = `status-led ${device.connected ? "status-led--online" : "status-led--offline"}`;
|
|
669
671
|
const title = document.createElement("h3");
|
|
@@ -672,9 +674,9 @@ function renderDeviceCards() {
|
|
|
672
674
|
if (isEditingName) {
|
|
673
675
|
const input = document.createElement("input");
|
|
674
676
|
input.type = "text";
|
|
677
|
+
input.className = "device-card-title-input";
|
|
675
678
|
input.value = editingDeviceNameValue || device.deviceName || "Screen";
|
|
676
679
|
input.placeholder = "Device name";
|
|
677
|
-
input.style.minWidth = "12rem";
|
|
678
680
|
input.addEventListener("input", (ev) => {
|
|
679
681
|
editingDeviceNameValue = String(ev.target.value || "");
|
|
680
682
|
});
|
|
@@ -691,8 +693,36 @@ function renderDeviceCards() {
|
|
|
691
693
|
} else {
|
|
692
694
|
title.textContent = device.deviceName || "Screen";
|
|
693
695
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
+
headerMain.appendChild(led);
|
|
697
|
+
headerMain.appendChild(title);
|
|
698
|
+
|
|
699
|
+
const headerActions = document.createElement("div");
|
|
700
|
+
headerActions.className = "device-card-header-actions";
|
|
701
|
+
if (isEditingName) {
|
|
702
|
+
const saveBtn = document.createElement("button");
|
|
703
|
+
saveBtn.type = "button";
|
|
704
|
+
saveBtn.className = "primary";
|
|
705
|
+
saveBtn.textContent = "Save";
|
|
706
|
+
saveBtn.addEventListener("click", () =>
|
|
707
|
+
void submitInlineDeviceRename(device.deviceId)
|
|
708
|
+
);
|
|
709
|
+
const cancelBtn = document.createElement("button");
|
|
710
|
+
cancelBtn.type = "button";
|
|
711
|
+
cancelBtn.textContent = "Cancel";
|
|
712
|
+
cancelBtn.addEventListener("click", cancelInlineDeviceRename);
|
|
713
|
+
headerActions.appendChild(saveBtn);
|
|
714
|
+
headerActions.appendChild(cancelBtn);
|
|
715
|
+
} else {
|
|
716
|
+
const renameBtn = document.createElement("button");
|
|
717
|
+
renameBtn.type = "button";
|
|
718
|
+
renameBtn.textContent = "Rename";
|
|
719
|
+
renameBtn.addEventListener("click", () =>
|
|
720
|
+
startInlineDeviceRename(device.deviceId, device.deviceName)
|
|
721
|
+
);
|
|
722
|
+
headerActions.appendChild(renameBtn);
|
|
723
|
+
}
|
|
724
|
+
header.appendChild(headerMain);
|
|
725
|
+
header.appendChild(headerActions);
|
|
696
726
|
|
|
697
727
|
const published = document.createElement("ul");
|
|
698
728
|
published.className = "device-published-list";
|
|
@@ -786,26 +816,6 @@ function renderDeviceCards() {
|
|
|
786
816
|
latestScreenshotBtn.textContent = "Last screen";
|
|
787
817
|
latestScreenshotBtn.addEventListener("click", () => viewLatestScreenshot(device.deviceId));
|
|
788
818
|
|
|
789
|
-
const renameBtn = document.createElement("button");
|
|
790
|
-
renameBtn.type = "button";
|
|
791
|
-
if (isEditingName) {
|
|
792
|
-
renameBtn.className = "primary";
|
|
793
|
-
renameBtn.textContent = "Save";
|
|
794
|
-
renameBtn.addEventListener("click", () =>
|
|
795
|
-
void submitInlineDeviceRename(device.deviceId)
|
|
796
|
-
);
|
|
797
|
-
} else {
|
|
798
|
-
renameBtn.textContent = "Rename";
|
|
799
|
-
renameBtn.addEventListener("click", () =>
|
|
800
|
-
startInlineDeviceRename(device.deviceId, device.deviceName)
|
|
801
|
-
);
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
const cancelRenameBtn = document.createElement("button");
|
|
805
|
-
cancelRenameBtn.type = "button";
|
|
806
|
-
cancelRenameBtn.textContent = "Cancel";
|
|
807
|
-
cancelRenameBtn.addEventListener("click", cancelInlineDeviceRename);
|
|
808
|
-
|
|
809
819
|
const unpairBtn = document.createElement("button");
|
|
810
820
|
unpairBtn.type = "button";
|
|
811
821
|
unpairBtn.className = "danger";
|
|
@@ -820,8 +830,6 @@ function renderDeviceCards() {
|
|
|
820
830
|
actions.appendChild(logsBtn);
|
|
821
831
|
actions.appendChild(screenshotBtn);
|
|
822
832
|
actions.appendChild(latestScreenshotBtn);
|
|
823
|
-
actions.appendChild(renameBtn);
|
|
824
|
-
if (isEditingName) actions.appendChild(cancelRenameBtn);
|
|
825
833
|
actions.appendChild(unpairBtn);
|
|
826
834
|
|
|
827
835
|
card.appendChild(header);
|
|
@@ -141,15 +141,45 @@ body {
|
|
|
141
141
|
.device-card-header {
|
|
142
142
|
display: flex;
|
|
143
143
|
align-items: center;
|
|
144
|
-
|
|
144
|
+
justify-content: space-between;
|
|
145
|
+
gap: 0.35rem;
|
|
145
146
|
margin-bottom: 0.65rem;
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
.device-card-header-main {
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
gap: 0.5rem;
|
|
153
|
+
min-width: 0;
|
|
154
|
+
flex: 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.device-card-header-actions {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 0.35rem;
|
|
161
|
+
flex-shrink: 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.device-card-header-actions button {
|
|
165
|
+
font-size: 0.78rem;
|
|
166
|
+
padding: 0.35rem 0.6rem;
|
|
167
|
+
}
|
|
168
|
+
|
|
148
169
|
.device-card-title {
|
|
149
170
|
margin: 0;
|
|
150
171
|
font-size: 0.95rem;
|
|
151
172
|
font-weight: 600;
|
|
152
173
|
line-height: 1.2;
|
|
174
|
+
min-width: 0;
|
|
175
|
+
flex: 1;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.device-card-title-input {
|
|
179
|
+
width: 100%;
|
|
180
|
+
min-width: 0;
|
|
181
|
+
font-size: 0.95rem;
|
|
182
|
+
font-weight: 600;
|
|
153
183
|
}
|
|
154
184
|
|
|
155
185
|
.status-led {
|