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 @@
<v-col cols="12" md="6">
<v-text-field label="Port" type="text" v-model="ClientForm.Port"></v-text-field>
</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-container>
</v-card-text>
......@@ -119,6 +133,9 @@
<script>
import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor";
// import { log_init, logClient } from "../../imports/plugins/logger";
// log_init();
export default {
data() {
return {
......@@ -132,19 +149,39 @@ export default {
AETitle: "",
Hostname: "",
Port: "",
AutoComplete: false,
AutoCompleteTimeSpan: 1,
_id: ""
},
snackbar: false,
alertSnackbar: false,
alertText: "",
alertColor:"primary",
alertColor: "primary",
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: {
headerOfTable() {
let headers = ["Caption", "AETitle", "Hostname", "Port"];
let headers = [
"Caption",
"AETitle",
"Hostname",
"Port",
"AutoComplete",
"AutoCompleteTimeSpan"
];
let headerObjs = [];
for (let header of headers) {
headerObjs.push({
......@@ -178,10 +215,19 @@ export default {
}
},
openNewDialog() {
// logClient(
// "debug",
// `openNewDialog() => newDialog `,
// this.ClientForm,
// Meteor.user().username
// );
for (let prop in this.ClientForm) {
this.$set(this.ClientForm, prop, "");
}
this.$set(this.ClientForm, "_id", "");
this.$set(this.ClientForm, "AutoComplete", false);
this.$set(this.ClientForm, "AutoCompleteTimeSpan", 1);
this.newOrEdit = "new";
this.dialog = true;
},
......@@ -200,15 +246,35 @@ export default {
this.dialog = true;
},
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;
let me = this;
if (this.newOrEdit == "new") {
Meteor.call("createClient", this.ClientForm, function() {
// me.dialog = false;
Meteor.call("createClient", this.ClientForm, function(error, result) {
});
}
if (this.newOrEdit == "edit") {
Meteor.call("editClient", this.ClientForm, function() {
Meteor.call("editClient", this.ClientForm, function(error, result) {
// me.dialog = false;
me.selectedItemInTable = [];
});
......
......@@ -141,6 +141,9 @@ import Devicemap from "../../imports/api/collections/devicemap.js";
import HisLink from "../../imports/api/collections/hislink.js";
import Client from "../../imports/api/collections/clients.js";
import { Meteor } from "meteor/meteor";
// import { log_init, logClient } from "../../imports/plugins/logger";
// log_init();
export default {
data() {
return {
......@@ -254,6 +257,12 @@ export default {
}
},
openNewDialog() {
// logClient(
// "debug",
// `openNewDialog() => newDialog `,
// this.DevicemapForm,
// Meteor.user().username
// );
for (let prop in this.DevicemapForm) {
this.$set(this.DevicemapForm, prop, "");
if (prop == "MaxLen") this.$set(this.DevicemapForm, prop, 0);
......
......@@ -3,7 +3,7 @@
<meta charset="utf-8">
<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">
<title>%title%</title>
<title>کارنامه</title>
</head>
<body>
......
......@@ -111,7 +111,11 @@ const messages = {
editBtn: "Edit",
clientSelectStatement: "please select one of Clients",
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: {
DeleteMessage: "Are You Sure?",
......@@ -295,7 +299,15 @@ const messages = {
editBtn: "ویرایش",
clientSelectStatement: "لطفا یکی از 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: {
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';
import '../imports/api/server/publications/translitdbuploads.js';
import '../imports/api/server/publications/transliterationdb.js';
import { log_init } from '../imports/plugins/logger';
import { Accounts } from "meteor/accounts-base";
......@@ -44,6 +46,7 @@ Meteor.startup(() => {
});
Meteor.users.deny({ update: () => true });
log_init();
console.log("app started");
});
......
{
"worklistUrl": "http://192.168.0.66:8086",
"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