Improve agent view styles
This commit is contained in:
1 parent
3e06a59f85
commit
569242b459
2 files changed
+74
-17
No files matched your search
@@ -9,6 +9,17 @@ a {
|
|||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
color: inherit;
|
||||||
|
background-color: var(--color-background-soft);
|
||||||
|
border: 1px solid var(--color-border);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
border-color: var(--color-border-hover);
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: flex;
|
||||||
direction: row;
|
direction: row;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
backend.sendAction("get-agent-kind-info", {kind: _agent.kind}).then(res => {
|
backend.sendAction("get-agent-kind-info", {kind: _agent.kind}).then(res => {
|
||||||
kindInfo.description = res.info.description;
|
kindInfo.value.description = res.info.description;
|
||||||
});
|
});
|
||||||
|
|
||||||
backend.sendAction('get-agent-config-fields', {agentId}).then(res => {
|
backend.sendAction('get-agent-config-fields', {agentId}).then(res => {
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ui.alert("Cancelled identifier update");
|
ui.alert("Cancelled name update");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function saveChanges() {
|
async function saveChanges() {
|
||||||
@@ -127,24 +127,70 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
<h1>{{ agent.name || `(Agent #${id})` }}</h1>
|
<h1>{{ agent.name || `Agent-${id}` }}</h1>
|
||||||
<section>
|
<section class="top-section">
|
||||||
<p>{{ description }}</p>
|
|
||||||
<p>Agent ID: {{ id }}, Identifier: {{ agent.agentname }}</p>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button @click="updateIdentifier">Update Identifier</button>
|
<span class="label">Agent ID</span>
|
||||||
<button @click="updateName">Update Name</button>
|
<span class="value">{{id}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="label">Identifier</span>
|
||||||
|
<span class="value">{{agent.agentname}}</span>
|
||||||
|
<button @click="updateIdentifier">Edit</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button @click="updateName">Change Name</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<p style="padding-bottom: 1em; border-bottom: 1px solid var(--color-border)">{{ kindInfo.description }}</p>
|
||||||
|
|
||||||
<form @submit.prevent="saveChanges">
|
<div v-for="(configField, index) in configFields" :key="index">
|
||||||
<div v-for="(configField, index) in configFields" :key="index">
|
<span class="label">{{ configField.name }}</span>
|
||||||
<label>{{ configField.name }}</label>
|
<input type="checkbox" v-model="configField.enabled" />
|
||||||
<input type="checkbox" v-model="configField.enabled" />
|
<br>
|
||||||
<textarea v-model="configField.value" />
|
<textarea v-model="configField.value" class="config-input" :disabled="!configField.enabled"/>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Save</button>
|
|
||||||
</form>
|
<button type="submit" @click="saveChanges()">Save</button>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
section {
|
||||||
|
margin: 1em;
|
||||||
|
padding: 1em;
|
||||||
|
border: 1px solid var(--color-border);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-section > div {
|
||||||
|
margin-right: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-size: 80%;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
padding: 0 0.5em;
|
||||||
|
padding-top: 0.35em;
|
||||||
|
|
||||||
|
border: 1px solid var(--color-border);
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea.config-input {
|
||||||
|
width: 100%;
|
||||||
|
resize: vertical;
|
||||||
|
height: 5em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in new issue
Block a user