-
Notifications
You must be signed in to change notification settings - Fork 3
/
basic.html
93 lines (71 loc) · 2.69 KB
/
basic.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="author" content="Sven Paulsen">
<meta name="description" content="Basic Example">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>REST API TSViewer - Basic Example</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/css/uikit.gradient.min.css" />
<link rel="stylesheet" href="../src/themes/colored/tree.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/uikit/2.27.5/js/uikit.min.js"></script>
<script src="../src/jquery.ts3viewer.min.js"></script>
<script>
$(document).ready(function()
{
$("#tsviewer").tsviewer({
// mandatory server address
host: "84.200.62.248",
port: "9987",
// optional tooltip patterns
serverTip: "Clients: $users/$slots",
channelTip: "Codec: $codec",
clientTip: "Version: $version on $platform",
// optional callbacks
onNode: function(elem, node) {
// your code
},
onReady: function(data, count) {
// your code
},
onError: function(error) {
// your code
}
});
$("#refresh").click(function() {
// shortcut to refresh the tree
$("#tsviewer").tsviewerRefresh(true);
});
$("#expand").click(function() {
// shortcut to expand all nodes
$("#tsviewer").tsviewerExpand();
});
$("#collapse").click(function() {
// shortcut to collapse all nodes
$("#tsviewer").tsviewerCollapse();
});
});
</script>
</head>
<body style="padding: 10px;">
<div class="uk-panel uk-panel-box" style="width: 300px;">
<h1 class="uk-panel-title">
<i class="uk-icon uk-icon-html5"></i> REST API TSViewer Demo
</h1>
<div class="uk-margin">
<button type="button" class="uk-button uk-button-small uk-button-primary" id="expand">
<span class="uk-icon uk-icon-plus"></span> Expand All
</button>
<button type="button" class="uk-button uk-button-small uk-button-primary" id="collapse">
<span class="uk-icon uk-icon-minus"></span> Collapse All
</button>
<button type="button" class="uk-button uk-button-small uk-button-success" id="refresh">
<i class="uk-icon uk-icon-refresh"></i> Refresh
</button>
</div>
<div id="tsviewer"></div>
</div>
</body>
</html>