Skip to content
Snippets Groups Projects
Commit 9d3b9acb authored by vkovtun's avatar vkovtun Committed by vkovtun
Browse files

SSDM-13839: Added file/directory creation to the JavaScript part.

parent 8b191d2d
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -100,7 +100,22 @@
</div>
</form>
<h2>Create</h2>
<form onsubmit="return false;">
<div id="create-area">
<table>
<tr>
<td><label>Name:</label></td>
<td><input type="text" id="create-path" required></td>
</tr>
<tr>
<td><label>Is directory:</label></td>
<td><input type="checkbox" id="create-directory"></td>
</tr>
</table>
<button id="create-submit">Create</button>
</div>
</form>
</div>
</body>
</html>
\ No newline at end of file
......@@ -223,5 +223,13 @@ window.onload = function() {
}));
}
};
document.getElementById("create-submit").onclick = function() {
datastoreServer.create(owner, document.getElementById("create-path").value.trim(), document.getElementById("create-directory").value,
(_ => {
showEntries();
}));
};
}
......@@ -497,6 +497,25 @@ datastore.prototype.move = function(sourceOwner, source, targetOwner, target, ac
}
/**
* Create a file/directory within DSS
*/
DataStoreServer.prototype.create = function(owner, source, directory, action){
const data = this.fillCommonParameters({
"method": "create",
"owner" : owner,
"source": source,
"directory": directory
});
this._internal.sendHttpRequest(
"POST",
"text/plain",
this._internal.datastoreUrl,
encodeParams(data),
(response) => action(response)
);
}
/**
* ==================================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment