Show version number in property inspector
This commit is contained in:
@@ -6433,7 +6433,7 @@ async function stopTimer(token, entryId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// src/plugin.ts
|
// src/plugin.ts
|
||||||
var CURRENT_VERSION = "1.0.1";
|
var CURRENT_VERSION = "1.0.2";
|
||||||
var GITEA_BASE = "http://100.120.125.113:3000/pdm/stream_deck_notion_timer/raw/branch/master";
|
var GITEA_BASE = "http://100.120.125.113:3000/pdm/stream_deck_notion_timer/raw/branch/master";
|
||||||
async function checkForUpdates() {
|
async function checkForUpdates() {
|
||||||
try {
|
try {
|
||||||
@@ -6481,14 +6481,14 @@ var TimerToggle = class extends SingletonAction {
|
|||||||
try {
|
try {
|
||||||
const global = await getGlobal();
|
const global = await getGlobal();
|
||||||
if (!isConfigured(global)) {
|
if (!isConfigured(global)) {
|
||||||
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Configure Notion credentials in plugin settings first." });
|
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Configure Notion credentials in plugin settings first.", version: CURRENT_VERSION });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const projects = await fetchProjects(global.notionToken, global.projectsDbId);
|
const projects = await fetchProjects(global.notionToken, global.projectsDbId);
|
||||||
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: projects });
|
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: projects, version: CURRENT_VERSION });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
plugin_default.logger.error("Failed to fetch projects:", err);
|
plugin_default.logger.error("Failed to fetch projects:", err);
|
||||||
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err) });
|
await plugin_default.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err), version: CURRENT_VERSION });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async onKeyDown(ev) {
|
async onKeyDown(ev) {
|
||||||
|
|||||||
@@ -72,6 +72,12 @@
|
|||||||
}
|
}
|
||||||
#statusText.running { color: #4caf50; }
|
#statusText.running { color: #4caf50; }
|
||||||
#statusText.error { color: #e57373; }
|
#statusText.error { color: #e57373; }
|
||||||
|
#versionText {
|
||||||
|
font-size: 10px;
|
||||||
|
color: #444;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
#credStatus {
|
#credStatus {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #888;
|
color: #888;
|
||||||
@@ -116,6 +122,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="statusText"></p>
|
<p id="statusText"></p>
|
||||||
|
<p id="versionText"></p>
|
||||||
|
|
||||||
<script src="libs/constants.js"></script>
|
<script src="libs/constants.js"></script>
|
||||||
<script src="libs/prototypes.js"></script>
|
<script src="libs/prototypes.js"></script>
|
||||||
@@ -243,6 +250,9 @@
|
|||||||
$PI.onSendToPropertyInspector(ACTION_UUID, function(jsn) {
|
$PI.onSendToPropertyInspector(ACTION_UUID, function(jsn) {
|
||||||
var payload = jsn.payload;
|
var payload = jsn.payload;
|
||||||
if (payload.event === "projects") {
|
if (payload.event === "projects") {
|
||||||
|
if (payload.version) {
|
||||||
|
document.getElementById("versionText").textContent = "v" + payload.version;
|
||||||
|
}
|
||||||
if (payload.error) {
|
if (payload.error) {
|
||||||
setStatus(payload.error, "error");
|
setStatus(payload.error, "error");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const CURRENT_VERSION = "1.0.1";
|
const CURRENT_VERSION = "1.0.2";
|
||||||
const GITEA_BASE = "http://100.120.125.113:3000/pdm/stream_deck_notion_timer/raw/branch/master";
|
const GITEA_BASE = "http://100.120.125.113:3000/pdm/stream_deck_notion_timer/raw/branch/master";
|
||||||
|
|
||||||
async function checkForUpdates(): Promise<void> {
|
async function checkForUpdates(): Promise<void> {
|
||||||
@@ -81,14 +81,14 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
|||||||
try {
|
try {
|
||||||
const global = await getGlobal();
|
const global = await getGlobal();
|
||||||
if (!isConfigured(global)) {
|
if (!isConfigured(global)) {
|
||||||
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Configure Notion credentials in plugin settings first." });
|
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Configure Notion credentials in plugin settings first.", version: CURRENT_VERSION });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const projects = await fetchProjects(global.notionToken, global.projectsDbId);
|
const projects = await fetchProjects(global.notionToken, global.projectsDbId);
|
||||||
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: projects });
|
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: projects, version: CURRENT_VERSION });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
streamDeck.logger.error("Failed to fetch projects:", err);
|
streamDeck.logger.error("Failed to fetch projects:", err);
|
||||||
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err) });
|
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err), version: CURRENT_VERSION });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user