-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathexistdb-settings.html
174 lines (147 loc) · 4.1 KB
/
existdb-settings.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!--
`existdb-settings`
-->
<dom-module id="existdb-settings">
<template>
<style>
:host {
display: block;
width:100%;
height:100%;
margin:0;
/*padding:0;*/
@apply(--paper-font-common-base);
color:white;
padding:30px;
}
app-header-layout {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
/*height: calc(100% - 200px);*/
background-color: ghostwhite;
overflow: hidden;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
app-header {
/*background: rgb(0, 136, 204);*/
background: var(--paper-blue-500);
padding: 0px;
color: white;
height: 60px;
}
h1{
color:var(--paper-grey-900);
}
paper-card{
max-width: 600px;
min-width: 320px;
padding: 20px;
margin:50px auto;
}
.hint{
color:var(--paper-grey-900);
font-size:14px;
font-style: italic;
}
.content{
display: block;
}
paper-card{
width: 100%;
display: block;
}
.card-content{
color:var(--paper-grey-900);
}
.highlight{
color:var(--paper-blue-500);
font-size: 18px;
padding: 10px;
}
[icon="settings"]{
--iron-icon-fill-color:white;
margin-right:10px;
--iron-icon-width: 30px;
--iron-icon-height: 30px;
}
@media only screen and (max-width: 768px) {
[main-title]{
font-size:18px;
}
.x{
display:none;
}
app-toolbar{
padding-right:0;
}
}
</style>
<iron-ajax id="getPublicUrl"
verbose with-credentials
method="get" handle-as="text"
on-response="_handleUrl"
auto></iron-ajax>
<iron-ajax id="getVersion"
with-credentials
method="get"
handle-as="text"
on-response="_handleVersion"
auto></iron-ajax>
<app-header-layout id="outer" fullbleed>
<app-header slot="header" fixed>
<app-toolbar>
<iron-icon icon="settings" class="x"></iron-icon>
<slot name="toggleIcon"></slot>
<div main-title>Settings</div>
</app-toolbar>
</app-header>
<div class="content">
<paper-card heading="Server Version">
<div class="card-content">
You are running
<div class="highlight">[[versionString]]</div>
</div>
</paper-card>
<paper-card heading="General Settings">
<div class="card-content">
<!--<paper-input id="publicUrl" label="Public Repository URL" aria-readonly="true" readOnly></paper-input>-->
Public Repository URL
<div class="highlight" id="publicUrl"></div>
<span class="hint">URL from which publicly available eXist-db apps and libraries are loaded.</span>
</div>
</paper-card>
</div>
</app-header-layout>
</template>
<script>
class ExistdbSettings extends Polymer.Element {
static get is() { return 'existdb-settings'; }
static get properties() {
return {
versionString:{
type: String,
reflectToAttribute:true
}
};
}
ready(){
super.ready();
// this.$.outer.resetLayout();
this.$.getPublicUrl.url = this.importPath + '../packageservice/packages/public-url';
this.$.getVersion.url = this.importPath + 'modules/getVersion.xql';
}
_handleUrl(){
console.log(this.$.getPublicUrl.lastResponse);
// this.$.publicUrl.value = this.$.getPublicUrl.lastResponse;
this.$.publicUrl.innerHTML = this.$.getPublicUrl.lastResponse;;
}
_handleVersion(){
this.versionString = this.$.getVersion.lastResponse;
}
}
window.customElements.define(ExistdbSettings.is, ExistdbSettings);
</script>
</dom-module>