Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUI to support support webmks #1520

Closed
AllenBW opened this issue Jan 29, 2019 · 12 comments · Fixed by #1554
Closed

SUI to support support webmks #1520

AllenBW opened this issue Jan 29, 2019 · 12 comments · Fixed by #1554
Assignees

Comments

@AllenBW
Copy link
Member

AllenBW commented Jan 29, 2019

Description of problem:
☝️ January 29, 2019 9:51 AM

https://bugzilla.redhat.com/show_bug.cgi?id=1532720

@skateman
Copy link
Member

skateman commented Jan 29, 2019

So as the WebMKS console isn't shipped OOTB and we cannot precompile assets on an already existing appliance, it cannot be included into the asset pipeline nor a webpack pack (sounds funny, you seriously say it like this?). So I think we could do the following:

// Send a HEAD request to determine if the file exists, IMO it's enough to check for the JS
fetch('/webmks/wmks.min.js', {
  method: 'HEAD'
}).then(() => new Promise((resolve, reject) => { // Create and return with a promise
  // Create a <link> tag that loads the CSS file and append it to the page
  let link = document.createElement('link');
  link.rel = 'stylesheet';
  link.type = 'text/css';
  link.href = '/webmks/css/wmks-all.css';
  document.head.appendChild(link);

  // Create a <script> tag that loads the JS file
  let script = document.createElement('script');
  script.src = '/webmks/wmks.min.js';

  script.onload = () => resolve(); // Set an onload function that resolves the promise

  document.head.appendChild(script); // Append the <script> tag to the page
})).then(() => {
  // The code is loaded, we can do stuff with WebMKS
}).catch((error) => {
  // some error handling
});

@himdel
Copy link
Contributor

himdel commented Jan 29, 2019

I suppose so, should work, yes :)

(EDITed from something else, I was confused about fetch vs require)

@skateman
Copy link
Member

@himdel the fetch is just an example, I assume angular can do something similar in its own world.

@AllenBW looking at the API code I think you can just ask for WebMKS consoles the same way as you do for VNC/SPICE, just use WebMKS as the console type. You will probably need my help with setting up a provider with WebMKS support, just ping me on IRC for the details.

@ahrechushkin
Copy link

Is there any new about this feature?

@skateman
Copy link
Member

skateman commented Feb 6, 2019

@AllenBW when will you have time to take a look? Do you have any questions about how and where to start?

@AllenBW
Copy link
Member Author

AllenBW commented Feb 11, 2019

Heyoh pto caused the delayed response, if time is available later this week I can begin to give this some 👀 in earnest! 🤞

@ahrechushkin
Copy link

up

@skateman
Copy link
Member

@AllenBW ping?

@AllenBW
Copy link
Member Author

AllenBW commented Feb 26, 2019

Yah, haven't had the time. 😔

@ahrechushkin
Copy link

up

@AllenBW
Copy link
Member Author

AllenBW commented Apr 3, 2019

no update on my end

@skateman
Copy link
Member

skateman commented Jul 2, 2019

Yes update on my end, final PR coming soon 😈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants