Skip to content

Commit

Permalink
#54: Moved agent send parameter response to toast
Browse files Browse the repository at this point in the history
  • Loading branch information
njbrunner committed Dec 28, 2023
1 parent 76f67d7 commit afe686c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 91 deletions.
72 changes: 0 additions & 72 deletions anms-ui/public/app/components/management/agents/Agent.vue

This file was deleted.

4 changes: 0 additions & 4 deletions anms-ui/public/app/components/management/agents/Agents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ export default {
goToAgentDetails(event) {
this.agentInfo = event;
this.showModal = true;
// this.$router.push({
// name: "Agent Details",
// params: { agentId: event['agent_id_string'] },
// });
},
handlePageChange(value) {
const vm = this;
Expand Down
30 changes: 15 additions & 15 deletions anms-ui/public/app/components/management/agents/crud.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@
</b-form-group>
<b-button @click="onClick()">Send Parameter</b-button>
</b-form>

<div>
[{{ results }}]
</div>
</div>
</template>

<script>
import { values } from 'lodash'
import api from '../../../shared/api'
import toastr from 'toastr';
export default {
name: "CRUD",
Expand All @@ -43,8 +39,6 @@ export default {
selected: -1,
headers: [],
title: "",
results: "",
results2: "",
params: [],
final_values: {}
}
Expand All @@ -53,11 +47,9 @@ export default {
setParams(command_parameters) {
command_parameters.forEach((value) => {
this.results2 = value;
this.params.push({ "name": value, "value": "" });
});
this.results = command_parameters;
},
onClick() {
this.final_values = {}
Expand All @@ -67,13 +59,14 @@ export default {
api.methods
.apiPutCRUD(this.agentId, this.selected.agent_parameter_id, this.final_values)
.then((response) => {
this.results = "SENT! " + response.data + " " + response.statusText;
console.log(response);
toastr.success(`${response.statusText} ${response.data}`);
this.selected = -1;
this.params = []
})
.catch((error) => {
this.results = "ERROR sending " + error
console.error(error);
toastr.error(error);
})
},
},
Expand All @@ -94,16 +87,23 @@ export default {
margin: 16px 0;
}
.capitalize::-webkit-input-placeholder { /* Chrome/Opera/Safari */
.capitalize::-webkit-input-placeholder {
/* Chrome/Opera/Safari */
text-transform: capitalize;
}
.capitalize::-moz-placeholder { /* Firefox 19+ */
.capitalize::-moz-placeholder {
/* Firefox 19+ */
text-transform: capitalize;
}
.capitalize:-ms-input-placeholder { /* IE 10+ */
.capitalize:-ms-input-placeholder {
/* IE 10+ */
text-transform: capitalize;
}
.capitalize:-moz-placeholder { /* Firefox 18- */
.capitalize:-moz-placeholder {
/* Firefox 18- */
text-transform: capitalize;
}
</style>

0 comments on commit afe686c

Please sign in to comment.