mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-20 05:02:50 +08:00
refactor: ♻️ 框架代码同步
This commit is contained in:
parent
7d0fcd4906
commit
220b19d152
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0.4 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
RUN apt update
|
||||
|
@ -1,11 +1,11 @@
|
||||
namespace NetAdmin.Domain.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// 标记一个枚举的状态指示
|
||||
/// 枚举装饰
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Enum)]
|
||||
public sealed class IndicatorAttribute(string indicate, bool pulse) : Attribute
|
||||
public sealed class EnumDecorationAttribute(string indicate = nameof(Indicates.None), bool pulse = false, int sort = 0) : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态指示
|
||||
@ -16,4 +16,9 @@ public sealed class IndicatorAttribute(string indicate, bool pulse) : Attribute
|
||||
/// 脉动
|
||||
/// </summary>
|
||||
public bool Pulse { get; } = pulse;
|
||||
|
||||
/// <summary>
|
||||
/// 排序值
|
||||
/// </summary>
|
||||
public int Sort { get; } = sort;
|
||||
}
|
@ -9,7 +9,7 @@ public enum JobStatues
|
||||
/// <summary>
|
||||
/// 空闲
|
||||
/// </summary>
|
||||
[Indicator(nameof(Indicates.Success), false)]
|
||||
[EnumDecoration(nameof(Indicates.Success), false)]
|
||||
[ResourceDescription<Ln>(nameof(Ln.空闲))]
|
||||
Idle = 1
|
||||
|
||||
@ -18,7 +18,7 @@ public enum JobStatues
|
||||
/// <summary>
|
||||
/// 运行
|
||||
/// </summary>
|
||||
[Indicator(nameof(Indicates.Warning), true)]
|
||||
[EnumDecoration(nameof(Indicates.Warning), true)]
|
||||
[ResourceDescription<Ln>(nameof(Ln.运行))]
|
||||
Running = 2
|
||||
}
|
@ -38,4 +38,11 @@ public enum Indicates
|
||||
/// 危险
|
||||
/// </summary>
|
||||
Danger = 5
|
||||
|
||||
,
|
||||
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
None = 6
|
||||
}
|
@ -35,8 +35,11 @@ public sealed class ConstantService : ServiceBase<IConstantService>, IConstantSe
|
||||
return [..ret, z.GetCallingCode().ToInvString()];
|
||||
}
|
||||
|
||||
var indicate = y.Attr<IndicatorAttribute>();
|
||||
return indicate == null ? ret : [..ret, indicate.Indicate.ToLowerInvariant(), indicate.Pulse.ToString().ToLowerInvariant()];
|
||||
var decorationAttribute = y.Attr<EnumDecorationAttribute>() ?? new EnumDecorationAttribute();
|
||||
return [
|
||||
..ret, decorationAttribute.Indicate.ToLowerInvariant(), decorationAttribute.Pulse.ToString().ToLowerInvariant()
|
||||
, decorationAttribute.Sort.ToInvString()
|
||||
];
|
||||
}
|
||||
|
||||
static string[] GetHttpStatusCodeDicValue(string name)
|
||||
|
@ -26,7 +26,7 @@
|
||||
"vue-i18n": "11.1.3",
|
||||
"vue-router": "4.5.0",
|
||||
"vue3-ace-editor": "2.2.4",
|
||||
"vue3-json-viewer": "2.2.2",
|
||||
"vue3-json-viewer": "2.3.0",
|
||||
"vuedraggable": "4.0.3",
|
||||
"vuex": "4.1.0"
|
||||
},
|
||||
|
@ -3,7 +3,11 @@
|
||||
<div v-if="this.$TOOL.getNestedProperty(data, this.prop)?.toString().toLowerCase() === item.value?.toString().toLowerCase()">
|
||||
<scStatusIndicator
|
||||
:pulse="item.pulse"
|
||||
:style="item.type ? '' : `background: #${Math.abs(this.$TOOL.crypto.hashCode(item.value)).toString(16).substring(0, 6)}`"
|
||||
:style="
|
||||
item.type && item.type !== 'none'
|
||||
? ''
|
||||
: `background: #${Math.abs(this.$TOOL.crypto.hashCode(item.value)).toString(16).substring(0, 6)}`
|
||||
"
|
||||
:type="item.type" />
|
||||
<span v-if="!$slots.default"> {{ item.text }}</span>
|
||||
<slot :data="data" :text="item.text"></slot>
|
||||
|
Loading…
x
Reference in New Issue
Block a user