This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfd-polymer-trigger.html
113 lines (104 loc) · 4.65 KB
/
fd-polymer-trigger.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../fd-polymer-rest-service/fd-polymer-rest-service.html">
<link rel="import" href="../fd-polymer-ws-service/fd-polymer-ws-service.html">
<link rel="import" href="../fd-polymer-api-settings/fd-polymer-api-settings.html">
<link rel="import" href="../fd-polymer-i18next-translate/fd-polymer-i18next-translate.html">
<link rel="import" href="../paper-shadow/paper-shadow.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../fd-polymer-generics/fd-generic-item.html">
<link rel="import" href="../fd-polymer-ispermitted/fd-polymer-ispermitted.html">
<!--
Element providing proof of concept of a Thing card, with all needed features
##### Example
<fd-thing address="fritz.bestmazzo.it" port="9111" apiVersion="v3"
thingUuid="76fd619c-617b-4fb7-9870-8f08164c4926" guest></fd-thing>
@element fd-thing
@blurb Element providing proof of concept of a Thing card, with all needed features
@status beta
@homepage http://bestmazzo.github.io/fd-polymer-thing
-->
<polymer-element name="fd-trigger" attributes="ssl address port apiVersion trigger uuid guest mode encopy enshape">
<template>
<style>
:host {
display: block;
position: relative;
font-size: 1.2rem;
font-weight: 300;
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
}
</style>
<fd-api-settings ssl="{{ssl}}" address="{{address}}" port="{{port}}" apiVersion="{{apiVersion}}" apiUrl="{{apiUrl}}">
</fd-api-settings>
<fd-ispermitted permission="triggers:update" allowed="{{canUpdate}}"></fd-ispermitted>
<fd-generic-item on-icon-tap="" mode="{{mode}}" guest="{{guest}}" ensettings="{{canUpdate}}" item="{{trigger}}" uuid="{{uuid}}" type="triggers" encopy="{{encopy}}" enshape="{{enshape}}">
<icon>
<paper-icon-button icon="track-changes"></paper-icon-button>
</icon>
<name>{{trigger.name}}</name>
<description>{{trigger.description}}</description>
<extra></extra>
<modify>
<div layout vertical>
<h3>{{trigger.name}}</h3>
<paper-input label="{{'name' | t }}" value="{{trigger.name}}" floatingLabel></paper-input>
<paper-input label="{{'description' | t }}" value="{{trigger.description}}" floatingLabel></paper-input>
<paper-input label="{{'channel' | t }}" value="{{trigger.channel}}" floatingLabel></paper-input>
<paper-input label="{{'suspensionTime' | t }}" value="{{trigger.suspensionTime}}" floatingLabel></paper-input>
<paper-input label="{{'hardwareLevel' | t }}" value="{{trigger.hardwareLevel}}" floatingLabel></paper-input>
<paper-input label="{{'persistence' | t }}" value="{{trigger.persistence}}" floatingLabel></paper-input>
<paper-input label="{{'delay' | t }}" value="{{trigger.delay}}" floatingLabel></paper-input>
<paper-input label="{{'priority' | t }}" value="{{trigger.priority}}" floatingLabel></paper-input>
<paper-input label="{{'maxExecutions' | t }}" value="{{trigger.maxExecutions}}" floatingLabel></paper-input>
<paper-input label="{{'suspensionStart' | t }}" value="{{trigger.suspensionStart}}" floatingLabel></paper-input>
</div>
</modify>
</fd-generic-item>
</template>
<script>
Polymer("fd-trigger", {
/**
* The 'guest' attribute tells whether the API call should be made as a guest user
*
* @attribute guest
* @type boolean
*/
/**
* The 'thingUuid' attribute specifies the uuid of Thing to show
*
* @attribute thingUuid
* @type string
*/
/**
* The 'address' attribute specifies the hostname or ip address of API service
*
* @attribute address
* @type string
*/
/**
* The 'apiVersion' attribute specifies the API version to use
*
* @attribute apiVersion
* @type string
*/
/**
* The 'port' attribute specifies the tcp port of API service.
* Default value 0 mean the port number is choosen from the SSL attribute,
* so port will be 9111 if no SSL, and 9113 is SSL
* @attribute port
* @type int
*/
/**
* The 'ssl' attribute tells whether the API call requires a encrypted connection
*
* @attribute ssl
* @type boolean
*/
mode: 'matCard',
guest: undefined
});
</script>
</polymer-element>