|
|
|
@ -14,8 +14,20 @@
|
|
|
|
|
<f7-view main>
|
|
|
|
|
<f7-page>
|
|
|
|
|
<f7-navbar title="节点">
|
|
|
|
|
<a href="config.html" slot="nav-right" class="link external"><i class="icon f7-icons if-not-md">menu</i></a>
|
|
|
|
|
<f7-nav-right>
|
|
|
|
|
<f7-link class="searchbar-enable" data-searchbar=".searchbar" icon-ios="f7:search"></f7-link>
|
|
|
|
|
</f7-nav-right>
|
|
|
|
|
<f7-searchbar class="searchbar-demo"
|
|
|
|
|
expandable
|
|
|
|
|
search-container=".search-list"
|
|
|
|
|
search-in=".item-title"></f7-searchbar>
|
|
|
|
|
</f7-navbar>
|
|
|
|
|
<f7-list class="searchbar-not-found">
|
|
|
|
|
<f7-list-item title="没有匹配的结果"></f7-list-item>
|
|
|
|
|
</f7-list>
|
|
|
|
|
<f7-list class="search-list searchbar-found">
|
|
|
|
|
<f7-list-item v-if="nodes" v-for="n in nodes" :title="n.Name" ></f7-list-item>
|
|
|
|
|
</f7-list>
|
|
|
|
|
<f7-toolbar tabbar labels position="bottom">
|
|
|
|
|
<a href="index.html" class="tab-link external">
|
|
|
|
|
<i class="icon icon f7-icons">house</i>
|
|
|
|
@ -55,7 +67,8 @@
|
|
|
|
|
theme: 'ios',
|
|
|
|
|
},
|
|
|
|
|
server: localStorage.getItem('server'),
|
|
|
|
|
token: localStorage.getItem('token')
|
|
|
|
|
token: localStorage.getItem('token'),
|
|
|
|
|
nodes: null
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -67,27 +80,19 @@
|
|
|
|
|
}
|
|
|
|
|
this.$f7ready((f7) => {
|
|
|
|
|
app = this.$f7;
|
|
|
|
|
$.validator.unobtrusive.parse('form');
|
|
|
|
|
});
|
|
|
|
|
this.load();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
submit: function (e) {
|
|
|
|
|
if (!$(e.target).valid()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = e.target.action;
|
|
|
|
|
var data = $(e.target).serialize();
|
|
|
|
|
load: function () {
|
|
|
|
|
var url = this.server + '/IoTCenter/App/GetNodes';
|
|
|
|
|
var data = new FormData();
|
|
|
|
|
data.append('token', this.token);
|
|
|
|
|
axios.post(url, data)
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
console.log(response);
|
|
|
|
|
var data = response.data;
|
|
|
|
|
if (data.Code === 0) {
|
|
|
|
|
localStorage.setItem("token", data.Token);
|
|
|
|
|
window.location.href = "index.html";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
app.dialog.alert(data.Message, '警告', function () { });
|
|
|
|
|
}
|
|
|
|
|
vm.nodes = data;
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
app.dialog.alert(error, '警告', function () { })
|
|
|
|
|