outsource db routes, schemata and logic into dbs.js
This commit is contained in:
+48
-2
@@ -98,10 +98,19 @@
|
||||
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
||||
<form class="om-searchbar">
|
||||
<b-field>
|
||||
<b-input placeholder="Suche..."
|
||||
<b-input
|
||||
type="search"
|
||||
icon="magnify">
|
||||
icon="magnify"
|
||||
placeholder="Suche...">
|
||||
</b-input>
|
||||
<!--<b-autocomplete
|
||||
v-model="name"
|
||||
:data="filteredTagArray"
|
||||
type="search"
|
||||
icon="magnify"
|
||||
placeholder="Suche..."
|
||||
@blur="evaluate">
|
||||
</b-autocomplete>-->
|
||||
</b-field>
|
||||
</form>
|
||||
</div>
|
||||
@@ -178,6 +187,43 @@
|
||||
methods: {
|
||||
}
|
||||
});
|
||||
const search_data = [];
|
||||
/*
|
||||
export.default {
|
||||
data: function () {
|
||||
return {
|
||||
selected: [],
|
||||
taglist: data,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredTagArray() {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.indexOf(this.name.toLowerCase()) >= 0
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
evaluate(text) {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.indexOf(text.toLowerCase()) >= 0
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
$(this).bootstrapMaterialDesign();
|
||||
},
|
||||
};
|
||||
*/
|
||||
|
||||
</script>
|
||||
|
||||
<!-- CDN_Vue.js minified lib -->
|
||||
|
||||
@@ -19,7 +19,7 @@ const CreateMsgRouter = {
|
||||
<b-field label="Tags">
|
||||
<b-taginput
|
||||
v-model="selected"
|
||||
:data=items
|
||||
:data=taglist
|
||||
autocomplete
|
||||
allow-new:false
|
||||
icon="label"
|
||||
@@ -33,7 +33,7 @@ const CreateMsgRouter = {
|
||||
</b-field>
|
||||
|
||||
<b-button @click="$router.go(-1)">ABBRECHEN</b-button>
|
||||
<b-button type="is-primary" @click="$router.push('/home')">SENDEN</b-button>
|
||||
<b-button type="is-primary" @click="createMsg">SENDEN</b-button>
|
||||
|
||||
|
||||
|
||||
@@ -42,29 +42,30 @@ const CreateMsgRouter = {
|
||||
data: function () {
|
||||
return {
|
||||
selected: [],
|
||||
items: data
|
||||
taglist: data,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
createMsg: function () {
|
||||
var subject = $("#subject").val();
|
||||
var message = $("#message").val();
|
||||
var tag = $("#tag").val();
|
||||
var user = $("#user").val();
|
||||
console.log("Message Created: " + tag + " " + message + " " + user);
|
||||
var _subject = $("#subject").val();
|
||||
var _message = $("#message").val();
|
||||
var _tag = $("#tag").val();
|
||||
var _user = $("#user").val();
|
||||
//console.log("Message Created: " + _tag + " " + _message + " " + _user);
|
||||
$.ajax({
|
||||
url: "api/createMsg",
|
||||
url: "api/msg",
|
||||
data: {
|
||||
sub: subject,
|
||||
mess: message,
|
||||
use: user,
|
||||
ta: tag
|
||||
subject: _subject,
|
||||
message: _message,
|
||||
user: _user,
|
||||
tag: _tag
|
||||
},
|
||||
method: "POST"
|
||||
}).done(have_result).fail(have_error);
|
||||
|
||||
function have_result(res) {
|
||||
console.log(res);
|
||||
//console.log(res);
|
||||
router.push('/home')
|
||||
}
|
||||
|
||||
function have_error(err) {
|
||||
@@ -73,13 +74,13 @@ const CreateMsgRouter = {
|
||||
}
|
||||
},
|
||||
getFilteredTags(text) {
|
||||
this.items = data.filter((option) => {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.indexOf(text.toLowerCase()) >= 0
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
|
||||
@@ -24,12 +24,12 @@ const HomeRouter = {
|
||||
});
|
||||
},*/
|
||||
list_messages: function () {
|
||||
$.ajax({url: "api/ids", method: "GET"})
|
||||
$.ajax({url: "api/msg/ids", method: "GET"})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
_messagelist.splice(0, _messagelist.length);
|
||||
_messagelist.push.apply(_messagelist, jd);
|
||||
console.log("jd: "+jd);
|
||||
//console.log("jd: "+jd);
|
||||
for (var e in jd) {
|
||||
if (!_messages[jd[e]]) {
|
||||
get_insert_message(jd[e]);
|
||||
@@ -49,7 +49,7 @@ const HomeRouter = {
|
||||
}
|
||||
}*/
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
console.log("list_msg: err: " + e + f + g);
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -61,7 +61,7 @@ const HomeRouter = {
|
||||
};
|
||||
|
||||
function get_insert_message(id) {
|
||||
$.ajax({ url: "api/msg/"+id, method: "GET" }).done(function (msg) {
|
||||
$.ajax({ url: "api/msg/id/"+id, method: "GET" }).done(function (msg) {
|
||||
Vue.set(_messages, id, msg);
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||
|
||||
Reference in New Issue
Block a user