コード例 #1
0
        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 ?? ""));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public new static TepWebContext GetWebContext(PagePrivileges privileges)
        {
            TepWebContext result = new TepWebContext(privileges);

            return(result);
        }