Import the wilm agent store, WINC adoption work and batches CLI, with four fixes
This commit is contained in:
@@ -353,7 +353,7 @@
|
||||
<button type="submit" class="btn btn-primary" :disabled="saving">
|
||||
{{ saving ? 'Saving...' : 'Save PC' }}
|
||||
</button>
|
||||
<router-link to="/pcs" class="btn btn-secondary">Cancel</router-link>
|
||||
<router-link :to="returnTo" class="btn btn-secondary">Cancel</router-link>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -385,6 +385,11 @@ const router = useRouter()
|
||||
|
||||
const isEdit = computed(() => !!route.params.id)
|
||||
|
||||
// Return-navigation origin, threaded through from Fleet via ?from=fleet so
|
||||
// Cancel and a successful Save land back on Fleet; every other entry path
|
||||
// falls back to the PCs list.
|
||||
const returnTo = computed(() => (route.query.from === 'fleet' ? '/endpoints' : '/pcs'))
|
||||
|
||||
// Seeded asset-type id for computers (see /api/assets/types). Custom-field
|
||||
// values are keyed by the underlying asset id, captured on load / create.
|
||||
const COMPUTER_ASSETTYPEID = 2
|
||||
@@ -685,7 +690,7 @@ async function savePC() {
|
||||
}
|
||||
}
|
||||
|
||||
router.push('/pcs')
|
||||
router.push(returnTo.value)
|
||||
} catch (err) {
|
||||
console.error('Error saving PC:', err)
|
||||
error.value = apiError(err, 'Failed to save PC')
|
||||
|
||||
Reference in New Issue
Block a user