Commit 514e0875 authored by Reza Sahebgharan's avatar Reza Sahebgharan

feat(setting for logging in client and change Client): setting for logging in…

feat(setting for logging in client and change Client): setting for logging in client and change Client
parent 0094233e
Pipeline #1107 passed with stage
in 54 minutes and 54 seconds
...@@ -29,6 +29,20 @@ ...@@ -29,6 +29,20 @@
<v-col cols="12" md="6"> <v-col cols="12" md="6">
<v-text-field label="Port" type="text" v-model="ClientForm.Port"></v-text-field> <v-text-field label="Port" type="text" v-model="ClientForm.Port"></v-text-field>
</v-col> </v-col>
<v-col cols="12" md="6">
<v-text-field
:label="$t('Client.AutoCompleteTimeSpanLabel')"
type="number"
v-model="ClientForm.AutoCompleteTimeSpan"
:rules="numberRules"
:disabled="!ClientForm.AutoComplete"
placeholder="1-23"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-checkbox v-model="ClientForm.AutoComplete" class="mx-2" :label="$t('Client.AutoCompleteLabel')"></v-checkbox>
</v-col>
</v-row> </v-row>
</v-container> </v-container>
</v-card-text> </v-card-text>
...@@ -119,6 +133,9 @@ ...@@ -119,6 +133,9 @@
<script> <script>
import Client from "../../imports/api/collections/clients.js"; import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor"; import { Meteor } from "meteor/meteor";
// import { log_init, logClient } from "../../imports/plugins/logger";
// log_init();
export default { export default {
data() { data() {
return { return {
...@@ -132,19 +149,39 @@ export default { ...@@ -132,19 +149,39 @@ export default {
AETitle: "", AETitle: "",
Hostname: "", Hostname: "",
Port: "", Port: "",
AutoComplete: false,
AutoCompleteTimeSpan: 1,
_id: "" _id: ""
}, },
snackbar: false, snackbar: false,
alertSnackbar: false, alertSnackbar: false,
alertText: "", alertText: "",
alertColor:"primary", alertColor: "primary",
loading: false, loading: false,
search: "" search: "",
maxLength: 24,
minLength: 0,
numberRules: [
// v => !!v || "Input is required!",
v =>
v < this.maxLength ||
this.$t("Client.lessThan25"),
v =>
v > this.minLength ||
this.$t("Client.greaterThanZero")
]
}; };
}, },
computed: { computed: {
headerOfTable() { headerOfTable() {
let headers = ["Caption", "AETitle", "Hostname", "Port"]; let headers = [
"Caption",
"AETitle",
"Hostname",
"Port",
"AutoComplete",
"AutoCompleteTimeSpan"
];
let headerObjs = []; let headerObjs = [];
for (let header of headers) { for (let header of headers) {
headerObjs.push({ headerObjs.push({
...@@ -178,10 +215,19 @@ export default { ...@@ -178,10 +215,19 @@ export default {
} }
}, },
openNewDialog() { openNewDialog() {
// logClient(
// "debug",
// `openNewDialog() => newDialog `,
// this.ClientForm,
// Meteor.user().username
// );
for (let prop in this.ClientForm) { for (let prop in this.ClientForm) {
this.$set(this.ClientForm, prop, ""); this.$set(this.ClientForm, prop, "");
} }
this.$set(this.ClientForm, "_id", ""); this.$set(this.ClientForm, "_id", "");
this.$set(this.ClientForm, "AutoComplete", false);
this.$set(this.ClientForm, "AutoCompleteTimeSpan", 1);
this.newOrEdit = "new"; this.newOrEdit = "new";
this.dialog = true; this.dialog = true;
}, },
...@@ -200,15 +246,35 @@ export default { ...@@ -200,15 +246,35 @@ export default {
this.dialog = true; this.dialog = true;
}, },
createOrEditClient() { createOrEditClient() {
if (
this.ClientForm.AutoComplete &&
this.ClientForm.AutoCompleteTimeSpan <= 0
) {
this.alertColor = "danger";
this.alertText = this.$t("Client.greaterThanZero");
this.alertSnackbar = true;
return;
}
if (
this.ClientForm.AutoComplete &&
this.ClientForm.AutoCompleteTimeSpan > 24
) {
this.alertColor = "danger";
this.alertText = this.$t("Client.lessThan25");
this.alertSnackbar = true;
return;
}
this.loading = true; this.loading = true;
let me = this; let me = this;
if (this.newOrEdit == "new") { if (this.newOrEdit == "new") {
Meteor.call("createClient", this.ClientForm, function() { Meteor.call("createClient", this.ClientForm, function(error, result) {
// me.dialog = false;
}); });
} }
if (this.newOrEdit == "edit") { if (this.newOrEdit == "edit") {
Meteor.call("editClient", this.ClientForm, function() { Meteor.call("editClient", this.ClientForm, function(error, result) {
// me.dialog = false; // me.dialog = false;
me.selectedItemInTable = []; me.selectedItemInTable = [];
}); });
......
...@@ -141,6 +141,9 @@ import Devicemap from "../../imports/api/collections/devicemap.js"; ...@@ -141,6 +141,9 @@ import Devicemap from "../../imports/api/collections/devicemap.js";
import HisLink from "../../imports/api/collections/hislink.js"; import HisLink from "../../imports/api/collections/hislink.js";
import Client from "../../imports/api/collections/clients.js"; import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor"; import { Meteor } from "meteor/meteor";
// import { log_init, logClient } from "../../imports/plugins/logger";
// log_init();
export default { export default {
data() { data() {
return { return {
...@@ -254,6 +257,12 @@ export default { ...@@ -254,6 +257,12 @@ export default {
} }
}, },
openNewDialog() { openNewDialog() {
// logClient(
// "debug",
// `openNewDialog() => newDialog `,
// this.DevicemapForm,
// Meteor.user().username
// );
for (let prop in this.DevicemapForm) { for (let prop in this.DevicemapForm) {
this.$set(this.DevicemapForm, prop, ""); this.$set(this.DevicemapForm, prop, "");
if (prop == "MaxLen") this.$set(this.DevicemapForm, prop, 0); if (prop == "MaxLen") this.$set(this.DevicemapForm, prop, 0);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<title>%title%</title> <title>کارنامه</title>
</head> </head>
<body> <body>
......
...@@ -111,7 +111,11 @@ const messages = { ...@@ -111,7 +111,11 @@ const messages = {
editBtn: "Edit", editBtn: "Edit",
clientSelectStatement: "please select one of Clients", clientSelectStatement: "please select one of Clients",
clientDeleteStatement: "Client has been deleted", clientDeleteStatement: "Client has been deleted",
clientRelationshipError: "selected Client have been linked to a devicemap" clientRelationshipError: "selected Client have been linked to a devicemap",
greaterThanZero: "number of AutoCompleteTimeSpan must be greater than 0",
lessThan25: "number of AutoCompleteTimeSpan must be less than 24",
AutoCompleteTimeSpanLabel: "AutoCompleteTimeSpan",
AutoCompleteLabel: "AutoComplete"
}, },
DeviceMap: { DeviceMap: {
DeleteMessage: "Are You Sure?", DeleteMessage: "Are You Sure?",
...@@ -295,7 +299,15 @@ const messages = { ...@@ -295,7 +299,15 @@ const messages = {
editBtn: "ویرایش", editBtn: "ویرایش",
clientSelectStatement: "لطفا یکی از Client ها را انتخاب نمایید", clientSelectStatement: "لطفا یکی از Client ها را انتخاب نمایید",
clientDeleteStatement: "Client حذف گردید", clientDeleteStatement: "Client حذف گردید",
clientRelationshipError: "دستگاه انتخاب شده دارای یک نگاشت می باشد" clientRelationshipError: "دستگاه انتخاب شده دارای یک نگاشت می باشد",
// greaterThanZero: "دوره زمان انجام کار می بایست بیشتر از صفر باشد",
// lessThan25: "دوره زمان انجام کار می بایست کمتر از 24 باشد",
// AutoCompleteTimeSpanLabel: "زمان انجام کار",
// AutoCompleteLabel: "امکان حذف"
greaterThanZero: "number of AutoCompleteTimeSpan must be greater than 0",
lessThan25: "number of AutoCompleteTimeSpan must be less than 24",
AutoCompleteTimeSpanLabel: "AutoCompleteTimeSpan",
AutoCompleteLabel: "AutoComplete"
}, },
DeviceMap: { DeviceMap: {
DeleteMessage: "آیا مطمین هستید؟", DeleteMessage: "آیا مطمین هستید؟",
......
import { Logger } from 'meteor/ostrio:logger';
import { LoggerFile } from 'meteor/ostrio:loggerfile';
let mylog = {};
export function log_init() {
mylog = new Logger();
(new LoggerFile(mylog)).enable();
}
export function logClient(level, message, data, username) {
mylog[level](message, data, username);
}
\ No newline at end of file
...@@ -23,6 +23,8 @@ import '../imports/api/server/publications/worklist4hislink.js'; ...@@ -23,6 +23,8 @@ import '../imports/api/server/publications/worklist4hislink.js';
import '../imports/api/server/publications/translitdbuploads.js'; import '../imports/api/server/publications/translitdbuploads.js';
import '../imports/api/server/publications/transliterationdb.js'; import '../imports/api/server/publications/transliterationdb.js';
import { log_init } from '../imports/plugins/logger';
import { Accounts } from "meteor/accounts-base"; import { Accounts } from "meteor/accounts-base";
...@@ -44,6 +46,7 @@ Meteor.startup(() => { ...@@ -44,6 +46,7 @@ Meteor.startup(() => {
}); });
Meteor.users.deny({ update: () => true }); Meteor.users.deny({ update: () => true });
log_init();
console.log("app started"); console.log("app started");
}); });
......
{ {
"worklistUrl": "http://192.168.0.66:8086", "worklistUrl": "http://192.168.0.66:8086",
"databusUrl": "http://localhost:8090", "databusUrl": "http://localhost:8090",
"enableDebug": true "enableDebug": false,
"public": {
"enableDebug": false
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment