show assigned url after adding
This commit is contained in:
parent
b93879baab
commit
b01145720b
1 changed files with 13 additions and 2 deletions
|
@ -1867,13 +1867,23 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||
},
|
||||
|
||||
async _addSite() {
|
||||
// Get URL and container ID from form
|
||||
const formValues = new FormData(this._editForm);
|
||||
const url = formValues.get("site-name");
|
||||
const userContextId = formValues.get("container-id");
|
||||
const currentTab = await Logic.currentTab();
|
||||
const tabId = currentTab.id;
|
||||
const fullURL = this.checkUrl(url);
|
||||
Logic.setOrRemoveAssignment(tabId, fullURL, userContextId, false);
|
||||
|
||||
// Assign URL to container
|
||||
await Logic.setOrRemoveAssignment(tabId, fullURL, userContextId, false);
|
||||
|
||||
// Clear form
|
||||
document.querySelector("#edit-container-panel-site-input").value = "";
|
||||
|
||||
// Show new assignments
|
||||
const assignments = await Logic.getAssignmentObjectByContainer(userContextId);
|
||||
this.showAssignedContainers(assignments);
|
||||
},
|
||||
|
||||
checkUrl(url){
|
||||
|
@ -1997,7 +2007,8 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
|
|||
});
|
||||
// Only show ability to add site if it's an existing container
|
||||
document.querySelector("#edit-container-panel-add-site").hidden = !userContextId;
|
||||
|
||||
// Make site input empty
|
||||
document.querySelector("#edit-container-panel-site-input").value = "";
|
||||
document.querySelector("#edit-container-panel-name-input").value = identity.name || "";
|
||||
document.querySelector("#edit-container-panel-usercontext-input").value = userContextId || NEW_CONTAINER_ID;
|
||||
const containerName = document.querySelector("#edit-container-panel-name-input");
|
||||
|
|
Loading…
Add table
Reference in a new issue