diff --git a/www/src/data/command.js b/www/src/data/command.js
new file mode 100644
index 0000000..2e27e8b
--- /dev/null
+++ b/www/src/data/command.js
@@ -0,0 +1,73 @@
+function Command({ id, protocol, command, device, command_type, title } = {}) {
+ let _id = id;
+ let _protocol = protocol;
+ let _command = command;
+ let _device = device;
+ let _command_type = command_type;
+ let _title = title;
+
+ function getId() {
+ return _id;
+ }
+
+ function setId(id) {
+ _id = id;
+ }
+
+ function getProtocol() {
+ return _protocol;
+ }
+
+ function setProtocol(protocol) {
+ _protocol = protocol;
+ }
+
+ function getCommand() {
+ return _command;
+ }
+
+ function setCommand(command) {
+ _command = command;
+ }
+
+ function getDevice() {
+ return _device;
+ }
+
+ function setDevice(device) {
+ _device = device;
+ }
+
+ function getCommandType() {
+ return _command_type;
+ }
+
+ function setCommandType(command_type) {
+ _command_type = command_type;
+ }
+
+ function getTitle() {
+ return _title;
+ }
+
+ function setTitle(title) {
+ _title = title;
+ }
+
+ return {
+ getId,
+ setId,
+ getProtocol,
+ setProtocol,
+ getCommand,
+ setCommand,
+ getDevice,
+ setDevice,
+ getCommandType,
+ setCommandType,
+ getTitle,
+ setTitle,
+ };
+}
+
+export default Command;
diff --git a/www/src/data/remote.js b/www/src/data/remote.js
new file mode 100644
index 0000000..1bf8ed0
--- /dev/null
+++ b/www/src/data/remote.js
@@ -0,0 +1,40 @@
+function Remote({ id, title, commands } = {}) {
+ let _id = id;
+ let _title = title;
+ let _commands = commands;
+
+ function getId() {
+ return _id;
+ }
+
+ function setId(id) {
+ _id = id;
+ }
+
+ function getTitle() {
+ return _title;
+ }
+
+ function setTitle(title) {
+ _title = title;
+ }
+
+ function getCommands() {
+ return _commands;
+ }
+
+ function setCommands(commands) {
+ _commands = commands;
+ }
+
+ return {
+ getId,
+ setId,
+ getTitle,
+ setTitle,
+ getCommands,
+ setCommands,
+ };
+}
+
+export default Remote;
diff --git a/www/src/views/remotes/commands-list-view.jsx b/www/src/views/remotes/commands-list-view.jsx
index bfcfe72..591a54f 100644
--- a/www/src/views/remotes/commands-list-view.jsx
+++ b/www/src/views/remotes/commands-list-view.jsx
@@ -27,30 +27,6 @@ function CommandsList(props) {
({
- id: {
- html: {integration.getId()},
- },
- name: {
- text: integration.getName(),
- },
- options: {
- html: (
- <>
-
- >
- ),
- },
- integration: integration,
- }))}
class={"flex-fill"}
columns={[
{
@@ -59,8 +35,18 @@ function CommandsList(props) {
width: 6,
},
{
- id: "name",
- name: "Name",
+ id: "title",
+ name: "Title",
+ },
+ {
+ id: "protocol",
+ name: "Protocol",
+ width: 10,
+ },
+ {
+ id: "type",
+ name: "Type",
+ width: 6,
},
{
id: "options",
@@ -68,6 +54,36 @@ function CommandsList(props) {
width: 4,
},
]}
+ items={(commands() || []).map((command) => ({
+ id: {
+ html: {command.getId()},
+ },
+ title: {
+ text: command.getTitle(),
+ },
+ protocol: {
+ text: command.getProtocol(),
+ },
+ type: {
+ text: command.getCommandType(),
+ },
+ options: {
+ html: (
+ <>
+
+ >
+ ),
+ },
+ command,
+ }))}
>
>
);
diff --git a/www/src/views/remotes/remotes-list-view.jsx b/www/src/views/remotes/remotes-list-view.jsx
index a50f937..bbe2735 100644
--- a/www/src/views/remotes/remotes-list-view.jsx
+++ b/www/src/views/remotes/remotes-list-view.jsx
@@ -3,8 +3,9 @@ import List from "../../modules/list";
import RemotesService from "../../services/remotes-service";
function RemotesList(props) {
- const [remotes, { refetch: refetchRemotes }] =
- createResource(RemotesService.getRemotes);
+ const [remotes, { refetch: refetchRemotes }] = createResource(
+ RemotesService.getRemotes
+ );
onMount(() => {
refetchRemotes();
@@ -26,19 +27,6 @@ function RemotesList(props) {
{}}
- items={(remotes() || []).map((device) => ({
- id: {
- html: {device.getId()},
- },
- name: {
- text: device.getName(),
- },
- description: {
- text: device.getDescription(),
- },
- device,
- }))}
class={"flex-fill"}
columns={[
{
@@ -47,15 +35,40 @@ function RemotesList(props) {
width: 6,
},
{
- id: "name",
- name: "Name",
- width: 10,
+ id: "title",
+ name: "Title",
},
{
- id: "description",
- name: "Description",
+ id: "options",
+ name: "",
+ width: 4,
},
]}
+ onListItemClick={() => {}}
+ items={(remotes() || []).map((remote) => ({
+ id: {
+ html: {remote.getId()},
+ },
+ name: {
+ text: remote.getTitle(),
+ },
+ options: {
+ html: (
+ <>
+
+ >
+ ),
+ },
+ remote,
+ }))}
>
>
);
diff --git a/www/src/views/remotes/remotes-view.jsx b/www/src/views/remotes/remotes-view.jsx
index 3c1a38a..8af6fe5 100644
--- a/www/src/views/remotes/remotes-view.jsx
+++ b/www/src/views/remotes/remotes-view.jsx
@@ -10,10 +10,10 @@ import RemotesList from "./remotes-list-view";
function RemotesView(props) {
props = mergeProps({ onIntegrationClicked: () => {} }, props);
- const REMOTES_LIST_TYPE = "remotes";
- const COMMANDS_LIST_TYPE = "commands";
+ const REMOTES_LIST_VIEW = "remotes_list";
+ const COMMANDS_LIST_VIEW = "commands_list";
- const [listType, setListType] = createSignal(REMOTES_LIST_TYPE);
+ const [currentView, setCurrentView] = createSignal(REMOTES_LIST_VIEW);
function Navigation(props) {
return (
@@ -21,9 +21,9 @@ function RemotesView(props) {