command repository added and a lot of other changes
This commit is contained in:
139
.gitignore
vendored
139
.gitignore
vendored
@@ -1,21 +1,120 @@
|
|||||||
.DS_Store
|
app.db
|
||||||
node_modules
|
# Byte-compiled / optimized / DLL files
|
||||||
/dist
|
|
||||||
|
|
||||||
# local env files
|
|
||||||
.env.local
|
|
||||||
.env.*.local
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
__pycache__/
|
||||||
*.suo
|
node_modules/
|
||||||
*.ntvs*
|
frontend/node_modules/
|
||||||
*.njsproj
|
backend/uploads/*
|
||||||
*.sln
|
*.py[cod]
|
||||||
*.sw*
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
package-lock.json
|
||||||
|
|||||||
7173
package-lock.json
generated
7173
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ import GroupRepository from './groupRepository';
|
|||||||
import UserRepository from './userRepository';
|
import UserRepository from './userRepository';
|
||||||
import RoomRepository from './roomRepository';
|
import RoomRepository from './roomRepository';
|
||||||
import RecorderRepository from './recorderRepository';
|
import RecorderRepository from './recorderRepository';
|
||||||
|
import CommandRepository from './commandRepository';
|
||||||
|
|
||||||
|
|
||||||
export default function get(name: string) {
|
export default function get(name: string) {
|
||||||
@@ -20,6 +21,9 @@ export default function get(name: string) {
|
|||||||
case 'user': {
|
case 'user': {
|
||||||
return UserRepository;
|
return UserRepository;
|
||||||
}
|
}
|
||||||
|
case 'command': {
|
||||||
|
return CommandRepository;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
// statements;
|
// statements;
|
||||||
break;
|
break;
|
||||||
|
|||||||
30
src/api/commandRepository.ts
Normal file
30
src/api/commandRepository.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// groupRepository.ts
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
import Repository from './Repository';
|
||||||
|
|
||||||
|
const commandResource = '/command';
|
||||||
|
|
||||||
|
import {dictEmptyValToNull} from '@/utils';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getCommands() {
|
||||||
|
return Repository.get(`${commandResource}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCommand(commandId: number) {
|
||||||
|
return Repository.get(`${commandResource}/${commandId}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteCommand(commandId: number) {
|
||||||
|
return Repository.delete(`${commandResource}/${commandId}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
createCommand(commandData: any) {
|
||||||
|
return Repository.post(`${commandResource}`, dictEmptyValToNull(commandData));
|
||||||
|
},
|
||||||
|
|
||||||
|
updateCommand(commandId: number, commandData: any) {
|
||||||
|
return Repository.put(`${commandResource}/${commandId}`, dictEmptyValToNull(commandData));
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -12,157 +12,77 @@
|
|||||||
<b-tabs v-model="tabIndex" card>
|
<b-tabs v-model="tabIndex" card>
|
||||||
<b-tab title="Command list" active>
|
<b-tab title="Command list" active>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<font-awesome-icon icon="list"/> <font-awesome-icon icon="door-open"/>
|
<font-awesome-icon icon="list"/> <font-awesome-icon icon="cogs"/>
|
||||||
<strong>command</strong> <i>list</i>
|
<strong>command</strong> <i>list</i>
|
||||||
</template>
|
</template>
|
||||||
<p>{{ $t('There are')}} {{commands.length}} {{ $t('commands defined')}}:</p>
|
<p>{{ $t('There are')}} {{commands.length}} {{ $t('recorder commands defined')}}:</p>
|
||||||
<b-card-group deck>
|
<b-card-group deck>
|
||||||
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(command) in commands"
|
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(command) in commands"
|
||||||
:header="command.name + ' (' +command.number+ ')'" v-bind:key="command.id">
|
:header="command.name + ' (' +command.recorder_model.name+ ')'" v-bind:key="command.id">
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<h5 class="card-title">{{ $t('name') }}:
|
<h5 class="card-title">{{ $t('name') }}:
|
||||||
<span v-if="!formEditField[command.id+'_name']">{{command.name}}
|
<span>{{command.name}} </span>
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<p class="card-text">
|
||||||
|
<small><strong>{{ $t('alternative_name') }}:</strong>
|
||||||
|
<span v-if="!formEditField[command.id+'_alternative_name']">{{command.alternative_name}}
|
||||||
<a class="float-right badge badge-pill badge-primary">
|
<a class="float-right badge badge-pill badge-primary">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@click="initcommandUpdate(command, 'name')"
|
@click="initRecCommandUpdate(command, 'alternative_name')"
|
||||||
icon="pencil-alt"/>
|
icon="pencil-alt"/>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<b-input-group v-else>
|
<b-input-group v-else>
|
||||||
<b-form-input :id="command.id+'_name'" name="name"
|
<b-form-input :id="command.id+'_alternative_name'" name="alternative_name"
|
||||||
v-model="updateValues[command.id+'_name']"
|
v-model="updateValues[command.id+'_alternative_name']"
|
||||||
v-validate="'required|min:3'"
|
v-validate="'required|min:3'"
|
||||||
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
v-bind:class="{'is-danger': errors.has('alternative_name'), 'is-invalid': errors.has('alternative_name')}"
|
||||||
class="form-control" type="text"
|
class="form-control" type="text"
|
||||||
:placeholder="'Name ('+command.name +')'"
|
:placeholder="'Alternative name ('+command.alternative_name +')'"
|
||||||
required></b-form-input>
|
required></b-form-input>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-button :disabled="errors.has('name')"
|
<b-button :disabled="errors.has('alternative_name')"
|
||||||
@click="updatecommand(command.id, 'name')"
|
@click="updateRecCommand(command.id, 'alternative_name')"
|
||||||
variant="outline-success">
|
|
||||||
<font-awesome-icon icon="check"></font-awesome-icon>
|
|
||||||
</b-button>
|
|
||||||
</b-input-group-append>
|
|
||||||
</b-input-group>
|
|
||||||
</h5>
|
|
||||||
<p class="card-text"><strong>{{ $t('alternate_name') }}:</strong>
|
|
||||||
<span v-if="!formEditField[command.id+'_alternate_name']">{{command.alternate_name}}
|
|
||||||
<a class="float-right badge badge-pill badge-info">
|
|
||||||
<font-awesome-icon
|
|
||||||
@click="initcommandUpdate(command, 'alternate_name')"
|
|
||||||
icon="pencil-alt"/>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<b-input-group v-else size="sm">
|
|
||||||
<b-form-input name="alternate_name"
|
|
||||||
v-model="updateValues[command.id+'_alternate_name']"
|
|
||||||
class="form-control" type="text"
|
|
||||||
:placeholder="'Alternate name ('+command.alternate_name +')'"
|
|
||||||
@blur="updatecommand(command.id, 'alternate_name')"
|
|
||||||
@keyup.enter="updatecommand(command.id, 'alternate_name')"></b-form-input>
|
|
||||||
<b-input-group-append>
|
|
||||||
<b-button :disabled="errors.has('alternate_name')"
|
|
||||||
@click="updatecommand(command.id, 'alternate_name')"
|
|
||||||
variant="outline-success">
|
|
||||||
<font-awesome-icon icon="check"></font-awesome-icon>
|
|
||||||
</b-button>
|
|
||||||
</b-input-group-append>
|
|
||||||
</b-input-group>
|
|
||||||
</p>
|
|
||||||
<p class="card-text"><strong>{{ $t('command_number') }}:</strong>
|
|
||||||
<span v-if="!formEditField[command.id+'_number']">{{command.number}}
|
|
||||||
<a class="float-right badge badge-pill badge-info">
|
|
||||||
<font-awesome-icon
|
|
||||||
@click="initcommandUpdate(command, 'number')"
|
|
||||||
icon="pencil-alt"/>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<b-input-group v-else size="sm">
|
|
||||||
<b-form-input name="number"
|
|
||||||
v-model="updateValues[command.id+'_number']"
|
|
||||||
v-validate="'required|min:3'"
|
|
||||||
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
|
||||||
class="form-control" type="text"
|
|
||||||
:placeholder="'command number ('+command.number +')'"
|
|
||||||
@blur="updatecommand(command.id, 'number')"
|
|
||||||
@keyup.enter="updatecommand(command.id, 'number')"
|
|
||||||
required></b-form-input>
|
|
||||||
<b-input-group-append>
|
|
||||||
<b-button :disabled="errors.has('number')"
|
|
||||||
@click="updatecommand(command.id, 'number')"
|
|
||||||
variant="outline-success">
|
variant="outline-success">
|
||||||
<font-awesome-icon icon="check"></font-awesome-icon>
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
</b-button>
|
</b-button>
|
||||||
</b-input-group-append>
|
</b-input-group-append>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
|
</small>
|
||||||
</p>
|
</p>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small><strong>{{ $t('comment') }}:</strong>
|
<small><strong>{{ $t('description') }}:</strong>
|
||||||
<span v-if="!formEditField[command.id+'_comment']">{{command.comment}}
|
<span v-if="!formEditField[command.id+'_description']">{{command.description}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@click="initcommandUpdate(command, 'comment')"
|
@click="initRecCommandUpdate(command, 'description')"
|
||||||
icon="pencil-alt"/>
|
icon="pencil-alt"/>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<textarea class="textarea form-control" v-else name="comment"
|
<textarea class="textarea form-control" v-else name="comment"
|
||||||
v-model="updateValues[command.id+'_comment']"
|
v-model="updateValues[command.id+'_description']"
|
||||||
:placeholder="'Comment ('+command.comment +')'"
|
:placeholder="'Comment ('+command.description +')'"
|
||||||
@blur="updatecommand(command.id, 'comment')"></textarea>
|
@blur="updateRecCommand(command.id, 'description')"></textarea>
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<span v-if="!formEditField[command.id+'_recorder_id']">{{command.recorder_id}}
|
|
||||||
<div v-if="command.recorder">
|
<div v-if="command.recorder_model">
|
||||||
<p class="card-text"><strong>{{ $t('Recorder') }}:</strong> {{command.recorder.name}}
|
<p class="card-text"><strong>{{ $t('Recorder') }} {{ $t('model') }}:</strong> {{command.recorder_model.name}} </p>
|
||||||
({{command.recorder.ip}}) / ({{command.recorder.network_name}})</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p class="card-text"><strong>{{ $t('Recorder') }}:</strong> {{
|
<p class="card-text"><strong>{{ $t('Recorder') }}:</strong> {{
|
||||||
$t('no_recorder_defined')}}</p>
|
$t('no_recorder_model_defined')}}</p>
|
||||||
</div>
|
</div>
|
||||||
<a class="float-right badge badge-pill badge-info">
|
|
||||||
<font-awesome-icon
|
|
||||||
@click="initcommandUpdate(command, 'recorder_id')" icon="pencil-alt"/>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<b-form v-else>
|
|
||||||
<b-input-group>
|
|
||||||
<select class="form-control" v-model="updateValues[command.id+'_recorder_id']">
|
|
||||||
<option value="">No recorder selected</option>
|
|
||||||
<option v-for="recorder in recorders" v-bind:value="recorder.id">
|
|
||||||
{{ recorder.name }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<b-input-group-append>
|
|
||||||
<b-button :disabled="errors.has('recorder_id')"
|
|
||||||
@click="updatecommand(command.id, 'recorder_id')"
|
|
||||||
variant="outline-success">
|
|
||||||
<font-awesome-icon icon="check"></font-awesome-icon>
|
|
||||||
</b-button>
|
|
||||||
</b-input-group-append>
|
|
||||||
</b-input-group>
|
|
||||||
|
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="checkbox"
|
|
||||||
v-model="show_assigned_recorders" id="defaultCheck1">
|
|
||||||
<label class="form-check-label" for="defaultCheck1">
|
|
||||||
Show already assigned recorders
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</b-form>
|
|
||||||
|
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
<p>{{ $t('created')}}: {{command.created_at | moment("dddd, MMMM Do YYYY")}}
|
<p>{{ $t('created')}}: {{command.created_at | moment("dddd, MMMM Do YYYY")}}
|
||||||
<span class="pull-right">
|
|
||||||
<button type="button" v-on:click="deletecommand(command.id)"
|
|
||||||
class="btn btn-sm btn-danger">{{
|
|
||||||
$t('delete') }} <font-awesome-icon
|
|
||||||
icon="trash"/>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</p>
|
</p>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,8 +93,8 @@
|
|||||||
<b-tab title="Create command">
|
<b-tab title="Create command">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<font-awesome-icon icon="plus"/>
|
<font-awesome-icon icon="plus"/>
|
||||||
<i>{{$t('create')}}</i> <font-awesome-icon icon="door-open"/>
|
<i>{{$t('create')}}</i> <font-awesome-icon icon="cogs"/>
|
||||||
<strong>{{$t('command')}}</strong>
|
<strong>{{$t('virtual')}} {{$t('command')}}</strong>
|
||||||
</template>
|
</template>
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<p>{{ $t('Create a new command')}}:</p>
|
<p>{{ $t('Create a new command')}}:</p>
|
||||||
@@ -287,6 +207,7 @@
|
|||||||
import PulseLoader from 'vue-spinner/src/PulseLoader.vue';
|
import PulseLoader from 'vue-spinner/src/PulseLoader.vue';
|
||||||
import getRepository from '@/api/RepositoryFactory';
|
import getRepository from '@/api/RepositoryFactory';
|
||||||
|
|
||||||
|
const recorderRepository = getRepository('recorder');
|
||||||
const commandRepository = getRepository('command');
|
const commandRepository = getRepository('command');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -310,11 +231,11 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
savecommand() {
|
saveCommand() {
|
||||||
this.$parent.$data.isLoading = true;
|
this.$parent.$data.isLoading = true;
|
||||||
commandRepository.createcommand(this.form)
|
commandRepository.createCommand(this.form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('loadcommands')
|
this.$store.dispatch('loadCommands')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$parent.$data.isLoading = false;
|
this.$parent.$data.isLoading = false;
|
||||||
this.tabIndex = 0;
|
this.tabIndex = 0;
|
||||||
@@ -324,33 +245,50 @@
|
|||||||
this.$log.warn(msg);
|
this.$log.warn(msg);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initcommandUpdate(command, fieldName) {
|
initCommandUpdate(command, fieldName) {
|
||||||
this.$set(this.formEditField, command.id + '_' + fieldName, true);
|
this.$set(this.formEditField, command.id + '_' + fieldName, true);
|
||||||
this.$set(this.updateValues, command.id + '_' + fieldName, command[fieldName]);
|
this.$set(this.updateValues, command.id + '_' + fieldName, command[fieldName]);
|
||||||
},
|
},
|
||||||
updatecommand(id, fieldName) {
|
updateCommand(id, fieldName) {
|
||||||
this.$parent.$data.isLoading = true;
|
this.$parent.$data.isLoading = true;
|
||||||
const data = {};
|
const data = {};
|
||||||
data[fieldName] = this.updateValues[id + '_' + fieldName];
|
data[fieldName] = this.updateValues[id + '_' + fieldName];
|
||||||
commandRepository.updatecommand(id, data)
|
commandRepository.updateCommand(id, data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('loadcommands')
|
this.$store.dispatch('loadCommands')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$parent.$data.isLoading = false;
|
this.$parent.$data.isLoading = false;
|
||||||
this.formEditField[id + '_' + fieldName] = false;
|
this.formEditField[id + '_' + fieldName] = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deletecommand(id) {
|
deleteCommand(id) {
|
||||||
this.$parent.$data.isLoading = true;
|
this.$parent.$data.isLoading = true;
|
||||||
commandRepository.deletecommand(id)
|
commandRepository.deleteCommand(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('loadcommands')
|
this.$store.dispatch('loadCommands')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$parent.$data.isLoading = false;
|
this.$parent.$data.isLoading = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initRecCommandUpdate(command, fieldName) {
|
||||||
|
this.$set(this.formEditField, command.id + '_' + fieldName, true);
|
||||||
|
this.$set(this.updateValues, command.id + '_' + fieldName, command[fieldName]);
|
||||||
|
},
|
||||||
|
updateRecCommand(id, fieldName) {
|
||||||
|
this.$parent.$data.isLoading = true;
|
||||||
|
const data = {};
|
||||||
|
data[fieldName] = this.updateValues[id + '_' + fieldName];
|
||||||
|
recorderRepository.updateRecorderCommand(id, data)
|
||||||
|
.then(() => {
|
||||||
|
this.$store.dispatch('loadRecorderCommands')
|
||||||
|
.then(() => {
|
||||||
|
this.$parent.$data.isLoading = false;
|
||||||
|
this.formEditField[id + '_' + fieldName] = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
showErrorMessage(msg) {
|
showErrorMessage(msg) {
|
||||||
this.$parent.$data.isLoading = false;
|
this.$parent.$data.isLoading = false;
|
||||||
this.$parent.$data.showAlert = true;
|
this.$parent.$data.showAlert = true;
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<p>{{ $t('There are')}} {{recorders.length}} {{ $t('recorders defined')}}:</p>
|
<p>{{ $t('There are')}} {{recorders.length}} {{ $t('recorders defined')}}:</p>
|
||||||
<b-card-group deck>
|
<b-card-group deck>
|
||||||
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(recorder) in recorders"
|
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;"
|
||||||
|
v-for="(recorder) in recorders"
|
||||||
:header="recorder.name + ' (' + recorder.ip + ' / ' + recorder.network_name + ')'"
|
:header="recorder.name + ' (' + recorder.ip + ' / ' + recorder.network_name + ')'"
|
||||||
v-bind:key="recorder.id">
|
v-bind:key="recorder.id">
|
||||||
{{recorder}}
|
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<h5 class="card-title">{{ $t('name') }}:
|
<h5 class="card-title"><strong>{{ $t('name') }}: </strong>
|
||||||
<span v-if="!formEditField[recorder.id+'_name']">{{recorder.name}}
|
<span v-if="!formEditField[recorder.id+'_name']">{{recorder.name}}
|
||||||
<a class="float-right badge badge-pill badge-primary">
|
<a class="float-right badge badge-pill badge-primary">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@@ -39,6 +39,8 @@
|
|||||||
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
||||||
class="form-control" type="text"
|
class="form-control" type="text"
|
||||||
:placeholder="'Name ('+recorder.name +')'"
|
:placeholder="'Name ('+recorder.name +')'"
|
||||||
|
@blur="updateRecorder(recorder.id, 'name')"
|
||||||
|
@keyup.enter="updateRecorder(recorder.id, 'name')"
|
||||||
required></b-form-input>
|
required></b-form-input>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-button :disabled="errors.has('name')"
|
<b-button :disabled="errors.has('name')"
|
||||||
@@ -49,6 +51,7 @@
|
|||||||
</b-input-group-append>
|
</b-input-group-append>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
</h5>
|
</h5>
|
||||||
|
<hr/>
|
||||||
<p class="card-text"><strong>{{ $t('network_name') }}:</strong>
|
<p class="card-text"><strong>{{ $t('network_name') }}:</strong>
|
||||||
<span v-if="!formEditField[recorder.id+'_network_name']">{{recorder.network_name}}
|
<span v-if="!formEditField[recorder.id+'_network_name']">{{recorder.network_name}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
@@ -59,10 +62,12 @@
|
|||||||
</span>
|
</span>
|
||||||
<b-input-group v-else size="sm">
|
<b-input-group v-else size="sm">
|
||||||
<b-form-input name="network_name"
|
<b-form-input name="network_name"
|
||||||
|
style="min-width: 80%;"
|
||||||
v-model="updateValues[recorder.id+'_network_name']"
|
v-model="updateValues[recorder.id+'_network_name']"
|
||||||
|
v-validate="'required|ip_or_fqdn'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('network_name'), 'is-invalid': errors.has('network_name')}"
|
||||||
class="form-control" type="text"
|
class="form-control" type="text"
|
||||||
:placeholder="'Network name ('+recorder.network_name +')'"
|
:placeholder="'Network name ('+recorder.network_name +')'"
|
||||||
@blur="updateRecorder(recorder.id, 'network_name')"
|
|
||||||
@keyup.enter="updateRecorder(recorder.id, 'network_name')"></b-form-input>
|
@keyup.enter="updateRecorder(recorder.id, 'network_name')"></b-form-input>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
<b-button :disabled="errors.has('network_name')"
|
<b-button :disabled="errors.has('network_name')"
|
||||||
@@ -71,8 +76,10 @@
|
|||||||
<font-awesome-icon icon="check"></font-awesome-icon>
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
</b-button>
|
</b-button>
|
||||||
</b-input-group-append>
|
</b-input-group-append>
|
||||||
|
<span>{{ errors.first('network_name') }}</span>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="card-text"><strong>{{ $t('ip') }}:</strong>
|
<p class="card-text"><strong>{{ $t('ip') }}:</strong>
|
||||||
<span v-if="!formEditField[recorder.id+'_ip']">{{recorder.ip}}
|
<span v-if="!formEditField[recorder.id+'_ip']">{{recorder.ip}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
@@ -84,11 +91,10 @@
|
|||||||
<b-input-group v-else size="sm">
|
<b-input-group v-else size="sm">
|
||||||
<b-form-input name="ip"
|
<b-form-input name="ip"
|
||||||
v-model="updateValues[recorder.id+'_ip']"
|
v-model="updateValues[recorder.id+'_ip']"
|
||||||
v-validate="'required|min:3'"
|
v-validate="'ip'"
|
||||||
v-bind:class="{'is-danger': errors.has('ip'), 'is-invalid': errors.has('ip')}"
|
v-bind:class="{'is-danger': errors.has('ip'), 'is-invalid': errors.has('ip')}"
|
||||||
class="form-control" type="text"
|
class="form-control" type="text"
|
||||||
:placeholder="'Room number ('+recorder.ip +')'"
|
:placeholder="$t('ip address') +' ('+recorder.ip +')'"
|
||||||
@blur="updateRecorder(recorder.id, 'ip')"
|
|
||||||
@keyup.enter="updateRecorder(recorder.id, 'ip')"
|
@keyup.enter="updateRecorder(recorder.id, 'ip')"
|
||||||
required></b-form-input>
|
required></b-form-input>
|
||||||
<b-input-group-append>
|
<b-input-group-append>
|
||||||
@@ -99,22 +105,115 @@
|
|||||||
</b-button>
|
</b-button>
|
||||||
</b-input-group-append>
|
</b-input-group-append>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
|
<span>{{ errors.first('ip') }}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="card-text"><strong>{{ $t('ip v6') }}:</strong>
|
||||||
|
<span v-if="!formEditField[recorder.id+'_ip6']">{{recorder.ip6}}
|
||||||
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'ip6')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<b-input-group v-else size="sm">
|
||||||
|
<b-form-input name="ip6"
|
||||||
|
v-model="updateValues[recorder.id+'_ip6']"
|
||||||
|
v-validate="'ip:6'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('ip6'), 'is-invalid': errors.has('ip6')}"
|
||||||
|
class="form-control" type="text"
|
||||||
|
:placeholder="$t('ip v6 address') +' ('+recorder.ip6 +')'"
|
||||||
|
@keyup.enter="updateRecorder(recorder.id, 'ip6')"
|
||||||
|
required></b-form-input>
|
||||||
|
<b-input-group-append>
|
||||||
|
<b-button :disabled="errors.has('ip6')"
|
||||||
|
@click="updateRecorder(recorder.id, 'ip6')"
|
||||||
|
variant="outline-success">
|
||||||
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
|
</b-button>
|
||||||
|
</b-input-group-append>
|
||||||
|
</b-input-group>
|
||||||
|
<span>{{ errors.first('ip6') }}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="card-text"><strong>{{ $t('ssh_port') }}:</strong>
|
||||||
|
<span v-if="!formEditField[recorder.id+'_ssh_port']">{{recorder.ssh_port}}
|
||||||
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'ssh_port')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<b-input-group v-else size="sm">
|
||||||
|
<b-form-input name="ssh_port"
|
||||||
|
v-model="updateValues[recorder.id+'_ssh_port']"
|
||||||
|
v-validate="'required|between:0,65535'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('ssh_port'), 'is-invalid': errors.has('ssh_port')}"
|
||||||
|
class="form-control" type="text"
|
||||||
|
:placeholder="'Room number ('+recorder.ssh_port +')'"
|
||||||
|
@blur="updateRecorder(recorder.id, 'ssh_port')"
|
||||||
|
@keyup.enter="updateRecorder(recorder.id, 'ssh_port')"
|
||||||
|
required></b-form-input>
|
||||||
|
<b-input-group-append>
|
||||||
|
<b-button :disabled="errors.has('ssh_port')"
|
||||||
|
@click="updateRecorder(recorder.id, 'ssh_port')"
|
||||||
|
variant="outline-success">
|
||||||
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
|
</b-button>
|
||||||
|
</b-input-group-append>
|
||||||
|
</b-input-group>
|
||||||
|
<span>{{ errors.first('ssh_port') }}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="card-text"><strong>{{ $t('telnet_port') }}:</strong>
|
||||||
|
<span v-if="!formEditField[recorder.id+'_telnet_port']">{{recorder.telnet_port}}
|
||||||
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'telnet_port')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<b-input-group v-else size="sm">
|
||||||
|
<b-form-input name="telnet_port"
|
||||||
|
v-model="updateValues[recorder.id+'_telnet_port']"
|
||||||
|
v-validate="'required|between:0,65535'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('telnet_port'), 'is-invalid': errors.has('telnet_port')}"
|
||||||
|
class="form-control" type="text"
|
||||||
|
:placeholder="'Room number ('+recorder.telnet_port +')'"
|
||||||
|
@blur="updateRecorder(recorder.id, 'telnet_port')"
|
||||||
|
@keyup.enter="updateRecorder(recorder.id, 'telnet_port')"
|
||||||
|
required></b-form-input>
|
||||||
|
<b-input-group-append>
|
||||||
|
<b-button :disabled="errors.has('telnet_port')"
|
||||||
|
@click="updateRecorder(recorder.id, 'telnet_port')"
|
||||||
|
variant="outline-success">
|
||||||
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
|
</b-button>
|
||||||
|
</b-input-group-append>
|
||||||
|
</b-input-group>
|
||||||
|
<span>{{ errors.first('telnet_port') }}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<div v-if="recorder.room">
|
<div v-if="recorder.room && !formEditField[recorder.id+'_room_id']">
|
||||||
<p class="card-text"><strong>{{ $t('Room') }}:</strong> {{recorder.room.name}}
|
<p class="card-text"><strong>{{ $t('Room') }}:</strong> {{recorder.room.name}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
<font-awesome-icon icon="pencil-alt"/>
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'room_id')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
</a></p>
|
</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p class="card-text"><strong>{{ $t('Room') }}:</strong> {{
|
<p class="card-text"><strong>{{ $t('Room') }}:</strong>
|
||||||
$t('no_room_defined')}}</p>
|
<span v-if="recorder.room && recorder.room.name">{{recorder.room.name}}</span>
|
||||||
|
<span v-else>{{$t('no_room_defined')}}</span>
|
||||||
|
</p>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" v-model="form.room">
|
<select class="form-control"
|
||||||
<option value="">No recorder selected</option>
|
v-model="updateValues[recorder.id+'_room_id']"
|
||||||
|
@change="updateRecorder(recorder.id, 'room_id')">
|
||||||
|
<option value="">{{$t('No room selected')}}</option>
|
||||||
<option v-for="room in rooms" v-bind:value="room.id">
|
<option v-for="room in rooms" v-bind:value="room.id">
|
||||||
{{ room.name }}
|
{{ room.name }}
|
||||||
</option>
|
</option>
|
||||||
@@ -131,6 +230,44 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<b-form-group label-cols-sm="4"
|
||||||
|
label-cols-lg="3"
|
||||||
|
description="Set to offline / maintenance mode."
|
||||||
|
label-for="offline"
|
||||||
|
:label="$t('offline')">
|
||||||
|
<b-form-checkbox id="offline"
|
||||||
|
v-model="form.offline" name="check-button" switch>
|
||||||
|
<b>({{$t('Offline')}}: {{ form.offline }})</b>
|
||||||
|
</b-form-checkbox>
|
||||||
|
</b-form-group>
|
||||||
|
|
||||||
|
<b-form-group label-cols-sm="4"
|
||||||
|
label-cols-lg="3"
|
||||||
|
description="Lock recorder: No changes can be made."
|
||||||
|
label-for="locked"
|
||||||
|
:label="$t('locked')">
|
||||||
|
<b-form-checkbox id="locked"
|
||||||
|
v-model="recorder.locked" name="check-button" switch
|
||||||
|
@change="()=>{initRecorderUpdate(recorder, 'locked'); updateRecorder(recorder.id, 'locked')}">
|
||||||
|
<b>({{$t('Locked')}}: {{ form.locked }})</b>
|
||||||
|
</b-form-checkbox>
|
||||||
|
</b-form-group>
|
||||||
|
|
||||||
|
<strong>{{ $t('lock_message') }}:</strong>
|
||||||
|
<span v-if="!formEditField[recorder.id+'_lock_message']">{{recorder.lock_message}}
|
||||||
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'lock_message')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<textarea class="textarea form-control" v-else name="lock_message"
|
||||||
|
v-model="updateValues[recorder.id+'_lock_message']"
|
||||||
|
:placeholder="$t('lock_message') +' ('+recorder.lock_message +')'"
|
||||||
|
@blur="updateRecorder(recorder.id, 'lock_message')"></textarea>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
<div v-if="recorder.recorder_model">
|
<div v-if="recorder.recorder_model">
|
||||||
<p class="card-text"><strong>{{ $t('Model') }}:</strong> {{recorder.recorder_model.name}}
|
<p class="card-text"><strong>{{ $t('Model') }}:</strong> {{recorder.recorder_model.name}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
@@ -143,7 +280,7 @@
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select class="form-control" v-model="form.recorder_model">
|
<select class="form-control" v-model="form.recorder_model">
|
||||||
<option value="">No recorder selected</option>
|
<option value="">{{$t('No model selected')}}</option>
|
||||||
<option v-for="recorderModel in recorderModels"
|
<option v-for="recorderModel in recorderModels"
|
||||||
v-bind:value="recorderModel.id">
|
v-bind:value="recorderModel.id">
|
||||||
{{ recorderModel.name }}
|
{{ recorderModel.name }}
|
||||||
@@ -153,10 +290,41 @@
|
|||||||
<label class="label col-sm-4 col-form-label">{{ $t('model') }}</label>
|
<label class="label col-sm-4 col-form-label">{{ $t('model') }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<strong>{{ $t('description') }}:</strong>
|
||||||
|
<span v-if="!formEditField[recorder.id+'_description']">{{recorder.description}}
|
||||||
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRecorderUpdate(recorder, 'description')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<textarea class="textarea form-control" v-else name="description"
|
||||||
|
v-model="updateValues[recorder.id+'_description']"
|
||||||
|
:placeholder="$t('description') +' ('+recorder.description +')'"
|
||||||
|
@blur="updateRecorder(recorder.id, 'description')"></textarea>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<strong>{{ $t('Virtual commands') }}:</strong>
|
||||||
|
|
||||||
|
<b-list-group v-if="recorder.virtual_commands.length"
|
||||||
|
style="max-height: 400px; overflow-y:scroll;">
|
||||||
|
<b-list-group-item v-for="command in recorder.virtual_commands">
|
||||||
|
{{command.name}}
|
||||||
|
</b-list-group-item>
|
||||||
|
|
||||||
|
</b-list-group>
|
||||||
|
<span>
|
||||||
|
{{$t('No virtual commands defined yet.')}}
|
||||||
|
</span>
|
||||||
|
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
<p>{{ $t('created')}}: {{recorder.created_at | moment("dddd, MMMM Do YYYY")}}
|
<p>{{ $t('created')}}: {{recorder.created_at | moment("dddd, MMMM Do YYYY")}}<br/>
|
||||||
|
{{ $t('last_time_modified')}}: {{recorder.last_time_modified | moment("dddd, MMMM Do YYYY")}}<br/>
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<button type="button" v-on:click="deleteRecorder(recorder.id)"
|
<button type="button" v-on:click="deleteRecorder(recorder.id)"
|
||||||
class="btn btn-sm btn-danger">{{
|
class="btn btn-sm btn-danger">{{
|
||||||
@@ -189,7 +357,8 @@
|
|||||||
v-model="form.name"
|
v-model="form.name"
|
||||||
v-validate="'required|min:3'"
|
v-validate="'required|min:3'"
|
||||||
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
v-bind:class="{'is-danger': errors.has('name'), 'is-invalid': errors.has('name')}"
|
||||||
class="form-control" type="text" placeholder="Recorder name" required>
|
class="form-control" type="text" placeholder="Recorder name"
|
||||||
|
required>
|
||||||
</div>
|
</div>
|
||||||
<p class="col-sm-4" v-show="errors.has('name')">
|
<p class="col-sm-4" v-show="errors.has('name')">
|
||||||
{{ errors.first('name') }}
|
{{ errors.first('name') }}
|
||||||
@@ -207,41 +376,77 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="label col-sm-2 col-form-label">{{ $t('network_name') }}</label>
|
<label class="label required col-sm-2 col-form-label">{{ $t('network_name') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="description"
|
<input name="network_name"
|
||||||
v-model="form.network_name"
|
v-model="form.network_name"
|
||||||
class="form-control" type="text" :placeholder="$t('network_name')">
|
v-validate="'required|ip_or_fqdn'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('network_name'), 'is-invalid': errors.has('network_name')}"
|
||||||
|
class="form-control" type="text" :placeholder="$t('network_name')"
|
||||||
|
required
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="col-sm-4" v-show="errors.has('network_name')">
|
||||||
|
{{ errors.first('network_name') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="label col-sm-2 col-form-label">{{ $t('ip') }}</label>
|
<label class="label col-sm-2 col-form-label">{{ $t('ip') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="number"
|
<input name="ip"
|
||||||
|
v-validate="'ip'"
|
||||||
v-model="form.ip"
|
v-model="form.ip"
|
||||||
|
v-bind:class="{'is-danger': errors.has('ip'), 'is-invalid': errors.has('ip')}"
|
||||||
class="form-control" type="text" placeholder="Recorder IP">
|
class="form-control" type="text" placeholder="Recorder IP">
|
||||||
</div>
|
</div>
|
||||||
|
<p class="col-sm-4" v-show="errors.has('ip')">
|
||||||
|
{{ errors.first('ip') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="label col-sm-2 col-form-label">{{ $t('ip v6') }}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="ip6"
|
||||||
|
v-validate="'ip:6'"
|
||||||
|
v-model="form.ip6"
|
||||||
|
v-bind:class="{'is-danger': errors.has('ip6'), 'is-invalid': errors.has('ip6')}"
|
||||||
|
class="form-control" type="text" placeholder="Recorder IPv6">
|
||||||
|
</div>
|
||||||
|
<p class="col-sm-4" v-show="errors.has('ip6')">
|
||||||
|
{{ errors.first('ip6') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="label col-sm-2 col-form-label">{{ $t('telnet_port') }}</label>
|
<label class="label col-sm-2 col-form-label">{{ $t('telnet_port') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="number"
|
<input name="telnet_port"
|
||||||
v-model="form.telnet_port"
|
v-model="form.telnet_port"
|
||||||
|
v-validate="'required|between:0,65535'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('telnet_port'), 'is-invalid': errors.has('telnet_port')}"
|
||||||
class="form-control" type="number" value="22"
|
class="form-control" type="number" value="22"
|
||||||
placeholder="Telnet Port (23)">
|
placeholder="Telnet Port (23)">
|
||||||
</div>
|
</div>
|
||||||
|
<p class="col-sm-4" v-show="errors.has('telnet_port')">
|
||||||
|
{{ errors.first('telnet_port') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="label col-sm-2 col-form-label">{{ $t('ssh_port') }}</label>
|
<label class="label col-sm-2 col-form-label">{{ $t('ssh_port') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="number"
|
<input name="ssh_port"
|
||||||
v-model="form.ssh_port"
|
v-model="form.ssh_port"
|
||||||
|
v-validate="'required|between:0,65535'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('ssh_port'), 'is-invalid': errors.has('ssh_port')}"
|
||||||
class="form-control" type="number" value="23"
|
class="form-control" type="number" value="23"
|
||||||
placeholder="SSH Port (22)">
|
placeholder="SSH Port (22)">
|
||||||
</div>
|
</div>
|
||||||
|
<p class="col-sm-4" v-show="errors.has('ssh_port')">
|
||||||
|
{{ errors.first('ssh_port') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
@@ -269,6 +474,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="label col-sm-2 col-form-label">{{ $t('username') }}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="username"
|
||||||
|
v-model="form.username"
|
||||||
|
v-bind:class="{'is-danger': errors.has('username'), 'is-invalid': errors.has('username')}"
|
||||||
|
class="form-control" type="text" :placeholder="$t('username')"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<p class="col-sm-4">
|
||||||
|
{{ $t('username') }} {{$t('may be left blank (-> recorder model)')}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="label col-sm-2 col-form-label">{{ $t('password') }}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="password"
|
||||||
|
v-model="form.password"
|
||||||
|
v-bind:class="{'is-danger': errors.has('password'), 'is-invalid': errors.has('password')}"
|
||||||
|
class="form-control" type="text" :placeholder="$t('password')"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<p class="col-sm-4">
|
||||||
|
{{ $t('password') }} {{$t('may be left blank (-> recorder model)')}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="field is-grouped">
|
<div class="field is-grouped">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
@@ -292,7 +525,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<p>{{ $t('There are')}} {{recorderModels.length}} {{ $t('recorder models defined')}}:</p>
|
<p>{{ $t('There are')}} {{recorderModels.length}} {{ $t('recorder models defined')}}:</p>
|
||||||
<b-card-group deck>
|
<b-card-group deck>
|
||||||
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(recorderModel) in recorderModels"
|
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;"
|
||||||
|
v-for="(recorderModel) in recorderModels"
|
||||||
:header="recorderModel.name"
|
:header="recorderModel.name"
|
||||||
v-bind:key="recorderModel.id">
|
v-bind:key="recorderModel.id">
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
@@ -312,13 +546,23 @@
|
|||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p class="card-text">
|
||||||
|
<strong>{{ $t('requires_username') }}:</strong> <span
|
||||||
|
v-if="recorderModel.requires_username">{{$t('yes')}}</span><span v-else>{{$t('no')}}</span>
|
||||||
|
</p>
|
||||||
|
<p class="card-text">
|
||||||
|
<strong>{{ $t('requires_password') }}:</strong> <span
|
||||||
|
v-if="recorderModel.requires_password">{{$t('yes')}}</span><span v-else>{{$t('no')}}</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<b-list-group style="max-height: 200px; overflow-y:scroll;">
|
<b-list-group style="max-height: 400px; overflow-y:scroll;">
|
||||||
<strong>Recorder Model {{ $t('Commands') }}:</strong>
|
<strong>Recorder Model {{ $t('Commands') }}:</strong>
|
||||||
<b-list-group-item v-for="command in recorderModel.commands">
|
<b-list-group-item v-for="command in recorderModel.commands">
|
||||||
{{command.name}}
|
{{command.name}}
|
||||||
<b-badge v-for="(a_type, arg) in command.parameters" v-if="command.parameters !== null" style="margin-right: 10px;">
|
<b-badge v-for="(a_type, arg) in command.parameters"
|
||||||
|
v-if="command.parameters !== null" style="margin-right: 10px;">
|
||||||
<small>{{arg}}: {{a_type}}</small>
|
<small>{{arg}}: {{a_type}}</small>
|
||||||
</b-badge>
|
</b-badge>
|
||||||
|
|
||||||
@@ -366,7 +610,7 @@
|
|||||||
import PulseLoader from 'vue-spinner/src/PulseLoader.vue';
|
import PulseLoader from 'vue-spinner/src/PulseLoader.vue';
|
||||||
import getRepository from '@/api/RepositoryFactory';
|
import getRepository from '@/api/RepositoryFactory';
|
||||||
|
|
||||||
const RecorderRepository = getRepository('recorder');
|
const recorderRepository = getRepository('recorder');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -383,19 +627,45 @@
|
|||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
network_name: '',
|
||||||
ip: '',
|
ip: '',
|
||||||
|
ip6: '',
|
||||||
telnet_port: 23,
|
telnet_port: 23,
|
||||||
ssh_port: 22,
|
ssh_port: 22,
|
||||||
network_name: '',
|
locked: false,
|
||||||
|
offline: false,
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
recorder_model: null,
|
recorder_model: null,
|
||||||
room: null,
|
room: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initRecorderUpdate(recorder, fieldName) {
|
||||||
|
this.$log.debug(recorder);
|
||||||
|
this.$log.debug(recorder[fieldName]); // THIS SHOULD BE TRUE, NOT FALSE!! grml
|
||||||
|
this.$set(this.formEditField, recorder.id + '_' + fieldName, true);
|
||||||
|
this.$set(this.updateValues, recorder.id + '_' + fieldName, recorder[fieldName]);
|
||||||
|
this.$log.debug(this.updateValues);
|
||||||
|
},
|
||||||
|
updateRecorder(id, fieldName) {
|
||||||
|
this.$parent.$data.isLoading = true;
|
||||||
|
const data = {};
|
||||||
|
this.$log.debug(this.updateValues);
|
||||||
|
data[fieldName] = this.updateValues[id + '_' + fieldName];
|
||||||
|
recorderRepository.updateRecorder(id, data)
|
||||||
|
.then(() => {
|
||||||
|
this.$store.dispatch('loadRecorders')
|
||||||
|
.then(() => {
|
||||||
|
this.$parent.$data.isLoading = false;
|
||||||
|
this.formEditField[id + '_' + fieldName] = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
saveRecorder() {
|
saveRecorder() {
|
||||||
this.$parent.$data.isLoading = true;
|
this.$parent.$data.isLoading = true;
|
||||||
RecorderRepository.createRecorder(this.form)
|
recorderRepository.createRecorder(this.form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('loadRecorders')
|
this.$store.dispatch('loadRecorders')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -409,7 +679,7 @@
|
|||||||
},
|
},
|
||||||
deleteRecorder(id) {
|
deleteRecorder(id) {
|
||||||
this.$parent.$data.isLoading = true;
|
this.$parent.$data.isLoading = true;
|
||||||
RecorderRepository.deleteRecorder(id)
|
recorderRepository.deleteRecorder(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('loadRecorders')
|
this.$store.dispatch('loadRecorders')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -464,4 +734,8 @@
|
|||||||
.required:after {
|
.required:after {
|
||||||
content: " *";
|
content: " *";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b-form-input {
|
||||||
|
min-width: 80%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
<p>{{ $t('There are')}} {{rooms.length}} {{ $t('rooms defined')}}:</p>
|
<p>{{ $t('There are')}} {{rooms.length}} {{ $t('rooms defined')}}:</p>
|
||||||
<b-card-group deck>
|
<b-card-group deck>
|
||||||
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(room) in rooms"
|
<b-card class="mb-2" style="max-width: 30rem; min-width:20rem;" v-for="(room) in rooms"
|
||||||
:header="room.name + ' (' +room.number+ ')'" v-bind:key="room.id">
|
:header="room.name + ' (' +room.building_number+ ')'" v-bind:key="room.id">
|
||||||
<b-card-text>
|
<b-card-text>
|
||||||
<h5 class="card-title">{{ $t('name') }}:
|
<h5 class="card-title"><strong>{{ $t('name') }}</strong>:
|
||||||
<span v-if="!formEditField[room.id+'_name']">{{room.name}}
|
<span v-if="!formEditField[room.id+'_name']">{{room.name}}
|
||||||
<a class="float-right badge badge-pill badge-primary">
|
<a class="float-right badge badge-pill badge-primary">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
@@ -45,6 +45,60 @@
|
|||||||
</b-input-group-append>
|
</b-input-group-append>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
|
|
||||||
|
<p class="card-text"><strong>{{ $t('building_number') }}</strong>:
|
||||||
|
<span v-if="!formEditField[room.id+'_building_number']">{{room.building_number}}
|
||||||
|
<a class="float-right badge badge-pill badge-primary">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRoomUpdate(room, 'building_number')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<b-input-group v-else>
|
||||||
|
<b-form-input :id="room.id+'_building_number'" name="building_number"
|
||||||
|
v-model="updateValues[room.id+'_building_number']"
|
||||||
|
v-validate="'required|min:3'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('building_number'), 'is-invalid': errors.has('building_number')}"
|
||||||
|
class="form-control" type="text"
|
||||||
|
:placeholder="'Building number ('+room.building_number +')'"
|
||||||
|
required></b-form-input>
|
||||||
|
<b-input-group-append>
|
||||||
|
<b-button :disabled="errors.has('building_number')"
|
||||||
|
@click="updateRoom(room.id, 'building_number')"
|
||||||
|
variant="outline-success">
|
||||||
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
|
</b-button>
|
||||||
|
</b-input-group-append>
|
||||||
|
</b-input-group>
|
||||||
|
</p>
|
||||||
|
<p class="card-text"><strong>{{ $t('building_name') }}</strong>:
|
||||||
|
<span v-if="!formEditField[room.id+'_building_name']">{{room.building_name}}
|
||||||
|
<a class="float-right badge badge-pill badge-primary">
|
||||||
|
<font-awesome-icon
|
||||||
|
@click="initRoomUpdate(room, 'building_name')"
|
||||||
|
icon="pencil-alt"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<b-input-group v-else>
|
||||||
|
<b-form-input :id="room.id+'_building_name'" name="building_name"
|
||||||
|
v-model="updateValues[room.id+'_building_name']"
|
||||||
|
v-validate="'required|min:3'"
|
||||||
|
v-bind:class="{'is-danger': errors.has('building_name'), 'is-invalid': errors.has('building_name')}"
|
||||||
|
class="form-control" type="text"
|
||||||
|
:placeholder="'Building name ('+room.building_name +')'"
|
||||||
|
required></b-form-input>
|
||||||
|
<b-input-group-append>
|
||||||
|
<b-button :disabled="errors.has('building_name')"
|
||||||
|
@click="updateRoom(room.id, 'building_name')"
|
||||||
|
variant="outline-success">
|
||||||
|
<font-awesome-icon icon="check"></font-awesome-icon>
|
||||||
|
</b-button>
|
||||||
|
</b-input-group-append>
|
||||||
|
</b-input-group>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<p class="card-text"><strong>{{ $t('alternate_name') }}:</strong>
|
<p class="card-text"><strong>{{ $t('alternate_name') }}:</strong>
|
||||||
<span v-if="!formEditField[room.id+'_alternate_name']">{{room.alternate_name}}
|
<span v-if="!formEditField[room.id+'_alternate_name']">{{room.alternate_name}}
|
||||||
<a class="float-right badge badge-pill badge-info">
|
<a class="float-right badge badge-pill badge-info">
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
faList,
|
faList,
|
||||||
faTrash,
|
faTrash,
|
||||||
faPencilAlt,
|
faPencilAlt,
|
||||||
|
faCogs,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome';
|
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome';
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ import 'bootstrap-vue/dist/bootstrap-vue.css';
|
|||||||
|
|
||||||
const isProduction = process.env.NODE_ENV === 'production';
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
library.add(faCoffee, faTrash, faPencilAlt, faScroll, faCheck, faCircle, faList, faPlus, faDoorOpen);
|
library.add(faCoffee, faTrash, faPencilAlt, faScroll, faCheck, faCircle, faList, faPlus, faDoorOpen, faCogs);
|
||||||
|
|
||||||
Vue.component('font-awesome-icon', FontAwesomeIcon);
|
Vue.component('font-awesome-icon', FontAwesomeIcon);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ const messages = {
|
|||||||
plugins: 'Installed CLI Plugins',
|
plugins: 'Installed CLI Plugins',
|
||||||
links: 'Essential Links',
|
links: 'Essential Links',
|
||||||
ecosystem: 'Ecosystem',
|
ecosystem: 'Ecosystem',
|
||||||
|
building_number: 'Building #',
|
||||||
|
building_name: 'Building'
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
welcomeMsg: 'Bienvenido a tu aplicación Vue.js + TypeScript',
|
welcomeMsg: 'Bienvenido a tu aplicación Vue.js + TypeScript',
|
||||||
|
|||||||
Reference in New Issue
Block a user