Closed rasunag27 closed 3 years ago
If I understood your question correctly, I would say
/page1 should redirect to /lite?fileToLoad=....&application=LiteWithFile
Where you config will add an entry for LiteWithFile
and the usage of fileToLoad like you used to.
Dear Jourdain,
That is correct.
So, how to proceed with LineWithFile
in launcher config for this?
Also, it will in the form of http://localhost/lite/page1
??
Regards,
Sunag R A.
LineWithFile
would what you use to have in your launcher command but with a different command entry.
"apps": {
"paraview-lite": {
"cmd": [
"${python_exec}",
"-dr",
"${web_path}/lite/server/pvw-lite.py",
"--port", "${port}",
"--data", "${dataDir}",
"--authKey", "${secret}",
"--content", "${content}"
],
"ready_line" : "Starting factory"
},
"paraview-lite-file": {
"cmd": [
"${python_exec}",
"-dr",
"${web_path}/lite/server/pvw-lite.py",
"--port", "${port}",
"--data", "${dataDir}",
"--load-file", "${fileName}",
"--authKey", "${secret}",
"--content", "${content}"
],
"ready_line" : "Starting factory"
}
}
Then in page 1
<html>
<body>
<script>
location= '/lite?application=paraview-lite-file&fileName=test.vtp'
</script>
</body>
</html>
Dear Jourdain,
I have added paraview-lite-file
in the launcher along with edits in index.html to add the content from page1.html.
Here are the contents from index.html and page1.html.
Index.html
In here, I have added <a>
to include the page1.html file contents
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="google" value="notranslate">
<title>ParaView Lite</title>
<meta name="description" content="Lite ParaView client for Scientific Visualization on the Web">
<link inline rel="icon" type="image/png" href="ParaView.png">
<style type="text/css">
/* override vuetify */
html {
overflow: hidden !important;
}
</style>
<script inline type="text/javascript" src="version.js"></script>
<script
inline
type="text/javascript"
src="runtime.js"
></script>
<script
inline
type="text/javascript"
src="vendors.js"
></script>
<script
inline
type="text/javascript"
src="ParaViewLite.js"
></script>
<a href="page1.html">paraview-lite-file</a>
</head>
<body>
<div id="root-container"></div>
<script type="text/javascript">
const container = document.querySelector('#root-container');
const viewer = ParaViewLite.createViewer(container);
</script>
</body>
</html>
Page1.html
<!DOCTYPE html>
<html>
<body>
<script>
location = '/home/data/pv/pv-5.7.0/share/paraview-5.7/web/lite?application=paraview-lite-file&fileName=48_left.vtk'
</script>
</body>
</html>
I am not able to understand how I could possilbly show the contents via http://localhost/lite/page1
.
What changes/addition need to be done in order to make these correct?
Regards, Sunag R A.
Indeed, the browser use URL, providing a path to your filesystem is not going to work. Also adding a link in the
Based on your lack of understanding it might be too hard for me to help you. I can only spare a couple minutes here and there.
I'm going to try again:
http://localhost/lite?application=paraview-lite-file&fileName=48_left.vtk
do you manage to get your file loaded?Dear Jourdain,
Thank you very much for your patience. I was able to visualize the data as a separate URL when I type this:
http://localhost/lite/?data=48/48_left.vtk
--load-file
and check with the URL. I followed the instructions from old discussion which got me through this link as below. --load-file
loads the file and not directory. How to load the directory say as http://localhost/lite/?data=48
, so that it shows all the files present in it?Thanks and Regards, Sunag R A.
To load a directory you will need to add a new arg yourself to perform that action.
Dear jourdain,
Due to some other work, I was not able to work much on the paraview web side. But from past a week I have been working on the issue related to default directory loading in the paraview lite.
Say, I have two directories namely, directory1 and directory2. In each directory, there are vtk files present in it.
So, I managed to get the file loaded as default into paraview lite.
Now, I wanted the directory to be loaded as default, showing the files page as default for that directory.
Eg : http://localhost/lite/?data=directory1
. (Not vtk files, vtk files should be shown in the left side of the paraview lite.
As u mentioned in the previous message related to add new argument for default directory loading, How do I do that?
Thanks for Patience.
Regards, Sunag R A.
I'm not sure what you mean?
Hi Jourdain,
My question is related to the launcher to use those url parameters.
--load-file
we can specify while file to load from the directory. I actually wanted some directory itself to load as default.Eg. There is a directory named directory1 and directory2. How to customize the launcher such that when the url is typed as http://localhost/lite/?data=directory1
goes to the directory and not file as in http://localhost/lite/?data=file.vtk
??
Hope the framework of questioning is clear.
Regards, Sunag R A.
What about cmd: [ ..., "--data", "${key1}", "--data2", "${key2}"]
?
From this I understand that for each directory, I need to add new arguments as data and key pair
?
So, If there are some 50 directories, the launcher should have 50 lines?
I am asking this because, the directories are automatically created through codes. So, for each new directory, there needs to be new argument.?
So, I need to add/change in below line for pvw-lite.py everytime a new directory is added/created.?
parser.add_argument("--data", default=os.getcwd(), help="path to data directory to list, or else multiple directories given as 'name1=path1|name2=path2|...'", dest="path")
Also, new line for the launcher as data and key pair
?
Regards, Sunag R A.
Dear all,
How do I run the Paraview lite with multiple requests for single host using apache.
Now, I am able to run with apache where the paraview-lite is hosted at
http//localhost/lite
.How do I modify this so that it can run dynamically as
http://localhost/page1
and thepage1
should change to other forms depending on new data.I need this because I have multiple test cases to be visualized in a separate page.
Hopefully, the question is well understood. Any leads will be appreciated.
Regards,
Sunag R A.