public object Get(GetQgisIPRequest request)
        {
            string        url     = "";
            TepWebContext context = new TepWebContext(PagePrivileges.UserView);

            try {
                context.Open();

                context.LogInfo(this, string.Format("/user/current/qgis GET"));

                var user = UserTep.FromId(context, context.UserId);
                k8sFactory = new KubernetesFactory(context);
                url        = GetUserVncUrl(context, user, null);

                context.Close();
            } catch (Exception e) {
                context.LogError(this, e.Message + " - " + e.StackTrace);
                context.Close();
                throw e;
            }

            return(new WebResponseString(url ?? ""));
        }
        public object Post(CreateQgisRequest request)
        {
            string        url     = "";
            TepWebContext context = new TepWebContext(PagePrivileges.EverybodyView);

            try {
                context.Open();

                context.LogInfo(this, string.Format("/user/current/qgis POST"));

                var user = UserTep.FromId(context, context.UserId);
                k8sFactory = new KubernetesFactory(context);
                var k8srequest = CreateK8sRequest(k8sFactory, user);
                url = GetUserVncUrl(context, user, k8srequest);

                context.Close();
            } catch (Exception e) {
                context.LogError(this, e.Message + " - " + e.StackTrace);
                context.Close();
                throw e;
            }

            return(new WebResponseString(url));
        }
Exemple #3
0
        public new static TepWebContext GetWebContext(PagePrivileges privileges)
        {
            TepWebContext result = new TepWebContext(privileges);

            return(result);
        }