Browse Source

json可视化

懒得勤快 4 years ago
parent
commit
172e3ed401

+ 9 - 10
src/Masuit.MyBlogs.Core/Common/HttpContextExtension.cs

@@ -32,16 +32,15 @@ namespace Masuit.MyBlogs.Core.Common
                 var nslookup = new LookupClient();
                 using var cts = new CancellationTokenSource(100);
                 return nslookup.QueryReverseAsync(req.HttpContext.Connection.RemoteIpAddress, cts.Token).ContinueWith(t => t.IsCompletedSuccessfully && t.Result.Answers.Any(r => r.ToString().Contains(new[]
-                {
-                    "baidu",
-                    "google",
-                    "bing",
-                    "360",
-                    "sogou",
-                    "soso",
-                    "yahoo",
-                    "yandex",
-                }))).Result;
+                   {
+                        "baidu.com",
+                        "google.com",
+                        "bing.com",
+                        "sogou.com",
+                        "soso.com",
+                        "yandex.com",
+                        "sm.cn"
+                     }))).Result;
             }
 
             return robotUA;

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Dashboard/Index.cshtml

@@ -65,7 +65,7 @@
     <script src="~/ng-views/app/app.config.js"></script>
     <script src="~/ng-views/app/route.config.js"></script>
     <script src="~/ng-views/app/angular-ueditor.min.js"></script>
-    <script src="~/ng-views/app/template.min.js"></script>
+    <script src="~/ng-views/app/template.js"></script>
     <script src="~/ng-views/app/form.js"></script>
     <script src="~/ng-views/controllers/main.js"></script>
 </head>

+ 1 - 1
src/Masuit.MyBlogs.Core/Views/Post/All.cshtml

@@ -151,4 +151,4 @@
     gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
     }
 </script>
-<script src="~/Scripts/global/post-all.min.js"></script>
+<script src="~/Scripts/global/post-all.js"></script>

File diff suppressed because it is too large
+ 0 - 0
src/Masuit.MyBlogs.Core/wwwroot/Scripts/global/post-all.min.js


+ 0 - 98
src/Masuit.MyBlogs.Core/wwwroot/ng-views/app/angular-ueditor.js

@@ -1,98 +0,0 @@
-(function() {
-  "use strict";
-  (function() {
-    var NGUeditor;
-    NGUeditor = angular.module("ng.ueditor", []);
-    NGUeditor.directive("ueditor", [
-      function() {
-        return {
-          restrict: "C",
-          require: "ngModel",
-          scope: {
-            config: "=",
-            ready: "="
-          },
-          link: function($S, element, attr, ctrl) {
-            var _NGUeditor, _updateByRender;
-            _updateByRender = false;
-            _NGUeditor = (function() {
-              function _NGUeditor() {
-                this.bindRender();
-                this.initEditor();
-                return;
-              }
-
-
-              /**
-               * 初始化编辑器
-               * @return {[type]} [description]
-               */
-
-              _NGUeditor.prototype.initEditor = function() {
-                var _UEConfig, _editorId, _self;
-                _self = this;
-                if (typeof UE === 'undefined') {
-                  console.error("Please import the local resources of ueditor!");
-                  return;
-                }
-                _UEConfig = $S.config ? $S.config : {};
-				_UEConfig.initialFrameWidth = null;
-                _editorId = attr.id ? attr.id : "_editor" + (Date.now());
-                element[0].id = _editorId;
-                this.editor = new UE.ui.Editor(_UEConfig);
-                this.editor.render(_editorId);
-                return this.editor.ready(function() {
-                  _self.editorReady = true;
-                  _self.editor.addListener("contentChange", function() {
-                    ctrl.$setViewValue(_self.editor.getContent());
-                    if (!_updateByRender) {
-                      if (!$S.$$phase) {
-                        $S.$apply();
-                      }
-                    }
-                    _updateByRender = false;
-                  });
-                  if (_self.modelContent && _self.modelContent.length > 0) {
-                    _self.setEditorContent();
-                  }
-                  if (typeof $S.ready === "function") {
-                    $S.ready(_self.editor);
-                  }
-                  $S.$on("$destroy", function() {
-                    if (!attr.id && UE.delEditor) {
-                      UE.delEditor(_editorId);
-                    }
-                  });
-                });
-              };
-
-              _NGUeditor.prototype.setEditorContent = function(content) {
-                if (content == null) {
-                  content = this.modelContent;
-                }
-                if (this.editor && this.editorReady) {
-                  this.editor.setContent(content);
-                }
-              };
-
-              _NGUeditor.prototype.bindRender = function() {
-                var _self;
-                _self = this;
-                ctrl.$render = function() {
-                  _self.modelContent = (ctrl.$isEmpty(ctrl.$viewValue) ? "" : ctrl.$viewValue);
-                  _updateByRender = true;
-                  _self.setEditorContent();
-                };
-              };
-
-              return _NGUeditor;
-
-            })();
-            new _NGUeditor();
-          }
-        };
-      }
-    ]);
-  })();
-
-}).call(this);

+ 3 - 1
src/Masuit.MyBlogs.Core/wwwroot/ng-views/app/route.config.js

@@ -248,7 +248,9 @@ myApp.config([
                             {
                                 files: [
                                     "/Assets/semantic/semantic.css",
-                                    "https://cdn.staticfile.org/semantic-ui/2.4.1/semantic.min.js"
+                                    "https://cdn.jsdelivr.net/gh/abodelot/jquery.json-viewer@master/json-viewer/jquery.json-viewer.css",
+                                    "https://cdn.staticfile.org/semantic-ui/2.4.1/semantic.min.js",
+                                    "https://cdn.jsdelivr.net/gh/abodelot/jquery.json-viewer@master/json-viewer/jquery.json-viewer.js"
                                 ],
                                 cache: true
                             }, cpath + "/system.js"

+ 0 - 1
src/Masuit.MyBlogs.Core/wwwroot/ng-views/app/template.min.js

@@ -1 +0,0 @@
-myApp.directive("changeLayout",function(){return{restrict:"A",scope:{changeLayout:"="},link:function(n,t){n.changeLayout==="1"&&t.prop("checked",!0);t.on("change",function(){t.is(":checked")?(localStorage.setItem("ma-layout-status",1),n.$apply(function(){n.changeLayout="1"})):(localStorage.setItem("ma-layout-status",0),n.$apply(function(){n.changeLayout="0"}))})}}}).directive("toggleSidebar",function(){return{restrict:"A",scope:{modelLeft:"=",modelRight:"="},link:function(n,t){t.on("click",function(){t.data("target")==="mainmenu"&&(n.modelLeft===!1?n.$apply(function(){n.modelLeft=!0}):n.$apply(function(){n.modelLeft=!1}));t.data("target")==="chat"&&(n.modelRight===!1?n.$apply(function(){n.modelRight=!0}):n.$apply(function(){n.modelRight=!1}))})}}}).directive("toggleSubmenu",function(){return{restrict:"A",link:function(n,t){t.click(function(){t.next().slideToggle(200);t.parent().toggleClass("toggled")})}}}).directive("stopPropagate",function(){return{restrict:"C",link:function(n,t){t.on("click",function(n){n.stopPropagation()})}}}).directive("aPrevent",function(){return{restrict:"C",link:function(n,t){t.on("click",function(n){n.preventDefault()})}}}).directive("print",function(){return{restrict:"A",link:function(n,t){t.click(function(){window.print()})}}});

+ 8 - 1
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/system.js

@@ -535,7 +535,14 @@ myApp.controller("firewall", ["$scope", "$http","NgTableParams","$timeout", func
 	}
 
 	$scope.detail= function(text) {
-        layer.alert(text);
+        layer.open({
+          type: 1,
+          skin: 'layui-layer-rim', //加上边框
+          area: ['600px', '80%'], //宽高
+          content: text
+        });
+		$('.layui-layer-content').jsonViewer(eval("("+text+")"), {withQuotes: true, withLinks: true});
+		$('.layui-layer-content').css("word-wrap"," break-word");
     }
 }]);
 

+ 3 - 2
src/Masuit.MyBlogs.Core/wwwroot/ng-views/css/app.css

@@ -1,4 +1,4 @@
-/*#region ¹ö¶¯ÌõÃÀ»¯ */
+/*#region 滚动�美化 */
 
 ::-webkit-scrollbar-track {
     -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
@@ -16241,7 +16241,8 @@ select.chosen {
 }
 .ng-table > tbody > tr > td {
     max-width: 300px;
-    word-wrap: break-word;
+    overflow: hidden;
+    text-overflow: ellipsis;
 }
 table.table >tbody > tr>td img {
     max-height: 80px;

Some files were not shown because too many files changed in this diff