-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinfrastructure.html
More file actions
58 lines (53 loc) · 1.76 KB
/
infrastructure.html
File metadata and controls
58 lines (53 loc) · 1.76 KB
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
<ui-component name="miniform" path="common.form2" config="if:~PATH~;width:400;submit:?/submit;reload:?/reload;autofocus:1;icon:ti ti-sitemap;zindex:30" plugin="~PATH~" class="hidden">
<div class="padding">
<ui-bind path="?.id" config="template;show" class="block fs12 m">
<script type="text/html">
<div class="monospace">ID: <b>{{ value }}</b></div>
</script>
</ui-bind>
<div>
<div class="m">
<ui-component name="input" path="?.name" config="required:1">@(Name)</ui-component>
</div>
<div class="m">
<ui-component name="input" path="?.description" config="required:1">@(Description)</ui-component>
</div>
</div>
</div>
<hr class="nmt nmb" />
<div class="padding">
<div class="grid-2">
<div class="m">
<ui-component name="input" path="?.color" config="type:color" default="'#4285F4'">@(Color)</ui-component>
</div>
<div class="m">
<ui-component name="input" path="?.icon" config="type:icon" default="'ti ti-bull'">@(Icon)</ui-component>
</div>
</div>
</div>
<nav>
<ui-component name="validate" path="?">
<button name="submit" disabled><i class="ti ti-check-circle"></i>@(SUBMIT)</button>
<button name="cancel">@(Close)</button>
</ui-component>
</nav>
</ui-component>
<script>
PLUGIN(function(exports) {
var caller;
exports.reload = function(header) {
var model = exports.model;
header.reconfigure({ title: model.id ? '@(Update infrastructure)' : '@(Add infrastructure)' });
caller = exports.caller;
};
exports.submit = function(hide) {
var form = exports.form;
exports.tapi('infrastructures_{0} ERROR'.format(form.id ? ('update/' + form.id) : 'create'), form, function() {
hide();
CLRELOAD('cl');
SETTER('notify/success', '@(Done)');
caller.exec('refresh');
});
};
});
</script>