forked from ratiw/vuetable-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
185 lines (171 loc) · 6.98 KB
/
index.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
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue2</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<style type="text/css">
.ui.vertical.stripe h3 {
font-size: 2em;
}
.secondary.pointing.menu .toc.item {
display: none;
}
.vuetable {
margin-top: 1em !important;
}
.vuetable-wrapper.ui.basic.segment {
padding: 0em;
}
.vuetable button.ui.button {
padding: .5em .5em;
font-weight: 400;
}
.vuetable button.ui.button i.icon {
margin: 0;
}
.vuetable th.sortable:hover {
color: #2185d0;
cursor: pointer;
}
.vuetable-actions {
width: 15%;
padding: 12px 0px;
text-align: center;
}
.vuetable-pagination {
background: #f9fafb !important;
}
.vuetable-pagination-info {
margin-top: auto;
margin-bottom: auto;
}
.highlight {
background-color: yellow;
}
.vuetable-detail-row {
height: 200px;
}
.detail-row {
margin-left: 40px;
}
.expand-transition {
transition: all .5s ease;
}
.expand-enter, .expand-leave {
height: 0;
opacity: 0;
}
tr.odd {
background-color: #e6f5ff;
}
body {
overflow-y: scroll;
}
</style>
</head>
<body>
<div class="ui vertical segment">
<div class="ui container">
<div id="app" class="ui vertical stripe segment">
<div id="content" class="ui basic segment">
<h3 class="ui header">List of Users</h3>
<div class="ui grid">
<div class="ui left aligned nine wide column">
<div class="ui labeled icon input">
<div class="ui label">Search:</div>
<input v-model="searchFor" class="ui input" @keyup.enter="setFilter">
<i class="search icon"></i>
</div>
<button class="ui button primary" @click="setFilter">Go</button>
<button class="ui button" @click="resetFilter">Reset</button>
</div>
<div class="ui right aligned seven wide column">
<button class="ui basic button" id="settingsBtn" @click="showSettingsModal">
<i class="setting icon"></i>
Settings
</button>
</div>
</div><!-- ui grid -->
<div :class="[{'vuetable-wrapper ui basic segment': true}, loading]">
<vuetable ref="vuetable"
api-url="http://vuetable.ratiw.net/api/users"
:fields="fields"
pagination-path="pagination"
:sort-order="sortOrder"
:multi-sort="multiSort"
:per-page="perPage"
:append-params="moreParams"
detail-row-component="my-detail-row"
detail-row-transition="expand"
row-class-callback="rowClassCB"
@vuetable:pagination-data="onPaginationData"
@vuetable:load-success="onLoadSuccess"
@vuetable:loading="showLoader"
@vuetable:loaded="hideLoader"
@vuetable:cell-clicked="onCellClicked"
></vuetable>
<div class="vuetable-pagination ui bottom attached segment grid">
<vuetable-pagination-info ref="paginationInfo"
:info-template="paginationInfoTemplate"
></vuetable-pagination-info>
<component :is="paginationComponent" ref="pagination"
@vuetable-pagination:change-page="onChangePage"
></component>
</div>
</div><!-- vuetable-wrapper -->
</div><!-- content -->
<div class="ui small modal" id="settingsModal">
<div class="header">Settings</div>
<div class="content ui form">
<div class="field">
<div class="ui checkbox">
<input type="checkbox" v-model="multiSort">
<label>Multisort (use Alt+Click)</label>
</div>
</div>
<div class="ui divider"></div>
<div class="field">
<label>Pagination:</label>
<select class="ui simple dropdown" v-model="paginationComponent">
<option value="vuetable-pagination">vuetable-pagination</option>
<option value="vuetable-pagination-dropdown">vuetable-pagination-dropdown</option>
</select>
</div>
<div class="field">
<label>Per Page:</label>
<select class="ui simple dropdown" v-model="perPage">
<option :value="10">10</option>
<option :value="15">15</option>
<option :value="20">20</option>
<option :value="25">25</option>
</select>
</div>
<div class="ui fluid card">
<div class="content">
<div class="header">Visible fields</div>
</div>
<div class="content">
<div v-for="field in fields" class="field">
<div class="ui checkbox">
<input type="checkbox" v-model="field.visible">
<label>{{ getFieldTitle(field) }}</label>
</div>
</div>
</div>
</div>
</div>
<div class="actions">
<div class="ui cancel button">Close</div>
</div>
</div>
</div><!-- app -->
</div><!-- ui container -->
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
</body>
</html>