This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
forked from liddiard/google-sheet-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.html
130 lines (103 loc) · 2.92 KB
/
config.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
/* https://css-tricks.com/box-sizing/ */
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
font-family: Helvetica, Arial, sans-serif;
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin: 1em 0;
}
label {
font-weight: bold;
}
input[type=text], input[type=password] {
display: block;
border: 1px solid #ccc;
font-size: 1em;
padding: 0.5em;
margin: 0.25em 0;
width: 100%;
outline: none;
}
input[type=text]:invalid, input[type=password]:invalid {
border-color: red;
}
input[type=text]:focus, input[type=password]:focus {
border-color: #3079ed;
}
button {
font-size: 1.25em;
border: 0;
padding: 0.5em 1em;
cursor: pointer;
color: white;
border-radius: 4px;
}
button.primary {
background-color: #3079ed;
}
button.loading {
opacity: 0.5;
cursor: default;
}
.sheet-id {
color: gray;
font-size: 0.8em;
}
.action-buttons {
display: flex;
justify-content: flex-end;
}
</style>
</head>
<body>
<form onsubmit="handleSubmit(); return false">
<ul>
<li>
<label for="bucket-name">Bucket name</label>
<input id="bucket-name" name="bucketName" type="text" autofocus value="<?!= bucketName ?>" placeholder="my-bucket-name" required />
</li>
<li>
<label for="path">Path (without leading or trailing slashes)</label>
<input id="path" name="path" type="text" value="<?!= path ?>" placeholder="path/to/folder" />
</li>
<li>
<label for="aws-access-key-id">AWS access key ID</label>
<input id="aws-access-key-id" name="awsAccessKeyId" type="text" value="<?!= awsAccessKeyId ?>" placeholder="from AWS management console" required />
</li>
<li>
<label for="aws-secret-key">AWS secret key</label>
<input id="aws-secret-key" name="awsSecretKey" type="password" value="<?!= awsSecretKey ?>" placeholder="from AWS management console" required />
</li>
<li class="sheet-id">
Sheet ID: <?!= sheetId ?>
</li>
</ul>
<div class="action-buttons">
<button type="submit" class="primary">Save</button>
</div>
</form>
<script>
function handleSubmit() {
var form = document.querySelector('form');
var submitButton = document.querySelector('form button[type=submit]');
submitButton.classList.add('loading');
submitButton.innerHTML = 'Saving...';
google.script.run.updateConfig(form);
}
</script>
</body>
</html>