forked from adam/discord-bot-shtik
Compare commits
No commits in common. "8cb4005192f1e872e199869bee3ea3fed6de1b32" and "88ca4687080a1a1ee4c76eb42366de5c7c1a031e" have entirely different histories.
8cb4005192
...
88ca468708
@ -1,4 +1,3 @@
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using vassago.Models;
|
||||
|
||||
@ -8,11 +7,6 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddControllersWithViews();
|
||||
builder.Services.AddSingleton<IHostedService, vassago.ConsoleService>();
|
||||
builder.Services.AddDbContext<ChattingContext>();
|
||||
builder.Services.Configure<RazorViewEngineOptions>(o => {
|
||||
o.ViewLocationFormats.Clear();
|
||||
o.ViewLocationFormats.Add("/WebInterface/Views/{1}/{0}" + RazorViewEngine.ViewExtension);
|
||||
o.ViewLocationFormats.Add("/WebInterface/Views/Shared/{0}" + RazorViewEngine.ViewExtension);
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@ -29,5 +23,4 @@ app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
|
||||
app.Run();
|
||||
|
16
Views/Home/Index.cshtml
Normal file
16
Views/Home/Index.cshtml
Normal file
@ -0,0 +1,16 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
<div id="tree"></div>
|
||||
<div>
|
||||
<a href="Users">Users</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Accounts">Accounts</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Channels">Channels</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Behaviors">Behaviors</a>
|
||||
</div>
|
@ -5,8 +5,6 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - vassago</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/fontawesome.min.css" />
|
||||
<link rel="stylesheet" href="~/css/bs.min.treeview.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/vassago.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
@ -18,7 +16,7 @@
|
||||
</div>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/js/bstreeview.min.js"></script>
|
||||
<script src="bootstrap-treeview.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
@ -1,63 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
<div id="tree"></div>
|
||||
<div>
|
||||
<a href="Users">Users</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Accounts">Accounts</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Channels">Channels</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="Behaviors">Behaviors</a>
|
||||
</div>
|
||||
|
||||
<div id="tree"></div>
|
||||
|
||||
|
||||
@section Scripts{
|
||||
<script type="text/javascript">
|
||||
function getTree() {
|
||||
// Some logic to retrieve, or generate tree structure
|
||||
var tree = [
|
||||
{
|
||||
text: "Parent 1",
|
||||
nodes: [
|
||||
{
|
||||
text: "Child 1",
|
||||
nodes: [
|
||||
{
|
||||
text: "Grandchild 1"
|
||||
},
|
||||
{
|
||||
text: "Grandchild 2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "Child 2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "Parent 2"
|
||||
},
|
||||
{
|
||||
text: "Parent 3"
|
||||
},
|
||||
{
|
||||
text: "Parent 4"
|
||||
},
|
||||
{
|
||||
text: "Parent 5"
|
||||
}
|
||||
];
|
||||
return tree;
|
||||
}
|
||||
|
||||
$('#tree').bstreeview({data: getTree()});
|
||||
</script>
|
||||
}
|
@ -7,7 +7,6 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="bootstrap" Version="5.3.3" />
|
||||
<PackageReference Include="discord.net" Version="3.10.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
37
wwwroot/css/bootstrap-treeview.css
vendored
Normal file
37
wwwroot/css/bootstrap-treeview.css
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/* =========================================================
|
||||
* bootstrap-treeview.css v1.2.0
|
||||
* =========================================================
|
||||
* Copyright 2013 Jonathan Miles
|
||||
* Project URL : http://www.jondmiles.com/bootstrap-treeview
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
.treeview .list-group-item {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.treeview span.indent {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.treeview span.icon {
|
||||
width: 12px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.treeview .node-disabled {
|
||||
color: silver;
|
||||
cursor: not-allowed;
|
||||
}
|
10
wwwroot/css/bstreeview.min.css
vendored
10
wwwroot/css/bstreeview.min.css
vendored
@ -1,10 +0,0 @@
|
||||
/*
|
||||
@preserve
|
||||
bstreeview.css
|
||||
Version: 1.2.0
|
||||
Authors: Sami CHNITER <sami.chniter@gmail.com>
|
||||
Copyright 2020
|
||||
License: Apache License 2.0
|
||||
Project: https://github.com/nhmvienna/bs5treeview
|
||||
*/
|
||||
.bstreeview{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem;padding:0;overflow:hidden}.bstreeview .list-group{margin-bottom:0}.bstreeview .list-group-item{border-radius:0;border-width:1px 0 0 0;padding-top:.5rem;padding-bottom:.5rem;cursor:pointer}.bstreeview .list-group-item:hover{background-color:#dee2e6}.bstreeview>.list-group-item:first-child{border-top-width:0}.bstreeview .state-icon{margin-right:8px}.bstreeview .item-icon{margin-right:5px}
|
9
wwwroot/css/fontawesome.min.css
vendored
9
wwwroot/css/fontawesome.min.css
vendored
File diff suppressed because one or more lines are too long
1249
wwwroot/js/bootstrap-treeview.js
vendored
Normal file
1249
wwwroot/js/bootstrap-treeview.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
wwwroot/js/bstreeview.min.js
vendored
10
wwwroot/js/bstreeview.min.js
vendored
@ -1,10 +0,0 @@
|
||||
/*
|
||||
@preserve
|
||||
bstreeview.js
|
||||
Version: 1.2.0
|
||||
Authors: Sami CHNITER <sami.chniter@gmail.com>
|
||||
Copyright 2020
|
||||
License: Apache License 2.0
|
||||
Project:https://github.com/nhmvienna/bs5treeview
|
||||
*/
|
||||
!function (t, e, i, s) { "use strict"; var n = { expandIcon: "fa fa-angle-down fa-fw", collapseIcon: "fa fa-angle-right fa-fw", expandClass: 'show', indent: 1.25, parentsMarginLeft: "1.25rem", openNodeLinkOnNewTab: !0 }, a = '<div role="treeitem" class="list-group-item" data-bs-toggle="collapse"></div>', d = '<div role="group" class="list-group collapse" id="itemid"></div>', o = '<i class="state-icon"></i>', r = '<i class="item-icon"></i>'; function l(e, i) { this.element = e, this.itemIdPrefix = e.id + "-item-", this.settings = t.extend({}, n, i), this.init() } t.extend(l.prototype, { init: function () { this.tree = [], this.nodes = [], this.settings.data && (this.settings.data.isPrototypeOf(String) && (this.settings.data = t.parseJSON(this.settings.data)), this.tree = t.extend(!0, [], this.settings.data), delete this.settings.data), t(this.element).addClass("bstreeview"), this.initData({ nodes: this.tree }); var i = this; this.build(t(this.element), this.tree, 0), t(this.element).on("click", ".list-group-item", function (s) { t(".state-icon", this).toggleClass(i.settings.expandIcon).toggleClass(i.settings.collapseIcon), s.target.hasAttribute("href") && (i.settings.openNodeLinkOnNewTab ? e.open(s.target.getAttribute("href"), "_blank") : e.location = s.target.getAttribute("href")) }) }, initData: function (e) { if (e.nodes) { var i = e, s = this; t.each(e.nodes, function (t, e) { e.nodeId = s.nodes.length, e.parentId = i.nodeId, s.nodes.push(e), e.nodes && s.initData(e) }) } }, build: function (e, i, s) { var n = this, l = n.settings.parentsMarginLeft; s > 0 && (l = (n.settings.indent + s * n.settings.indent).toString() + "rem;"), s += 1, t.each(i, function (i, g) { var h = t(a).attr("data-bs-target", "#" + n.itemIdPrefix + g.nodeId).attr("style", "padding-left:" + l).attr("aria-level", s); if (g.nodes) { var c = t(o).addClass((g.expanded)?n.settings.expandIcon:n.settings.collapseIcon); h.append(c) } if (g.icon) { var f = t(r).addClass(g.icon); h.append(f) } if (h.append(g.text), g.href && h.attr("href", g.href), g.class && h.addClass(g.class), g.id && h.attr("id", g.id), e.append(h), g.nodes) { var p = t(d).attr("id", n.itemIdPrefix + g.nodeId); e.append(p), n.build(p, g.nodes, s); if (g.expanded) p.addClass(n.settings.expandClass) } }) } }), t.fn.bstreeview = function (e) { return this.each(function () { t.data(this, "plugin_bstreeview") || t.data(this, "plugin_bstreeview", new l(this, e)) }) } }(jQuery, window, document);
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user