LT-67: Migrating DIMSE inputs to components
This commit is contained in:
1 parent
c3d7c2af09
commit
e5eb98cbc0
6 files changed
+54
-41
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
Template.serverInformationDicomWeb.onRendered(function() {
|
||||
var instance = Template.instance();
|
||||
Template.serverInformationDicomWeb.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
instance.autorun(function() {
|
||||
const mode = instance.data.mode.get();
|
||||
if (mode === 'edit') {
|
||||
|
||||
+18
-16
@@ -5,39 +5,41 @@
|
||||
<button class="btn btn-primary pull-right js-new-peer">New peer</button>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
{{#group class='row' key='peers' arrayValues=true}}
|
||||
{{#each peer in instance.peers.get}}
|
||||
<div class="col-lg-6">
|
||||
{{#group class='col-lg-6'}}
|
||||
<div class="panel panel-default panel-body">
|
||||
<div class="row">
|
||||
{{>serverInformationFormField name=(concat "peers[]." @index ".aeTitle") label="AE title"}}
|
||||
{{>serverInformationFormField name=(concat "peers[]." @index ".hostAE") label="AE host"}}
|
||||
{{>serverInformationFormField name=(concat "peers[]." @index ".host") label="Host"}}
|
||||
{{>serverInformationFormField name=(concat "peers[]." @index ".port") label="Port"}}
|
||||
<div class="col-lg-6">
|
||||
{{>inputText class='form-control' key='aeTitle'}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{>inputText class='form-control' key='hostAE'}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{>inputText class='form-control' key='host'}}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{>inputText class='form-control' key='port'}}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<strong>Settings</strong>
|
||||
<div class="form-group">
|
||||
<div class="form-control clearfix">
|
||||
<div class="checkbox pull-left">
|
||||
<label>
|
||||
<input type="checkbox" name="peers[].{{@index}}.default">
|
||||
<span>Default</span>
|
||||
</label>
|
||||
{{>inputCheckbox key='default'}}
|
||||
</div>
|
||||
<div class="checkbox pull-left">
|
||||
<label>
|
||||
<input type="checkbox" name="peers[].{{@index}}.server">
|
||||
<span>Server</span>
|
||||
</label>
|
||||
{{>inputCheckbox key='server'}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/group}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/group}}
|
||||
</div>
|
||||
<hr>
|
||||
</template>
|
||||
+12
-12
@@ -1,29 +1,29 @@
|
||||
Template.serverInformationDimse.onCreated(function() {
|
||||
var instance = Template.instance();
|
||||
Template.serverInformationDimse.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
instance.peers = new ReactiveVar([]);
|
||||
instance.autorun(function() {
|
||||
var currentItem = instance.data.currentItem.get();
|
||||
instance.autorun(() => {
|
||||
const currentItem = instance.data.currentItem.get();
|
||||
if (currentItem) {
|
||||
instance.peers.set(currentItem.peers || []);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.serverInformationDimse.onRendered(function() {
|
||||
var instance = Template.instance();
|
||||
instance.autorun(function() {
|
||||
var mode = instance.data.mode.get();
|
||||
Template.serverInformationDimse.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
instance.autorun(() => {
|
||||
const mode = instance.data.mode.get();
|
||||
if (mode === 'edit') {
|
||||
var data = instance.data.currentItem.get();
|
||||
FormUtils.setFormData(instance.data.$form, data);
|
||||
const data = instance.data.currentItem.get();
|
||||
instance.data.form.value(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.serverInformationDimse.events({
|
||||
'click .js-new-peer': function(event, instance) {
|
||||
'click .js-new-peer'(event, instance) {
|
||||
event.preventDefault();
|
||||
var peers = instance.peers.get();
|
||||
const peers = instance.peers.get();
|
||||
peers.push({});
|
||||
instance.peers.set(peers);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user