Vue widget example

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
10,137
Location
LT, EU
Hello,

I'm attaching "Your Account" widget to show how native elements/translations etc. could be used in vue widgets (native widgets without any iframe, using skin elements, notification system etc.). You may change the text of the widget title in in user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/template.html, you will also find "user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/lang/lt.json" as an example for the single string to translate, you may remove word "Customized" from there, and default DA translation would cover it then, as it'd have it in translation strings.

Thank you!

View attachment your_account.tar.gz
 
I can't understand anything..
I never did anything in Direct Admin, so I do not know where the filrs are..
 
Just download the attachment and install it as a plugin, you'll then find the files under /usr/local/directadmin/plugins/your_account.
 
How to add it by default, when user open his/her direct admin panel it should be there added in sidebar by default on top , not added by user.
 
Where user.conf file is located, it is not there in EVOLUTION skins, skin.conf files is there only...
 
/usr/local/directadmin/data/users/USER/user.conf. Widget order can also be set in skin.conf.
 
I tried it but it does not effect anything
Code:
admin_widgets=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS
reseller_widgets=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS
user_widgets=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
user_widgets_default=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
 
It does not showing the widget which should be shown by default.
I have to manually add this...
 
Hello,

I'm seeing 2 different questions here.
1) The ability to control the order when it's added
2) It not being added to existing accounts

Let me know if that's not correct.

I'll use the "user" options for discussion to keep things simple.
The user_widgets setting by default is not in the user.conf.
When a User logs in for the first time, if there is no user_widgets entry in the user.conf, one it assembled and added.
If the plugin is added to the system after the User already has the user_widgets line, then this rule doesn't apply

Proposals:
A) This could be changed the moment a plugin is installed, to go through all existing Users and add the plugins user_widgets_defaults to each user.conf user_widgets. In your case, should we implement this change, simply re-install the plugin to reset all plugin widgets.

B) As for the order, there is nothing for this currently, unless you manually change the skin.conf defaults to include the plugin widgets, since they're 2 different default lists (skin.conf and plugin.conf, plugin.conf comes 2nd). The plugin.conf could have a new setting to request priority order when added.

Let me know your thoughts, if those would help, or if I'm missing anything :)

John
 
How to change the skin.conf defaults to include the plugin widgets...
Widget will show only for users, not for admin or reseller
 
In case there is any confusion, the above example was only for "user" widgets in the user.conf.
Reseller and Admin widget settings would respectively be in their other files:
reseller.conf: reseller_widgets=
admin.conf: admin_widgets=

Where the "*_widgets_default=" still only lives in the skin.conf and plugin.conf files.

I couldn't say using the data/skins/evolution/skin.conf for default order would be a great, since it will be overwritten anytime the skin gets updated.
However, I was just going through the code and forgot about this one which would be useful for you:

So you can setup a skin.conf override containing ONLY the 3 default lines you want
Code:
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES:WGT_IP_MANAGER
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
user_widgets_default=WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
plus the plugin widget, to the left, if you want them to be at the top for new accounts.

Note that the file would be:
Code:
/usr/local/directadmin/data/users/CREATOR/skin_customizations/evolution/skin.conf
where CREATOR is the name of the account that created the Reseller or User.. this would very often be "admin".

====
For Existing Accounts

any accounts that already exist will likely already have their user.conf, reseller.conf and/or admin.conf files loaded in with those respective widget orders.. so the defaults wont' apply here.
If you want to fully reset everyone's widget settings, and reload all defaults, simply delete those widget lines from all admin.conf, reseller.conf, user.conf files. (Or only the files in question).

So for example, if you're only having issues with the new default plugin widgets not showing for Resellers.. you'd just clear all "reseller_widget=" lines from all reseller.conf files, which means the next time that account logins, the default list is reset, and loaded with whatever you've sorted out in the new skin.conf override (in theory).
 
In case there is any confusion, the above example was only for "user" widgets in the user.conf.
Reseller and Admin widget settings would respectively be in their other files:
reseller.conf: reseller_widgets=
admin.conf: admin_widgets=

Where the "*_widgets_default=" still only lives in the skin.conf and plugin.conf files.

I couldn't say using the data/skins/evolution/skin.conf for default order would be a great, since it will be overwritten anytime the skin gets updated.
However, I was just going through the code and forgot about this one which would be useful for you:

So you can setup a skin.conf override containing ONLY the 3 default lines you want
Code:
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES:WGT_IP_MANAGER
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
user_widgets_default=WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
plus the plugin widget, to the left, if you want them to be at the top for new accounts.

Note that the file would be:
Code:
/usr/local/directadmin/data/users/CREATOR/skin_customizations/evolution/skin.conf
where CREATOR is the name of the account that created the Reseller or User.. this would very often be "admin".

====
For Existing Accounts

any accounts that already exist will likely already have their user.conf, reseller.conf and/or admin.conf files loaded in with those respective widget orders.. so the defaults wont' apply here.
If you want to fully reset everyone's widget settings, and reload all defaults, simply delete those widget lines from all admin.conf, reseller.conf, user.conf files. (Or only the files in question).

So for example, if you're only having issues with the new default plugin widgets not showing for Resellers.. you'd just clear all "reseller_widget=" lines from all reseller.conf files, which means the next time that account logins, the default list is reset, and loaded with whatever you've sorted out in the new skin.conf override (in theory).
Where I will add these lines,
admin_widgets=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS
reseller_widgets=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS
user_widgets=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
user_widgets_default=WGT_PLUGINS_YOUR_ACCOUNT:WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS

Please tell me the path
 
Hello,

I'm attaching "Your Account" widget to show how native elements/translations etc. could be used in vue widgets (native widgets without any iframe, using skin elements, notification system etc.). You may change the text of the widget title in in user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/template.html, you will also find "user/widgets/WGT_PLUGINS_YOUR_ACCOUNT/lang/lt.json" as an example for the single string to translate, you may remove word "Customized" from there, and default DA translation would cover it then, as it'd have it in translation strings.

Thank you!

View attachment 2570
Where can i find a list of all tokens avalible to use ? for custom design.

Also is it possible to create tokens ?
What I mean is I am looking at Vue for new plugin and to make sub theme just wondering if I can attach to DA and get acces to the variables and tokens like a API ?
 
Last edited:
Where can i find a list of all tokens avalible to use ? for custom design.

Also is it possible to create tokens ?
What I mean is I am looking at Vue for new plugin and to make sub theme just wondering if I can attach to DA and get acces to the variables and tokens like a API ?
To answer my self: here is the info: https://www.directadmin.com/skin_basics.php

Solves allot of questions am laying around now with the evolution skin and dev node env but whoa thats an whole other ball game still intressted in any guide help/documentation though.
 
How to show widget for all old users?
In case there is any confusion, the above example was only for "user" widgets in the user.conf.
Reseller and Admin widget settings would respectively be in their other files:
reseller.conf: reseller_widgets=
admin.conf: admin_widgets=

Where the "*_widgets_default=" still only lives in the skin.conf and plugin.conf files.

I couldn't say using the data/skins/evolution/skin.conf for default order would be a great, since it will be overwritten anytime the skin gets updated.
However, I was just going through the code and forgot about this one which would be useful for you:

So you can setup a skin.conf override containing ONLY the 3 default lines you want
Code:
admin_widgets_default=WGT_ADMIN_STATS:WGT_ALL_USERS:WGT_SHOW_SERVICES:WGT_IP_MANAGER
reseller_widgets_default=WGT_RESELLER_STATS:WGT_LIST_USERS:WGT_SKINS
user_widgets_default=WGT_USER_STATS:WGT_ADDITIONAL_DOMAINS
plus the plugin widget, to the left, if you want them to be at the top for new accounts.

Note that the file would be:
Code:
/usr/local/directadmin/data/users/CREATOR/skin_customizations/evolution/skin.conf
where CREATOR is the name of the account that created the Reseller or User.. this would very often be "admin".

====
For Existing Accounts

any accounts that already exist will likely already have their user.conf, reseller.conf and/or admin.conf files loaded in with those respective widget orders.. so the defaults wont' apply here.
If you want to fully reset everyone's widget settings, and reload all defaults, simply delete those widget lines from all admin.conf, reseller.conf, user.conf files. (Or only the files in question).

So for example, if you're only having issues with the new default plugin widgets not showing for Resellers.. you'd just clear all "reseller_widget=" lines from all reseller.conf files, which means the next time that account logins, the default list is reset, and loaded with whatever you've sorted out in the new skin.conf override (in theory).
[/Q
 
How to show widget for all old users?
Ok, so if it's just User widgets (not Reseeler/Admin widgets), to reset the list of widgets, such that the new defaults should kick in, you'd just need to clear the user_widgets= from all user.conf files. We could add a GUI for this at some point if it's a common task, but currently, just clear the user.conf files with perl.
Code:
perl -pi -e 's/^user_widgets=.*\n//' /usr/local/directadmin/data/users/*/user.conf
The next time a User logs in, DA will grab all defaults from all skins, plugins, etc.. and the defaults should be listed.

John
 
Ok, so if it's just User widgets (not Reseeler/Admin widgets), to reset the list of widgets, such that the new defaults should kick in, you'd just need to clear the user_widgets= from all user.conf files. We could add a GUI for this at some point if it's a common task, but currently, just clear the user.conf files with perl.
Code:
perl -pi -e 's/^user_widgets=.*\n//' /usr/local/directadmin/data/users/*/user.conf
The next time a User logs in, DA will grab all defaults from all skins, plugins, etc.. and the defaults should be listed.

John
perl -pi -e 's/^user_widgets=.*\n//' /usr/local/directadmin/data/users/*/user.conf
Where write it..
 
Back
Top